Instructions to use dranger003/starcoder2-15b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use dranger003/starcoder2-15b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="dranger003/starcoder2-15b-GGUF", filename="ggml-starcoder2-15b-f16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use dranger003/starcoder2-15b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dranger003/starcoder2-15b-GGUF:F16 # Run inference directly in the terminal: llama-cli -hf dranger003/starcoder2-15b-GGUF:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dranger003/starcoder2-15b-GGUF:F16 # Run inference directly in the terminal: llama-cli -hf dranger003/starcoder2-15b-GGUF:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf dranger003/starcoder2-15b-GGUF:F16 # Run inference directly in the terminal: ./llama-cli -hf dranger003/starcoder2-15b-GGUF:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf dranger003/starcoder2-15b-GGUF:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf dranger003/starcoder2-15b-GGUF:F16
Use Docker
docker model run hf.co/dranger003/starcoder2-15b-GGUF:F16
- LM Studio
- Jan
- vLLM
How to use dranger003/starcoder2-15b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dranger003/starcoder2-15b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dranger003/starcoder2-15b-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dranger003/starcoder2-15b-GGUF:F16
- Ollama
How to use dranger003/starcoder2-15b-GGUF with Ollama:
ollama run hf.co/dranger003/starcoder2-15b-GGUF:F16
- Unsloth Studio new
How to use dranger003/starcoder2-15b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dranger003/starcoder2-15b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dranger003/starcoder2-15b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dranger003/starcoder2-15b-GGUF to start chatting
- Docker Model Runner
How to use dranger003/starcoder2-15b-GGUF with Docker Model Runner:
docker model run hf.co/dranger003/starcoder2-15b-GGUF:F16
- Lemonade
How to use dranger003/starcoder2-15b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dranger003/starcoder2-15b-GGUF:F16
Run and chat with the model
lemonade run user.starcoder2-15b-GGUF-F16
List all available models
lemonade list
support by llama-cpp-python?
I want to use llamacpp for starcoder model however it throws error for starcoder2, is it not supported by llamacpp python?
@madhucharan You need to check if the version of llamacpp python you are using is running a commit after they added support.
Hi, Yes i updated the version it loaded starchat2 model, now my main confusion is the prompt format for instruction. This is what I currently use for llama and mistral.
if use_system_prompt:
input_prompt = f"[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n "
else:
input_prompt = f"[INST] "
for interaction in history:
input_prompt = input_prompt + str(interaction[0]) + " [/INST] " + str(interaction[1]) + " </s><s> [INST] "
input_prompt = input_prompt + str(message) + " [/INST] "
output = llm(
input_prompt,
temperature=Env.TEMPERATURE,
top_p=Env.TOP_P,
top_k=Env.TOP_K,
repeat_penalty=Env.REPEAT_PENALTY,
max_tokens=max_tokens_input,
stop=[
"<|prompter|>",
"<|endoftext|>",
"<|endoftext|> \n",
"ASSISTANT:",
"USER:",
"SYSTEM:",
],
stream=True,
)
Where to access the template for starchat model? ( I use this model specifically though - https://huggingface.co/bartowski/starchat2-15b-v0.1-GGUF)
@madhucharan This model has no template, this is only a base model. You should use dranger003/dolphincoder-starcoder2-15b-iMat.GGUF for prompting.
@dranger003 when you say this, do you mean this repo or the link I shared (https://huggingface.co/bartowski/starchat2-15b-v0.1-GGUF). Confused as these are two different ones.
Ah, I see sorry I missed that last bit. I think you may need to change your template, have a look here.
do you think it should work. Sorry Im new to this, hence there is a lil bit of confusion on understanding prompt format.
This is the prompt I got from the first gguf link(https://huggingface.co/dranger003/dolphincoder-starcoder2-15b-iMat.GGUF) you shared and used it as reference
Format reference:
<|im_start|>system
You are DolphinCoder, a helpful AI programming assistant.<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
if use_system_prompt:
input_prompt = f"<|im_start|> system\n{system_prompt} <|im_end|>\n"
else:
input_prompt = f"<|im_start|>"
input_prompt = f"{input_prompt}user\n{str(message)}<|im_end|>\n<|im_start|>assistant "
output = llm(
input_prompt,
temperature=Env.TEMPERATURE,
top_p=Env.TOP_P,
top_k=Env.TOP_K,
repeat_penalty=Env.REPEAT_PENALTY,
max_tokens=max_tokens_input,
stop=[
"<|im_end|>"
],
stream=True,
)
I think you'll have to try it, it looks fine but I don't use llamacpp python. Also, at the end after assistant instead of a space, use a newline character.