OmniGlyph

skill
Security Audit
Fail
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Fail
  • 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 Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

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.

README.md
A real render: system prompt + tool docs packed into one dense 1568×728 page

🖼️ 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.


59–70% Bill Cut
10x Fewer Tokens
100% Read Accuracy
Zero Confabulations

CI
npm version
License: MIT
Node ≥18

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

Quickstart: start the proxy, check the dashboard, 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⌉ + 4 tokens 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_tokens counterfactual.

🔬 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)

The two benchmark harnesses running in dry-run mode

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

📄 License

MIT — see LICENSE.

Reviews (0)

No results found