Instructions to use stabilityai/StableBeluga2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stabilityai/StableBeluga2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stabilityai/StableBeluga2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga2") model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stabilityai/StableBeluga2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stabilityai/StableBeluga2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stabilityai/StableBeluga2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stabilityai/StableBeluga2
- SGLang
How to use stabilityai/StableBeluga2 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 "stabilityai/StableBeluga2" \ --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": "stabilityai/StableBeluga2", "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 "stabilityai/StableBeluga2" \ --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": "stabilityai/StableBeluga2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stabilityai/StableBeluga2 with Docker Model Runner:
docker model run hf.co/stabilityai/StableBeluga2
Download pytorch_model-00008-of-00029.bin from stabilityai/StableBeluga2: direct link, hf CLI and curl.
- Browser
- Download file 10 GB
-
https://huggingface.co/stabilityai/StableBeluga2/resolve/refs%2Fpr%2F16/pytorch_model-00008-of-00029.bin
- Command line
-
hf download hf://stabilityai/StableBeluga2@refs/pr/16/pytorch_model-00008-of-00029.bin
-
curl -L -o pytorch_model-00008-of-00029.bin https://huggingface.co/stabilityai/StableBeluga2/resolve/refs%2Fpr%2F16/pytorch_model-00008-of-00029.bin
10 GB
- Xet hash:
- b4103dd66cd12cb11ae9f5be08ef5a8ec3f88e792ea5edad79a7ff6760ff3787
- Size of remote file:
- 10 GB
- SHA256:
- 3dd9a4c35c3de53751525d2b3b16d4e156aa5329c08c63c958ec53e65c7e5c74
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.