Instructions to use ZBox008003/AgentForesight-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZBox008003/AgentForesight-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ZBox008003/AgentForesight-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ZBox008003/AgentForesight-7B") model = AutoModelForCausalLM.from_pretrained("ZBox008003/AgentForesight-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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ZBox008003/AgentForesight-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ZBox008003/AgentForesight-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": "ZBox008003/AgentForesight-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ZBox008003/AgentForesight-7B
- SGLang
How to use ZBox008003/AgentForesight-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 "ZBox008003/AgentForesight-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": "ZBox008003/AgentForesight-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 "ZBox008003/AgentForesight-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": "ZBox008003/AgentForesight-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ZBox008003/AgentForesight-7B with Docker Model Runner:
docker model run hf.co/ZBox008003/AgentForesight-7B
AgentForesight-7B
AgentForesight-7B is a model for online auditing of multi-agent systems. It examines an execution trajectory as it unfolds and decides whether to continue or flag the earliest decisive error. When it raises an alarm, it identifies the step, the responsible agent, and a short reason.
The model is based on Qwen/Qwen2.5-7B-Instruct and trained with boundary-pair preference optimization (BPPO) followed by group relative policy optimization (GRPO). The checkpoint is provided in Hugging Face Transformers format with its tokenizer and chat template.
Usage
The GitHub repository contains the auditor prompt and an inference runner that presents each trajectory prefix to the model in order. The model weights are downloaded automatically when the runner starts.
git clone https://github.com/ZBox1005/AgentForesight.git
cd AgentForesight
pip install -r requirements.txt accelerate
python -c "from huggingface_hub import snapshot_download; snapshot_download('ZBox008003/AFTraj', repo_type='dataset', local_dir='data/AFTraj')"
python -m inference.infer_local \
--model-path ZBox008003/AgentForesight-7B \
--data-dir data/AFTraj \
--output-dir outputs/agentforesight \
--max-trajs 1
The runner writes per-trajectory predictions to outputs/agentforesight/per_sample.jsonl and summary metrics to outputs/agentforesight/results.json. Remove --max-trajs 1 to process more trajectories. To evaluate the paper split, add --paper-test-split --macro-domain.
The model's answer is SAFE when no decisive error is visible. Otherwise, it returns the first error step, the responsible agent, and a brief explanation. See the repository README for the input format and further examples.
License
The model weights are released under Apache-2.0. The code in the GitHub repository is MIT licensed, and AFTraj-2K is available under CC BY 4.0.
Citation
@article{zhang2026agentforesight,
title={AgentForesight: Online Auditing for Early Failure Prediction in Multi-Agent Systems},
author={Zhang, Boxuan and Zhu, Jianing and Shi, Zeru and Liu, Dongfang and Tang, Ruixiang},
journal={arXiv preprint arXiv:2605.08715},
year={2026}
}
- Downloads last month
- 536