Instructions to use cmp-nct/llava-1.6-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cmp-nct/llava-1.6-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cmp-nct/llava-1.6-gguf") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cmp-nct/llava-1.6-gguf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use cmp-nct/llava-1.6-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf cmp-nct/llava-1.6-gguf:F16 # Run inference directly in the terminal: llama cli -hf cmp-nct/llava-1.6-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf cmp-nct/llava-1.6-gguf:F16 # Run inference directly in the terminal: llama cli -hf cmp-nct/llava-1.6-gguf:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf cmp-nct/llava-1.6-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf cmp-nct/llava-1.6-gguf:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf cmp-nct/llava-1.6-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf cmp-nct/llava-1.6-gguf:F16
Use Docker
docker model run hf.co/cmp-nct/llava-1.6-gguf:F16
- LM Studio
- Jan
- vLLM
How to use cmp-nct/llava-1.6-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cmp-nct/llava-1.6-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cmp-nct/llava-1.6-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/cmp-nct/llava-1.6-gguf:F16
- SGLang
How to use cmp-nct/llava-1.6-gguf 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 "cmp-nct/llava-1.6-gguf" \ --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": "cmp-nct/llava-1.6-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "cmp-nct/llava-1.6-gguf" \ --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": "cmp-nct/llava-1.6-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use cmp-nct/llava-1.6-gguf with Ollama:
ollama run hf.co/cmp-nct/llava-1.6-gguf:F16
- Unsloth Studio
How to use cmp-nct/llava-1.6-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cmp-nct/llava-1.6-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cmp-nct/llava-1.6-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cmp-nct/llava-1.6-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use cmp-nct/llava-1.6-gguf with Docker Model Runner:
docker model run hf.co/cmp-nct/llava-1.6-gguf:F16
- Lemonade
How to use cmp-nct/llava-1.6-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cmp-nct/llava-1.6-gguf:F16
Run and chat with the model
lemonade run user.llava-1.6-gguf-F16
List all available models
lemonade list
LLama-cpp-python compatibility
Is LLava-v1.6 34B compatible with LLama-cpp-python library? If so, should I use the same code that I would use for LLava-v1.5 family or should I use a different prompt format?
I don't know about the library, it's probably wrapping llama.cpp so it is compatible to inference the llava-1.6 models.
However, whatever code/functions you use to inference it, they need to access the new functionality.
llava-1.6 splits images into grids, created embeddings and permutes those into grids.
llama.cpp -> clip.cpp/llava.cpp those now contains the necessary APIs. You can see them being using in llava-cli.cpp
@enrico07 Hi, I have the same question with you. I tested the llava 1.6 mistral 7b model directly on the code of llava1.5 gguf. But the model printed nothing. DO you have any ideas? THank you very much!
@Wangderful I tested only LLava 1.6 34b and I don't have any problem. I'm using create_chat_completion() and Llava16ChatHandler() from LLama-cpp-python library.
@enrico07 Did you use it with image URLs or local images? I found that when using with local images using the base64 encoding it just hangs indefinitely.