Instructions to use chris0809/tinyLLM-0.51B-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chris0809/tinyLLM-0.51B-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chris0809/tinyLLM-0.51B-SFT", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("chris0809/tinyLLM-0.51B-SFT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chris0809/tinyLLM-0.51B-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chris0809/tinyLLM-0.51B-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": "chris0809/tinyLLM-0.51B-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chris0809/tinyLLM-0.51B-SFT
- SGLang
How to use chris0809/tinyLLM-0.51B-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 "chris0809/tinyLLM-0.51B-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": "chris0809/tinyLLM-0.51B-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 "chris0809/tinyLLM-0.51B-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": "chris0809/tinyLLM-0.51B-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chris0809/tinyLLM-0.51B-SFT with Docker Model Runner:
docker model run hf.co/chris0809/tinyLLM-0.51B-SFT
tinyLLM SFT 0.51B
䏿–‡é¡¹ç›®æ–‡æ¡£ · English project overview · Live demo
One SFT base: mathematical reasoning with a verified answer, then tested Python code.
tinyLLM is a custom 0.51B decoder-only model trained from scratch for Chinese and English.
Loading requires trust_remote_code=True because the architecture is implemented in this repository.
The released SFT checkpoint scores 50.64% (668/1319) on GSM8K with the project's greedy evaluation setup. It is also the shared base for the ARC GRPO, IFEval OPD and VLM releases.
Load
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "chris0809/tinyLLM-0.51B-SFT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype="auto",
)
Thinking mode
Ordinary chat uses the default template. For mathematics or multi-step reasoning, turn on the bundled switch; the template automatically injects the same reasoning protocol used during training and evaluation.
messages = [{"role": "user", "content": "Solve: 17 * 6. Give the final answer clearly."}]
inputs = tokenizer.apply_chat_template(
messages,
enable_thinking=True,
add_generation_prompt=True,
return_tensors="pt",
)
Omit enable_thinking or set it to False for ordinary chat. The thought
boundaries are encoded with existing tokenizer pieces, so do not add special
tokens or resize the embeddings. For GSM8K/ARC-style evaluation, append
Put your final answer in LaTeX boxed form like $\boxed{answer}$. to the
user question.
Task LoRAs can be attached without reloading the base model:
model.load_lora_pretrained("chris0809/tinyLLM-0.51B-ARC-GRPO")
Try the SFT checkpoint in the hosted tinyLLM demo. The Space uses free ZeroGPU, so a cold start or queue is normal.
Source
Training code and full project documentation: https://github.com/Huanz86251/tinyLLM
- Downloads last month
- 668
