Instructions to use nvidia/Minitron-4B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Minitron-4B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/Minitron-4B-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nvidia/Minitron-4B-Base") model = AutoModelForCausalLM.from_pretrained("nvidia/Minitron-4B-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/Minitron-4B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Minitron-4B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Minitron-4B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nvidia/Minitron-4B-Base
- SGLang
How to use nvidia/Minitron-4B-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 "nvidia/Minitron-4B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Minitron-4B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "nvidia/Minitron-4B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Minitron-4B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nvidia/Minitron-4B-Base with Docker Model Runner:
docker model run hf.co/nvidia/Minitron-4B-Base
Commit History
-
Set library_name and metadata
Verified signaturede85cf9
-
Update tokenizer config
d6321f6
-
Add back tokenizer.model
7d59eef
-
Model name change
ebb5506
-
Update model card.
babe61e -
Update config and instructions
475785a -
Add copyright notice
061e11a
-
Update model name
4df81ea
-
Add results preview
5e7fcb9 -
Clarify commit ID
d249aff -
Add arXiv details
ebe4fbf
-
Point to the correct commit ID
e3f411e -
Simplify example snippet
dd5c82d -
Disable BOS token
45afb20 -
Add HF checkpoint and metadata
d06f30b -
Update README
91968f6 -
Add nemo checkpoint
d9660bf -
Update gitattributes
871ef6e -
Add requirements.txt, update gitattributes
6b397de -
Add initial README
4fd2193 -
Add LICENSE
2fb6086
-
initial commit
PavloVerified signature7f12643