Model reference · open weights
santacoder is an open-weight language model from bigcode. santacoder (BF16) weighs 4.6 GB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the bigcode/santacoder model card, 2026-10-01
What it is
| Released by | bigcode |
|---|---|
| Released | 2022-12-02 |
| VRAM | 4.6 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory |
|---|---|---|---|
| 2K each | |||
| RTX 3060 12 GB | 15 | all 2K | 11.6 GB |
| RTX 4060 Ti 16 GB | 25 | all 2K | 15.4 GB |
| RTX 3090 24 GB | 45 | all 2K | 23.4 GB |
| RTX 4090 24 GB | 45 | all 2K | 23.4 GB |
| RTX 5090 32 GB | 64 | all 2K | 31.0 GB |
| L40S 48 GB | 96 | all 2K | 44.0 GB |
| A100 80 GB | 181 | all 2K | 78.2 GB |
| H100 80 GB | 173 | all 2K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 212 | all 2K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 246 | all 2K | 107 GB |
| H200 141 GB | 322 | all 2K | 138 GB |
| B200 180 GB | 416 | all 2K | 176 GB |
| Requests at once | 2K tokens each |
|---|---|
| 1 | 5.6 GB |
| 5 | 7.2 GB |
| 8 | 8.4 GB |
| 16 | 11.6 GB |
| 32 | 18.1 GB |
| 64 | 31.0 GB |
One card, with vLLM's small-card settings.
From the model card
Play with the model on the SantaCoder Space Demo.
The SantaCoder models are a series of 1.1B parameter models trained on the Python, Java, and JavaScript subset of The Stack (v1.1) (which excluded opt-out requests). The main model uses Multi Query Attention, a context window of 2048 tokens, and was trained using near-deduplication and comment-to-code ratio as filtering criteria and using the Fill-in-the-Middle objective. In addition there are several models that were trained on datasets with different filter parameters and with architecture and objective variations.
| Model | Architecture | Objective | Filtering |
|---|---|---|---|
mha | MHA | AR + FIM | Base |
no-fim | MQA | AR | Base |
fim | MQA | AR + FIM | Base |
stars | MQA | AR + FIM | GitHub stars |
fertility | MQA | AR + FIM | Tokenizer fertility |
comments | MQA | AR + FIM | Comment-to-code ratio |
dedup-alt | MQA | AR + FIM | Stronger near-deduplication |
final | MQA | AR + FIM | Stronger near-deduplication and comment-to-code ratio |
The final model is the best performing model and was trained twice as long (236B tokens) as the others. This checkpoint is the default model and available on the main branch. All other checkpoints are on separate branches with according names.
The model was trained on GitHub code. As such it is not an instruction model and commands like "Write a function that computes the square root." do not work well.
You should phrase commands like they occur in source code such as comments (e.g. # the following function computes the sqrt) or write a function signature and docstring and let the model complete the function body.
Feel free to share your generations in the Community tab!
# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "bigcode/santacoder"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint, trust_remote_code=True).to(device)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
input_text = "def print_hello_world():\n \n print('Hello world!')"
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
Make sure to use , , and not , , as in StarCoder models.
We upload the checkpoint of each experiment to a separate branch as well as the intermediate checkpoints as commits on the branches. You can load them with the revision flag:
model = AutoModelForCausalLM.from_pretrained(
"bigcode/santacoder",
revision="no-fim", # name of branch or commit hash
trust_remote_code=True
)
The pretraining dataset of the model was filtered for permissive licenses only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a search index that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
The model has been trained on source code in Python, Java, and JavaScript. The predominant language in source is English although other languages are also present. As such the model is capable to generate code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits.
The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement here.
@article{allal2023santacoder,
title={SantaCoder: don't reach for the stars!},
author={Allal, Loubna Ben and Li, Raymond and Kocetkov, Denis and Mou, Chenghao and Akiki, Christopher and Ferrandis, Carlos Munoz and Muennighoff, Niklas and Mishra, Mayank and Gu, Alex and Dey, Manan and others},
journal={arXiv preprint arXiv:2301.03988},
year={2023}
}
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
Benchmarks
As published on the model card: the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| text-generation | MultiPL HumanEval (Python) | pass@1 | 0.180 |
| text-generation | MultiPL HumanEval (Python) | pass@10 | 0.290 |
| text-generation | MultiPL HumanEval (Python) | pass@100 | 0.490 |
| text-generation | MultiPL MBPP (Python) | pass@1 | 0.350 |
| text-generation | MultiPL MBPP (Python) | pass@10 | 0.580 |
| text-generation | MultiPL MBPP (Python) | pass@100 | 0.770 |
| text-generation | MultiPL HumanEval (JavaScript) | pass@1 | 0.160 |
| text-generation | MultiPL HumanEval (JavaScript) | pass@10 | 0.270 |
| text-generation | MultiPL HumanEval (JavaScript) | pass@100 | 0.470 |
| text-generation | MultiPL MBPP (Javascript) | pass@1 | 0.280 |
| text-generation | MultiPL MBPP (Javascript) | pass@10 | 0.510 |
| text-generation | MultiPL MBPP (Javascript) | pass@100 | 0.700 |
| text-generation | MultiPL HumanEval (Java) | pass@1 | 0.150 |
| text-generation | MultiPL HumanEval (Java) | pass@10 | 0.260 |
| text-generation | MultiPL HumanEval (Java) | pass@100 | 0.410 |
| text-generation | MultiPL MBPP (Java) | pass@1 | 0.280 |
| text-generation | MultiPL MBPP (Java) | pass@10 | 0.440 |
| text-generation | MultiPL MBPP (Java) | pass@100 | 0.590 |
| text-generation | HumanEval FIM (Python) | single_line | 0.440 |
| text-generation | MultiPL HumanEval FIM (Java) | single_line | 0.620 |
| text-generation | MultiPL HumanEval FIM (JavaScript) | single_line | 0.600 |
| text-generation | CodeXGLUE code-to-text (Python) | BLEU | 18.130 |