Instructions to use ShayonSarker/StarCoder2-3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ShayonSarker/StarCoder2-3B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ShayonSarker/StarCoder2-3B-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ShayonSarker/StarCoder2-3B-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ShayonSarker/StarCoder2-3B-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
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 ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
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 ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ShayonSarker/StarCoder2-3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ShayonSarker/StarCoder2-3B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShayonSarker/StarCoder2-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
- SGLang
How to use ShayonSarker/StarCoder2-3B-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ShayonSarker/StarCoder2-3B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShayonSarker/StarCoder2-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ShayonSarker/StarCoder2-3B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShayonSarker/StarCoder2-3B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use ShayonSarker/StarCoder2-3B-GGUF with Ollama:
ollama run hf.co/ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use ShayonSarker/StarCoder2-3B-GGUF with Docker Model Runner:
docker model run hf.co/ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
- Lemonade
How to use ShayonSarker/StarCoder2-3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ShayonSarker/StarCoder2-3B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.StarCoder2-3B-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
StarCoder2-3B GGUF
Source model · HF release · Build hub
This release contains a validated Q4_K_M artifact for the StarCoder2-3B base model. The weights come from the established second-state/StarCoder2-3B-GGUF Q4_K_M conversion; no weight values were changed. The GGUF metadata was repaired to add the required tokenizer.ggml.pre=starcoder field, which removes llama.cpp's missing-pre-tokenizer warning.
Format status
| File | Status | Purpose |
|---|---|---|
starcoder2-3b-Q4_K_M.gguf |
Published | Compact code model |
starcoder2-3b-F16.gguf |
Not published | Source checkpoint download exceeded the available transfer budget |
starcoder2-3b-Q8_0.gguf |
Not published | Same reason; it would have to be requantised from the source, not from Q4 |
The source checkpoint is 12.1 GB, so a fresh source conversion was not repeated here. The included build_gguf.py can build F16, Q8_0, and Q4_K_M from the pinned source when the download and disk requirements are available.
Verified code completions
Verbatim starcoder2-3b-Q4_K_M.gguf completions, --temp 0, 24 new tokens. The prompt is the def/for/SELECT line plus the already-given return or print(, and the model's text is reproduced as-is.
| Prompt | Model completion |
|---|---|
def is_even(number): return |
number % 2 == 0 |
def reverse_text(text): return |
text[::-1] |
def factorial(number): if number <= 1: return |
1 else: return number * factorial(number - 1) |
def sum_list(numbers): return |
sum(numbers) |
def find_max(numbers): return |
max(numbers) |
for index, item in enumerate(items): print( |
index, item) |
Python is clean. SQL is not, and it fails differently from DeepSeek-Coder: SELECT name FROM users WHERE active = drifts into a JavaScript then(result => ...) block, and SELECT COUNT(*) FROM orders WHERE total > emits 10000000000000000000000. StarCoder2-3B is a base model, so the trailing print(...) test calls and generated helper functions are trimmed above rather than presented as intended output.
Validation
WikiText-2 raw test evaluation, 8 chunks of 512 tokens:
| Format | PPL |
|---|---|
| Q4_K_M, metadata repaired | 11.7857 +/- 0.67032 |
A deterministic code-completion smoke test completed successfully:
def add(a, b):
return a + b
Build
python -m pip install -r requirements-build.txt
python build_gguf.py --model-id bigcode/starcoder2-3b
The builder pins llama.cpp commit 6b790a9c291b5d7af3312bbf9f0c558aa023b13e and the upstream model revision. It does not upload or overwrite this repository.
License and provenance
BigCode OpenRAIL-M. See the upstream model card, the LICENSE notice, and the full license agreement linked there. The Q4_K_M weights are attributed to second-state/StarCoder2-3B-GGUF; this repository only repairs missing GGUF tokenizer metadata and adds documentation.
- Downloads last month
- 53
4-bit
Model tree for ShayonSarker/StarCoder2-3B-GGUF
Base model
bigcode/starcoder2-3b