Metadata-Version: 2.4
Name: llmcalc
Version: 0.1.0
Summary: Calculate LLM token costs from llmlite pricing data
Project-URL: Homepage, https://github.com/onlyoneaman/llmcalc
Project-URL: Repository, https://github.com/onlyoneaman/llmcalc
Project-URL: Issues, https://github.com/onlyoneaman/llmcalc/issues
Project-URL: Changelog, https://github.com/onlyoneaman/llmcalc/blob/main/CHANGELOG.md
Author: Aman
License: MIT
License-File: LICENSE
Keywords: cost,llm,pricing,tokens
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Requires-Dist: platformdirs<5,>=4.2
Requires-Dist: pydantic<3,>=2.8
Requires-Dist: typer<1,>=0.12
Provides-Extra: dev
Requires-Dist: mypy<2,>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio<1,>=0.23; extra == 'dev'
Requires-Dist: pytest<9,>=8.2; extra == 'dev'
Requires-Dist: ruff<1,>=0.6; extra == 'dev'
Requires-Dist: twine<7,>=5; extra == 'dev'
Description-Content-Type: text/markdown

# llmcalc

`llmcalc` is a Python package to calculate LLM token costs from `llmlite` pricing data.

## Install

```bash
pip install llmcalc
```

## Python usage

```python
import asyncio
from llmcalc import calculate_token_cost

result = asyncio.run(calculate_token_cost("gpt-4o-mini", 1200, 800))
if result:
    print(result.total_cost)
```

## CLI usage

```bash
llmcalc quote --model gpt-4o-mini --input 1200 --output 800
llmcalc model --model gpt-4o-mini --json
llmcalc cache clear
llmcalc --version
```

## Defaults

- Default cache TTL is `43200` seconds (12 hours).
- Override cache TTL with `LLMCALC_CACHE_TIMEOUT`.
- Override pricing source with `LLMCALC_PRICING_URL`.
- Set fallback currency label with `LLMCALC_CURRENCY` (used only when upstream omits currency).

## Release Validation

```bash
python -m build --no-isolation
python -m twine check dist/*
```
