Reduce LLM API costs by 90% with ML-powered recommendations and beautiful interactive dashboards
Project description
๐ LLMOptimize - AI Cost Optimization Made Beautiful
Reduce your LLM API costs by 90% with automatic tracking, ML-powered recommendations, and stunning interactive reports.
โจ Features
- ๐ฏ Auto-Tracking - Automatically tracks OpenAI, Anthropic, Groq, and LangChain calls
- ๐ค ML-Powered Recommendations - Smart model suggestions based on your usage patterns
- ๐ Beautiful Interactive Dashboard - Gorgeous terminal UI with animations
- ๐ฐ Real Savings - Users report 85-95% cost reduction
- ๐ Privacy-First - No prompts sent to server, only metadata
- ๐ Agent Workflow Monitoring - Track multi-step AI agent executions
- ๐จ Zero Configuration - Just import and use!
๐ Quick Start
Installation
pip install llmoptimize
Usage
import llmoptimize
import openai
# Use OpenAI normally - LLMOptimize tracks automatically!
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
# See your beautiful cost report
llmoptimize.report()
That's it! ๐
๐ Beautiful Interactive Reports
Terminal UI (Default)
llmoptimize.report() # Interactive animated terminal report
Features:
- ๐ฌ Animated number counting
- ๐ Real-time cost tracking
- ๐ก Personalized recommendations
- ๐จ Beautiful ASCII art
- ๐ Color-coded insights
Simple Text Output
llmoptimize.report(interactive=False) # Clean text output
๐ฏ What Gets Tracked
Supported Providers
- โ OpenAI - Chat completions, embeddings, images, audio
- โ Anthropic - Claude (Opus, Sonnet, Haiku)
- โ Groq - Llama, Mixtral, Gemma
- โ LangChain - All LLM calls via callback
- โ Custom APIs - Manual tracking support
What We Track
{
"model": "gpt-4", # โ
Model name
"prompt_tokens": 100, # โ
Token count
"completion_tokens": 50, # โ
Token count
"session_id": "anonymous-uuid" # โ
Anonymous ID
}
What we DON'T track:
- โ Your actual prompts
- โ AI responses
- โ Personal information
- โ API keys
๐ก Example Report
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ ๐ L L M O P T I M I Z E R E P O R T ๐ โ
โ โ
โ Your AI Cost Optimization Summary โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Analyzing your data... โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ YOUR USAGE SUMMARY
๐ Total API Calls Tracked
15
๐ฐ Total Cost
$0.1047
๐ Potential Savings
$0.1038
That's 99% you could save!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ MODEL USAGE
gpt-4: 10 calls
gpt-3.5-turbo: 4 calls
text-embedding-3-large: 1 call
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก PERSONALIZED RECOMMENDATIONS
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ #1 Recommendation โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ฏ gpt-4o-mini โ
โ ๐ฐ Save 99% โ
โ โ
โ ๐ก Cheaper alternative to gpt-4 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โจ Keep tracking to see more insights!
๐ง Advanced Features
Manual Tracking
For custom APIs or non-supported providers:
import llmoptimize
# Track any API call
llmoptimize.track(
model="custom-model-v1",
prompt_tokens=100,
completion_tokens=50,
provider="custom"
)
LangChain Integration
import llmoptimize
from langchain.llms import OpenAI
# Add callback to track LangChain
llm = OpenAI(callbacks=[llmoptimize.langchain.llmoptimize_callback])
# Use normally - automatically tracked!
result = llm("What is AI?")
๐ Real Results
"We reduced our OpenAI bill from $4,200/month to $380/month using LLMOptimize recommendations. The ROI was immediate."
โ SaaS Startup, 50K users
"The interactive dashboard makes it so easy to spot optimization opportunities. Saved us 92% on GPT-4 costs."
โ AI Research Team
๐๏ธ How It Works
- Import -
import llmoptimize - Auto-Patch - Automatically wraps your AI provider SDKs
- Track - Records metadata (model, tokens) on every call
- Analyze - ML system analyzes your patterns
- Recommend - Suggests cheaper alternatives
- Report - Beautiful visualization of your usage
All happens automatically. Zero code changes required!
๐ Privacy & Security
- โ No Prompts Sent - Only metadata (model names, token counts)
- โ Anonymous Sessions - Random UUID, no user tracking
- โ Open Source Server - Run your own instance if needed
- โ No API Key Storage - Your keys stay with you
๐จ Installation Options
Basic (Default)
pip install llmoptimize
With All Providers
pip install llmoptimize[full]
Development Tools
pip install llmoptimize[dev]
Everything
pip install llmoptimize[dev,full]
๐ Documentation
- Homepage: https://aioptimize.up.railway.app
- Source Code: https://github.com/hackrudra1234/llmoptimize
- Issues: https://github.com/hackrudra1234/llmoptimize/issues
๐ค Contributing
This is a proprietary project. For bugs and feature requests, please open an issue.
๐ License
Proprietary - All Rights Reserved
๐ Get Started Now!
pip install llmoptimize
import llmoptimize
# Your AI code here...
llmoptimize.report()
Save 90% on AI costs. Beautiful reports. Zero configuration. ๐
Made with โค๏ธ by the LLMOptimize Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmoptimize-3.1.0.tar.gz.
File metadata
- Download URL: llmoptimize-3.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95acfa1890947ae9f43d3a778346fb535a05f8376ed712bd751ddbf634ebf405
|
|
| MD5 |
bd4a248ecee549f4b5c85444a6e22051
|
|
| BLAKE2b-256 |
00687488fef7482fd83583eb2e79e15247276a43d1f28ff71ef82d1d2b885f8a
|
File details
Details for the file llmoptimize-3.1.0-py3-none-any.whl.
File metadata
- Download URL: llmoptimize-3.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
756814b3678a707bcfd2f4402e0591a879192929320debbc676a19588a22aa81
|
|
| MD5 |
7dd325e004722b469882f2a59a9aaff8
|
|
| BLAKE2b-256 |
cca984c844e6b0dbf86f3471ed36d9cf1e0fe79f1b1a3cfbd4d8555615e218b6
|