Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

Nanbeige
/
Nanbeige4.2-3B

Text Generation
Transformers
Safetensors
English
Chinese
nanbeige
llm
conversational
custom_code
Eval Results
Model card Files Files and versions
xet
Community
19

Instructions to use Nanbeige/Nanbeige4.2-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use Nanbeige/Nanbeige4.2-3B with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="Nanbeige/Nanbeige4.2-3B", 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", trust_remote_code=True, device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use Nanbeige/Nanbeige4.2-3B 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"
    # 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",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
    Use Docker
    docker model run hf.co/Nanbeige/Nanbeige4.2-3B
  • SGLang

    How to use Nanbeige/Nanbeige4.2-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.2-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.2-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.2-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.2-3B",
    		"messages": [
    			{
    				"role": "user",
    				"content": "What is the capital of France?"
    			}
    		]
    	}'
  • Docker Model Runner

    How to use Nanbeige/Nanbeige4.2-3B with Docker Model Runner:

    docker model run hf.co/Nanbeige/Nanbeige4.2-3B
Nanbeige4.2-3B
8.36 GB
Ctrl+K
Ctrl+K
  • 5 contributors
History: 19 commits
leran1995's picture
leran1995
Upload Nanbeige42_report.pdf
e6d5746 verified 1 day ago
  • .eval_results
    Add community evaluation results for CLAW-EVAL, GPQA, HLE, HMMT_FEB_2026, SWE-BENCH_PRO, SWE-BENCH_VERIFIED, TERMINAL-BENCH-2.0 (#7) 4 days ago
  • figures
    Upload 2 files 5 days ago
  • .gitattributes
    1.69 kB
    Upload Nanbeige42_report.pdf 2 days ago
  • Nanbeige42_report.pdf
    588 kB
    xet
    Upload Nanbeige42_report.pdf 1 day ago
  • README.md
    16.4 kB
    Update README.md 2 days ago
  • added_tokens.json
    174 Bytes
    Upload 9 files 5 days ago
  • config.json
    1.02 kB
    Update config.json 5 days ago
  • configuration_nanbeige.py
    20.7 kB
    Upload 9 files 5 days ago
  • generation_config.json
    187 Bytes
    Upload 9 files 5 days ago
  • model-00001-of-00002.safetensors
    4.97 GB
    xet
    Upload 3 files 5 days ago
  • model-00002-of-00002.safetensors
    3.37 GB
    xet
    Upload 3 files 5 days ago
  • model.safetensors.index.json
    16.5 kB
    Upload 3 files 5 days ago
  • modeling_nanbeige.py
    122 kB
    Upload modeling_nanbeige.py 5 days ago
  • special_tokens_map.json
    623 Bytes
    Upload 9 files 5 days ago
  • tokenizer.json
    18.5 MB
    xet
    Upload 9 files 5 days ago
  • tokenizer.model
    2.78 MB
    xet
    Upload 9 files 5 days ago
  • tokenizer_config.json
    11 kB
    Upload 9 files 5 days ago