Instructions to use spitfire4794/Supra-1.5-50M-Base-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spitfire4794/Supra-1.5-50M-Base-exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="spitfire4794/Supra-1.5-50M-Base-exp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("spitfire4794/Supra-1.5-50M-Base-exp") model = AutoModelForCausalLM.from_pretrained("spitfire4794/Supra-1.5-50M-Base-exp") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use spitfire4794/Supra-1.5-50M-Base-exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "spitfire4794/Supra-1.5-50M-Base-exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spitfire4794/Supra-1.5-50M-Base-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/spitfire4794/Supra-1.5-50M-Base-exp
- SGLang
How to use spitfire4794/Supra-1.5-50M-Base-exp 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 "spitfire4794/Supra-1.5-50M-Base-exp" \ --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": "spitfire4794/Supra-1.5-50M-Base-exp", "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 "spitfire4794/Supra-1.5-50M-Base-exp" \ --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": "spitfire4794/Supra-1.5-50M-Base-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use spitfire4794/Supra-1.5-50M-Base-exp with Docker Model Runner:
docker model run hf.co/spitfire4794/Supra-1.5-50M-Base-exp
Supra1.5-50M Base (ChatML)
Continued Pretraining • 50M Parameters • 5K Context
Supra-1.5-50M-Base-exp is a continued-pretrained 50M parameter Llama-style base model derived from SupraLabs/Supra-50M-Base. The context window has been expanded from 1,024 to 5,120 tokens using RoPE scaling and full-weight continued pretraining.
This specific repository has been modified to natively support ChatML. The tokenizer and embedding layers have been updated to include <|im_start|> and <|im_end|> as single special tokens.
Architecture & Updates
| Specification | Value |
|---|---|
| Architecture | LlamaForCausalLM |
| Parameters | ~50M |
| Vocabulary Size | 32,002 (Expanded for ChatML) |
| Hidden Size | 512 |
| Layers | 12 |
| Attention Heads | 8 |
| KV Heads | 4 |
| Context Length | 5,120 tokens |
| Tokenizer | BPE tokenizer (ChatML Jinja template applied) |
| Native EOS Token | `< |
Vocabulary Expansion & Initialization
The model's 3B token CPT corpus included raw ChatML text. As a result, the base model originally learned the tags <|im_start|> and <|im_end|> as sequences of 7 separate subwords.
To convert these tags into single tokens without destroying the learned pre-trained representations, we used subword-mean initialization:
- Extracted the attention embeddings for the original 7-token sequences.
- Averaged the weights for each sequence.
- Assigned these mean weights to the new single-token IDs.
This ensures stable loss at the start of fine-tuning and allows inference frameworks to natively stop generation when <|im_end|> is predicted.
Continued Pretraining Objective
This is a base model, not an instruct model. Training used packed raw text with standard causal language-modeling loss:
labels = input_ids- all non-pad tokens are trained
- no response-only masking
- no system/user/assistant masking
- no LoRA adapters in the default run
Data Mix
The training mix prepared for the CPT run was:
- 3,000,000,062 CPT tokens
- 30% Tool Calling
- 30% ChatML Conversations
- 25% Factual Text (articles, essays, blogs)
- 15% Math & Logic Questions
Fine-Tuning Guide
This model is intended for Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL), including reasoning-style (R1) alignments.
You can use standard Hugging Face tools and call tokenizer.apply_chat_template() directly on your datasets.
LoRA Configuration Note: Because the vocabulary size was expanded from 32,000 to 32,002, you must train the embedding layers during fine-tuning so the model can update the new ChatML tokens. Add the following to your PEFT/LoRA configuration:
modules_to_save=["embed_tokens", "lm_head"]
- Downloads last month
- 526
