Views
No views yet
vision_projector_v1_standalone.onnx (ONNX Runtime, CPU) to produce
image embeddings.fastvlm_server process (a custom llama.cpp-based
binary) that keeps the GGUF language model loaded in memory.| File | Role |
|---|---|
vision_projector_v1_standalone.onnx | Vision encoder — converts image → embeddings |
fastvlm_qwen2_q4km.gguf | Quantized Qwen2-0.5B language model (Q4_K_M) |
fastvlm_server | Compiled C binary (llama.cpp-based) that loads the GGUF model and serves generation over stdin/stdout |
libggml.so, libggml-base.so, libggml-cpu.so, libllama.so (+ .0 versions) | Shared libraries required by fastvlm_server at runtime |
stream_api.py | FastAPI server tying the vision encoder and LLM server together, exposing /predict |
onnxruntime, fastapi, uvicorn, pillow, numpy, python-multipartpip install onnxruntime fastapi uvicorn pillow numpy python-multipartstream_api.py looks for the .onnx, .gguf,
fastvlm_server, and .so files relative to its own location), then:python stream_api.pyhttp://0.0.0.0:8000. On startup it:fastvlm_server as a persistent subprocess with the GGUF
model loaded and kept in memory, so the model isn't reloaded per
request.GET / — basic status infoGET /health — reports whether the ONNX session, GGUF file, and
server binary are all present and loadedPOST /predict — send an image + optional prompt, get a streamed
text response1curl -X POST http://localhost:8000/predict \
2 -F "image=@your_image.jpg" \
3 -F "prompt=Describe this image in detail." \
4 --no-bufferfastvlm_server is started once at API startup and kept alive as a
long-running subprocess — the GGUF model is loaded into memory a
single time. Each /predict request sends the embedding file path and
prompt over the process's stdin and reads generated tokens back from
stdout until a ---END--- sentinel, avoiding reload cost per request.
Requests are serialized (one at a time), since the underlying server
is single-threaded.| Resolution | Visual tokens | TTFT | Benchmark | Score |
|---|---|---|---|---|
| 512×512 | 64 | ~1.4 s | POPE | 80.39% |
| 512×512 | 64 | ~1.4 s | GQA | 60.12% |
| 1024×1024 | 256 | ~5.5–9.6 s | TextVQA | 72.21% |
| 1024×1024 | 256 | ~5.5–9.6 s | OCRBench v2 | 45.57% |