Instructions to use iaroy/sgc-522m-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iaroy/sgc-522m-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iaroy/sgc-522m-sft", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("iaroy/sgc-522m-sft", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use iaroy/sgc-522m-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iaroy/sgc-522m-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iaroy/sgc-522m-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/iaroy/sgc-522m-sft
- SGLang
How to use iaroy/sgc-522m-sft 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 "iaroy/sgc-522m-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iaroy/sgc-522m-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "iaroy/sgc-522m-sft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iaroy/sgc-522m-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use iaroy/sgc-522m-sft with Docker Model Runner:
docker model run hf.co/iaroy/sgc-522m-sft
sgc-522m-sft
sgc (Single-GPU Coder) is a 522M-parameter decoder-only transformer for Python and C++ code, pretrained from scratch on 103B tokens in 76.3 hours on one NVIDIA GH200 GPU. This repository holds the model after supervised fine-tuning (SFT) on reasoning traces, before reinforcement learning. The final model is sgc-522m.
- Paper: One GPU, 0.1 Trillion Tokens: Pretraining a Sub-Billion-Parameter Code Model
- Code, training and evaluation records: github.com/indrajeetadityaroy9/single-gpu-code-llm
Results
| Model | HumanEval | HumanEval+ |
|---|---|---|
| sgc-522m-base | 26.8 | 22.0 |
| sgc-522m-sft | 32.9 | 31.7 |
| sgc-522m | 40.9 | 38.4 |
pass@1 with greedy decoding, scored by EvalPlus. On 512 held-out KodCode problems (4 samples each at temperature 0.6, top-p 0.95, up to 16,384 tokens), this model's pass@1 is 0.334, and 918 of its 2,048 responses do not finish: most fall into a repeating loop. RL reduces this to 266 (sgc-522m).
Prompt format and usage
As for sgc-522m: the chat template renders <|bos|>, the user message,
then \n\n<think>\n; the model reasons, closes with </think> and answers. Serve it with the repository's
scripts/serve.sh iaroy/sgc-522m-sft, or load it with transformers (trust_remote_code=True).
Training
SFT for 2 epochs (7,676 steps, 11.32B tokens, 11.2 hours) of reasoning traces from Nemotron-Cascade SFT (code), Nemotron SFT Competitive Programming v2 and KodCode-V1-SFT-R1, starting from sgc-522m-base.
- Downloads last month
- 403