4 versions
StarCoder is a code generation model trained on 80+ programming languages.
Install our magic
package manager:
curl -ssL https://magic.modular.com/ | bash
Then run the source
command that's printed in your terminal.
Install Max Pipelines in order to run this model.
magic global install max-pipelines
Start a local endpoint for starcoder/1b:
max-serve serve --huggingface-repo-id bigcode/starcoderbase-1b
The endpoint is ready when you see the URI printed in your terminal:
Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Now open another terminal to send a request using curl
:
curl -N http://0.0.0.0:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "starcoder/1b",
"stream": true,
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the World Series in 2020?"}
]
}' | grep -o '"content":"[^"]*"' | sed 's/"content":"//g' | sed 's/"//g' | tr -d '
' | sed 's/\n/
/g'
🎉 Hooray! You’re running Generative AI. Our goal is to make this as easy as possible.
StarCoder models are a specialized family of AI systems designed to work with source code. These models are trained using extensive datasets obtained from GitHub, encompassing over 80 programming languages. This targeted training enables the models to understand and generate code snippets effectively, making them powerful tools for developers, educators, and anyone working in or learning programming.
For example, given a simple Python function prompt like:
def print_hello_world():
The model can generate a corresponding and syntactically correct response such as:
print("Hello world")
This demonstrates the StarCoder model's ability to support code understanding, generation, and potentially automating repetitive tasks in software development. Its vast training across multiple languages ensures versatility and usefulness in diverse coding scenarios.
DETAILS
MODULAR GITHUB
ModularCREATED BY
bigcode
MODEL
bigcode/starcoderbase-1b
TAGS
@ Copyright - Modular Inc - 2024