Instructions to use Nanbeige/Nanbeige4.2-3B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nanbeige/Nanbeige4.2-3B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nanbeige/Nanbeige4.2-3B-Base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Nanbeige/Nanbeige4.2-3B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nanbeige/Nanbeige4.2-3B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nanbeige/Nanbeige4.2-3B-Base" # 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.2-3B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nanbeige/Nanbeige4.2-3B-Base
- SGLang
How to use Nanbeige/Nanbeige4.2-3B-Base 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.2-3B-Base" \ --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.2-3B-Base", "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.2-3B-Base" \ --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.2-3B-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nanbeige/Nanbeige4.2-3B-Base with Docker Model Runner:
docker model run hf.co/Nanbeige/Nanbeige4.2-3B-Base
Update README.md
Browse filesupdate citation information
README.md
CHANGED
|
@@ -98,15 +98,14 @@ While we place great emphasis on model safety throughout the training process, t
|
|
| 98 |
|
| 99 |
# <span id="Citation">5. Citation</span>
|
| 100 |
|
| 101 |
-
If you find our model useful or would like to use it in your own work, please cite
|
| 102 |
|
| 103 |
```bibtex
|
| 104 |
-
@
|
| 105 |
-
title
|
| 106 |
-
author
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
howpublished = {\url{https://huggingface.co/Nanbeige/Nanbeige4.2-3B-Base}}
|
| 110 |
}
|
| 111 |
```
|
| 112 |
|
|
|
|
| 98 |
|
| 99 |
# <span id="Citation">5. Citation</span>
|
| 100 |
|
| 101 |
+
If you find our model useful or would like to use it in your own work, please cite as follows:
|
| 102 |
|
| 103 |
```bibtex
|
| 104 |
+
@article{lab2026nanbeige4,
|
| 105 |
+
title={Nanbeige4. 2-3B: Unlocking Agentic Capabilities in a Compact Mode},
|
| 106 |
+
author={Lab, Nanbeige and Yang, Chen and Huang, Chengrui and Lan, Fufeng and Chen, Hanhui and Zhou, Hao and Song, Huatong and Cao, Jiaqi and Zhu, Jiaying and Niu, Jinlin and others},
|
| 107 |
+
journal={arXiv preprint arXiv:2607.22083},
|
| 108 |
+
year={2026}
|
|
|
|
| 109 |
}
|
| 110 |
```
|
| 111 |
|