Image-Text-to-Text
Transformers
Safetensors
trinity_vlm
text-generation
vision-language-model
multimodal
custom_code
trinity
moondream
conversational
Instructions to use NyxKrage/TrinityVLM-Nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NyxKrage/TrinityVLM-Nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NyxKrage/TrinityVLM-Nano", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("NyxKrage/TrinityVLM-Nano", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use NyxKrage/TrinityVLM-Nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NyxKrage/TrinityVLM-Nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NyxKrage/TrinityVLM-Nano", "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/NyxKrage/TrinityVLM-Nano
- SGLang
How to use NyxKrage/TrinityVLM-Nano 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 "NyxKrage/TrinityVLM-Nano" \ --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": "NyxKrage/TrinityVLM-Nano", "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 "NyxKrage/TrinityVLM-Nano" \ --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": "NyxKrage/TrinityVLM-Nano", "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" } } ] } ] }' - Docker Model Runner
How to use NyxKrage/TrinityVLM-Nano with Docker Model Runner:
docker model run hf.co/NyxKrage/TrinityVLM-Nano
| library_name: transformers | |
| pipeline_tag: image-text-to-text | |
| license: other | |
| base_model: | |
| - arcee-ai/Trinity-Nano-Preview | |
| - moondream/moondream3-preview | |
| tags: | |
| - vision-language-model | |
| - multimodal | |
| - custom_code | |
| - trinity | |
| - moondream | |
| # TrinityVLM | |
| Trinity VLM is a vision model built on top of [arcee-ai/Trinity-Nano-Preview](https://huggingface.co/arcee-ai/Trinity-Nano-Preview) using the vision encoder extracted from [moondream/moondream3-preview](https://huggingface.co/moondream/moondream3-preview) | |
| This is not inteded to be a good model, but is only an experiment in adding vision capabilites to a text-only model from scratch. | |
| The model is trained using the following datamix: | |
| - 20% anthracite-org/pixmo-cap-images | |
| - 30% anthracite-org/pixmo-cap-qa-images | |
| - 25% anthracite-org/pixmo-point-explanations-images | |
| - 25% nvidia/Llama-Nemotron-Post-Training-Dataset chat examples with irrelevant PixMo images attached to avoid overfitting on image explaination when the prompt do not require image context. | |
| The model is licensed under the BSL 1.1 terms of Moondream 3. |