CommunityArte e Designgithub.com

sid732/LocalContextRouter

Preflight router that decides locally whether each document page reaches a multimodal model as text, on-device OCR, or an image. Cuts vision-token cost. macOS.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add sid732/LocalContextRouter

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentação

Local Context Router

A multimodal model reads a PDF by extracting its text and rendering every page to an image, then paying for both. On a page that is mostly prose, the image is wasted spend. Run this preflight first and send the model only what each page needs.

When to use

Before reading, summarizing, or extracting from a PDF, scan, or screenshot the user has shared.

Requirements

The localcontextrouter package must be installed (pip install localcontextrouter, macOS). It provides the localctx command used below.

Run

Route the document and read the JSON, rendering any visual pages into a folder:

localctx <path-to-document> --json --vision-dir ./lcr-pages

If the localctx command is not available, run the bundled script with a Python that has localcontextrouter installed (the script imports the same package):

python scripts/preflight.py <path-to-document> --json --vision-dir ./lcr-pages

Use the result

The JSON has tokens_saved and a pages array. Each page carries source, text, text_tokens, image_tokens, and image:

  • source: "text": use text directly; do not attach the image.
  • source: "ocr": the page was image-only and has been OCR'd on-device; use text.
  • source: "vision": the page is a table, chart, or diagram; attach the image at image so the model can read it. The text is a rough fallback only.

Assemble the text and OCR pages in reading order, attach images only for the vision pages, and mention tokens_saved if the user cares about cost.

Notes

Everything runs locally and offline; the document does not leave the machine.

Habilidades Relacionadas

Shreyash-Ghatage/awesome-agentic-AI-coding-template

Provide a ready-to-use multi-agent AI coding template that boosts project setup speed, agent consistency, and safety from the start.

community

conceptworksx/Artha-Analytics

A multi-agent trading system for Indian stocks where AI agents analyze market, news, social sentiment, and fundamentals. Agents debate and challenge each other to generate explainable, data-driven trading strategies for stocks on NSE and BSE.

community

lukaskellerstein/claude-my-marketplace

A collection of Claude Code plugins — dev tools, documentation, infra, Figma, media generation, design direction, and web design. Reusable skills, agents, and commands across projects.

community

wasp-lang/open-saas

A 100% free modern JS SaaS boilerplate (React, NodeJS, Prisma). Full-featured: Auth (email, google, github, slack, MS), Email sending, Background jobs, Landing page, Payments (Stripe, Polar.sh), Shadcn UI, S3 file upload. AI-ready with tailored AGENTS.md, skills, and Claude Code plugin. One cmd deploy. Powered by Wasp full-stack framework.

community

zate/godot-ui

Expert knowledge of Godot's UI system including Control nodes, themes, styling, responsive layouts, and common UI patterns for menus, HUDs, inventories, and dialogue systems. Use when working with Godot UI/menu creation or styling.

community

KangweiLIAO/skill-vibe-audit

A platform-agnostic codebase audit skill. Automatically analyzes project architecture, security hygiene, and code quality. Generates a rich, interactive HTML "Insight Report" to guide refactoring and scaling.

community