Instructions to use MSDDDD/Kestrel-330M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MSDDDD/Kestrel-330M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MSDDDD/Kestrel-330M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MSDDDD/Kestrel-330M", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MSDDDD/Kestrel-330M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MSDDDD/Kestrel-330M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MSDDDD/Kestrel-330M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MSDDDD/Kestrel-330M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MSDDDD/Kestrel-330M
- SGLang
How to use MSDDDD/Kestrel-330M 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 "MSDDDD/Kestrel-330M" \ --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": "MSDDDD/Kestrel-330M", "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 "MSDDDD/Kestrel-330M" \ --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": "MSDDDD/Kestrel-330M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MSDDDD/Kestrel-330M with Docker Model Runner:
docker model run hf.co/MSDDDD/Kestrel-330M
Kestrel-330M (base)
A 336M-parameter language model trained from scratch by one person on a single GPU (NVIDIA RTX PRO 6000 Blackwell), on 6.0B tokens. This is a base model: it continues text. It is not instruction-tuned. The chat version is Kestrel-330M-Chat.
Results (zero-shot)
All four models were scored with the same evaluation script (log-likelihood scoring, up to 1,000 examples per task).
| Task | Kestrel-330M | GPT-2 Medium (355M) | Pythia-410M | SmolLM-360M |
|---|---|---|---|---|
| Training tokens | 6B | ~10–40B (est.) | 300B | 600B |
| HellaSwag (acc_norm) | 40.9 | 43.4 | 44.5 | 48.9 |
| ARC-Easy (acc) | 56.1 | 48.4 | 51.9 | 68.2 |
| ARC-Challenge (acc_norm) | 27.2 | 23.4 | 22.7 | 36.6 |
| WinoGrande (acc) | 50.8 | 52.8 | 52.2 | 56.2 |
| LAMBADA (acc) | 30.2 | 40.8 | 47.2 | 45.2 |
| Average | 41.0 | 41.8 | 43.7 | 51.0 |
Overall it roughly matches GPT-2 Medium, and it beats GPT-2 Medium and Pythia-410M on the ARC science questions. It was trained on about 50× fewer tokens than Pythia-410M. SmolLM-360M, trained on 100× more data, remains clearly stronger.
Architecture
The model has a Llama/Qwen3-style decoder:
- 16 layers, hidden size 1024, and 16 attention heads with 4 KV heads (GQA)
- SwiGLU feed-forward layers (size 2816) and RMSNorm
- QK-norm and RoPE (θ = 500k), with a context length of 2048
- Tied embeddings and the Qwen2.5 tokenizer (vocabulary 151,936)
- A final logit soft-cap of 30
The weights load as Qwen3. A small modeling_kestrel.py adds the logit soft-cap the model was trained
with, so trust_remote_code=True is required. Without it, outputs are much worse.
Training
- Optimizers: Muon for the hidden matrices and AdamW for the embeddings and norms.
- Schedule: warmup–stable–decay, with linear decay over the last 15% of training.
- Batch: about 1M tokens per step, for 5,722 steps.
- Precision and compilation: bf16 with
torch.compile. - Data mix (approximate weights):
- educational web text (FineWeb-Edu, score ≥ 4): 19%
- HTML, JavaScript, CSS, TypeScript and Python code from The Stack (filtered by stars, with minified, vendor and generated files removed): about 38%
- maths (FineMath): 9%
- synthetic textbooks (Cosmopedia v2): 8%
- Wikipedia: 5%
- WebSight: 4.5%
- Project Gutenberg: 3%
- a small multilingual share from FineWeb-2 and Wikipedia in 10 languages
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("MSDDDD/Kestrel-330M")
model = AutoModelForCausalLM.from_pretrained("MSDDDD/Kestrel-330M", trust_remote_code=True)
x = tok("Photosynthesis is the process by which", return_tensors="pt")
print(tok.decode(model.generate(**x, max_new_tokens=60, do_sample=True, temperature=0.7, top_k=40, repetition_penalty=1.15)[0]))
Sample outputs (unedited, temperature 0.7)
Once upon a time, a young girl named Lily lived in the charming town of Penderwell. She loved her neighbors and always looked forward to having fun together while learning new things through their shared love for books.
Photosynthesis is the process by which plants convert solar energy into chemical energy.
Limitations
- Facts: it often states wrong facts confidently. Do not rely on it for factual information.
- Long outputs: it loses coherence and can drift off topic after a paragraph or two.
- Questions: it does not answer questions or follow instructions reliably, because it is a base model.
- Unfiltered content: it learned from web text and can produce biased, offensive or unrelated unpleasant content, sometimes even from harmless prompts. No safety tuning has been applied.
- Code: the code it writes is often plausible-looking but wrong.
It is intended for research, experimentation and fine-tuning, not for production use.
License
The model weights are released under Apache-2.0. The training data comes from public datasets, each under its own license and terms of use.
- Downloads last month
- 8