Image-Text-to-Text
Transformers
Safetensors
fastvlm_lfm2
feature-extraction
vllm
vision-language
image-captioning
fastvlm
conversational
custom_code
Instructions to use irotem98/FastLFM2.5-VL-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use irotem98/FastLFM2.5-VL-0.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="irotem98/FastLFM2.5-VL-0.5B", 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 AutoModel model = AutoModel.from_pretrained("irotem98/FastLFM2.5-VL-0.5B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use irotem98/FastLFM2.5-VL-0.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "irotem98/FastLFM2.5-VL-0.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": "irotem98/FastLFM2.5-VL-0.5B", "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/irotem98/FastLFM2.5-VL-0.5B
- SGLang
How to use irotem98/FastLFM2.5-VL-0.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 "irotem98/FastLFM2.5-VL-0.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": "irotem98/FastLFM2.5-VL-0.5B", "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 "irotem98/FastLFM2.5-VL-0.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": "irotem98/FastLFM2.5-VL-0.5B", "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 irotem98/FastLFM2.5-VL-0.5B with Docker Model Runner:
docker model run hf.co/irotem98/FastLFM2.5-VL-0.5B
| { | |
| "architectures": [ | |
| "FastVLMLfm2ForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_fastvlm_lfm2.FastVLMLfm2Config", | |
| "AutoModel": "modeling_fastvlm_lfm2.FastVLMLfm2ForConditionalGeneration" | |
| }, | |
| "model_type": "fastvlm_lfm2", | |
| "text_config": { | |
| "_name_or_path": "LiquidAI/LFM2-350M", | |
| "architectures": [ | |
| "Lfm2ForCausalLM" | |
| ], | |
| "block_auto_adjust_ff_dim": true, | |
| "block_dim": 1024, | |
| "block_ff_dim": 6656, | |
| "block_ffn_dim_multiplier": 1.0, | |
| "block_mlp_init_scale": 1.0, | |
| "block_multiple_of": 256, | |
| "block_norm_eps": 1e-05, | |
| "block_out_init_scale": 1.0, | |
| "block_use_swiglu": true, | |
| "block_use_xavier_init": true, | |
| "conv_L_cache": 3, | |
| "conv_bias": false, | |
| "conv_dim": 1024, | |
| "conv_dim_out": 1024, | |
| "conv_use_xavier_init": true, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 7, | |
| "hidden_size": 1024, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 6656, | |
| "layer_types": [ | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "full_attention", | |
| "conv", | |
| "full_attention", | |
| "conv" | |
| ], | |
| "max_position_embeddings": 128000, | |
| "model_type": "lfm2", | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 16, | |
| "num_heads": 16, | |
| "num_hidden_layers": 16, | |
| "num_key_value_heads": 8, | |
| "rope_parameters": { | |
| "rope_theta": 1000000.0, | |
| "rope_type": "default" | |
| }, | |
| "use_cache": true, | |
| "use_pos_enc": true, | |
| "vocab_size": 65536 | |
| }, | |
| "image_token_id": 396, | |
| "image_seq_length": 64, | |
| "image_size": 512, | |
| "vision_hidden_size": 3072, | |
| "connector_hidden_size": 3072, | |
| "tie_word_embeddings": true, | |
| "dtype": "bfloat16", | |
| "transformers_version": "5.13.1" | |
| } | |