Instructions to use Nanbeige/Nanbeige4.1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanbeige/Nanbeige4.1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanbeige/Nanbeige4.1-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nanbeige/Nanbeige4.1-3B") model = AutoModelForCausalLM.from_pretrained("Nanbeige/Nanbeige4.1-3B") 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]:])) - Inference
- Local Apps Settings
- vLLM
How to use Nanbeige/Nanbeige4.1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanbeige/Nanbeige4.1-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nanbeige/Nanbeige4.1-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanbeige/Nanbeige4.1-3B
- SGLang
How to use Nanbeige/Nanbeige4.1-3B 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 "Nanbeige/Nanbeige4.1-3B" \ --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": "Nanbeige/Nanbeige4.1-3B", "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 "Nanbeige/Nanbeige4.1-3B" \ --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": "Nanbeige/Nanbeige4.1-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanbeige/Nanbeige4.1-3B with Docker Model Runner:
docker model run hf.co/Nanbeige/Nanbeige4.1-3B
Any plans for a larger scale up? (e.g., 7B - 12B version)
Hi Nanbeige Team,
First of all, thank you so much for open-sourcing Nanbeige4.1-3B! The post-training pipeline, RL setup, and data synthesis here are absolutely mind-blowing.
Seeing a 3B-parameter model hit 76.9% on LiveCodeBench, 87.4% on AIME 2026, and sustain over 500+ long-horizon tool invocation turns in deep search is unreal. It legitimately punches way above its weight class, often outperforming Qwen3-30B-A3B and other much larger models on agentic workflows. It’s the perfect compact model for highly efficient local deployment.
Given how incredibly dense and efficient your alignment and RL framework is, I wanted to ask: Are there any plans to release a scaled-up version in the near future (e.g., in the 7B–12B parameter range)?
A 7B-12B version trained with the exact same post-training philosophy would be an absolute game-changer for consumer hardware. It would easily fit into a single GPU for local deployment while potentially providing enough capacity to challenge closed commercial models on complex coding and deep-search tasks.
Huge respect for your work, and looking forward to any insights or roadmaps you can share!
Thanks for your interest and support!
Both larger-scale models and improved smaller ones will be released over the coming months. Stay tuned.