
Universal Pre-Flight Standard for Autonomous AI Systems
In antiquity, the Talanton (talent) was the sovereign baseline unit of honest measure against debasement. In modern agentic computing, Talanton provides deterministic pre-flight token metrology and hard budget ceilings before requests cross the network to cloud APIs.
Quickstart in 30 Seconds
Talanton runs 100% locally on your machine or server. It has zero external dependencies on Redis, Postgres, or SaaS telemetry servers.
1. Installation via PyPI
pip install talanton-pytalanton-py. Once installed via pip install talanton-py, you import it directly as import talanton (or from talanton.guardrails import BudgetGuard). In the terminal, run the CLI directly using talanton.2. Verify Terminal CLI
$ talanton count "Hello production world" --model gpt-4o
{"model": "gpt-4o", "tokens": 4, "chat_overhead": 7, "total_input_tokens": 11}<|im_start|>system<|im_end|>) per message. Talanton accounts for this overhead in pre-flight calculation so your cost estimates never drift from actual invoices.Core Architecture: Blazing Fast Local Storage
Talanton embeds an ultra-high performance SQLite database directly on your computer. Every token count and cost record is saved privately in milliseconds without ever slowing down your app.
Tracking Cost Events with Python SDK
from talanton.tracker import CostTracker
tracker = CostTracker()
# Record an LLM inference call
event = tracker.record_call(
model="gpt-4o",
prompt_tokens=450,
completion_tokens=180,
team="search-team",
project="agent-orchestrator",
latency_ms=312.4
)
print(f"Recorded event: {event.id} | Cost: ${event.cost:.6f}")| PARAMETER | TYPE | DESCRIPTION |
|---|---|---|
model | string | Frontier model identifier (e.g. gpt-4o, claude-3-5-sonnet-20241022, meta-llama/Llama-3.3-70B-Instruct). |
prompt_tokens | int | Exact number of input tokens consumed by the prompt context. |
completion_tokens | int | Exact number of generated output tokens returned by the provider. |
team / project | string (optional) | Organizational attribution tags for team budget quota enforcement. |
modelstringFrontier model identifier (e.g. gpt-4o, claude-3-5-sonnet, meta-llama/Llama-3.3-70B).
prompt_tokensintExact number of input tokens consumed by the prompt context.
completion_tokensintExact number of generated output tokens returned by the provider.
team / projectstring (optional)Organizational attribution tags for team budget quota enforcement.
BudgetGuard: Hard Caps & Soft Alerts
Unbounded autonomous agents can run into recursive loops, generating hundreds of dollars in API spend within minutes. BudgetGuard intercepts calls before sending them to the provider, halting requests in sub-2ms if thresholds are breached.
from talanton.guardrails import BudgetGuard, HardBudgetExceededError
guard = BudgetGuard(
hard_limit_usd=50.00, # Absolute stop: raises error
soft_limit_usd=35.00, # Warning alert trigger
team_quotas={"agents": 20.00, "evals": 15.00}
)
# Intercept before making LLM invocation
try:
guard.check_and_charge(
estimated_cost=0.045,
team="agents"
)
# Proceed to provider call...
except HardBudgetExceededError as e:
print(f"REQUEST HALTED: {e}")fail_closed=True to ensure no rogue agent continues executing if the budget database is unreachable.OpenAI, LiteLLM & LangChain Wrappers
Talanton wraps existing provider SDKs with a single line of code, automatically extracting tokens, computing exact dollar spend, and enforcing guardrails.
OpenAI Official Python SDK Wrapper
from openai import OpenAI
from talanton.integrations.openai_wrapper import wrap_openai
# Initialize standard OpenAI client
client = OpenAI()
# Wrap with Talanton observability
client = wrap_openai(client, team="production-backend")
# Normal OpenAI calls are now automatically measured & recorded!
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Analyze quarterly retention metrics."}]
)
print(response.choices[0].message.content)Terminal CLI Commands
Talanton provides an ergonomic CLI tool for CI/CD pipelines, pre-commit validation, and terminal introspection.
| COMMAND | DESCRIPTION | EXAMPLE |
|---|---|---|
talanton count | Accurately count prompt tokens including chat framing. | talanton count "System prompt" --model gpt-4o |
talanton cost | Calculate exact dollar cost for input + expected output tokens. | talanton cost "Analyze this" --model claude-3-5-sonnet -o 500 |
talanton compare | Rank candidate frontier models by cost efficiency. | talanton compare "prompt" --models gpt-4o,gpt-4o-mini,claude-3-5-haiku |
talanton forecast | Project 30-day to 12-month compounding compute cost trajectories. | talanton forecast --model gpt-4o --calls-per-day 10000 --months 6 |
talanton models | List all 61 verified models, providers, context windows, and pricing. | talanton models --provider anthropic |
talanton countAccurately count prompt tokens including chat framing overhead.
$ talanton count "System prompt" --model gpt-4otalanton costCalculate exact dollar cost for input + expected output tokens.
$ talanton cost "Analyze this" --model claude-3-5-sonnet -o 500talanton compareRank candidate frontier models side-by-side by cost efficiency.
$ talanton compare "prompt" --models gpt-4o,gpt-4o-minitalanton forecastProject 30-day to 12-month compounding compute cost trajectories.
$ talanton forecast --model gpt-4o --calls-per-day 10000 --months 6talanton modelsList all 61 verified models, providers, context windows, and pricing.
$ talanton models --provider anthropicProduction Benchmarks & Latency SLAs
Every commit is validated against industry-grade performance SLAs. Talanton guarantees sub-2ms guardrail overhead and high-concurrency multi-threaded writes without database locking errors.
| WHAT WE MEASURE | MEASURED VALUE | SLA TARGET | STATUS |
|---|---|---|---|
| Added Delay Per Call (Median) Time added to inspect each prompt | 1.942 ms | < 5.000 ms | PASSED (Virtually imperceptible) |
| Peak Delay (Worst 1%) Guaranteed response even under spikes | 5.477 ms | < 15.000 ms | PASSED (Ultra-stable) |
| Processing Capacity Number of AI calls logged per second | 24,586 calls/sec | > 5,000 calls/sec | PASSED (4.9x Target) |
| Multi-Thread Concurrent Writes 25 parallel background processes | 50.1 calls/sec | > 25 calls/sec | PASSED (Zero Locks) |
| Storage Efficiency Disk space required to record receipts | ~310 Bytes / call | < 1,000 Bytes | PASSED (1M calls = ~310MB) |
Local-First Architectural Guarantees
Unlike SaaS observability platforms that stream your prompts and completions to third-party cloud infrastructure, Talanton stores everything on your sovereign machine.
ZERO EXFILTRATION
No phone-home telemetry. No cloud API keys required to observe and meter spend.
AIR-GAPPED READY
Operate in secure VPCs, GovCloud, or on-premise Kubernetes clusters without network egress.
MIT LICENSE PERMISSIVE
Commercial-friendly license created by Ameya Kulkarni with full rights for private enterprise use.