Instructions to use chris0809/tinyLLM-0.51B-VLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chris0809/tinyLLM-0.51B-VLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="chris0809/tinyLLM-0.51B-VLM", 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("chris0809/tinyLLM-0.51B-VLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chris0809/tinyLLM-0.51B-VLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chris0809/tinyLLM-0.51B-VLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chris0809/tinyLLM-0.51B-VLM", "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/chris0809/tinyLLM-0.51B-VLM
- SGLang
How to use chris0809/tinyLLM-0.51B-VLM 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 "chris0809/tinyLLM-0.51B-VLM" \ --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": "chris0809/tinyLLM-0.51B-VLM", "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 "chris0809/tinyLLM-0.51B-VLM" \ --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": "chris0809/tinyLLM-0.51B-VLM", "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 chris0809/tinyLLM-0.51B-VLM with Docker Model Runner:
docker model run hf.co/chris0809/tinyLLM-0.51B-VLM
tinyLLM VLM 0.51B
䏿–‡é¡¹ç›®æ–‡æ¡£ · English project overview · Live demo
The local demo switches to the VLM checkpoint, encodes five image views, and streams the checked output.
tinyLLM is a custom 0.51B decoder-only model trained from scratch for Chinese and English.
Loading requires trust_remote_code=True because the architecture is implemented in this repository.
This release is the step 18000 VLM checkpoint. It combines the language model with a 4-layer Q-Former, projector and rank-128 visual LoRA. The visual continual-SFT stage used 201,748 image examples plus 20% bilingual text replay.
Load
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "chris0809/tinyLLM-0.51B-VLM"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype="auto",
)
model.load_lora_pretrained(model_id, subfolder="adapter")
Thinking mode
The bundled tokenizer also accepts enable_thinking=True in
apply_chat_template, mainly for text-only mathematics or multi-step
reasoning. Keep it off for ordinary image description; the GitHub demo uses a
separate conservative visual system prompt to reduce hallucination.
Vision encoder
The frozen vision tower is OpenGVLab/InternViT-300M-448px-V2_5 and is loaded separately. This repository contains the language model, Q-Former, projector and the visual LoRA adapter.
The model forward accepts precomputed vision_feats, vision_mask, global_pos and global_off tensors.
The five-view image preprocessing and end-to-end chat path are in the GitHub project. This repository does not claim generic AutoProcessor support.
Source
Training code and full project documentation: https://github.com/Huanz86251/tinyLLM
- Downloads last month
- 55
Model tree for chris0809/tinyLLM-0.51B-VLM
Base model
chris0809/tinyLLM-0.51B-SFT