Skip to main content

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.

PyPI version Python 3.8+ License: Proprietary


โœจ 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

  1. Import - import llmoptimize
  2. Auto-Patch - Automatically wraps your AI provider SDKs
  3. Track - Records metadata (model, tokens) on every call
  4. Analyze - ML system analyzes your patterns
  5. Recommend - Suggests cheaper alternatives
  6. 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


๐Ÿค 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmoptimize-3.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llmoptimize-3.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

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

Hashes for llmoptimize-3.1.0.tar.gz
Algorithm Hash digest
SHA256 95acfa1890947ae9f43d3a778346fb535a05f8376ed712bd751ddbf634ebf405
MD5 bd4a248ecee549f4b5c85444a6e22051
BLAKE2b-256 00687488fef7482fd83583eb2e79e15247276a43d1f28ff71ef82d1d2b885f8a

See more details on using hashes here.

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

Hashes for llmoptimize-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 756814b3678a707bcfd2f4402e0591a879192929320debbc676a19588a22aa81
MD5 7dd325e004722b469882f2a59a9aaff8
BLAKE2b-256 cca984c844e6b0dbf86f3471ed36d9cf1e0fe79f1b1a3cfbd4d8555615e218b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page