Instructions to use stabilityai/stablelm-base-alpha-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stabilityai/stablelm-base-alpha-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stabilityai/stablelm-base-alpha-3b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-base-alpha-3b") model = AutoModelForCausalLM.from_pretrained("stabilityai/stablelm-base-alpha-3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stabilityai/stablelm-base-alpha-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stabilityai/stablelm-base-alpha-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stabilityai/stablelm-base-alpha-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stabilityai/stablelm-base-alpha-3b
- SGLang
How to use stabilityai/stablelm-base-alpha-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 "stabilityai/stablelm-base-alpha-3b" \ --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/stablelm-base-alpha-3b", "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/stablelm-base-alpha-3b" \ --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/stablelm-base-alpha-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stabilityai/stablelm-base-alpha-3b with Docker Model Runner:
docker model run hf.co/stabilityai/stablelm-base-alpha-3b
Commit History
-
update: redirect users to more recent models
Jonathan Tow819657d
-
Update README.md (#3)
- Update README.md (d8abd08a2b8e85c96f62ba966253441272ba42bc) Co-authored-by: mkshing <mkshing@users.noreply.huggingface.co>99567cc
-
Update README.md
fe16172 -
Update README.md
c998d16 -
Updated model identifier in the example code.
cb246fb -
Update README.md
881125b -
Update README.md
98548bf -
Update README.md
8dd6378 -
Update README.md
ae8a1b5 -
Update README.md
01cc39a -
Update README.md
ed32dbc -
Update README.md
63e3dfb -
Create README.md
c7e3f8d -
Upload tokenizer
34ac20a
-
Upload GPTNeoXForCausalLM
73bec0e -
initial commit
432f706