Skip to main content

Limitora

Limitora is a typed Python library for provider-agnostic quota and status observations. It keeps provider adapters, composition, caching, output projection, and the CLI behind explicit boundaries so scripts and small tools can inspect status without embedding UI logic or leaking secrets.

Current status: 0.2.0 is the published baseline. The current source tree prepares 0.3.1 with the typed public API, deterministic output projections, a provider-aware limitora status CLI, Codex JSONL support including structural notification-metadata compatibility, opt-in OpenCode Go support, and the additive ValueAvailability.RATE_LIMITED state. 0.3.1 is not published yet.

Supported CPython versions are 3.10 through 3.14. A newer minor is not claimed until CI covers it; an upper bound requires a reproduced incompatibility.

Install and typed quick path

python -m pip install -e .

The public API can be used without invoking a provider:

from datetime import timedelta
from limitora import AuthorizationPolicy, FreshnessPolicy, MetricKind, StatusRequest

request = StatusRequest(
    frozenset({MetricKind.COMMERCIAL_QUOTA}),
    AuthorizationPolicy.DENY_AUTHORIZED_SOURCE,
    FreshnessPolicy(timedelta(minutes=5)),
)
print(request.requested_metrics)

Provider reads require an explicit StatusClient or construction boundary; provider calls are never implicit.

Problem

Local scripting tools that call LLM providers often end up tied to a specific editor, desktop widget, or GUI framework. That coupling makes them hard to test, hard to reuse, and risky to extend. Limitora keeps the provider conversation in a plain Python library so integrations can be thin and optional.

Architecture at a glance

┌─────────────────────────────────────┐
│           consumers / CLI           │
├─────────────────────────────────────┤
│  limitora.cli / limitora.output     │
│  limitora.composition / limitora.api│
│  limitora.core / limitora.models    │
├─────────────────────────────────────┤
│  limitora.providers                 │
│    ├── codex                        │
│    ├── opencode-go                  │
│    └── explicit provider adapters   │
├─────────────────────────────────────┤
│  limitora.providers.cache           │
└─────────────────────────────────────┘
  • api and models define the stable typed consumer boundary.
  • core coordinates detection and snapshot reads; composition selects one explicit provider.
  • providers owns contracts and private adapters; cache is opt-in, in-memory reuse.
  • output projects typed results to JSON v1 or human text; cli owns parsing, streams, and exits.

Limitora never imports YASB, PyQt, Waybar, or any UI integration.

Provider support

Provider Status Boundary
Codex implemented Explicit Codex JSONL adapter; authorized source is opt-in.
OpenCode Go implemented, opt-in Explicit supported API adapter using a Bearer API key.
Claude / Gemini not shipped No adapter or support promise.

Public API

The stable root surface includes StatusClient, StatusRequest, freshness types, provider-neutral models, safe provider errors, and the closed construction boundary: CodexJsonlConfig, OpenCodeGoConfig, ProviderConfig, activate_provider, CompositionError, and CompositionErrorKind. Provider dependencies, transports, sessions, and adapters remain internal.

Consumers construct and retain one client for the selected provider:

from limitora import OpenCodeGoConfig, activate_provider

config = OpenCodeGoConfig(api_key)
client = activate_provider(config)

The consuming application owns environment or configuration access and passes the API key explicitly. The limitora status CLI accepts LIMITORA_OPENCODE_API_KEY or --api-key; it never loads .env files. Treat the API key as sensitive. Limitora-controlled representations omit it, and request representations omit credentials, headers, and bodies.

CLI status

limitora status supports --json, --help, and explicit --provider codex|opencode-go activation. Without a provider it performs no provider I/O and reports ERROR: no provider configured on stderr with exit code 4. Routing is documented in cli-activation.md.

Security and privacy

Never store tokens, cookies, sessions, credentials, or provider cache data unredacted in this repository. Diagnostic dumps must be redacted before sharing. Redacted artifacts may use the names *.redacted.json or *.redacted.txt.

Roadmap status

The original provider-status roadmap is concluded/historical for the shipped baseline. Current implementation evidence is in the source and tests; future provider work is not promised.

  1. ✅ Typed domain, provider contract, orchestration, and public API.
  2. ✅ Codex and OpenCode Go adapters with explicit composition.
  3. ✅ In-memory cache and deterministic JSON v1/human projections.
  4. ✅ Explicit CLI activation with safe, documented failure boundaries.
  5. ⏸ Claude and Gemini remain unimplemented evaluation items.

Future relation to yasb-limitora

A separate yasb-limitora integration may consume this library to connect YASB to LLM providers. That integration will live in its own repository and import Limitora as a normal Python dependency. Limitora itself will remain UI-free.

Download files

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

Source Distribution

limitora-0.3.1.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

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

limitora-0.3.1-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file limitora-0.3.1.tar.gz.

File metadata

  • Download URL: limitora-0.3.1.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for limitora-0.3.1.tar.gz
Algorithm Hash digest
SHA256 9548c4cd4fcfcd37f3479c8e2a6574b6ebea011a12a468f8584f4544c6837717
MD5 237081fdc1d024efb01046822e6e9e2a
BLAKE2b-256 583dad2b9385cf3b0e90c4b59145ee3fa79d6049347c6846403b2f0f7cec1d94

See more details on using hashes here.

Provenance

The following attestation bundles were made for limitora-0.3.1.tar.gz:

Publisher: protected-release.yml on dnieblesdev/limitora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file limitora-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: limitora-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for limitora-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26827d4a35a1f44b85c1b69f29990791d1043684bb89a76d025385dad1bf97bd
MD5 c3e77b7590a433e3972accbfc434c8a0
BLAKE2b-256 0ea105d5499f957e7c854e1fa03b0c20303a4ca5dbf1f714adffb5d45b1d7d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for limitora-0.3.1-py3-none-any.whl:

Publisher: protected-release.yml on dnieblesdev/limitora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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