Instructions to use OsaurusAI/Raptor-0.7-4B-JANG_6M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OsaurusAI/Raptor-0.7-4B-JANG_6M with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("OsaurusAI/Raptor-0.7-4B-JANG_6M") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use OsaurusAI/Raptor-0.7-4B-JANG_6M with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Raptor-0.7-4B-JANG_6M"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "OsaurusAI/Raptor-0.7-4B-JANG_6M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use OsaurusAI/Raptor-0.7-4B-JANG_6M with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "OsaurusAI/Raptor-0.7-4B-JANG_6M"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "OsaurusAI/Raptor-0.7-4B-JANG_6M" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsaurusAI/Raptor-0.7-4B-JANG_6M", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use OsaurusAI/Raptor-0.7-4B-JANG_6M with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Raptor-0.7-4B-JANG_6M"
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 OsaurusAI/Raptor-0.7-4B-JANG_6M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use OsaurusAI/Raptor-0.7-4B-JANG_6M with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Raptor-0.7-4B-JANG_6M"
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 "OsaurusAI/Raptor-0.7-4B-JANG_6M" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
OsaurusAI/Raptor-0.7-4B-JANG_6M
Raptor 0.7, the local agent model for Osaurus, quantized to 3.41 GiB for Apple Silicon.
Raptor 0.7 is a LoRA fine-tune of Spark-X2.6-4B (SparkLLM team, Apache-2.0), merged into the weights. It is tuned for the Osaurus tool surface:
- files, workbooks and PDFs
- sandbox and shell
- calculator
- delegation and Osaurus workflows (orchestration, configuration, editing workflow definitions)
- multi-turn tool use in all three reasoning modes
This repo is its JANG_6M quantization: attention and the tied embedding at 8-bit, the MLP at 6-bit, group size 64, every group scale in bfloat16, and the per-head attention gate kept in full precision. Benchmark results for the model are on the BF16 source card; they were measured at a JANG_6M-equivalent quantization.
Runtime: Osaurus 0.25.33 or newer.
Reasoning modes
| mode | how to select | notes |
|---|---|---|
| high (default) | nothing, or reasoning_effort: "high" |
careful mode, longer reasoning |
| low | reasoning_effort: "low" |
short reasoning |
| off | enable_thinking: false |
no reasoning |
Quality of this quantization
Measured against the model's own BF16 weights on held-out data that was never used in calibration:
- Osaurus agent and workflow tasks: first turn, in low, high and off. The workflow tasks cover orchestration, configuration, import and repair.
- Held-out Osaurus agent and workflow trajectories.
- Reasoning, coding, agentic tool use, finance, document and terminal prompts.
KL divergence is in nats per position. It is scored only on the assistant tokens (the model's own sampled replies, reasoning included), with a full-sequence forward pass, over 90,309 scored tokens.
| mean KL | top-1 agreement | |
|---|---|---|
| this bundle (GPTQ + imatrix), all held-out | 0.00622 | 98.36% |
| same, reasoning high | 0.00118 | 98.58% |
| same, reasoning low | 0.00105 | 98.79% |
| same, reasoning off | 0.00139 | 99.00% |
| GPTQ + imatrix + AWQ fold, all held-out | 0.00654 | 98.45% |
The "all" rows include held-out terminal sessions and raw text scored as plain continuations, which carry most of the divergence. On the Osaurus agent and workflow rows alone this bundle measures 0.00107 / 98.85%. The two calibration variants are within noise of each other. This bundle has lower KL in every reasoning mode, and that is the criterion it was chosen on.
Behaviour gates pass 8/8, the same as BF16. They check:
- stopping on EOS
- thinking on and off
- tool-call shape and parsing
- multi-turn conversations and mid-conversation tool changes
| this bundle | BF16 source | |
|---|---|---|
| Size | 3.41 GiB (7.126 bits/weight) | 7.66 GiB |
| decode | 148 tok/s | 93 tok/s |
| prefill (512-token prompt) | 8,850 tok/s | 10,479 tok/s |
Measured on a Mac Studio (M5 Ultra) with a 512-token prompt and 128 generated tokens.
Calibration
Calibration is one capture of 7.60M tokens through the model's own chat template. Every domain is covered in both reasoning efforts (low and high) plus reasoning-off:
- Osaurus agent trajectories.
- Osaurus workflow trajectories: orchestrator, architect, configurator, import reader and step runner.
- The model's own sampled reasoning and tool-call replies (1.44M tokens).
- Finance: annual-report tables and 10-K filings.
- Document editing, and long documents / PDF text.
- Terminal sessions and tasks.
- Coding across 11 languages.
- Math and science.
- Multilingual chat and encyclopedic text.
GPTQ runs on the full input covariance of every quantized linear, and the importance matrix is its diagonal. An AWQ-folded variant was built and measured too. It was within noise, with higher KL, so it was not used.
Serving contract
- Sampling:
temperature=1.0,top_p=0.95,top_k=-1, no repetition penalty. These are carried in bothgeneration_config.jsonandjang_config.json. - Reasoning is on by default (effort high). The generation prompt ends with
<|Bot|><think>. Withenable_thinking=falseit ends with<|Bot|></think>. - Tools render into the first system block (
## Toolsplus a<tools>JSON list). Changing the tool set therefore means a full re-prefill, not a suffix append. - Tool calls use this shape, with no newlines:
<tool_call>NAME<arg_key>k</arg_key><arg_value>v</arg_value></tool_call>. Tool results go in a<|Tool|>block, and consecutive tool messages are merged. generation_config.jsoncarries the base model's nonstandardmax_tokenskey. Pass your own cap.
Known limits
This is a 4B agent model and it still makes mistakes:
- wrong tool names
- schema and JSON slips
- claims of success it has not earned
- invented identifiers
- arithmetic and recall errors
Keep your harness's approval step for destructive actions. Known gaps of the model itself (error recovery, designing a complete workflow from scratch) are listed on the BF16 source card.
Provenance
Quantized by Jinho Jang (eric@osaurus.ai) from
OsaurusAI/Raptor-0.7-4B-BF16 (rev 2323fe1, checkpoint
R14-u8). osaurus.json records the bundle iteration (model_version) and the minimum runtime
(required_osaurus_version).
License
Raptor 0.7 is a derivative of XHToken/Spark-X2.6-4B by the SparkLLM
Team, released under the Apache License, Version 2.0. The full license text is in the LICENSE
file, carried over unchanged from the base model.
This model is distributed under the same Apache License, Version 2.0. In accordance with Section 4 of that license, the changes made to the original work are:
- A supervised fine-tune of the attention and MLP projections: rank-16 LoRA on
q_k_v_proj,out_proj,gate_proj,up_projanddown_proj, merged into the weights. - Quantization of the merged weights to the JANG_6M format (affine 6-bit MLP, 8-bit attention and embedding, group size 64) with GPTQ and importance-matrix calibration.
Osaurus, Raptor and the Osaurus banner are trademarks of Osaurus and are not covered by the Apache license.
If you use this model, please also credit the base model:
@misc{sparkx2.6,
title = {Spark-X2.6-4B&1.7B: Advancing the Frontier of On-Device Agents for Real-World Tasks},
author = {SparkLLM Team},
year = {2026}
}
- Downloads last month
- 764
Quantized
Model tree for OsaurusAI/Raptor-0.7-4B-JANG_6M
Base model
OsaurusAI/Raptor-0.7-4B-BF16