Skip to main content

Robot Resources — cache-aware LLM model routing for Python agents. Auto-attaches Anthropic, OpenAI, and Google (google-genai) SDKs to a local router sidecar (default ON; opt out with RR_AUTOATTACH=0).

Project description

robot-resources-router

Cache-aware LLM model routing for Python agents — install it and your agent's Anthropic, OpenAI, and Google (google-genai) calls route through a local engine that picks the cheapest model that can do each turn, per request, cache-aware. Your API keys flow straight to the labs; routing happens at a loopback proxy.

pip install robot-resources-router

Alpha: install via the wizard — npx @robot-resources/cli — which sets up the sidecar runtime and your (anonymous) account. Requires Node ≥ 18 on the machine (the routing engine runs as a sidecar child process).

How it works

This package is a thin attach shim, not a routing engine. On interpreter startup (via a .pth hook, like coverage/ddtrace) it:

  1. Spawns — or reuses — a local router sidecar (@robot-resources/router, a Node child process that dies with your agent; never a daemon).
  2. Points ANTHROPIC_BASE_URL / OPENAI_BASE_URL / GOOGLE_GEMINI_BASE_URL at that sidecar only after it answers a health check — so if the sidecar can't start, your SDKs talk to the real APIs unchanged (fail open).

No code changes, nothing to import.

Controls

Env var Effect
RR_AUTOATTACH=0 Kill switch — raw SDKs, no sidecar.
RR_ROUTING=0 Attach but never switch models (passthrough).
RR_PORT=<port> Override the loopback port (default 18790).
RR_ROUTER_DEBUG=1 Print attach/routing decisions to stderr.

SDK support

SDK Routed
anthropic
openai (≥ 1.0)
google-genai (new unified SDK)
google-generativeai (legacy, deprecated) ❌ — pip install google-genai

MIT licensed. Part of Robot Resources.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robot_resources_router-5.0.0a2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robot_resources_router-5.0.0a2-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file robot_resources_router-5.0.0a2.tar.gz.

File metadata

File hashes

Hashes for robot_resources_router-5.0.0a2.tar.gz
Algorithm Hash digest
SHA256 7c17be749dd3db2a82ebe2ca5b7504f1da2f280db7a262496a7bed98fc3bcde0
MD5 ac679728f8427c0a0e4903f02af7f6f6
BLAKE2b-256 06545a2e8e899cc2a5ee0215cd000ebc2062c3c258ebdd28bcad4fb857acc95a

See more details on using hashes here.

File details

Details for the file robot_resources_router-5.0.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for robot_resources_router-5.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed6ae2626f6d3ae519e7943212384c1b0d828bfdf22cb44d7e00a560c057fc88
MD5 d3fe4c4ce1b4043a869ebf933f10f1dc
BLAKE2b-256 0d529e0eca23bd5040fcc9227e9471b7d9b8c2df1816b56a490078a2e848f363

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page