- New GeminiNativeClient with generate_content and generate_content_stream methods
- GeminiNative variant added to BackendClient enum and BackendError
- All existing match arms updated to handle the new variant
- 10 unit tests for URL construction, model mapping, error display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove needless borrows in openai_batch_client.rs
- Replace redundant closure with function reference in CSRF middleware
- Narrow handler visibility to pub(crate) for anthropic_batch routes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- fetchCsrfToken(): fetches from GET /admin/csrf-token on load, stores in _csrfToken
- mutatingHeaders(): returns authHeaders merged with X-CSRF-Token header
- All POST/PUT/DELETE fetch calls now use mutatingHeaders() instead of authHeaders
- fetchCsrfToken() called before loadDashboard() so token is ready at startup
- normalize_schema_for_strict: recursively ensures all object schema
properties are listed in required and sets additionalProperties: false
- apply_strict_to_forced_tool: sets strict=true and normalizes the
parameter schema for the named forced tool, leaves others unchanged
- 6 unit tests covering normalization, nesting, merge, non-object, and
apply_strict cases
Gemini and Vertex only accept the OpenAPI 3.0 subset of JSON Schema in
function parameters. Adds sanitize_schema_for_gemini() in tools_map.rs and
applies it to all tool parameter schemas in both the non-streaming (routes.rs)
and streaming (streaming.rs) Gemini/Vertex code paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add NamedIntegration support to CallbackConfig (with_named constructor,
named_count(), notify() dispatches to named integrations)
- Derive Clone on NamedIntegration (required since CallbackConfig derives Clone)
- Parse "langfuse" from litellm_settings.callbacks into langfuse_requested
flag; filter it out of callback_urls
- Init LangfuseClient from env when langfuse_requested in LiteLLM config
- Env-var-only path in main.rs also activates Langfuse if keys are set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add missing +2 rounding bias to days_from_civil doy formula
(Hinnant algorithm); without it Feb/Apr/Jun/Sep/Nov timestamps
are off by one day
- Add February date test to catch this class of bug
- Comment integer truncation in latency_ms/1000 computation
- Remove env-var mutation from mod.rs test (races with langfuse tests)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sends generation-create events to Langfuse's batch ingestion API.
No new dependencies: base64 and ISO 8601 parsing are std-only.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds CostBased routing strategy to ModelRouter: selects the deployment
with the lowest combined input+output cost per token using the bundled
model_pricing.json. Falls back to round-robin when no deployment has
known pricing. Parsed from router_settings.routing_strategy: cost-based
in LiteLLM config files.
Also updates COMPARISON_LITELLM.md to reflect already-shipped features:
spend alerts, LITELLM_IP_ALLOWLIST alias, and routing strategy parity.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add warning logs when the proxy listener is bound to a non-loopback
address and either PROXY_API_KEYS is configured or virtual keys are
loaded from the database. Warns operators to place a TLS-terminating
reverse proxy in front of the service to protect credentials.
Does not block startup; purely informational.
Add structured tracing::info! log with key, old_value, new_value for
every config change via PUT /admin/api/config. Add is_safe_model_name
validation rejecting path traversal (..), query params (?#), and
non-alphanumeric characters outside the allowed set (-_./: @).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Defense-in-depth against token brute-force on the admin API. Uses a
DashMap-based sliding window (60s) per client IP, applied as the
outermost middleware layer on protected admin routes. Admin server now
uses into_make_service_with_connect_info to expose client IP. Limit
is configurable at runtime via set_admin_rpm for test flexibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Store secret_access_key and session_token as Zeroizing<String> so they
are wiped from heap memory when BedrockClient is dropped. Credentials
are reconstructed on each SigV4 signing call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- nextSibling could return text nodes causing duplicate detail panels
- loadModels showed data.note twice when no router active
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add "deny" as alias for "closed" policy. Change fail-closed retry-after
from 1s to 60s to give Redis time to recover. Add from_env default test.
Document env var in CLAUDE.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename AuthMode variants from Jwt/Keys terminology to OidcOnly/KeysOnly/Both.
Add allows_oidc() and allows_key_auth() helpers used in validate_auth.
Accept both new names (oidc, oidc-only, keys, keys-only, both) and legacy
names (jwt_only, keys_only, jwt_or_keys) for backward compatibility.
Default remains Both (try JWT first, fall through to keys).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split the single Tokens column into In/Out columns (7-column grid).
Add pause button and status filter (2xx/4xx/5xx) to the live feed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract resolve_admin_token_path() function to read ADMIN_TOKEN_PATH
env var (falling back to .admin_token). Replaces the previous inline
ADMIN_TOKEN_FILE env var. Updates non-Unix warning to reference the
new env var name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New virtual keys are hashed with HMAC-SHA256 using a per-installation
secret (auto-generated and stored in SQLite settings table). Auth
middleware tries HMAC hash first, falls back to legacy SHA-256 for
pre-existing keys. This binds key hashes to the installation, so a
stolen database cannot be used to brute-force keys elsewhere.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>