Tejas Chopra
|
2fd9552102
|
Add image token compression with trained ML router
Introduces automatic image compression for LLM requests, reducing token
usage by 40-90% while maintaining answer accuracy.
Key features:
- Trained MiniLM classifier (93.7% accuracy) hosted on HuggingFace
- SigLIP-based image analysis for content-aware routing
- Provider-specific compression:
- OpenAI: detail="low" parameter
- Anthropic: PIL resize to 512px
- Google: PIL resize to 768px (tile-optimized)
- Four compression techniques: full_low, preserve, crop, transcode
- Integration in both Headroom proxy and SDK (ContentRouter)
New files:
- headroom/image/ module with ImageCompressor API
- docs/image-compression.md user documentation
- tests/test_image_compressor.py (51 tests)
Model: chopratejas/technique-router on HuggingFace (~128MB)
|
2026-01-25 22:40:43 -08:00 |
|