Instructions to use casperhansen/tinyllama-1.1b-chat-smoothquant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use casperhansen/tinyllama-1.1b-chat-smoothquant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="casperhansen/tinyllama-1.1b-chat-smoothquant")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("casperhansen/tinyllama-1.1b-chat-smoothquant") model = AutoModelForCausalLM.from_pretrained("casperhansen/tinyllama-1.1b-chat-smoothquant") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use casperhansen/tinyllama-1.1b-chat-smoothquant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "casperhansen/tinyllama-1.1b-chat-smoothquant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "casperhansen/tinyllama-1.1b-chat-smoothquant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/casperhansen/tinyllama-1.1b-chat-smoothquant
- SGLang
How to use casperhansen/tinyllama-1.1b-chat-smoothquant 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 "casperhansen/tinyllama-1.1b-chat-smoothquant" \ --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": "casperhansen/tinyllama-1.1b-chat-smoothquant", "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 "casperhansen/tinyllama-1.1b-chat-smoothquant" \ --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": "casperhansen/tinyllama-1.1b-chat-smoothquant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use casperhansen/tinyllama-1.1b-chat-smoothquant with Docker Model Runner:
docker model run hf.co/casperhansen/tinyllama-1.1b-chat-smoothquant
- Xet hash:
- 39276c6d0fd57062a9e913dfaaae70287af3f749a1acae0dea827e8d3d2899f8
- Size of remote file:
- 1.23 GB
- SHA256:
- 1ffa2b4ac39f1f31154c84ad54eb6ff4c3ed2f469b276cba58a146fa3d9e7444
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.