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

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

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


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-1.0.0a1.tar.gz (13.6 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-1.0.0a1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file robot_resources-1.0.0a1.tar.gz.

File metadata

  • Download URL: robot_resources-1.0.0a1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for robot_resources-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 cfb4c6ce366bafb2ab9f675402b592129af72835f233f17722047996d5bdd8c2
MD5 62244cb7288d59310335bb6c3831bb07
BLAKE2b-256 f9254d934c9705455ee0b4d81d4ede313bd2f9f9fd45e3d8ce1e156a81309b5b

See more details on using hashes here.

File details

Details for the file robot_resources-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for robot_resources-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 2def347e9565b6b77f6c93977d8676767f4912bfa390e4036da638b509eb0774
MD5 17264cdc80061c1de682302efde184de
BLAKE2b-256 c5579aaf9c64a6322e8b408e9bcea198d9a55cb10d2b048a7b895842c39d7663

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