Instructions to use PersonalAILab/A2FM-32B-rl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PersonalAILab/A2FM-32B-rl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PersonalAILab/A2FM-32B-rl") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PersonalAILab/A2FM-32B-rl") model = AutoModelForCausalLM.from_pretrained("PersonalAILab/A2FM-32B-rl") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PersonalAILab/A2FM-32B-rl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PersonalAILab/A2FM-32B-rl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PersonalAILab/A2FM-32B-rl", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PersonalAILab/A2FM-32B-rl
- SGLang
How to use PersonalAILab/A2FM-32B-rl 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 "PersonalAILab/A2FM-32B-rl" \ --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": "PersonalAILab/A2FM-32B-rl", "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 "PersonalAILab/A2FM-32B-rl" \ --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": "PersonalAILab/A2FM-32B-rl", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PersonalAILab/A2FM-32B-rl with Docker Model Runner:
docker model run hf.co/PersonalAILab/A2FM-32B-rl
🧠 A²FM: Adaptive Agent Foundation Model for Tool-Aware Hybrid Reasoning
A²FM (Adaptive Agent Foundation Model) unifies reasoning-centric and agentic paradigms into a single framework that adaptively selects among three execution modes — instant, reasoning, and agentic.
It follows a route-then-align training principle and introduces Adaptive Policy Optimization (APO) to jointly optimize accuracy and efficiency.
A²FM achieves state-of-the-art performance on major reasoning and agentic benchmarks:
- 13.4% on BrowseComp (agentic)
- 70.4% on AIME25 (reasoning)
- 16.7% on HLE (general)
Notably, its adaptive execution achieves a cost of pass of only $0.00487 per correct answer, cutting cost by 45.2% vs. reasoning and 33.5% vs. agentic, delivering substantially higher cost efficiency while maintaining comparable accuracy.
🔑 Key Highlights
⚙️ Unified reasoning & agentic modeling
Integrates direct reasoning, chain-of-thought, and tool-augmented actions within a single backbone.🔄 Route-then-Align supervised fine-tuning
Trains task-aware routing followed by mode-aligned trajectory learning.🧩 Adaptive Policy Optimization (APO)
Reinforcement learning with adaptive sampling and cost-regularized reward for efficiency–accuracy balance.💡 Substantially lower inference cost
Adaptive routing cuts redundant reasoning/tool use while preserving correctness.
📘 Citation
@article{chen2025textsuperscript,
title={A$\backslash$textsuperscript $\{$2$\}$ FM: An Adaptive Agent Foundation Model for Tool-Aware Hybrid Reasoning},
author={Chen, Qianben and Cao, Jingyi and Zhang, Jiayu and Qin, Tianrui and Li, Xiaowan and Zhu, King and Shi, Dingfeng and Zhu, He and Liu, Minghao and Liang, Xiaobo and others},
journal={arXiv preprint arXiv:2510.12838},
year={2025}
}
- Downloads last month
- 2