Instructions to use apple/FastVLM-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apple/FastVLM-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="apple/FastVLM-1.5B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("apple/FastVLM-1.5B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use apple/FastVLM-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "apple/FastVLM-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "apple/FastVLM-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/apple/FastVLM-1.5B
- SGLang
How to use apple/FastVLM-1.5B 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 "apple/FastVLM-1.5B" \ --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": "apple/FastVLM-1.5B", "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 "apple/FastVLM-1.5B" \ --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": "apple/FastVLM-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use apple/FastVLM-1.5B with Docker Model Runner:
docker model run hf.co/apple/FastVLM-1.5B
Commit History
-
Remove redundant license fields from metadata
Verified signature5e71223 -
Make the repos compatible with transformers `trust_remote_code` 🤗 (#2)
Verified signature- Make the repos compatible with transformers `trust_remote_code` 🤗 (7334d4e35b0b38d842460831367df2048f3af6b8) - Update config.json (98098d3b0f14073a540f9da079ab5c3f23420350) - Update README.md (841e9be57b7bc9ced4b65896c96352c802f782e9) - Update README.md (bbc7b76c1de8721252e0a2d243b8e15be648b7f9) - Update README.md (131535e57ec24f791be1625e5fa63216548f60f5) Co-authored-by: Vaibhav Srivastav <reach-vb@users.noreply.huggingface.co>bc79cee
-
Upload folder using huggingface_hub
Verified signature7b529ec -
initial commit
Verified signaturebe28190