OmniGlyph
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Basarisiz
- process.env — Environment variable access in benchmarks/billing-sweep/run.mjs
- network request — Outbound network request in benchmarks/billing-sweep/run.mjs
- network request — Outbound network request in benchmarks/density-frontier/omniroute.ts
- spawnSync — Synchronous process spawning in benchmarks/density-frontier/run.ts
- process.env — Environment variable access in benchmarks/density-frontier/run.ts
- network request — Outbound network request in benchmarks/density-frontier/run.ts
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Cut your Claude bill 59–70% by rendering bulky LLM context as dense PNG pages — 100% read accuracy, exact per-provider billing math (Anthropic/OpenAI/Gemini), fail-closed gates, measured benchmarks. CLI + proxy + Cloudflare Workers. Docs in 42 languages. Part of the OmniRoute family.
🖼️ OmniGlyph — Context as Image
Cut your Claude bill by 59–70% by rendering bulky context as dense PNG pages — the same content, in a fraction of the tokens.
Models bill text per token, but bill an image by its dimensions — not by how much text is inside it.
Part of the OmniRoute family · 🌐 All languages
| 🇺🇸 | 🇸🇦 | 🇦🇿 | 🇧🇬 | 🇧🇩 | 🇨🇿 | 🇩🇰 | 🇩🇪 | 🇪🇸 | 🇮🇷 | 🇫🇮 | 🇫🇷 | 🇮🇳 | 🇮🇱 |
| 🇮🇳 | 🇭🇺 | 🇮🇩 | 🇮🇹 | 🇯🇵 | 🇰🇷 | 🇮🇳 | 🇲🇾 | 🇳🇱 | 🇳🇴 | 🇵🇭 | 🇵🇱 | 🇵🇹 | 🇧🇷 |
| 🇷🇴 | 🇷🇺 | 🇸🇰 | 🇸🇪 | 🇰🇪 | 🇮🇳 | 🇮🇳 | 🇹🇭 | 🇹🇷 | 🇺🇦 | 🇵🇰 | 🇻🇳 | 🇨🇳 | 🇹🇼 |
📊 The numbers — measured, not estimated
| metric | result | receipt |
|---|---|---|
| End-to-end bill reduction | 59–70% | production trace, 13,709 requests |
| Tokens per converted block | 10× fewer (28,080 chars: 14,040 → 1,460 tokens) | billing sweep |
| Billing-formula accuracy | residual zero across 22 count_tokens probes, 2 models × 2 tiers |
benchmarks/billing-sweep/results/ |
| Exact-read accuracy, production config | 30/30 (100%) on Claude Fable 5 | density frontier |
| Silent confabulations in ~300 read probes | 0 — every miss abstains as ILEGIVEL |
benchmarks/density-frontier/results/ |
Model scorecard (can it read dense renders? n=30 per arm, deterministic scoring):
| model | reading | verdict |
|---|---|---|
| Claude Fable 5 | 100% exact | ✅ production target |
| Claude Opus 4.8 | 77–87% at 4× glyph size | ⚠️ opt-in safe mode (savings drop to ~2×) |
| GPT-5.5 | 0/60 — and inflates its answers ~40× trying | ❌ blocked by the gate, with proof |
| Gemini 2.5-flash | 0/26 — and confabulates instead of abstaining | ❌ blocked (partial test, quota-limited) |
The advantage is Fable-specific today — other vision encoders don't resolve dense glyphs yet. The benchmark harness re-tests any new model in one command.
🤔 Why OmniGlyph?
Every long-running agent session drags the same dead weight on every request: the system prompt, tool docs, and old history — re-billed per token, every turn. OmniGlyph is a local proxy that rewrites those bulky parts into dense PNG pages before they leave your machine:
- Exact billing math, not heuristics — it computes the provider's real image-token formula (measured to residual zero) and converts only when the math wins.
- Fail-closed by design — models that can't read dense renders are blocked by a gate, with benchmark receipts. No silent quality loss.
- Private & local-first — the rewrite happens on
127.0.0.1; nothing extra is sent anywhere. - Reproducible — every number above has a receipt in
benchmarks/*/results/, re-runnable in one command.
⚡ Quick Start
npx omniglyph # proxy on 127.0.0.1:47821
ANTHROPIC_BASE_URL=http://127.0.0.1:47821 claude # point Claude Code at it

Works both ways:
- API key (pay per token): your bill drops 59–70% end-to-end.
- Subscription session: you don't pay less, but usage limits are counted in tokens — so your limits stretch ~2–3×.
Dashboard at http://127.0.0.1:47821/: tokens saved, every text→image conversion side by side, kill switch, live model chips. Responses stream normally — only the request is compressed, never the model's output.
⚙️ How it works
bulky request block ──► profitability gate ──► reflow + render (1-bit 5×8 atlas)
(exact billing math) ──► 1568×728 PNG pages ──► splice back, cache-friendly
- Billing is computed exactly, before converting: Anthropic bills
⌈w/28⌉ × ⌈h/28⌉ + 4tokens per image (28 px patches — measured to residual zero). A full page carries 28,080 chars for 1,460 tokens ≈ 19 chars/token, vs ~2 chars/token for dense text. The gate converts only when the math wins. - What converts: the static system prompt + tool docs, old collapsed history, large tool outputs.
- What never converts: your messages, recent turns, the model's output, sparse prose, byte-exact values (hashes/IDs ride alongside as text), and any model that failed the reading benchmark.
🧭 The honest part
- It is lossy. Byte-exact recall from images is unreliable by nature. Mitigations shipped: exact identifiers travel as text next to the image, and the measured production config produced zero silent confabulations — failed reads abstain.
- Only Fable 5 is approved today, with receipts. GPT-5.5 and Gemini 2.5-flash measurably cannot read dense renders; Opus 4.8 needs 4× bigger glyphs. The gate enforces this.
- We found and avoided a billing trap: the high-resolution image tier bills 3.3× more per page, but the vision encoder doesn't receive the extra resolution — bigger pages read worse. Measured, documented in docs/benchmarks/BENCHMARKS.md, not enabled.
- Prices change; the durable metric is the token cut, which the proxy logs per request against a free
count_tokenscounterfactual.
🔬 Reproduce every number
pnpm install && pnpm test # full suite
node benchmarks/billing-sweep/run.mjs --dry-run # billing predictions, $0
pnpm exec tsx benchmarks/density-frontier/run.ts --dry-run # cost table, $0
# with keys: ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY (or --via-cli for a Claude Code subscription)

Full methodology and every result table: docs/benchmarks/BENCHMARKS.md. Raw per-answer receipts: benchmarks/*/results/*.jsonl.
🚀 The OmniRoute family
OmniGlyph also ships as a native compression engine inside OmniRoute — the free AI gateway. There it runs as the omniglyph engine (standalone single mode or stacked with the other engines), with fail-closed gates and image-aware token accounting.
🛠️ Tech Stack
| layer | tech |
|---|---|
| Language | TypeScript (strict), ESM |
| Runtime | Node ≥18 · Cloudflare Workers (wrangler.toml) |
| Rendering | own 1-bit glyph atlas (Spleen/Unifont-derived, licenses in assets/) → PNG |
| Tests | Vitest — TDD, plus docs-integrity and rebrand guards |
| Benchmarks | benchmarks/ harnesses (billing-sweep, density-frontier) with JSONL receipts |
Project layout
| path | what |
|---|---|
src/ |
the proxy: transform pipeline, exact billing per provider, renderer, hosts (Node + Cloudflare Workers) |
benchmarks/ |
the harnesses that produced every number above — re-runnable |
docs/ |
BENCHMARKS · ARCHITECTURE · ROADMAP |
📧 Support & Community
- 🐛 Issues — bugs and feature requests
- 🔒 SECURITY.md — vulnerability reports
- 🤝 CONTRIBUTING.md — strict TDD + measurement-before-claims
- 📜 CHANGELOG.md · CODE_OF_CONDUCT.md
📄 License
MIT — see LICENSE.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi