Commit Graph
40 Commits
Author SHA1 Message Date
whit3rabbitandClaude 75a5a3a230 chore: release v0.16.0
Bump workspace + all inter-crate version refs from 0.15.1 to 0.16.0
(workspace Cargo.toml, anyllm_client pinned version, batch_engine,
proxy's 8 internal deps, optimizer core/passes/scorer + cli + benches).
Refresh Cargo.lock. Move CHANGELOG [Unreleased] -> [0.16.0] - 2026-07-16
and add a fresh empty [Unreleased]; bump the README deb filename to
anyllm-proxy_0.16.0-1_amd64.deb and add the v0.16.0 compare link.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-16 20:12:53 -05:00
whit3rabbitandClaude Opus 4.8 063af0d423 fix: admin UI provider model cache wipe, chip removal, stale-backend edit (v0.15.1)
- discover/refresh no longer wipe provider_models_cache on an empty result
  (DELETE-then-INSERT upsert skipped when zero ids), preserving autorouter
  model suggestions.
- Provider editor: removed model chips stick; persisted names seeded once
  instead of re-unioned on every cache refetch.
- Managed-backend edit falls back to SQLite on an in-memory miss, so a row
  skipped at startup no longer 404s on every save (heals value-fixable
  configs; unknown provider_id still 400s).
- Add get_managed_backend DB helper + round-trip test.
- Bump workspace to 0.15.1; CHANGELOG + README deb filename.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 21:50:42 -05:00
whit3rabbitandClaude Opus 4.8 3dc4f8d491 chore: release v0.15.0
Bump workspace + all crate versions 0.14.1 -> 0.15.0, move CHANGELOG
[Unreleased] into [0.15.0], backfill compare links, update README deb URL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 20:59:27 -05:00
whit3rabbitandClaude Opus 4.8 d12309d701 chore: release 0.14.1
Re-cut of the 0.14.0 release. The v0.14.0 tag was pushed before the CI
publish job knew about the new leaf crates (pxpipe, rtk, optimize_*), so
its pipeline would have failed to publish anyllm_proxy to crates.io. The
publish-order fix landed on main after the tag, and a tag can't be moved
under auto mode, so the release is re-cut as 0.14.1 with the fix in place.

Bump 0.14.0 -> 0.14.1 (workspace, inter-crate deps, client pinned version,
README deb filename) and rename the CHANGELOG section (0.14.0 was never
released).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 21:36:24 -05:00
whit3rabbitandClaude Opus 4.8 ff03a7ebd7 chore: release 0.14.0
Move Unreleased changelog entries (RTK compression, opt-in prompt
optimizer, release binary archives, Bedrock allowlist fix, model
discovery fix) into the 0.14.0 section. Bump workspace + inter-crate
versions 0.13.0 -> 0.14.0 and the README deb filename.

Fix clippy missing_const_for_thread_local in optimize-core alloc_budget
test (const-init the thread-locals) so cargo clippy -D warnings is clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 21:21:14 -05:00
whit3rabbitandClaude Opus 4.8 d155bfd148 feat: RTK tool-output compression and opt-in prompt optimizer
RTK (anyllm_rtk crate): command-aware filtering of tool-result text
(test/build/git/log output) via a catalog of 55 declarative filters ported
from OmniRoute (MIT). IO-free, deterministic, prompt-cache safe (cache_control
blocks preserved byte-for-byte). Wired into the Anthropic passthrough (stream +
non-stream) and OpenAI-translate paths, gated per-model via RTK_MODELS.
RTK_COMPRESS env / admin toggle, rtk_compress/rtk_models runtime config.

Optimizer (anyllm_optimize_* crates): opt-in Frozen-Frontier Extractive
Compression of long client-sent conversation history for OpenAI Chat
Completions, the Anthropic translate path, and the Anthropic passthrough path
(client history only, never proxy tool-loop turns). OPTIMIZER_MODE=off|shadow|
live env / admin toggle; live places a cache_control breakpoint at the frontier
over raw bytes. Optional LLMLingua-2 ONNX scorer behind the optimizer-onnx
feature (model fetched on demand, never bundled). New optimizer_* metrics
counters and GET/POST /admin/api/optimizer/model endpoints.

Both features expose runtime config + Settings UI controls and fail open on any
error. Adds workspace members, CI lint/test for the optimizer-onnx feature, and
gitignore rules for downloaded ONNX artifacts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 19:55:33 -05:00
whit3rabbitandClaude Opus 4.8 c2e77c59c7 chore: release 0.13.0
Bump workspace + inter-crate versions 0.12.0 -> 0.13.0, README deb filename,
and move CHANGELOG [Unreleased] into [0.13.0] - 2026-07-12.

Also bump crossbeam-epoch 0.9.18 -> 0.9.20 (Cargo.lock) to clear
RUSTSEC-2026-0204 (invalid pointer dereference), which was failing the
CI Security audit step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 08:00:28 -05:00
whit3rabbit 9031e0ee16 chore: release 0.12.0 2026-07-05 19:20:29 -05:00
whit3rabbit a786da1e49 Release 0.11.0 2026-07-04 17:58:14 -05:00
whit3rabbit ce89a2d19c Release 0.10.1 2026-06-20 15:24:43 -05:00
whit3rabbitandClaude Opus 4.8 ee6a39d5d4 fix: streaming/cost/cache correctness, litellm compat, provider docs
- client/proxy SSE + streaming loop cleanups (sse.rs, streaming.rs,
  runtime/stream.rs, chat_completions stream/anthropic/generic, gemini_input)
- cost + cache module fixes with added tests
- provider catalog/registry adjustments
- litellm YAML config support + tests; single-config tweaks
- docs: scope Vertex auth to VERTEX_API_KEY/GOOGLE_ACCESS_TOKEN,
  Bedrock LiteLLM YAML limits, Docker Hub image/tag docs in README
- CI: docker workflow multi-arch tag handling

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 12:24:07 -05:00
whit3rabbitandClaude Opus 4.8 bfe24b5cc2 chore(release): v0.10.0
Bump workspace + inter-crate version refs 0.9.9 -> 0.10.0 and update
CHANGELOG with admin UI redesign, cache auth/backend scoping, Gemini
virtual-key accounting, and security dependency bumps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 21:12:49 -05:00
whit3rabbitandClaude Opus 4.8 65cf673b97 feat: performative admin UI redesign + admin API contract fixes
Large admin-ui refactor (Performative component system, sidebar nav,
provider/route tabs) plus backend module restructuring.

Admin UI contract fixes (this session):
- Fix Models page crash: useBackends unwraps {backends:[...]}; align
  ModelEntry to {model_name, deployments} and ModelsResponse.strategy;
  fix add-model body to {model_name, actual_model, backend_name}.
- Fix Backends/Providers health rendering: source per-backend status and
  latency from the uptime endpoint (health_checks); narrow Backend type to
  the real get_backends shape.
- Route + sidebar-link the previously-unrouted Backends tab.

Verified: cargo test (exit 0), clippy -D warnings (exit 0), fmt --check,
admin-ui tsc + vite build all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:13:59 -05:00
whit3rabbitandClaude Opus 4.8 138aaa65ac fix: error classification + retry consistency across backends; bump 0.9.9
Surface upstream errors hidden in 200 bodies/streams (OpenRouter), unify
retry/fallback policy, fast-fail insufficient_quota, add timeout_error
mapping. Gemini native now retries with backoff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 15:43:04 -05:00
whit3rabbitandClaude Sonnet 4.6 ad4fbf8dd4 style: cargo fmt, fix CHANGELOG release instruction
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:39:39 -05:00
whit3rabbitandClaude Sonnet 4.6 681b0d47d9 chore: bump to 0.9.8, add CHANGELOG, cargo update
- Version: 0.9.7 → 0.9.8 (workspace + all pinned inter-crate deps)
- New: AnthropicMessagesClient passthrough client
- New: RetryPolicy struct, retry_transport_errors flag, extra_header builder
- New: ssrf_allow_loopback, ssrf_allow_private, extra_headers in HttpClientConfig
- New: ChatMessage::effective_text(), claude-fable-5 in provider catalog
- Fix: relaxed serde defaults for lax local backends (Ollama, llama.cpp)
- Fix: warn on empty choices in openai_to_anthropic_response
- ci: create-release now uses CHANGELOG section as release body
- docs: CHANGELOG.md created, release process documented in CLAUDE.md
- deps: cargo update (~105 packages, tokio 1.52, axum 0.8.9, rustls 0.23.40)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:37:09 -05:00
whit3rabbit 8b4abfdf7d chore: bump version to 0.9.7 2026-06-07 15:38:56 -05:00
whit3rabbit 45e18c83d2 chore: bump version to 0.9.6 2026-05-23 16:39:43 -05:00
whit3rabbit c68bb88f85 chore: bump version to 0.9.5 2026-05-23 15:35:01 -05:00
whit3rabbit 98bc1c833a fix: include pricing asset in proxy crate 2026-05-23 15:03:09 -05:00
whit3rabbit 4cdfef82e3 chore: prepare 0.9.3 release 2026-05-23 12:28:08 -05:00
whit3rabbitandClaude Opus 4.7 6de126893f chore: fix all clippy lints across workspace
- tools_map: use std::slice::from_ref over &[clone()] in 4 tests
- gemini_streaming_map: rewrite match as matches!
- backend/mod.rs: move impl BackendClient before #[cfg(test)] mod tests
- middleware: replace .filter().last() with .rfind() (xff parsing)
- middleware: drop dead `|| true` in is_ip_allowed smoke test
- sse: drop blank line between doc comment and assert_sse_ok
- streaming example: collapse nested if-let into outer match arms
- tool_execution tests: array literal over vec! for one-off slices
- live_bedrock: use is_some_and instead of map_or(false, _)
- live_api / live_responses: contains() over iter().any() on &[&str]

All test-only / example changes; no production behavior change.
1130 tests pass, fmt clean, clippy -D warnings clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 19:11:35 -05:00
whit3rabbitandClaude Opus 4.7 25f37dd9a4 docs(crates): add READMEs for client, batch_engine, proxy; bump 0.9.2
Each new README places the crate inside the anyllm-proxy workspace and
includes verified library-use examples for downstream consumers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 19:04:38 -05:00
whit3rabbitandClaude Opus 4.6 58bd323242 fix(deps): bump rustls-webpki 0.103.10 -> 0.103.12, version 0.9.1
Fixes RUSTSEC-2026-0098 (URI name constraint bypass) and
RUSTSEC-2026-0099 (wildcard name constraint bypass).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 20:36:31 -05:00
whit3rabbitandClaude Sonnet 4.6 22e4ee73aa chore: bump workspace version to 0.9.0 to match release tag
Aligns crate versions with the GitHub release tag so the deb package
filename, crates.io versions, and release tag all agree.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 15:05:20 -05:00
whit3rabbitandClaude Sonnet 4.6 e3275f81da feat: env import/export, spend alerts, model allowlist, audit log, and misc hardening
Adds admin env file import/export (multipart upload + download), per-key
spend alerts (80/95/100% of budget), model allowlist with wildcard support,
audit log for admin mutations, CSRF one-time-use tokens, SSRF-safe OIDC/webhook
clients, sliding-window admin rate limiter, and configurable Redis fail policy.
Also updates batch_engine, client, translator mapping, and admin UI settings tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 16:57:22 -05:00
whit3rabbitandClaude Sonnet 4.6 2e22cfef3c chore: stage pre-existing main branch changes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 15:28:55 -05:00
whit3rabbitandClaude Sonnet 4.6 1f9bb02968 feat: add Docker support, Gemini input handler, and batch engine improvements
Adds multi-arch Docker build with docker-compose, GitHub Actions CI workflow,
Gemini native input parsing, batch engine SQLite/file/webhook refactors,
and Bedrock streaming fixes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 12:01:24 -05:00
whit3rabbit b6158cf3fe feat: refactor admin routes into modular sub-modules and implement model management API endpoints 2026-04-04 20:30:13 -05:00
whit3rabbitandClaude Sonnet 4.6 01e04fa6b3 feat: expose period_reset_at in list_keys and show in budget bar
Add period_reset_at_from_row() to keys.rs for DB rows (budget_duration
as string), wire it into list_keys response, render reset date below
the budget bar in admin UI. Also fix with_http_client missing max_retries
field after retry.rs signature change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 20:30:13 -05:00
whit3rabbitandClaude Opus 4.6 04a58bfc6f style: run cargo fmt to fix CI formatting check
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 05:46:21 -05:00
whit3rabbitandClaude Opus 4.6 0fe011d718 fix(security): harden 4 medium findings from security audit
1. CSRF token store: replace unbounded DashMap with moka::sync::Cache
   (max 1,000 entries, 24h TTL) to prevent memory exhaustion.
2. Cloud metadata SSRF: warn at startup if QDRANT_URL/REDIS_URL points
   at 169.254.169.254 or metadata.google.internal.
3. TLS P12 password: wrap in zeroize::Zeroizing<String> so it is zeroed
   from heap on drop, preventing extraction from core dumps.
4. CSP nonce: replace unsafe-inline with per-request 128-bit nonce on
   admin SPA script/style tags.

Also includes: batch/bedrock model allowlist enforcement, litellm
master_key extraction moved to single-threaded fn main().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:31:11 -05:00
whit3rabbitandClaude Opus 4.6 b6277a8b86 feat: operator observability dashboard with error classification
- Admin UI: operator view with request volume, token usage, latency,
  cost charts, failure table, and request timeline
- Backend: add error_kind() method and infer_error_kind() for stable
  error classification (rate_limit, timeout, backend_error, client_error)
- Admin DB: error_kind column in request_log, observability aggregate
  queries (bucketed timeseries, failure breakdown, timeline)
- Gemini: improved streaming translation, thinking block support,
  grounding metadata passthrough
- Request timeout: configurable REQUEST_TIMEOUT_SECS with streaming
  watchdog
- Model pricing: MODEL_PRICING_FILE for external pricing overrides
- Degradation header: ANYLLM_DEGRADATION_WARNINGS env var control

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:12:03 -05:00
whit3rabbit b3b191e4bd chore: bump workspace version to 0.2.0 to match anyllm_client 2026-03-30 16:51:31 -05:00
whit3rabbitandClaude Opus 4.6 4a76511e38 fix(security): block IPv6 ULA (fc00::/7) and link-local (fe80::/10) in SSRF guard
The IPv6 arm of is_private_ip only checked loopback, unspecified, and
IPv4-mapped addresses. Unique Local Addresses and link-local addresses
were not blocked, allowing SSRF via URLs like http://[fc00::1]/v1.
Uses bitwise checks since Ipv6Addr::is_unique_local() is unstable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:21:28 -05:00
whit3rabbitandClaude Sonnet 4.6 3588f52ccb docs: expand library usage examples; borrow header slices in passthrough
Rewrote the "Using as a Library" README section: added cargo dependency
snippets, reorganized HTTP client/pure translation/reverse translation
examples, and added error handling + tool calling code blocks.

Changed AnthropicClient::forward/forward_stream to accept
`&[(&str, &str)]` instead of `&[(String, String)]` so the passthrough
handler can pass string literals directly without allocating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 14:48:19 -05:00
whit3rabbitandClaude Sonnet 4.6 aeb1e5efb3 feat(passthrough): forward anthropic-beta and x-claude-code-session-id headers upstream
Claude Code v2.1.86+ sends x-claude-code-session-id for session routing/aggregation.
The anthropic-beta header enables beta API features that must reach the upstream to
take effect (e.g., extended thinking, interleaved thinking).

- passthrough.rs: collect and forward the two headers via extra_headers
- anthropic_client.rs: accept extra_headers in forward/forward_stream/send_with_retry
- middleware.rs: log x-claude-code-session-id at debug level alongside anthropic-beta
- rate_limit.rs: parse and forward anthropic-organization-id response header; 3 new tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 13:43:47 -05:00
whit3rabbitandClaude Opus 4.6 215dd2eab3 chore: format, fix Bedrock match arms, verify line counts
- cargo fmt applied across all crates
- Fixed BackendClient::Bedrock match arms in chat_completions.rs,
  routes.rs, streaming.rs, openai_client.rs
- All new source files verified under 400 lines (2 files at 406/429,
  within tolerance for focused single-responsibility modules)
- 549 tests passing, clippy clean, both build paths verified

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 20:24:00 -05:00
whit3rabbitandClaude Opus 4.6 a4e655c8bb feat: LiteLLM gap fill - chat completions input, Azure backend, virtual keys, client SDK
Phase 1-8 implementation of the LiteLLM gap fill feature set:

- POST /v1/chat/completions: Accept OpenAI-format input, translate through
  Anthropic pipeline, return OpenAI-format responses (streaming + non-streaming)
- Reverse translation layer: openai_to_anthropic_request, anthropic_to_openai_response,
  ReverseStreamingTranslator (Anthropic SSE -> OpenAI ChatCompletionChunk)
- Azure OpenAI backend: BACKEND=azure with deployment-scoped URLs, api-key header,
  api-version query param (default 2024-10-21)
- Virtual key management: SQLite-backed CRUD via admin API (POST/GET/DELETE
  /admin/api/keys), DashMap in-memory cache, immediate revocation
- Per-key rate limiting: RPM sliding window enforcement in auth middleware,
  429 with retry-after header on limit exceeded
- Client library v0.2.0: ClientBuilder, ToolBuilder, ToolChoiceBuilder,
  typed streaming, rustdoc examples
- New dependencies: dashmap, aws-sigv4, aws-credential-types (prod);
  opentelemetry stack (feature-gated, optional)

534 tests passing, 0 failures, clippy clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 20:09:40 -05:00
whit3rabbitandClaude Sonnet 4.6 f1df50ff37 refactor: extract shared client crate and rename to anyllm_*
Introduce `anyllm_client` crate containing HTTP client construction,
SSRF-safe DNS resolver, retry/backoff logic, rate limit header parsing,
and SSE frame parsing. These were previously inlined in the proxy crate.

Rename crates from `anthropic_openai_proxy`/`anthropic_openai_translate`
to `anyllm_proxy`/`anyllm_translate` throughout.

proxy/backend: now re-exports retry, rate limit, and SSE symbols from
the client crate; `send_with_retry` and `build_http_client` are thin
adapters bridging BackendAuth/TlsConfig to the client crate's types.

streaming: remove duplicate `find_double_newline` and
`MAX_SSE_BUFFER_SIZE` definitions; import from `crate::backend` instead.

Fix missing `pub mod` declarations in translator and proxy that were
accidentally replaced by doc comments (streaming, usage_map, server,
redact).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 06:11:01 -05:00