Skip to content

feat(python): usage-estimation bindings in ratel-ai#81

Draft
kayraucklnc wants to merge 1 commit into
kayra/rat-305-rust-core-usage-analyticsfrom
kayra/rat-308-python-observability
Draft

feat(python): usage-estimation bindings in ratel-ai#81
kayraucklnc wants to merge 1 commit into
kayra/rat-305-rust-core-usage-analyticsfrom
kayra/rat-308-python-observability

Conversation

@kayraucklnc

@kayraucklnc kayraucklnc commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Part 3 of 3 — surfaces the core usage-estimation maths in the ratel-ai Python SDK. Stacked on #79.

What's here

  • PyO3 wrappers estimate_tokens / estimate_cost_usd and registry catalog_tokens() / tokens_for(), exported from ratel_ai.
  • ToolCatalog(observe=True) records the full-catalog-vs-selected-top-K saving on each search into last_savingsin-memory only, best-effort, never emitted.

Retired vs the original PR

The whole observability/ package (the rollup client/exporter that shipped to /api/v1/events) is dropped — usage/cost telemetry rides the ratel-ai-cloud ADR-0013 event. See ADR-0015.

Verified locally

maturin develop ✓ · ruff ✓ · mypy (strict) ✓ · pytest 56/56 ✓ · workspace fmt / clippy -D warnings

Closes RAT-308. Part of RAT-291.

PyO3 wrappers for estimate_tokens/estimate_cost_usd and registry
catalog_tokens()/tokens_for(); ToolCatalog(observe=True) records the
full-catalog-vs-top-K saving into last_savings (in-memory only). No rollup
wire format — usage/cost telemetry rides ratel-ai-cloud (ADR-0015).

Closes RAT-308. Part of RAT-291.
@kayraucklnc kayraucklnc force-pushed the kayra/rat-305-rust-core-usage-analytics branch from c45d593 to fe4fb6b Compare July 3, 2026 10:20
@kayraucklnc kayraucklnc force-pushed the kayra/rat-308-python-observability branch from 723d4d4 to 3c8a263 Compare July 3, 2026 10:20
@kayraucklnc kayraucklnc changed the title feat(python): observability & usage-analytics layer in ratel-ai feat(python): usage-estimation bindings in ratel-ai Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant