✦ EASY DOCUMENTATION & QUICKSTART GUIDE

GETTING STARTED WITH TALANTON

Install Talanton in 10 seconds, set your first AI spending limit, and stop runaway costs before they happen. Complete Python code examples included.

VERSION: 0.2.0PYTHON: 3.9 – 3.13100% FREE & OPEN SOURCE (MIT)100% PRIVATE ON YOUR DEVICEPYPI: TALANTON-PY
AI AGENT & LLM INGESTION PROTOCOL

Machine-Readable Context for LLMs, Agents & Cursor Rules

If you are an AI model, agent, or developer compiling system prompts, Talanton exposes clean, structured raw markdown at /llms.txt (and /llms-full.txt). Zero HTML overhead, deterministic API schemas, and ready for immediate context window digestion.

Classical Archival Engraving — Sovereign Universal Standard (Zeus)
PLATE IV · THE SOVEREIGN STANDARD OF HONEST MEASURE
// HISTORICAL METROLOGY ARCHIVE // THE ANCIENT TALANTON STANDARD

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.

ENGINE LATENCY0.08ms CPU Local
CLOUD EXFILTRATION0.00% (Air-Gapped)
SUPPORTED MODELS61 Frontier & Open Models
DISTRIBUTIONtalanton-py (PyPI)
#01 GETTING STARTED

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

BASH / TERMINAL
pip install talanton-py
PYPI DISTRIBUTION // TALANTON-PY
Talanton is published to PyPI under the package name talanton-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

BASH
$ talanton count "Hello production world" --model gpt-4o
{"model": "gpt-4o", "tokens": 4, "chat_overhead": 7, "total_input_tokens": 11}
NOTE // CHAT TEMPLATE FRAMING TOKENS
Every production model (OpenAI, Claude, Llama 3) injects hidden framing tokens (e.g. <|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.
#02 STORAGE & ARCHITECTURE

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

PYTHON
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}")
PARAMETERTYPEDESCRIPTION
modelstringFrontier model identifier (e.g. gpt-4o, claude-3-5-sonnet-20241022, meta-llama/Llama-3.3-70B-Instruct).
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.
modelstring

Frontier model identifier (e.g. gpt-4o, claude-3-5-sonnet, meta-llama/Llama-3.3-70B).

prompt_tokensint

Exact number of input tokens consumed by the prompt context.

completion_tokensint

Exact number of generated output tokens returned by the provider.

team / projectstring (optional)

Organizational attribution tags for team budget quota enforcement.

#03 PRODUCTION GUARDRAILS

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.

PYTHON
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}")
SECURITY INVARIANT // FAIL-CLOSED VS FAIL-OPEN
In enterprise environments, you can configure fail_closed=True to ensure no rogue agent continues executing if the budget database is unreachable.
#04 ZERO-FRICTION INTEGRATIONS

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

PYTHON
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)
#05 SHELL AUTOMATION

Terminal CLI Commands

Talanton provides an ergonomic CLI tool for CI/CD pipelines, pre-commit validation, and terminal introspection.

COMMANDDESCRIPTIONEXAMPLE
talanton countAccurately count prompt tokens including chat framing.talanton count "System prompt" --model gpt-4o
talanton costCalculate exact dollar cost for input + expected output tokens.talanton cost "Analyze this" --model claude-3-5-sonnet -o 500
talanton compareRank candidate frontier models by cost efficiency.talanton compare "prompt" --models gpt-4o,gpt-4o-mini,claude-3-5-haiku
talanton forecastProject 30-day to 12-month compounding compute cost trajectories.talanton forecast --model gpt-4o --calls-per-day 10000 --months 6
talanton modelsList all 61 verified models, providers, context windows, and pricing.talanton models --provider anthropic
talanton count

Accurately count prompt tokens including chat framing overhead.

$ 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 side-by-side by cost efficiency.

$ talanton compare "prompt" --models gpt-4o,gpt-4o-mini
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
#06 MEASURED PERFORMANCE

Production 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 MEASUREMEASURED VALUESLA TARGETSTATUS
Added Delay Per Call (Median)
Time added to inspect each prompt
1.942 ms< 5.000 msPASSED (Virtually imperceptible)
Peak Delay (Worst 1%)
Guaranteed response even under spikes
5.477 ms< 15.000 msPASSED (Ultra-stable)
Processing Capacity
Number of AI calls logged per second
24,586 calls/sec> 5,000 calls/secPASSED (4.9x Target)
Multi-Thread Concurrent Writes
25 parallel background processes
50.1 calls/sec> 25 calls/secPASSED (Zero Locks)
Storage Efficiency
Disk space required to record receipts
~310 Bytes / call< 1,000 BytesPASSED (1M calls = ~310MB)
Added Delay Per Call (Median)
Time added to inspect each prompt
PASSED
MEASURED VALUE1.942 ms
SLA TARGET< 5.000 ms
Peak Delay (Worst 1%)
Guaranteed response even under spikes
PASSED
MEASURED VALUE5.477 ms
SLA TARGET< 15.000 ms
Processing Capacity
Number of AI calls logged per second
4.9x TARGET
MEASURED VALUE24,586 calls/s
SLA TARGET> 5,000 calls/s
Multi-Thread Concurrent Writes
25 parallel background processes
ZERO LOCKS
MEASURED VALUE50.1 calls/s
SLA TARGET> 25 calls/s
Storage Efficiency
Disk space required to record receipts
PASSED
MEASURED VALUE~310 Bytes
SLA TARGET< 1,000 Bytes
#07 DATA SOVEREIGNTY

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.