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)# 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
Request for Access to the Pre-training Dataset for Nanbeige/Nanbeige4.2-3B-Base (Open-Source Research)
Hello Nanbeige team,
First of all, thank you for releasing Nanbeige/Nanbeige4.2-3B-Base. It’s an amazing base model, and we truly appreciate the effort you’ve put into making it available to the open-source community. Models like this help researchers and developers build better AI systems without having to start from scratch.
We are currently building and researching LLMs for the open-source community, with a particular focus on efficient models for edge devices. One of the biggest challenges we face is obtaining high-quality, diverse pre-training data. While model architectures and training techniques are becoming increasingly accessible, data quality remains the largest bottleneck for meaningful progress.
We wanted to ask whether there is any possibility of accessing the pre-training dataset that was used for Nanbeige/Nanbeige4.2-3B-Base.
Our goal is to build fully open-source LLMs optimized for edge devices and contribute our work back to the community. Access to high-quality training data, or guidance on constructing similar datasets, would significantly accelerate our efforts and help improve the broader open-source ecosystem.
Thank you again for your work and for supporting open research. We would greatly appreciate any information or guidance you can share.
My email - arpitsh018@gmail.com
Thank you so much for your kind words and interest!
Regarding the pre-training dataset, we currently do not have plans to release the full dataset used to train the model.
That said, we do plan to release more high-quality post-training and synthetic datasets in the future. Similar to our previous Tool-Mind series, we hope to share datasets that can be useful for the open-source community, particularly for improving reasoning, tool use, and agentic capabilities.
We really appreciate your interest in building efficient open-source models for edge devices, and we wish you the best with your work! ❤️
Thanks for the contribution in the open model and democratisations of the ai