Instructions to use Migraine/Pi-Qwen3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Migraine/Pi-Qwen3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Migraine/Pi-Qwen3-8B")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Migraine/Pi-Qwen3-8B", device_map="auto") - PEFT
How to use Migraine/Pi-Qwen3-8B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Migraine/Pi-Qwen3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Migraine/Pi-Qwen3-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Migraine/Pi-Qwen3-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Migraine/Pi-Qwen3-8B
- SGLang
How to use Migraine/Pi-Qwen3-8B 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 "Migraine/Pi-Qwen3-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Migraine/Pi-Qwen3-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Migraine/Pi-Qwen3-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Migraine/Pi-Qwen3-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Migraine/Pi-Qwen3-8B with Docker Model Runner:
docker model run hf.co/Migraine/Pi-Qwen3-8B
Pi-Qwen3-8B
Pi-Qwen3-8B is a Qwen3-8B language model adapted for tool-using agents running inside the Pi AgentLoop runtime. It is the main Qwen3-8B model reported in the HPD paper, trained with Harness Policy Distillation (HPD). HPD uses replayed runtime state and harness-verified action targets to teach a native policy that can be executed without a control document at inference time.
The model is intended to be used together with the Pi harness and its tool protocol. A plain text-generation call does not reproduce the agent evaluation setting reported in the paper.
Paper
Harness Policy Distillation: Aligning Agent Policies with Runtime Semantics
The accompanying manuscript is under review at ICLR 2027. The paper studies how to distill runtime control state into a deployable agent policy. Its main Qwen3-8B result on 583 held-out TRAJECT-Bench tasks is:
| Model | Task Success | Final-answer F1 | Step-SR | Runtime Compliance | Exact |
|---|---|---|---|---|---|
| Qwen3-8B Base | 3.09 | 26.82 | 26.45 | 19.90 | 2.57 |
| Pi-Qwen3-8B (HPD) | 22.98 | 41.22 | 63.79 | 49.23 | 18.70 |
Scores are percentages. The model is trained with three coupled views at each replayed Pi provider boundary: the native action view, a control-document view, and a runtime-state reconstruction view. At deployment and evaluation, only the native context is supplied to the model.
Intended use
Use this model for research on harness-bound language-model agents, multi-turn tool execution, runtime-state alignment, and policy distillation. Run it inside the Pi AgentLoop with the same tool schemas, lifecycle rules, and termination protocol used by the training and evaluation pipeline.
Out-of-scope use
This release is not a general-purpose safety or autonomy guarantee. It should not be connected to tools with irreversible side effects without independent permission checks, sandboxing, monitoring, and application-level validation. The model may produce invalid arguments, premature termination, repeated calls, or incorrect final answers outside the Pi runtime and task distribution.
Training data and sources
HPD training uses the TRAJECT-Bench trajectories replayed through the Pi AgentLoop. The held-out test split contains 583 tasks and 2,140 provider boundaries; training uses the leakage-safe group split described in the paper and technical report.
- Base model: Qwen/Qwen3-8B
- Dataset: TRAJECT-Bench on Hugging Face
- Dataset source repository: PengfeiHePower/TRAJECT-Bench
- Runtime and harness source: earendil-works/pi
The Pi harness executes tools and inserts their observations at model-call boundaries. The replayed tool observations and runtime bookkeeping are used to construct supervision; the deployed student does not receive privileged runtime documents.
Evaluation details
The reported HPD checkpoint uses LoRA adaptation of Qwen3-8B. Training uses the three-view 1:1:1 cycle for 60,000 optimizer updates, corresponding to 20,000 training rounds, with the checkpoint evaluated under the no-injection/native profile. The BFCL v4 transfer evaluation uses the same checkpoint without BFCL-specific retraining and replaces only the test tasks, following BFCL's default task and tool execution settings.
For reproducibility, use the Pi AgentLoop, the TRAJECT-Bench split and metric definitions, and the evaluation scripts from the linked source repositories. The paper reports additional model-size, harness-portability, ablation, and cross-benchmark results.
Citation
@inproceedings{hpd2027,
title = {Harness Policy Distillation: Aligning Agent Policies with Runtime Semantics},
author = {Anonymous Authors},
booktitle = {International Conference on Learning Representations},
year = {2027},
note = {Under review}
}
License
The base Qwen3-8B model is distributed under the Apache-2.0 license. Please review the upstream Qwen license and the licenses of the Pi harness and TRAJECT-Bench before redistribution or deployment.
Model tree for Migraine/Pi-Qwen3-8B
Base model
Qwen/Qwen3-8B-Base