№ 0045GitHub
Glimmer HD Vision OCR proxy
Glimmer HD Vision is an OpenAI-compatible proxy that keeps images within Muse Glimmer 30B's 4,096 visual-token limit by sending a 4K image as one overview plus four overlapping detail tiles, with an OCR/layout mode.
# Glimmer HD Vision
[](https://github.com/HawgAuto/Glimmer-HD-Vision/actions/workflows/test.yml)
[](LICENSE)
[](pyproject.toml)
Automatic high-resolution vision for [Muse Glimmer 30B](https://huggingface.co/meta-models/Muse-Glimmer-30B), served through an OpenAI-compatible API.
Glimmer HD Vision keeps each image inside Muse Glimmer's trained 4,096 visual-token limit. For an image above 3,211,264 pixels, it automatically sends one full overview plus four overlapping detail tiles. A representative 3840x2160 image therefore gives the model 16,680 estimated visual tokens across five views without changing the model or projector.
## What it adds
- **Automatic HD mode:** 1080p remains one image; 4K becomes overview + overlapping 2x2 tiles.
- **OCR/layout mode:** labels tiles, injects an exact-transcription/layout preset, and guarantees at least 4,096 completion tokens.
- **OpenAI compatibility:** transforms `/v1/chat/completions` and transparently forwards other routes.
- **Streaming:** forwards server-sent events line by line through `[DONE]`.
- **Bounded expansion:** at most two high-resolution source images are tiled per request.
- **Pinned remote fetch:** validates public DNS once, connects to that IP, preserves Host/TLS SNI, and refuses redirects.
- **Process supervision:** starts the model server on a private ephemeral port, propagates graceful shutdown, and uses Linux parent-death signaling to avoid orphan GPU workers.
- **Observable contract:** response headers report the applied mode, source count, expanded count, and estimated visual tokens.
No model weights, private runtime state, or patched `llama.cpp` source are included.
## How it works
```mermaid
flowchart LR
C[OpenAI client] -->|chat request| P[Glimmer HD Vision]
P --> D{image above
3,211,264 px?}
D -->|no| S[single image]
D -->|yes| T[overview + 4 overlap tiles]
S --> L[private llama-server child]
T --> L
L -->|JSON or SSE| P
P -->|response + X-Glimmer headers| C
```
The proxy preserves the original overview and inserts four 10%-overlap crops labeled `top-left`, `top-right`, `bottom-left`, and `bottom-right`. Muse's projector independentl


ChatForm
Tgmlabs