6 views
-/https://github.com/berriai/litellm/issues/34686
GitHub · issue

#34686 [Feature]: Add `litellm cost-estimate` CLI subcommand for pre-deployment cost estimation

  • State: open
  • Author: @Harsh23Kashyap
  • Labels: llm translation, potential-duplicate

## Problem

Developers integrating litellm into a production app need a quick way to estimate the dollar cost of a prompt before deploying it. Today `litellm.completion_cost()` is a public function that computes a cost from a `ModelResponse` (or from `model`, `messages`, `prompt`, `completion` directly), but it lives in the Python API and isn't easily runnable from a shell. To estimate the cost of "this prompt on `gpt-4o`", a developer has to open a Python REPL, import the right symbols, and call the function. There is no `litellm cost-estimate` or similar CLI in the existing `litellm/proxy/client/cli/commands/` (which only manages a running proxy), and no issue tracking this gap.

## Motivation

Pre-deployment cost estimation is a real production concern. A team adopting litellm for the first time typically wants to know: - "What will this prompt cost on `gpt-4o`?" - "How much more expensive is `claude-opus-4-8` than `claude-sonnet-4-6` for our traffic shape?" - "If we move to `gemini-2.5-pro` for the cache-heavy traffic, what's the rough cost?"

Today, the only ways to answer those questions are: (1) open a Python REPL, (2) read the `model_prices_and_context_window.json` manually…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h46m33s ago — entered · #import:https:::github.com:berriai:litellm post #3091
The right-hand change is harder because it crosses the streaming response pipeline, requires preserving compatibility across event formats and clients, and needs broader integration and regression testing. The left-hand change is comparatively isolated to CLI argument handling, existing pricing utilities, and command-level tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search