Instructions to use PhaiModelLab/Phai-A1-35B-1M-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF 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 PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Use Docker
docker model run hf.co/PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with Ollama:
ollama run hf.co/PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
- Unsloth Desktop
- Pi
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with Docker Model Runner:
docker model run hf.co/PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
- Lemonade
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Run and chat with the model
lemonade run user.Phai-A1-35B-1M-GGUF-Q3_K_M
List all available models
lemonade list
- Hermes Agent
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_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:9931/v1 hermes config set model.default PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use PhaiModelLab/Phai-A1-35B-1M-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_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:9931/v1 \ --custom-model-id "PhaiModelLab/Phai-A1-35B-1M-GGUF:Q3_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"
Phai-A1-35B-1M
English | ็ฎไฝไธญๆ
Phai-A1-35B-1M is a model built upon Qwen3.6-35B-A3B, extensively post-trained and optimized for Coding & Agent workloads. The entire post-training pipeline, including Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL), was conducted on Huawei Ascend NPUs.
The model delivers substantial improvements in code generation, tool calling, long-horizon task planning, and execution across agentic workflows. It also natively supports a context window of up to 1 million (1M) tokens.
Model Highlights
- Large-Scale Post-Training for Coding & Agent Tasks: Extensive post-training covering core agentic capabilities, including code understanding, generation, debugging, tool calling, multi-step reasoning, and long-horizon planning.
- Reinforcement Learning with Real Sandbox Environments: The RL stage employs Group Relative Policy Optimization (GRPO) across 4,000 sandbox environments, providing execution-based feedback from code execution, unit testing, and tool interactions. This significantly improves reliability and task success rates in real-world coding and tool-use scenarios.
- Ultra-Long Context Support: Training data spans context lengths from 16K to 1M tokens. Throughout post-training, YaRN (factor=4) is consistently enabled to extend and stabilize the 1M-token context window, enabling repository-scale code understanding and long-horizon agent interactions.
Training Details
| Stage | Description |
|---|---|
| Base Model | Qwen3.6-35B-A3B (Mixture-of-Experts) |
| SFT | High-quality Coding & Agent instruction data*, covering multi-turn conversations, tool calling, long-chain reasoning, and related scenarios |
| RL | Primarily based on GRPO, leveraging 4,000 sandbox environments to provide real-world feedback through code execution, unit testing, and tool interactions |
* Training data covers sequence lengths ranging from 16K to 1M tokens. YaRN with a scaling factor of 4 is enabled throughout post-training to extend the context window to 1M tokens while maintaining training stability.
Quick Start
from llama_cpp import Llama
model_path = "<your GGUF model path>"
llm = Llama(
model_path=model_path,
n_ctx=4096,
n_gpu_layers=-1,
verbose=False
)
messages = [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "ๅธฎๆๅฎ็ฐไธไธชๆฏๆๅนถๅ้ๆต็ๅผๆญฅไปปๅก้ๅ"},
]
output = llm.create_chat_completion(
messages=messages,
max_tokens=2048,
temperature=0.7,
)
print(output["choices"][0]["message"]["content"])
Long-Context Inference Recommendations
- Built-in YaRN Configuration: The model has undergone additional training with YaRN (factor=4) to adapt to extended context lengths. RoPE scaling is already enabled in
config.jsonby default, supporting context windows of up to 1M tokens without requiring additional configuration. - Efficient Long-Context Inference: Ultra-long contexts impose significant memory and KV-cache overhead. We recommend using inference frameworks with long-context support, such as vLLM or SGLang, and enabling optimizations such as prefix caching and chunked prefill when appropriate.
- Short-Context Compatibility: After additional long-context training, the model largely preserves the inference behavior of the base model on short-context tasks. No special handling is required for standard context lengths.
Evaluation
We evaluate Phai-A1-35B-1M on a comprehensive suite of Coding & Agent benchmarks, including SWE-Bench (Verified / Pro / Multilingual), TAU3-Bench, IFBench, and AA-LCR.
The results demonstrate consistent improvements over the base model of comparable size, with performance approaching or surpassing that of significantly larger models on several benchmarks.
Note: "โ" indicates that benchmark results were not reported for the corresponding model.
Limitations and Usage Guidelines
- Domain Specialization: The model is primarily optimized for Coding & Agent workloads. Its performance on other general-purpose tasks may differ from that of the base model.
- Output Reliability: Model-generated outputs may contain errors, inaccuracies, or contextually inappropriate content. Thorough evaluation and human verification are recommended before production deployment.
- Responsible Use: Users are responsible for complying with applicable laws, regulations, and the licensing terms of the underlying base model.
License
Phai-A1-35B-1M is post-trained from Qwen3.6-35B-A3B. Users must comply with the license terms and conditions of the underlying base model when using or distributing the model weights.
- Downloads last month
- 151
3-bit
4-bit
Model tree for PhaiModelLab/Phai-A1-35B-1M-GGUF
Base model
Qwen/Qwen3.6-35B-A3B