Instructions to use Alexislhb/StreamAPD-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Alexislhb/StreamAPD-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Alexislhb/StreamAPD-4B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Alexislhb/StreamAPD-4B") model = AutoModelForMultimodalLM.from_pretrained("Alexislhb/StreamAPD-4B", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Alexislhb/StreamAPD-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Alexislhb/StreamAPD-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alexislhb/StreamAPD-4B", "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/Alexislhb/StreamAPD-4B
- SGLang
How to use Alexislhb/StreamAPD-4B 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 "Alexislhb/StreamAPD-4B" \ --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": "Alexislhb/StreamAPD-4B", "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 "Alexislhb/StreamAPD-4B" \ --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": "Alexislhb/StreamAPD-4B", "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 Alexislhb/StreamAPD-4B with Docker Model Runner:
docker model run hf.co/Alexislhb/StreamAPD-4B
StreamAPD-4B
Project Page: https://alexios-hub.github.io/StreamAPD-Page/ ยท Collection: Alexislhb/StreamAPD ยท Code: Alexios-hub/StreamAPD
StreamAPD-4B is a self-distilled online streaming video-language model adapted from Qwen/Qwen3.5-4B via StreamAPD (Self-Improving Offline Video LLMs for Online Interaction via Agentic Policy Distillation).
Without architectural modifications, external stronger teacher annotations, or extra memory modules, StreamAPD-4B extends the base vocabulary with two special decision tokens so that it jointly decides when to speak and what to answer in a single autoregressive pass:
| Decision Token | Token ID | Behavior |
|---|---|---|
</Silence> |
248077 |
Remain silent and continue observing incoming video frames |
</Response> |
248078 |
Respond immediately with the answer text that follows |
Benchmark Results (Paper Table 1)
Across 9 streaming video benchmarks (10 metrics), self-distilled StreamAPD-4B improves Qwen3.5-4B Overall performance from 38.15 to 46.52 (+8.37):
| Benchmark | Qwen3.5-4B | StreamAPD-4B | Gain |
|---|---|---|---|
| OVO-Bench | 59.17 | 63.41 | +4.25 |
| StreamingBench Real-Time | 81.80 | 86.64 | +4.84 |
| OVBench | 43.46 | 56.11 | +12.65 |
| ODVBench | 54.35 | 63.78 | +9.44 |
| StreamingBench Proactive | 33.60 | 43.20 | +9.60 |
| PhoStream | 32.28 | 48.91 | +16.63 |
| OmniMMI | 15.57 | 19.77 | +4.20 |
| ViSpeak-Bench (0โ5) | 2.12 | 2.13 | +0.02 |
| SPOT-Bench | 4.53 | 11.12 | +6.59 |
| IPIBench | 14.39 | 29.60 | +15.21 |
| Overall | 38.15 | 46.52 | +8.37 |
Usage with vLLM
Serve the checkpoint with its bundled tokenizer, processor, and chat template (keep skip_special_tokens=False and return_token_ids=True when parsing decision tokens):
python -m vllm.entrypoints.openai.api_server \
--model Alexislhb/StreamAPD-4B \
--served-model-name streamapd-4b \
--dtype bfloat16 --generation-config vllm \
--max-model-len 65536 \
--limit-mm-per-prompt '{"image":768,"video":0}' \
--chat-template-content-format openai
License
Weights and configuration are distributed under the Apache-2.0 license, inheriting from Qwen/Qwen3.5-4B.
- Downloads last month
- -