Skip to main content
Glama
Byte-Naut

npu-vision-fallback

by Byte-Naut

🔋 npu-vision-fallback

Local low-power vision for desktop AI agents

When accessibility APIs fail — NPU-first, zero GPU wake-up, 100% local

CI PyPI License: MIT Python 3.11+

English | 中文


What is this?

A lightweight, local-first vision service for desktop agents that need to see and interact with screens where traditional accessibility APIs fall short—games, remote desktops, canvas apps, and more.

Built for efficiency: Native OS OCR · Intel NPU acceleration · Zero cloud calls · Battery-friendly by design

Architecture Diagram


✨ Why Use This?

Desktop agents face a challenge: how to perceive UI when the accessibility tree is empty?

Common Approach

The Problem

🤖 Multimodal LLM screenshots

Expensive tokens, slow round-trips, coordinate hallucination — overkill for "just find the button"

🌳 OS Accessibility APIs only

Blind to games, canvas apps, remote desktops, emulators

🔥 Heavy GPU OCR (PaddleOCR)

Big dependencies, high power draw, wakes discrete GPU

🎮 "Just run it on the iGPU"

Contends with the very UI/game the agent is watching; this service asks for NPU or CPU only — never any GPU

Not a competitor to your cloud model — the gatekeeper in front of it. Modern multimodal LLMs are excellent at understanding a screen; they're wasteful when all the agent needs is "where is the Start button." npu-vision-fallback handles that low-level "find/read the widget" step locally — cheap, fast, offline — and you escalate to the big model only for the genuinely hard reasoning ("what does this dashboard mean?"). When the accessibility tree comes back empty, this is the layer that answers first, without touching the cloud or spinning up any GPU.

Perfect for:

  • 🎮 Game UIs and emulators

  • 🖥️ Remote desktop / VNC clients (no remote accessibility tree)

  • 🎨 Canvas / WASM web apps rendering outside the DOM

  • 💻 Local SLMs that can't afford multimodal screenshot tokens


💡 Design Philosophy

Three deliberate constraints — not limitations, but the whole point:

  1. Don't use a sledgehammer to crack a nut. Try the OS-native path first (Windows OCR), then a small local detector. The cloud multimodal model is the last resort, reserved for real reasoning — not for reading a button label.

  2. Isolate the compute. Let the NPU do inference so the GPU stays free to render the game/app the agent is looking at. By design this service requests NPU or CPU only — it never asks for any GPU, integrated or discrete (why?).

  3. Local, period. Screenshots are captured in memory and never written to disk; OCR text is never logged; nothing leaves the machine.

The point isn't that cloud vision can't do this — it's that spending tokens, latency, and battery on "find the OK button" is the wrong tool for the job.


🚀 Quick Start

1. Install (Windows + Intel NPU recommended)

pip install "npu-vision-fallback[ocr-win,detect]"
python scripts/download_ui_model.py  # One-time setup

2. Configure your MCP client

Add to your MCP configuration (e.g., claude_desktop_config.json or equivalent):

{
  "mcpServers": {
    "npu-vision-fallback": {
      "command": "npu-vision-fallback"
    }
  }
}

3. Use it

Restart your agent and try:

You: The accessibility tree for this game is empty. Can you read the screen at coordinates [0,0,1280,800] and find the "Start Game" button?

Claude: (calls analyze_screen) I found a button labeled "Start Game" at [520, 580, 720, 640]. Want me to click its center at (620, 610)?


📦 Installation Options

Native OCR + NPU UI detection (~85 MB total):

pip install "npu-vision-fallback[ocr-win,detect]"
python scripts/download_ui_model.py

Linux / macOS

Cross-platform OCR + CPU detection (~130 MB):

pip install "npu-vision-fallback[ocr-rapid,detect]"
python scripts/download_ui_model.py

Full (All Backends)

For development or testing all backends:

pip install "npu-vision-fallback[all]"
python scripts/download_ui_model.py

Minimal Core

Just the MCP server (no OCR/detection, ~20 MB):

pip install npu-vision-fallback

💡 Note: The detect extra uses OpenVINO (~80 MB) for runtime, not PyTorch. Model conversion requires the dev-convert extra (~2 GB), but that's a one-time setup most users skip.


🎯 Key Features

  • 🔋 NPU-first architecture — UI detection runs on Intel AI Boost at ~80ms per call (~0.3J energy)

  • ⚡ Zero dGPU wake-up — Default paths use NPU, system OCR, or CPU—laptop battery stays happy

  • 🌐 Native OS OCR — Uses Windows OCR engine (macOS Vision planned) for quality

  • 🧩 MCP protocol — Works with Claude Code, Codex, OpenCode, Antigravity CLI, or any MCP client out of the box

  • 🪶 Lightweight — No PyTorch/TensorFlow at runtime; all heavy deps are optional

  • 🛡️ Privacy-first — 100% local processing, no telemetry, no cloud


⚡ Performance

Measured on Intel Core Ultra 9 275HX (2560×1600 screen, on battery):

Task

Backend

Latency

Energy

Notes

OCR

WinOCR

~1100ms

2.5J

Native Windows API (full screen)

OCR

RapidOCR

~6300ms

14.5J

Cross-platform ONNX CPU

UI Detection

OpenVINO NPU

~80ms

0.3J

YOLOv8n on Intel AI Boost

UI Detection

OpenVINO CPU

~120ms

Fallback when no NPU

Full benchmark details and reproduction steps: outputs/power_report.md


🛠️ MCP Tools

Tool

Purpose

Key Arguments

health_check

Server status

list_backends

Available backends

ocr_region

Extract text from region

region=[x1,y1,x2,y2]

detect_ui

Find UI elements

region=[x1,y1,x2,y2]

analyze_screen

🌟 Combined OCR + detection

region=[x1,y1,x2,y2]

analyze_image_file

Analyze a single image file (not a live screenshot)

path, mode=ocr|ui|all

analyze_image_directory

Batch-analyze every image in a directory; writes one result JSON per image + a manifest, returns the output file paths

input_dir, output_dir, mode, recursive, overwrite, max_workers

analyze_screen is the primary tool — it fuses detection + OCR, returns spatially-sorted elements with text annotations. Perfect for agent navigation.

analyze_image_file / analyze_image_directory reuse the exact same OCR/UI-detection/fusion logic as the screen tools, but operate on image files instead of live screen captures — useful for batch-processing screenshots or UI mockups you already have on disk.


💻 CLI

Besides the MCP server, a standalone CLI is available for local file/directory analysis:

# Single image
uv run npu-vision-fallback-cli analyze-image path/to/image.png --mode all

# Directory batch (writes result JSON per image + manifest.json to --output-dir)
uv run npu-vision-fallback-cli analyze-dir path/to/dir --output-dir out/ --recursive

📚 Documentation


🧪 Examples

Example

Description

basic_ocr.py

Simple OCR call to screen region

agent_ui_navigation.py

Find and click UI elements

desktop_remote_vnc.py

Vision fallback in remote desktop

uv run python examples/basic_ocr.py --region 0 0 1280 800

🗺️ Roadmap

  • v1.1 — Multi-monitor support, DPI scaling awareness

  • v2.0 — Custom model training interface, bring your own detector

  • v2.1 — UI-TARS integration, macOS Vision backend, PP-OCR v4 on NPU


🤝 Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines. Please read CLAUDE.md—it's the project constitution that ensures code quality and architectural consistency.


📋 Supported Backends

Backend

Type

Device

Platform

Status

winocr

System OCR

CPU/NPU

Windows

✅ Primary

openvino_npu

UI Detection

NPU

Win/Linux + Intel NPU

✅ Primary

openvino_cpu

UI Detection

CPU

Win/Linux/macOS

✅ Fallback

rapid_ocr

OCR

CPU

All

✅ Cross-platform

pytesseract

OCR

CPU

All

✅ Last-resort

vision

System OCR

ANE

macOS

🚧 Planned


📄 License

MIT © npu-vision-fallback contributors


🙏 Acknowledgments

Built with:

Development assisted by Claude Code (Anthropic). Architecture design and code review powered by AI collaboration.

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Byte-Naut/npu-vision-fallback'

If you have feedback or need assistance with the MCP directory API, please join our Discord server