Instructions to use prathamkode/particle-1.8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prathamkode/particle-1.8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prathamkode/particle-1.8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prathamkode/particle-1.8") model = AutoModelForCausalLM.from_pretrained("prathamkode/particle-1.8", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prathamkode/particle-1.8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prathamkode/particle-1.8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prathamkode/particle-1.8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prathamkode/particle-1.8
- SGLang
How to use prathamkode/particle-1.8 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 "prathamkode/particle-1.8" \ --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": "prathamkode/particle-1.8", "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 "prathamkode/particle-1.8" \ --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": "prathamkode/particle-1.8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prathamkode/particle-1.8 with Docker Model Runner:
docker model run hf.co/prathamkode/particle-1.8
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("prathamkode/particle-1.8")
model = AutoModelForCausalLM.from_pretrained("prathamkode/particle-1.8", device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))Particle 1.8
Particle 1.8 is a compact (~109.5M) chat model trained from scratch. It builds on the same architecture and 2B-token pretrained base as Particle 1.0, Particle 1.6, and Particle 1.7.
This release is a 2-epoch continued supervised fine-tune initialized from Particle 1.7 on ~120k Q&A and short-chat pairs combining 98k child-friendly solar-system facts with a ~22k general replay mix (high-school science Q&A, code-filtered conversational pairs, and manners/fact seeds) using a conservative 5e-6 -> 5e-7 cosine schedule. It eliminates the synthetic orbital-metric template bleed observed in Particle 1.7, jumps from 4/40 to 24/40 strict accuracy on Solar System questions (35/100 strict overall vs 20/100 for Particle 1.7 and 25/100 for Particle 1.6), and maintains 95% clean EOS stopping within 64 tokens.
Weights are released under MIT. Training data is not included.
Quick start
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "prathamkode/particle-1.8"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
messages = [{"role": "user", "content": "What is the smallest planet in our solar system?"}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=False))
Model
| Architecture | Llama-style decoder (RoPE, SwiGLU, RMSNorm) |
| Parameters | 109.5M |
| Layers / hidden / heads | 12 / 768 / 12 |
| Context | 2048 tokens |
| Tokenizer | Custom byte-level BPE, 32k vocabulary |
| Precision | bfloat16 |
| License | MIT |
The model is trained from random initialization. It is not a fine-tune of Llama, SmolLM, or any other public checkpoint.
Training
- Pretrain β ~2B tokens of public educational web text (same base as Particle 1.0).
- SFT Stage 1 (v1.7) β 2 epochs (
15,146optimizer steps, cosine decay2e-5 -> 2e-6,seq_len=1024, effective batch size32) on a ~242k-row internal Q&A + chat mix. - Continued SFT Stage 2 (v1.8) β 2 epochs (
7,518optimizer steps, cosine decay5e-6 -> 5e-7,3%linear warmup,seq_len=1024, effective batch size32,weight_decay=0.01) initialized weights-only from Particle 1.7 on120,296rows (98,000solar-system Q&A +22,296general replay). Final held-out validation loss:0.4973.
The SFT mix is not published. Particle 1.8 is shared so others can inspect the weights, reproduce inference, and compare against Particle 1.0 and Particle 1.7.
Evaluation snapshot
Zero-context 100-question factual Q&A benchmark (do_sample=False, max_new_tokens=64):
| Model | Params | Strict | Weighted | Solar System (40) | EOS Stop | Avg Tokens |
|---|---|---|---|---|---|---|
| Particle 1.8 | 109.5M | 35/100 | 38.0% | 24/40 (+4p) | 95% | 23.9 |
| Particle 1.7 | 109.5M | 20/100 | 23.0% | 4/40 (+4p) | 96% | 16.0 |
| Particle 1.0 | 109.5M | 11/100 | 14.5% | 5/40 (+1p) | 49% | 48.2 |
| Particle 2.0 | 109.5M | 11/100 | 12.0% | 2/40 | 89% | 27.9 |
Intended use
Research, evaluation, and small demos. Suitable for studying from-scratch training and multi-stage continued SFT + replay dynamics at ~100M scale.
Not intended as a production assistant, a source of facts, or a coding model.
Limitations
- Small capacity (~109.5M params, ~2B pretraining tokens): weak on reasoning, long context, and tools
- Continued SFT heavily weighted toward solar-system facts improves astronomy recall dramatically (
4/40 -> 24/40), but can bleed solar-system facts into some unrelated superlative prompts and slightly reduces non-solar recall vs Particle 1.7 - Can hallucinate or contradict itself
- English-centric
- No preference tuning or safety alignment beyond the SFT mix
Citation
If you use these weights, please cite Particle and the public pretraining corpus used for the 1.0 base.
- Downloads last month
- 429
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prathamkode/particle-1.8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)