Python library for provider-agnostic LLM interaction with rate limiting and safe local integration.
Project description
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: the
0.1.0source tree contains the typed public API, deterministic output projections, a provider-awarelimitora statusCLI, Codex JSONL support, and opt-in OpenCode Go support. No distribution has been 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 │
└─────────────────────────────────────┘
apiandmodelsdefine the stable typed consumer boundary.corecoordinates detection and snapshot reads;compositionselects one explicit provider.providersowns contracts and private adapters;cacheis opt-in, in-memory reuse.outputprojects typed results to JSON v1 or human text;cliowns 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 dashboard adapter; authorization and endpoint behavior are qualified. |
| 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(workspace_id, auth_cookie)
client = activate_provider(config)
The consuming application owns environment or configuration access and passes values explicitly; Limitora does not read credentials from the environment. Treat both workspace_id and auth_cookie as sensitive. Limitora-controlled representations omit them, and request representations omit workspace-bearing URLs, 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.
- ✅ Typed domain, provider contract, orchestration, and public API.
- ✅ Codex and OpenCode Go adapters with explicit composition.
- ✅ In-memory cache and deterministic JSON v1/human projections.
- ✅ Explicit CLI activation with safe, documented failure boundaries.
- ⏸ 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file limitora-0.1.0.tar.gz.
File metadata
- Download URL: limitora-0.1.0.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0562bd8a4b4e30e341bed691679c2e23ad7b0ee0380f40088b696dafbf8d8c99
|
|
| MD5 |
20787ca1b07f4cc3ceb59887c77057cd
|
|
| BLAKE2b-256 |
25d2bbdc152720574e2476198adf9985f49b53a68839cc082b658930fe692b6d
|
Provenance
The following attestation bundles were made for limitora-0.1.0.tar.gz:
Publisher:
protected-release.yml on dnieblesdev/limitora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
limitora-0.1.0.tar.gz -
Subject digest:
0562bd8a4b4e30e341bed691679c2e23ad7b0ee0380f40088b696dafbf8d8c99 - Sigstore transparency entry: 2256951787
- Sigstore integration time:
-
Permalink:
dnieblesdev/limitora@678c095c55a8ddfec344d96c1872c3f75340f9a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dnieblesdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
protected-release.yml@678c095c55a8ddfec344d96c1872c3f75340f9a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file limitora-0.1.0-py3-none-any.whl.
File metadata
- Download URL: limitora-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84440f0b4c32c52559e91526c7c70d41532248fff817106e1775b4281d7b5c09
|
|
| MD5 |
8d60c40fc9c8c3825164da481c858e9a
|
|
| BLAKE2b-256 |
8baada0cbc23349bce31dd3785a88e203b9758b6fa03b535fe1df06ebebfe9e7
|
Provenance
The following attestation bundles were made for limitora-0.1.0-py3-none-any.whl:
Publisher:
protected-release.yml on dnieblesdev/limitora
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
limitora-0.1.0-py3-none-any.whl -
Subject digest:
84440f0b4c32c52559e91526c7c70d41532248fff817106e1775b4281d7b5c09 - Sigstore transparency entry: 2256951804
- Sigstore integration time:
-
Permalink:
dnieblesdev/limitora@678c095c55a8ddfec344d96c1872c3f75340f9a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dnieblesdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
protected-release.yml@678c095c55a8ddfec344d96c1872c3f75340f9a8 -
Trigger Event:
push
-
Statement type: