Instructions to use axonlabsai/Ranger-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axonlabsai/Ranger-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="axonlabsai/Ranger-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("axonlabsai/Ranger-7B") model = AutoModelForCausalLM.from_pretrained("axonlabsai/Ranger-7B", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use axonlabsai/Ranger-7B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf axonlabsai/Ranger-7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf axonlabsai/Ranger-7B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf axonlabsai/Ranger-7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf axonlabsai/Ranger-7B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf axonlabsai/Ranger-7B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf axonlabsai/Ranger-7B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf axonlabsai/Ranger-7B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf axonlabsai/Ranger-7B:Q4_K_M
Use Docker
docker model run hf.co/axonlabsai/Ranger-7B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use axonlabsai/Ranger-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axonlabsai/Ranger-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "axonlabsai/Ranger-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/axonlabsai/Ranger-7B:Q4_K_M
- SGLang
How to use axonlabsai/Ranger-7B 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 "axonlabsai/Ranger-7B" \ --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": "axonlabsai/Ranger-7B", "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 "axonlabsai/Ranger-7B" \ --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": "axonlabsai/Ranger-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use axonlabsai/Ranger-7B with Ollama:
ollama run hf.co/axonlabsai/Ranger-7B:Q4_K_M
- Unsloth Studio
How to use axonlabsai/Ranger-7B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for axonlabsai/Ranger-7B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for axonlabsai/Ranger-7B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for axonlabsai/Ranger-7B to start chatting
- Pi
How to use axonlabsai/Ranger-7B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf axonlabsai/Ranger-7B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "axonlabsai/Ranger-7B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use axonlabsai/Ranger-7B with Docker Model Runner:
docker model run hf.co/axonlabsai/Ranger-7B:Q4_K_M
- Lemonade
How to use axonlabsai/Ranger-7B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull axonlabsai/Ranger-7B:Q4_K_M
Run and chat with the model
lemonade run user.Ranger-7B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use axonlabsai/Ranger-7B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf axonlabsai/Ranger-7B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default axonlabsai/Ranger-7B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use axonlabsai/Ranger-7B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf axonlabsai/Ranger-7B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "axonlabsai/Ranger-7B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Ranger 7B
A reasoning-and-math model from Axon Labs. 7.62B parameters, dense, text only. Fine-tuned to answer like an engineer instead of thinking out loud for three thousand tokens first.
On context length — read this before you set -c. config.json says
max_position_embeddings: 131072, and that number is inherited, not earned.
rope_theta is 10000, the short-context value, and there is no rope_scaling.
The pretraining ancestor of this lineage, Qwen2.5-Math-7B, declares a trained
context of 4096 with that same rope_theta — whereas Qwen2.5-7B, which is
genuinely long-context, uses rope_theta: 1000000. Treat a few thousand tokens
as reliable, expect degradation well before 128k, and do not size a KV cache for
context this model cannot use. Nothing above 4k has been evaluated here.
The headline result is finishing within a realistic budget, and it is measured rather than asserted:
| token budget | HumanEval+ pass@1 | median output | |
|---|---|---|---|
| Ranger 7B | 1000 | 65.6% | 582 chars |
| base | 1000 | 34.4% | 3708 chars |
| base | 3000 | 56.2% | — |
Read that honestly. The base is not 31 points dumber — it is unfinished. At a 1000-token cap it emitted no code at all on 10 of 32 problems because it was still reasoning, and 27 of 32 of its responses hit the ceiling. Give it 3000 tokens and it recovers to 56.2%, at which point the remaining gap is inside the noise for a 32-problem sample.
So the claim is not "twice as good at code". The claim is that this model does comparable work in roughly a sixth of the output, which is what matters when you are paying per token or waiting for a response.
Quickstart
from transformers import AutoTokenizer, AutoModelForCausalLM
m = "axonlabsai/Ranger-7B"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, device_map="auto", dtype="auto")
msgs = [{"role": "user", "content": "Write a Python LRU cache with O(1) get and put."}]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device), max_new_tokens=1024)
print(tok.decode(out[0], skip_special_tokens=True))
Tool calling is supported through the standard tools= argument:
tools = [{"type": "function", "function": {
"name": "run_tests",
"description": "Run the project's test suite.",
"parameters": {"type": "object", "properties": {"path": {"type": "string"}}},
}}]
text = tok.apply_chat_template(msgs, tools=tools, tokenize=False, add_generation_prompt=True)
GGUF
Quantised builds live in gguf/ for llama.cpp, Ollama,
LM Studio, and anything else in that ecosystem.
| file | bits | size | use it when |
|---|---|---|---|
Ranger-7B-Q4_K_M.gguf |
4 | ~4.7 GB | default — fits 8GB VRAM or plain CPU |
Ranger-7B-Q5_K_M.gguf |
5 | ~5.4 GB | a little more headroom, better fidelity |
Ranger-7B-Q8_0.gguf |
8 | ~8.1 GB | near-lossless, 12GB+ VRAM |
Ranger-7B-F16.gguf |
16 | ~15.2 GB | reference / for making your own quants |
llama-cli -hf axonlabsai/Ranger-7B:Q4_K_M -p "Write a Python LRU cache."
# or locally
llama-cli -m Ranger-7B-Q4_K_M.gguf -c 8192 -p "..."
Because the model is terse, a 1024-token budget is genuinely enough for most work — which is the entire point of it.
What Axon Labs changed
A LoRA (rank 64, alpha 128) over all attention and MLP projections across all 28 layers, merged into the weights — the model ships adapter-free. It trains model identity and response discipline.
The chat template was also rebuilt, fixing two real defects in the stock one:
- it accepts a
toolslist and renders it, so the model can be told which functions exist. The stock template could emit tool calls but had no way to declare tools, and raised a type error when handed any. - it preserves
<think>content on the final turn while still stripping stale reasoning from earlier turns. The stock template stripped it from every assistant message.
Benchmarks and methodology
No standard suite has been run end to end on this checkpoint, and no leaderboard scores are claimed for it. Everything below was measured directly, and the numbers that are noisy are labelled as noisy.
HumanEval+ (32 problems, executed). 65.6% at a 1000-token budget vs the base's 34.4%. At n=32 the standard error on a single proportion is ±8.4 points, so treat the accuracy difference as suggestive rather than proven — a paired McNemar test gives p between 0.25 and 0.58. What is not noisy: the base emitted no code at all on 10 of 32 problems because it was still reasoning when the budget ran out, 27 of 32 of its responses hit the ceiling, and the 6x output-length difference holds across every problem. Given 3000 tokens the base recovers to 56.2% — still under this model at a third of the budget. In fairness to the base, that 56.2% comes from re-running only the problems where it produced nothing, so it is probably a slight underestimate.
Math is unchanged. On 4 competition problems (AIME 2024, MATH-500-hard, a counting problem) both this model and the base score 2/4, passing and failing the same problems. It reaches AIME 2024 Problem 1 (answer 204) in 2592 characters where the base takes 6699. Four problems is a regression check, not a score.
Identity: 8/12 held-out probes.
What did not work
A separate pass injected ~2,400 examples of coding data — OpenCodeReasoning traces, execution-verified OpenCodeInstruct solutions, CodeFeedback revision pairs. It moved HumanEval+ pass@1 by exactly zero (21/32 before, 21/32 after; five problems gained, five lost). A few thousand examples at LoRA rank 64 shifts style, not competence. That checkpoint was discarded rather than shipped as an upgrade, and the finding is published here because it is more useful than another rounded-up number.
Limitations
- Text only. No image, audio, or video input.
- The base is abliterated, so refusal behaviour is substantially reduced. It will answer things a safety-tuned model declines. Add your own filtering if your deployment needs it.
- Answers are terse. On problems that genuinely need exhaustive case analysis this is a disadvantage versus the base's longer traces, and it is where a full benchmark run would most likely find a gap.
- Competitive programming and graduate-level science are the weakest areas, and this checkpoint does not fix them.
- Like most R1-style distills it can occasionally loop on open-ended prompts.
Provenance
Built on
huihui-ai/DeepSeek-R1-Distill-Qwen-7B-abliterated-v2,
an abliterated release of DeepSeek-R1-Distill-Qwen-7B, itself distilled from
Qwen2.5-Math-7B on 800k DeepSeek-R1 samples. That maths-heavy lineage is why the
base arrives strong at reasoning and comparatively untrained at code.
For reference, the published figures for the underlying R1-Distill-Qwen-7B — measured by others, on the base, not claims about this checkpoint:
| benchmark | score |
|---|---|
| MATH-500 (pass@1) | 92.8 |
| AIME 2024 (cons@64) | 83.3 |
| AIME 2024 (pass@1) | 55.5 |
| GPQA-Diamond (pass@1) | 49.1 |
| LiveCodeBench (pass@1) | 37.6 |
| CodeForces (rating) | 1189 |
Note the honest shape of those: elite at maths, mid at competitive programming and graduate-level science. Anyone quoting a LiveCodeBench figure in the 80s for a 7B is quoting a much larger model.
License
MIT, inherited from DeepSeek-R1-Distill-Qwen-7B. The Qwen2.5 lineage beneath it is Apache-2.0.
- Downloads last month
- 621
Model tree for axonlabsai/Ranger-7B
Base model
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B