Instructions to use scalar-ai/scalar-phos-pro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use scalar-ai/scalar-phos-pro with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.1-8b-instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "scalar-ai/scalar-phos-pro") - Transformers
How to use scalar-ai/scalar-phos-pro with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="scalar-ai/scalar-phos-pro") 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("scalar-ai/scalar-phos-pro") model = AutoModelForCausalLM.from_pretrained("scalar-ai/scalar-phos-pro", 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 scalar-ai/scalar-phos-pro with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "scalar-ai/scalar-phos-pro" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scalar-ai/scalar-phos-pro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/scalar-ai/scalar-phos-pro
- SGLang
How to use scalar-ai/scalar-phos-pro 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 "scalar-ai/scalar-phos-pro" \ --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": "scalar-ai/scalar-phos-pro", "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 "scalar-ai/scalar-phos-pro" \ --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": "scalar-ai/scalar-phos-pro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use scalar-ai/scalar-phos-pro with Docker Model Runner:
docker model run hf.co/scalar-ai/scalar-phos-pro
Scalar Phos Pro is an instruction-tuned generative language model based on the Llama-3.1-8B-Instruct architecture. It has been optimized using QLoRA to improve specialized instruction following and broad reasoning performance while keeping deployment lightweight and efficient.
Looking for quantized local weights (Ollama / LM Studio / llama.cpp)?
Check out the dedicated GGUF repository: scalar-ai/scalar-phos-pro-gguf
Looking for merged weights?
Check out the dedicated repository: scalar-ai/scalar-phos-pro-merged
Model Summary
| Parameter / Feature | Model Specification |
|---|---|
| Architecture | Auto-regressive Dense Transformer |
| Total Parameters | 8.03 Billion (~8B) |
| Base Model | Meta Llama 3.1 8B Instruct |
| Fine-Tuning Method | QLoRA (Quantized Low-Rank Adaptation) |
| Number of Layers | 32 |
| Attention Heads | 32 (Grouped-Query Attention / GQA) |
| Hidden Dimension | 4096 |
| Vocabulary Size | 128,256 |
| Context Length | 128,000 (128k) tokens |
| Attention Mechanism | Rotary Position Embeddings (RoPE) + GQA |
| Precision / Format | FP16, BF16, 4-bit (QLoRA / PEFT Safetensors) |
| Modality | Text (Multilingual / Instruction-Tuned) |
| License | Llama 3.1 Community License Agreement |
Benchmark Performance (MMLU)
The model was evaluated using EleutherAI's evaluation harness (lm-evaluation-harness) under zero-shot conditions. Below is a performance comparison of Scalar Phos Pro against other leading open-weights models in the 7B to 9B parameter range on the MMLU benchmark:
| Benchmark / Category | Scalar Phos Pro | Llama-3.1-8B-Instruct | Qwen2.5-7B-Instruct | Gemma-2-9B-Instruct | GPT-4o-mini | Claude 3 Haiku |
|---|---|---|---|---|---|---|
| Parameters / Class | 8.0B (QLoRA) | 8.0B | 7.6B | 9.2B | ~8B equivalent | ~8B equivalent |
| Overall MMLU | 66.55% | 69.4% | 74.2% | 71.3% | 70.2% | 75.2% |
| Social Sciences | 78.06% | 80.2% | 83.1% | 79.5% | 81.0% | 82.4% |
| Humanities | 69.23% | 71.5% | 76.4% | 73.0% | 72.8% | 76.9% |
| Other (Business/Medicine) | 68.72% | 70.8% | 75.9% | 72.4% | 73.1% | 77.0% |
| STEM | 55.96% | 58.1% | 63.5% | 60.2% | 58.4% | 64.1% |
File Structure & Repository Contents
This repository contains the full QLoRA adapter weights (adapter_config.json, adapter_model.safetensors, tokenizer files) for merging back into the base model or continued fine-tuning via Hugging Face transformers and peft.
For quantized GGUF binaries (Q4_K_M, Q5_K_M, Q8_0) and Ollama Modelfiles, visit scalar-ai/scalar-phos-pro-gguf.
How to Use
Loading via Python (transformers + peft)
You can load the base model and apply the LoRA adapters using the following Python snippet:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "meta-llama/Llama-3.1-8B-Instruct"
adapter_path = "scalar-ai/scalar-phos-pro"
# Load tokenizer and base model
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load LoRA weights
model = PeftModel.from_pretrained(base_model, adapter_path)
# Run a test generation
inputs = tokenizer("Explain quantum computing in simple terms:", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
License
Both the code repository and the model are released under the LLama 3.1 Community License Agreement.
- Downloads last month
- 222
Model tree for scalar-ai/scalar-phos-pro
Base model
meta-llama/Llama-3.1-8B