mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
|
Some checks failed
CodSpeed Benchmarks / benchmarks (push) Waiting to run
Cost map pins recheck / rerun-cost-map-guard (push) Waiting to run
Publish lint base counts / publish (basedpyright, litellm/scripts/type_check_gate.py) (push) Waiting to run
LiteLLM Rust DB / db-queries (push) Waiting to run
Terraform Modules / fmt, validate, test (aws) (push) Waiting to run
Terraform Modules / fmt, validate, test (gcp) (push) Waiting to run
unit / llms-providers (push) Blocked by required conditions
unit / proxy-endpoints (push) Blocked by required conditions
unit / proxy-feature-endpoints (push) Blocked by required conditions
unit / auth-checks (push) Blocked by required conditions
unit / budgets (push) Blocked by required conditions
unit / custom-logging (push) Blocked by required conditions
unit / db-and-spend (push) Blocked by required conditions
unit / endpoints-and-responses (push) Blocked by required conditions
unit / enterprise-routing (push) Blocked by required conditions
unit / guardrails-hooks (push) Blocked by required conditions
unit / jwt-and-keys (push) Blocked by required conditions
unit / key-generation (push) Blocked by required conditions
unit / logging-misc (push) Blocked by required conditions
unit / mcp-oauth (push) Blocked by required conditions
unit / proxy-runtime (push) Blocked by required conditions
unit / proxy-server-core (push) Blocked by required conditions
unit / core-auth-spend (push) Blocked by required conditions
unit / core-logging-request-path (push) Blocked by required conditions
unit / rust-bridge (push) Waiting to run
unit / mcp-server (push) Blocked by required conditions
unit / proxy-auth (push) Blocked by required conditions
unit / proxy-extras (push) Blocked by required conditions
Publish lint base counts / publish (openapi-docs, litellm/scripts/openapi_docs_gate.py) (push) Waiting to run
Publish lint base counts / publish (ruff-strict, litellm/scripts/ruff_strict_gate.py) (push) Waiting to run
Publish lint base counts / publish (test-quality, litellm/scripts/test_quality_gate.py) (push) Waiting to run
Publish lint base counts / publish (type-discipline, litellm/scripts/type_discipline_gate.py) (push) Waiting to run
Root entry limit / root-entry-limit (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
lint / lint plan (push) Waiting to run
lint / python (push) Blocked by required conditions
lint / typecheck (push) Blocked by required conditions
lint / e2e-harness (push) Blocked by required conditions
lint / secret-scan (push) Waiting to run
lint / ui (push) Blocked by required conditions
lint / ui-api-types (push) Blocked by required conditions
lint / code-quality (push) Waiting to run
lint / ci-coverage (push) Waiting to run
lint / semgrep (push) Waiting to run
lint / lint passed (push) Blocked by required conditions
smoke / all-extras-py (push) Blocked by required conditions
smoke / smoke-rust-bridge (push) Waiting to run
smoke / dashboard-build (push) Waiting to run
smoke / py (push) Blocked by required conditions
smoke / windows-sdk (push) Waiting to run
smoke / proxy-build-from-pip (push) Waiting to run
smoke / smoke passed (push) Blocked by required conditions
unit / root (push) Blocked by required conditions
unit / proxy-utils (push) Blocked by required conditions
unit / core-auth-request (push) Blocked by required conditions
unit / core-management-cost (push) Blocked by required conditions
unit / core-utils-route (push) Blocked by required conditions
unit / core-router (push) Blocked by required conditions
unit / core-router-core (push) Blocked by required conditions
unit / core-router-retries (push) Blocked by required conditions
unit / changed-tests (push) Blocked by required conditions
unit / lint-runtime (push) Blocked by required conditions
unit / plan (push) Waiting to run
unit / enterprise-managed-files (push) Blocked by required conditions
unit / enterprise-repositories-secrets (push) Blocked by required conditions
unit / proxy-server (push) Blocked by required conditions
unit / lens-python-310 (push) Blocked by required conditions
unit / caching-local (push) Blocked by required conditions
unit / core-utils (push) Blocked by required conditions
unit / endpoints (push) Blocked by required conditions
unit / enterprise-package (push) Blocked by required conditions
unit / integrations (push) Blocked by required conditions
unit / llms-anthropic (push) Blocked by required conditions
unit / llms-bedrock (push) Blocked by required conditions
unit / llms-openai-meta (push) Blocked by required conditions
unit / llms-vertex-ai (push) Blocked by required conditions
unit / mcp-elicitation (push) Blocked by required conditions
unit / proxy-hooks-client (push) Blocked by required conditions
unit / proxy-infra-routing (push) Blocked by required conditions
unit / proxy-subprocess (push) Blocked by required conditions
unit / redis-py 7.4.1 compatibility (push) Blocked by required conditions
unit / redis-py 8.0.1 compatibility (push) Blocked by required conditions
GitHub Actions Security Analysis / zizmor (push) Waiting to run
unit / proxy-infra-db-spend (push) Blocked by required conditions
unit / proxy-infra-root-a-p (push) Blocked by required conditions
unit / proxy-infra-root-q-z (push) Blocked by required conditions
unit / responses-caching-types (push) Blocked by required conditions
unit / router (push) Blocked by required conditions
unit / rust-bridge-harness (push) Blocked by required conditions
unit / ui-unit (push) Waiting to run
unit / docs (push) Blocked by required conditions
unit / helm (push) Blocked by required conditions
unit / OpenAI 2.20.0 compatibility (push) Blocked by required conditions
unit / OpenAI 3.0.0 compatibility (push) Blocked by required conditions
unit / OpenAI 3.25.0 compatibility (push) Blocked by required conditions
unit / redis-py 5.3.1 compatibility (push) Blocked by required conditions
unit / redis-py 6.4.0 compatibility (push) Blocked by required conditions
unit / unit passed (push) Blocked by required conditions
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
* feat(cost): add the price, bound and rates query engine to litellm-cost price() answers a PriceQuery tagged by kind over a RowSource that Model Catalog will implement. The tokens kind ports the token path of completion_cost for Claude on Anthropic, Bedrock, Vertex AI and Azure AI, with speed, geo and regional uplifts, the web search fee, provider-keyed discount and margin, the stored cost breakdown and prompt-caching savings. Every other kind and unported case answers NotPorted. bound() ports the legacy budget hold and rates() returns a row's rates, its raw key facts and one pricing status for the auth predicates. Parity fixtures captured once from main's Python pin totals, breakdowns, savings and holds to the last bit. Copied main bugs are listed in the crate AGENTS.md. * feat(python-bridge): price, bound, rates and adjust over model-catalog catalog rows Model Catalog now feeds the litellm-cost query engine. pricing_rows reads a CostLookup and fetches the rows one query reads into PricingRows, the core's RowSource, each candidate keyed by the model name main priced it with, and a lowered row carries the RowFacts the core reads (mode, max tokens, how float() reads provider_specific_entry, the raw keys the auth checks read). PricingContext also holds the discount and margin config. The python-bridge snapshot reads the host's fallback_generalizations rules with the table and is rebuilt when the generation or the config values move. NativeModelCostMap gains price, bound, rates and adjust. Python hands each a document of raw facts and the bridge reads them the way main's Python did before it builds the core's typed query. A call the core does not price answers None so Python keeps pricing it. NativeTokenUsage now takes the core's TokenUsage document and bills it through TokenUsage::billed, so the counts to meters conversion exists once. * feat(cost): price Claude token calls, budget holds and auth price checks in Rust completion_cost prices a Claude token call on Anthropic, Bedrock, Vertex AI and Azure AI through NativeModelCostMap.price and stores the receipt's breakdown, rates and adjustments on the logging object as before. Any call Rust leaves to Python (another provider or call kind, built-in tools other than a reported web search, a provider-stated cost, custom per-call prices or a deferred candidate list) keeps the Python candidate loop for that call. The Anthropic speed and geo uplifts and the Bedrock geo uplift now come from the Rust core, and the Python bodies are gone. Discount and margin resolve in Rust for every kind through NativeModelCostMap.adjust, replacing _apply_cost_discount, _apply_cost_margin and resolve_cost_discount. The legacy budget hold calls bound, and the auth checks read token rate keys and positive token rates from rates. Tests that patched deleted internals now drive the public functions, and new cases pin the adapter to main's totals and breakdowns for the captured Claude fixtures. * refactor(cost): keep the lint gates flat for the Rust pricing adapter Split the Rust route's eligibility checks into early returns, read hidden params and web search options through typed mapping helpers, read the generalization rules through as_object_list, and sort the stub's __all__. Adjust and store the token and search costs of a completion_cost candidate in one helper so no Final is bound inside the candidate loop, type the Model Router fee dict, and merge the litellm_core_utils imports of the host module. * test(cost): match the unreadable geo value in the Bedrock ValueError check * test(cost): bill a price edited in place in litellm.model_cost on the next Rust-priced call The python-bridge row cache was keyed by row object identity, so editing a price in place kept billing the old rate until something called changed_in_place(). Lowerings are now reused only while the row reads the same fields. * docs(cost): say the RowSource is PricingRows over a catalog's PricingTable * fix(cost): port main's budget hold estimator changes into bound Main reworked the budget hold while this stack was open (#51752, #53412 and the per-model input counts). The rebase kept main's reservation, window and carry-over code and the Rust bound, so this commit brings the hold up to main The adapter reads the request: per model, the output caps that reach the provider through each serving deployment (surface, drop params, the Responses minimum, Gemini generationConfig caps) and the output count (n, best_of, candidateCount, router and deployment defaults), plus whether a Gemini body holds inline audio or names a cached content. A model whose input could not be counted is held at its input window without recounting bound reads the rows: a cached content holds the rest of the input window at the highest cache-read rate, text or audio, inline audio holds input at the higher of the text and audio rates, a counted Gemini prompt reads the `_above_<n>_tokens` prices it reaches, the threshold included, and a group reads those from each deployment's `deployment_pricing`. A row ceiling that is not positive reads the default, and a row missing an input or output rate holds nothing for tokens it would bill there max_cost_for_cost_info and input_cost_for_cost_info hold one model info row through bound, so main's tests run against the Rust hold unchanged apart from the names * refactor(cost): carry the RustRefusal rename into the pricing entry point --------- Co-authored-by: narmstrong-berri <narmstrong@berri.ai> |
||
|---|---|---|
| .. | ||
| _experimental | ||
| a2a | ||
| agent_endpoints | ||
| alerting_endpoints | ||
| analytics_endpoints | ||
| anthropic_endpoints | ||
| auth | ||
| batches_endpoints | ||
| client | ||
| common_utils | ||
| config_resolvers | ||
| container_endpoints | ||
| control_plane | ||
| credential_endpoints | ||
| db | ||
| decisions_endpoints | ||
| deps | ||
| discovery_endpoints | ||
| enterprise_billing | ||
| example_config_yaml | ||
| fine_tuning_endpoints | ||
| google_endpoints | ||
| guardrails | ||
| health_endpoints | ||
| hooks | ||
| image_endpoints | ||
| list_api | ||
| logging_endpoints | ||
| management | ||
| management_endpoints | ||
| management_helpers | ||
| mcp_server | ||
| memory | ||
| middleware | ||
| ocr_endpoints | ||
| openai_files_endpoint | ||
| pass_through_endpoints | ||
| policy_engine | ||
| prompts | ||
| proxy_server | ||
| public_endpoints | ||
| rag_endpoints | ||
| realtime_endpoints | ||
| rerank_endpoints | ||
| response_api_endpoints | ||
| response_polling | ||
| roi_calculator | ||
| rust_forward | ||
| search_endpoints | ||
| shutdown | ||
| spend_tracking | ||
| telemetry | ||
| test_configs | ||
| types_utils | ||
| ui_crud_endpoints | ||
| utils | ||
| vector_store_endpoints | ||
| vector_store_files_endpoints | ||
| video_endpoints | ||
| __init__.py | ||
| _prisma.py | ||
| conftest.py | ||
| proxy_server_config.yaml | ||
| router_entry_point_stubs.py | ||
| rust_auth_stores.py | ||
| skill_submission_rows.py | ||
| spend_counters_ledger_twin.py | ||
| test__lazy_features.py | ||
| test__types.py | ||
| test_admin_mcp.py | ||
| test_aiohttp_cleanup_closed.py | ||
| test_aiohttp_session_recovery.py | ||
| test_api_key_masking_in_errors.py | ||
| test_aproxy_startup.py | ||
| test_audio_speech_prometheus_hooks.py | ||
| test_batch_expiry.py | ||
| test_batch_metadata_none_fix.py | ||
| test_batch_retrieve_bedrock.py | ||
| test_batch_x_litellm_model_encoding.py | ||
| test_blocked_response_usage.py | ||
| test_body_snapshot_callback_params.py | ||
| test_budget_reservation.py | ||
| test_budget_reservation_ledger.py | ||
| test_budget_reservation_rust.py | ||
| test_budget_reservation_rust_ledger.py | ||
| test_bug_report_config.py | ||
| test_caching_routes.py | ||
| test_chat_completion_metadata.py | ||
| test_claude_code_marketplace.py | ||
| test_collector.py | ||
| test_common_request_processing.py | ||
| test_component_allowlists.py | ||
| test_conftest.py | ||
| test_cors_config.py | ||
| test_credential_slot_registry.py | ||
| test_custom_callback_input.py | ||
| test_custom_logger_s3_gcs.py | ||
| test_custom_proxy.py | ||
| test_custom_tokenizer_bug.py | ||
| test_db_schema_changes.py | ||
| test_dev_reload.py | ||
| test_dynamic_mcp_route.py | ||
| test_empty_model_list.py | ||
| test_enforce_user_param.py | ||
| test_fallback_management_endpoints.py | ||
| test_fastapi_offline_routes.py | ||
| test_filter_models_by_team_access_group.py | ||
| test_get_favicon.py | ||
| test_get_image.py | ||
| test_health_check_functions.py | ||
| test_health_check_max_tokens.py | ||
| test_init_litellm_callbacks.py | ||
| test_langfuse_passthrough_security.py | ||
| test_lazy_openapi_snapshot.py | ||
| test_litellm_pre_call_utils.py | ||
| test_max_budget_env_var.py | ||
| test_mcp_asgi_response.py | ||
| test_model_based_routing_files_batches.py | ||
| test_model_deprecations_endpoint.py | ||
| test_model_dump_with_preserved_fields.py | ||
| test_model_id_header_propagation.py | ||
| test_model_info_default_limits.py | ||
| test_model_level_guardrails.py | ||
| test_model_list_aliases.py | ||
| test_model_list_callback_filter.py | ||
| test_model_list_discoverable.py | ||
| test_model_list_healthy_only.py | ||
| test_modify_response_streaming_passthrough.py | ||
| test_moyai_endpoints.py | ||
| test_native_compaction.py | ||
| test_openai_ws_passthrough_routes.py | ||
| test_openapi_schema_validation.py | ||
| test_plugin_routes.py | ||
| test_pointfive_dashboard_config.py | ||
| test_pointfive_ui_callback.py | ||
| test_pricing_currency.py | ||
| test_pricing_field_strip.py | ||
| test_prisma_client_backoff_retry.py | ||
| test_prisma_engine_watchdog.py | ||
| test_prisma_migration.py | ||
| test_prometheus_cleanup.py | ||
| test_prometheus_metrics_server.py | ||
| test_prompt_test_endpoint.py | ||
| test_provider_url_destination_guard.py | ||
| test_proxy_cli.py | ||
| test_proxy_config_unit_test.py | ||
| test_proxy_custom_auth.py | ||
| test_proxy_logging_hook_detection.py | ||
| test_proxy_reject_logging.py | ||
| test_proxy_server.py | ||
| test_proxy_server_custom_logger.py | ||
| test_proxy_server_endpoints_and_startup.py | ||
| test_proxy_server_endpoints_and_startup_ledger.py | ||
| test_proxy_server_exception_mapping.py | ||
| test_proxy_setting_guardrails.py | ||
| test_proxy_token_counter.py | ||
| test_proxy_types.py | ||
| test_proxy_utils.py | ||
| test_proxy_utils_model_creation_and_error_logging.py | ||
| test_pyroscope.py | ||
| test_read_model_list.py | ||
| test_redis_auth_cache_flag.py | ||
| test_reducto_ocr_route.py | ||
| test_response_model_sanitization.py | ||
| test_response_polling_pre_call_checks.py | ||
| test_route_a2a_models.py | ||
| test_route_llm_request.py | ||
| test_route_priority.py | ||
| test_sensitive_route_auth.py | ||
| test_server_listener.py | ||
| test_server_root_path.py | ||
| test_shared_health_check.py | ||
| test_spend_log_cleanup.py | ||
| test_swagger_chat_completions.py | ||
| test_team_member_update.py | ||
| test_team_org_move.py | ||
| test_tools_allowlist_enforcement.py | ||
| test_ui_path_detection.py | ||
| test_unit_test_proxy_hooks.py | ||
| test_update_llm_router_resilience.py | ||
| test_update_spend.py | ||
| test_v2_hook_routing.py | ||
| test_v2_proxy_fields.py | ||
| test_zero_cost_model_budget_bypass.py | ||
| test_zerobus_dashboard_config.py | ||
| vector_store_access_group_state.py | ||
| vertex_key.json | ||