Instructions to use linius/Llama-3.1-8B-SPoT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use linius/Llama-3.1-8B-SPoT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="linius/Llama-3.1-8B-SPoT")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("linius/Llama-3.1-8B-SPoT") model = AutoModelForMultimodalLM.from_pretrained("linius/Llama-3.1-8B-SPoT") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use linius/Llama-3.1-8B-SPoT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "linius/Llama-3.1-8B-SPoT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "linius/Llama-3.1-8B-SPoT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/linius/Llama-3.1-8B-SPoT
- SGLang
How to use linius/Llama-3.1-8B-SPoT 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 "linius/Llama-3.1-8B-SPoT" \ --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": "linius/Llama-3.1-8B-SPoT", "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 "linius/Llama-3.1-8B-SPoT" \ --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": "linius/Llama-3.1-8B-SPoT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use linius/Llama-3.1-8B-SPoT with Docker Model Runner:
docker model run hf.co/linius/Llama-3.1-8B-SPoT
Llama-3.1-8B-SPoT
Model Description
Llama-3.1-8B-SPoT is a reasoning-enhanced large language model post-trained from the meta-llama/Llama-3.1-8B base model. It is trained using the Surgical Post-Training (SPoT) paradigm, which improves reasoning capabilities while alleviating the catastrophic forgetting typically associated with standard Supervised Fine-Tuning (SFT).
This model is the Llama 3.1 8B counterpart of linius/Qwen3-8B-SPoT, introduced alongside the SPoT methodology in the paper Surgical Post-Training: Proximal On-Policy Distillation for Reasoning with Knowledge Retention.
- Code Repository: Visual-AI/SPoT
Training Details & Performance
- Training paradigm: Surgical Post-Training (SPoT).
- Base model:
meta-llama/Llama-3.1-8B. - Focus: improving mathematical and step-by-step reasoning while preserving general capabilities.
- Format: sharded
safetensorscheckpoint compatible with Hugging Facetransformers. - Evaluation: benchmark details for this Llama 3.1 8B checkpoint will be added separately.
Usage
You can load and generate text with this model using Hugging Face transformers:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "linius/Llama-3.1-8B-SPoT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16,
)
prompt = "Solve the following math problem step-by-step: ..."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
generated_ids = model.generate(
**inputs,
max_new_tokens=2048,
temperature=0.6,
top_p=0.9,
)
response = tokenizer.decode(
generated_ids[0][inputs.input_ids.shape[-1]:],
skip_special_tokens=True,
)
print(response)
Files
config.jsongeneration_config.jsonmodel-00001-of-00007.safetensorsthroughmodel-00007-of-00007.safetensorsmodel.safetensors.index.json- tokenizer files
training_args.bin is intentionally not required for inference and may be omitted from public uploads.
Citation
If you find this model or the SPoT methodology useful in your research, please consider citing:
@article{lin2026surgical,
title={Surgical Post-Training: Proximal On-Policy Distillation for Reasoning with Knowledge Retention},
author={Wenye Lin and Kai Han},
year={2026},
journal={arXiv preprint arXiv:2603.01683}
}
License
This checkpoint uses the Llama architecture and should be used in compliance with the Llama 3.1 Community License and applicable acceptable-use terms.
- Downloads last month
- 29
Model tree for linius/Llama-3.1-8B-SPoT
Base model
meta-llama/Llama-3.1-8B