Image-Text-to-Text
Transformers
Safetensors
internvl_chat
feature-extraction
fp8
quantization
llm-compressor
vllm
vision
multimodal
conversational
custom_code
compressed-tensors
Instructions to use ucsbcit/InternVL3_5-38B-Flash-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ucsbcit/InternVL3_5-38B-Flash-FP8", 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("ucsbcit/InternVL3_5-38B-Flash-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ucsbcit/InternVL3_5-38B-Flash-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ucsbcit/InternVL3_5-38B-Flash-FP8", "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/ucsbcit/InternVL3_5-38B-Flash-FP8
- SGLang
How to use ucsbcit/InternVL3_5-38B-Flash-FP8 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 "ucsbcit/InternVL3_5-38B-Flash-FP8" \ --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": "ucsbcit/InternVL3_5-38B-Flash-FP8", "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 "ucsbcit/InternVL3_5-38B-Flash-FP8" \ --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": "ucsbcit/InternVL3_5-38B-Flash-FP8", "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 ucsbcit/InternVL3_5-38B-Flash-FP8 with Docker Model Runner:
docker model run hf.co/ucsbcit/InternVL3_5-38B-Flash-FP8
File size: 1,607 Bytes
113a2ee | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ---
license: mit
base_model: OpenGVLab/InternVL3_5-38B-Flash
tags:
- fp8
- quantization
- llm-compressor
- vllm
- vision
- multimodal
pipeline_tag: image-text-to-text
library_name: transformers
---
# InternVL3_5-38B-Flash-FP8
This repository contains an **FP8 quantized version** of the multi-modal model [OpenGVLab/InternVL3_5-38B-Flash](https://huggingface.co/OpenGVLab/InternVL3_5-38B-Flash).
## Model Details
* **Base Model:** `OpenGVLab/InternVL3_5-38B-Flash`
* **Quantization Format:** FP8 (E4M3) targeting `Linear` layers
* **Quantization Engine:** `llmcompressor` (Post-Training Quantization / PTQ)
* **Calibration Dataset:** 512 samples from `ultrachat-200k` (`train_sft`)
* **License:** MIT
## Method & Creation Process
The model was quantized using Neural Magic's [`llm-compressor`](https://github.com/vllm-project/llm-compressor) framework.
Post-training quantization (PTQ) was applied directly to the language backbone (`model.language_model`). This strategy ensures that all heavy `Linear` projections in the main LLM layers are converted to FP8 for maximum speedup and reduced VRAM footprint, while preserving the vision architecture intact.
### Quantization Recipe
```python
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
recipe = QuantizationModifier(
targets="Linear",
scheme="FP8",
ignore=["lm_head"]
)
oneshot(
model=model.language_model,
tokenizer=tokenizer,
dataset="ultrachat-200k",
splits="train_sft[:512]",
recipe=recipe,
max_seq_length=2048,
num_calibration_samples=512,
) |