Instructions to use zwenai13/Zwen-Prime with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use zwenai13/Zwen-Prime with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zwenai13/Zwen-Prime", filename="Zwen-Prime-Final.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use zwenai13/Zwen-Prime 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 zwenai13/Zwen-Prime:Q4_K_M # Run inference directly in the terminal: llama cli -hf zwenai13/Zwen-Prime:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf zwenai13/Zwen-Prime:Q4_K_M # Run inference directly in the terminal: llama cli -hf zwenai13/Zwen-Prime: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 zwenai13/Zwen-Prime:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf zwenai13/Zwen-Prime: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 zwenai13/Zwen-Prime:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf zwenai13/Zwen-Prime:Q4_K_M
Use Docker
docker model run hf.co/zwenai13/Zwen-Prime:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use zwenai13/Zwen-Prime with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zwenai13/Zwen-Prime" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zwenai13/Zwen-Prime", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zwenai13/Zwen-Prime:Q4_K_M
- Ollama
How to use zwenai13/Zwen-Prime with Ollama:
ollama run hf.co/zwenai13/Zwen-Prime:Q4_K_M
- Unsloth Studio
How to use zwenai13/Zwen-Prime 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 zwenai13/Zwen-Prime 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 zwenai13/Zwen-Prime to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for zwenai13/Zwen-Prime to start chatting
- Pi
How to use zwenai13/Zwen-Prime with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zwenai13/Zwen-Prime: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": "zwenai13/Zwen-Prime:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use zwenai13/Zwen-Prime with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zwenai13/Zwen-Prime: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 zwenai13/Zwen-Prime:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use zwenai13/Zwen-Prime with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zwenai13/Zwen-Prime: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 "zwenai13/Zwen-Prime: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"
- Docker Model Runner
How to use zwenai13/Zwen-Prime with Docker Model Runner:
docker model run hf.co/zwenai13/Zwen-Prime:Q4_K_M
- Lemonade
How to use zwenai13/Zwen-Prime with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zwenai13/Zwen-Prime:Q4_K_M
Run and chat with the model
lemonade run user.Zwen-Prime-Q4_K_M
List all available models
lemonade list
Zwen-Prime
An elite Full-Stack Principal Engineer in a 7B parameter body. Built by Zwen AI Labs.
Zwen-Prime is a two-stage model: a DARE-TIES neural fusion of three Mistral-7B-class specialists, followed by a supervised fine-tune on a hand-crafted five-corpus mixture that hard-installs strict <thinking> reasoning, Big-O discipline, native JSON function-calling, and zero-filler full-stack output. It is engineered for local inference on Apple Silicon and served via the official zwen-cli (with Ollama / llama.cpp as alternatives).
Model Summary
| Feature | Details |
|---|---|
| Creator | Zwen AI Labs |
| Architecture | Mistral-7B (DARE-TIES merge + LoRA SFT, fused) |
| Active params | ~7B |
| Context window | 32,000 tokens (32k via preserved RoPE scaling) |
| Quantization | Q4_K_M GGUF (~4.2 GB, < 5 GB RAM target) |
| Hardware target | Apple Silicon (M-series, Metal-accelerated) |
| Serving | zwen-cli (official) · Ollama · llama.cpp |
| Languages | English |
The Brain — Five-Corpus Training Mixture
Zwen-Prime is fine-tuned on a deliberate mixture of five datasets, each installing a distinct cognitive faculty:
| Corpus | Weight | Faculty installed |
|---|---|---|
| Alpaca Python | 40% | Elite, typed Python and algorithms at correct complexity. |
| Orca Math | 30% | Deep, step-by-step mathematical reasoning with verified derivation. |
| Salesforce XLAM | 20% | Flawless, raw-JSON function/tool calling (Mistral v0.3 convention). |
| LongAlpaca | 10% | Extended-context retention and long-document grounding without drift. |
| Zwen Custom | core spine | Strict <thinking> logic + Big-O breakdown, full-stack mastery (TypeScript, React/Next.js, Java concurrency), absolute zero-filler output. |
The custom 550-row dataset (zwen_prime_master_dataset.jsonl) is the enforcement spine: 50 Identity rows that set the persona and 500 Algorithmic/Logic rows that lock in the <thinking>...</thinking> → raw-code template across advanced TypeScript generics, React/Next.js App-Router architecture, Java concurrency primitives, and Python system design.
Capabilities
- Strict reasoning core: Every non-trivial answer opens a
<thinking>block with step-by-step logic and a time/space Big-O breakdown, immediately followed by the raw deliverable — no filler, no preamble. - Full-stack mastery:
- Python: typed (PEP 484/604), async-aware, concurrency-correct algorithms.
- TypeScript: advanced generics, conditional/mapped types, type-stateful builders, discriminated unions.
- React / Next.js: App Router, RSC, Server Actions, route handlers, caching/revalidation, React 19 hooks, streaming.
- Java: ReentrantLock, StampedLock, Semaphore, CompletableFuture, ForkJoinPool, virtual threads, happens-before reasoning.
- Native function calling: Emits
[TOOL_CALLS]raw JSON matching the provided tool schema; no markdown, no prose around the call. - Mathematical reasoning: Derives quantitative claims in the scratchpad before asserting them; sanity-checks units, magnitudes, and boundaries.
- Long-context discipline: Anchors claims to source passages; refuses to confabulate when evidence is absent.
- Zero conversational filler: No greetings, sign-offs, apologies, or compliance narration.
Merge Details
Merge Method
The base was produced with the DARE TIES merge method via mergekit, using Mistral-7B-Instruct-v0.3 as the density-0 reference base.
Models Merged
dphn/dolphin-2.9.3-mistral-7B-32k— reasoning specialisttheprint/ReWiz-7B— fine-tune specialistmistralai/Mistral-7B-Instruct-v0.3— base / reference (density 0, weight 0)
Merge Configuration
base_model: mistralai/Mistral-7B-Instruct-v0.3
merge_method: dare_ties
dtype: bfloat16
out_shard_size: 1.2B
parameters:
density: 0.5
weight: 1.0
normalize: true
int8_mask: true
rescale: true
lambda: 1.0
models:
- model: dphn/dolphin-2.9.3-mistral-7B-32k
parameters:
density: 0.5
weight: 1.0
- model: theprint/ReWiz-7B
parameters:
density: 0.5
weight: 1.0
- model: mistralai/Mistral-7B-Instruct-v0.3
parameters:
density: 0.0
weight: 0.0
Fine-Tune Stage
The merged base was then LoRA fine-tuned on the five-corpus mixture and the adapters permanently fused into the base weights (peft.merge_and_unload). The fused model is exported to GGUF for local serving.
DARE-TIES merge → LoRA SFT (5-corpus mixture) → merge_and_unload → GGUF → Ollama
ChatML-Native Format
Although the GGUF embeds the Mistral v0.3 chat template, Zwen-Prime's fusion corpus (Dolphin / ReWiz) is ChatML-formatted, so the model's native turn format is <|im_start|>system…<|im_end|><|im_start|>user…. Under Mistral [INST] framing it ignores the user prompt and runs on; under ChatML it reasons cleanly in <thinking> and stops on turn boundaries. Both official runtimes therefore pin the ChatML wrapper:
- zwen-cli pins
ChatMLChatWrapperautomatically — no configuration needed. - The Ollama Modelfile injects the strict Zwen-Prime system prompt and the ChatML template via its
TEMPLATE/SYSTEMdirectives.
The base merge is dolphin-2.9.3-mistral-7B-32k, and its 32k RoPE scaling is preserved intact — so Zwen-Prime officially supports a 32,000-token context window, enough to ingest a large enterprise codebase in a single pass.
Serving
Zwen-Prime is pre-quantized to Q4_K_M to run blisteringly fast on Apple Silicon and consumer GPUs (< 5 GB RAM required). The published quant is Zwen-Prime-Final.Q4_K_M.gguf (~4.2 GB).
Official CLI (recommended) — installs globally and auto-downloads the GGUF into ~/.zwen/models/ on first run, with a 32k context out of the box:
npm install -g @zwenailabs13/zwen-cli
zwen run zwen-prime
zwen chat # interactive REPL
zwen list # list cached models in ~/.zwen/models/
Ollama (alternative) — the Modelfile automatically injects the strict Zwen-Prime system prompt and handles the ChatML formatting:
ollama run zwenailabs/zwen-prime
llama.cpp (manual) — point any ChatML-aware runner at Zwen-Prime-Final.Q4_K_M.gguf and supply the Zwen-Prime system prompt.
System Prompt
Zwen-Prime ships with a dedicated system prompt that sets the Principal-Engineer persona, the <thinking> mandate, the zero-filler output protocol, full-stack mastery expectations, native JSON tool-calling rules, long-context discipline, and the hard constraints. It is embedded in the Modelfile's SYSTEM directive.
Intended Use
Zwen-Prime is intended as a local, autonomous engineering copilot: designing and shipping production code across Python, TypeScript, React/Next.js, and Java; reasoning through math and algorithms with verifiable steps; and calling tools via raw JSON when integrated into an agent runtime.
Limitations
- 7B scale: Strong on focused engineering tasks; not a frontier-class generalist.
- Wall-clock-sensitive: Derived math is verified symbolically in-context but not executed; verify numerically when stakes are high.
- Function calling: Follows the Mistral v0.3 / XLAM JSON convention and expects a tool-aware runtime to dispatch
[TOOL_CALLS]. - Behavioral design: Fine-tuned toward zero-filler directness; users expecting conversational preamble will not get it.
License & Commercial Use
The weights and architecture of Zwen-Prime are released under the CC BY-NC 4.0 (Creative Commons Non-Commercial) license.
- Free for Developers: Individual developers, researchers, and hobbyists are fully encouraged to download, run, and modify Zwen-Prime locally for free.
- Commercial Restrictions: Cloud hosting, API provisioning, enterprise internal deployments, and any form of commercial reselling are strictly prohibited under this license.
- Enterprise Licensing: For commercial deployment, managed hosting, or enterprise use, you must acquire a commercial license through Axora.
Visit: https://axoraio.in Email: contact@axoraio.in
- Downloads last month
- 2
Model tree for zwenai13/Zwen-Prime
Base model
mistralai/Mistral-7B-v0.3