FareedKhan-dev/save-llm-api-cost

A straightforward method to reduce your LLM inference API costs and token usage.

32
/ 100
Emerging

Implements a memory-efficient algorithm that compresses conversation history by selectively storing and updating only essential facts rather than the entire chat log, reducing token usage by ~40%. It uses embedding-based similarity matching with semantic fact extraction and classification (ADD, UPDATE, NOOP operations) to intelligently manage long-context conversations. The approach integrates with OpenAI-compatible APIs (Nebius, OpenAI) and provides a practical Python reference implementation with comparative benchmarks showing token savings at scale.

No commits in the last 6 months.

Stale 6m No Package No Dependents
Maintenance 2 / 25
Adoption 6 / 25
Maturity 9 / 25
Community 15 / 25

How are scores calculated?

Stars

21

Forks

4

Language

Jupyter Notebook

License

MIT

Last pushed

May 18, 2025

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/FareedKhan-dev/save-llm-api-cost"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.