diff --git a/.circleci/AGENTS.md b/.circleci/AGENTS.md deleted file mode 100644 index b3591145a3e..00000000000 --- a/.circleci/AGENTS.md +++ /dev/null @@ -1,7 +0,0 @@ -# .circleci - -The `integration` workflow on `main` runs from a scheduled pipeline in the CircleCI project settings, cron `9 0-8,14-23 * * *` (UTC) on `main` with no pipeline parameters. It has no `triggers:` block in this file because a workflow with one runs only on its schedule, so the API pipelines that set `run_migration_tests` or `routing_parity_base` would stop running it. If main stops getting integration runs, check that the schedule still exists and recreate it with these values - -Jobs clone with the `checkout_over_https` command, never the built-in `checkout` step, because CircleCI falls back to the project's SSH checkout key without its GitHub App access, GitHub rejects that key, and the public repo needs no key. It fetches the job's commit with full history and no file contents (`--filter=blob:none`), like the built-in step did, so `scripts/path_filter.sh` can find a merge base - -A step that checks out files from another commit fetches that commit with `--no-filter`, as `routing_parity` does, because the clone has no file contents and git would otherwise download each missing file in its own request, which took 210 to 896 seconds for the routing parity base diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 15129f1e5e3..00000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,1785 +0,0 @@ -version: 2.1 -parameters: - run_migration_tests: - type: boolean - default: false - migration_candidate_image: - type: string - default: "" - migration_baseline_image: - type: string - default: "ghcr.io/berriai/litellm-database:v1.102.0" - migration_source_sha: - type: string - default: "" - routing_parity_base: - type: string - default: "" -orbs: - codecov: codecov/codecov@4.0.1 - node: circleci/node@5.1.0 # Add this line to declare the node orb - win: circleci/windows@5.0 # Add Windows orb - -commands: - checkout_over_https: - parameters: - revision: - type: string - default: "" - shell: - type: string - default: /bin/bash -eo pipefail - steps: - - run: - name: Check out the public repository over HTTPS - shell: << parameters.shell >> - environment: - REQUESTED_REVISION: << parameters.revision >> - command: | - revision="${REQUESTED_REVISION:-$CIRCLE_SHA1}" - [[ "$revision" =~ ^[0-9a-f]{40}$ ]] || exit 1 - git init - git remote add origin https://github.com/BerriAI/litellm.git - for attempt in 1 2 3; do - git fetch --filter=blob:none origin "$revision" && git checkout --detach FETCH_HEAD && break - [[ $attempt -lt 3 ]] || exit 1 - sleep 5 - done - skip_if_unrelated_changes: - parameters: - category: - type: enum - enum: ["backend", "client"] - default: "backend" - steps: - - run: - name: "Skip job when no << parameters.category >>-relevant files changed" - command: bash .circleci/scripts/path_filter.sh << parameters.category >> - setup_google_dns: - steps: - - run: - name: "Configure Google DNS" - command: | - # Backup original resolv.conf - sudo cp /etc/resolv.conf /etc/resolv.conf.backup - # Add both local and Google DNS servers - echo "nameserver 127.0.0.11" | sudo tee /etc/resolv.conf - echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf - echo "nameserver 8.8.4.4" | sudo tee -a /etc/resolv.conf - wait_for_service: - description: "Poll a TCP or HTTP endpoint until it responds (replaces dockerize -wait)" - parameters: - url: - type: string - timeout: - type: string - default: "60" - steps: - - run: - name: "Wait for << parameters.url >>" - command: | - TIMEOUT=<< parameters.timeout >> - URL="<< parameters.url >>" - ELAPSED=0 - echo "Waiting up to ${TIMEOUT}s for ${URL} ..." - if echo "$URL" | grep -q '^tcp://'; then - HOST=$(echo "$URL" | sed 's|tcp://||' | cut -d: -f1) - PORT=$(echo "$URL" | sed 's|tcp://||' | cut -d: -f2) - while ! bash -c "echo > /dev/tcp/$HOST/$PORT" 2>/dev/null; do - sleep 2; ELAPSED=$((ELAPSED+2)) - if [ "$ELAPSED" -ge "$TIMEOUT" ]; then echo "Timed out"; exit 1; fi - done - else - while ! curl -sf --max-time 5 "$URL" > /dev/null 2>&1; do - sleep 2; ELAPSED=$((ELAPSED+2)) - if [ "$ELAPSED" -ge "$TIMEOUT" ]; then echo "Timed out"; exit 1; fi - done - fi - echo "Service ready after ${ELAPSED}s" - install_helm: - steps: - - run: - name: Install Helm v3.17.3 - command: | - curl -sSLf -o /tmp/helm.tar.gz \ - https://get.helm.sh/helm-v3.17.3-linux-amd64.tar.gz - echo "ee88b3c851ae6466a3de507f7be73fe94d54cbf2987cbaa3d1a3832ea331f2cd /tmp/helm.tar.gz" | sha256sum -c - - sudo tar -C /usr/local/bin --strip-components=1 -xzf /tmp/helm.tar.gz linux-amd64/helm - rm -f /tmp/helm.tar.gz - install_kind: - steps: - - run: - name: Install Kind v0.20.0 - command: | - curl -sSLf -o /tmp/kind \ - https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 - echo "513a7213d6d3332dd9ef27c24dab35e5ef10a04fa27274fe1c14d8a246493ded /tmp/kind" | sha256sum -c - - chmod +x /tmp/kind - sudo mv /tmp/kind /usr/local/bin/kind - install_uv: - description: "Install pinned uv (0.10.9) with checksum verification. Adds ~/.local/bin to PATH." - steps: - - run: - name: Install uv (pinned 0.10.9) - command: | - curl -LsSf -o /tmp/uv-install.sh https://astral.sh/uv/0.10.9/install.sh - echo "7fc46e39cb97290b57169c0c813a17970585ac519139f19006453c99b5f2f45f /tmp/uv-install.sh" | sha256sum -c - - env UV_NO_MODIFY_PATH=1 sh /tmp/uv-install.sh - rm -f /tmp/uv-install.sh - echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV" - export PATH="$HOME/.local/bin:$PATH" - install_node: - description: "Install the Node.js version pinned in ui/litellm-dashboard/.nvmrc (24.19.0, which bundles npm 11.17.0) with checksum verification, and prepend it to PATH. Run this on any executor whose image does not already ship that version, or `npm ci` in ui/litellm-dashboard fails EBADENGINE against the engines floor. Installs into /opt/node rather than over /usr/local on purpose: cimg/python:*-browsers ships its own node there, and unpacking the tarball on top of it leaves npm 11.17 files merged with the image's npm 11.9 tree, which reports the new version and then exits 1 on `npm ci` with no error text at all. Requires checkout, which the .nvmrc drift check reads." - steps: - - run: - name: Install Node.js 24.19.0 - command: | - NODE_VERSION="24.19.0" - NODE_TARBALL="node-v${NODE_VERSION}-linux-x64.tar.xz" - NODE_EXPECTED_SHA="14b342e71204f811bde6153be8e04b62aef63c236fef92b55f9c83154b409647" - NVMRC_VERSION="$(tr -d '[:space:]' < ui/litellm-dashboard/.nvmrc)" - if [ "$NVMRC_VERSION" != "$NODE_VERSION" ]; then - echo "install_node: ui/litellm-dashboard/.nvmrc pins ${NVMRC_VERSION} but this command pins ${NODE_VERSION}; update NODE_VERSION and NODE_EXPECTED_SHA together" >&2 - exit 1 - fi - curl -sSLf -o "/tmp/${NODE_TARBALL}" "https://nodejs.org/dist/v${NODE_VERSION}/${NODE_TARBALL}" - echo "${NODE_EXPECTED_SHA} /tmp/${NODE_TARBALL}" | sha256sum -c - - sudo mkdir -p /opt/node - sudo tar -xJf "/tmp/${NODE_TARBALL}" -C /opt/node --strip-components=1 - rm -f "/tmp/${NODE_TARBALL}" - echo 'export PATH="/opt/node/bin:$PATH"' >> "$BASH_ENV" - export PATH="/opt/node/bin:$PATH" - node --version - npm --version - install_rust: - description: "Install pinned rustup (1.28.2) and Rust toolchain (1.98.0) with checksum verification. Adds ~/.cargo/bin to PATH. Run this before any `uv sync` or `uv build` of the workspace: the root package builds litellm-rust through maturin, and on an image without cargo maturin fetches an unpinned rustup and a floating toolchain by itself. Also restores the dev-profile cargo cache that save_cargo_target writes on main, minus the workspace crates' fingerprints so those always rebuild from the checked-out source." - steps: - - run: - name: Install Rust (rustup 1.28.2, toolchain 1.98.0) - command: | - case "$(uname -m)" in - x86_64) - RUSTUP_TRIPLE=x86_64-unknown-linux-gnu - RUSTUP_SHA256=20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c - ;; - aarch64) - RUSTUP_TRIPLE=aarch64-unknown-linux-gnu - RUSTUP_SHA256=e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c - ;; - *) - echo "install_rust: unsupported architecture $(uname -m)" >&2 - exit 1 - ;; - esac - curl -sSLf --retry 3 --retry-all-errors --retry-max-time 120 --connect-timeout 15 --max-time 60 -o /tmp/rustup-init \ - "https://static.rust-lang.org/rustup/archive/1.28.2/${RUSTUP_TRIPLE}/rustup-init" - echo "${RUSTUP_SHA256} /tmp/rustup-init" | sha256sum -c - - chmod +x /tmp/rustup-init - /tmp/rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.98.0 - rm -f /tmp/rustup-init - echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> "$BASH_ENV" - echo 'export CARGO_INCREMENTAL=0' >> "$BASH_ENV" - export PATH="$HOME/.cargo/bin:$PATH" - rustc --version - cargo --version - { rustc -vV; cc --version; cat /etc/os-release; } > /tmp/cargo-build-env - - restore_cache: - keys: - - v1-cargo-dev-{{ checksum "/tmp/cargo-build-env" }}-{{ checksum "litellm-rust/Cargo.lock" }} - - v1-cargo-dev-{{ checksum "/tmp/cargo-build-env" }}- - - run: - name: Force a rebuild of the workspace crates restored from the cargo cache - command: rm -rf litellm-rust/target/debug/.fingerprint/litellm-* - save_cargo_target: - steps: - - when: - condition: - equal: [main, << pipeline.git.branch >>] - steps: - - save_cache: - key: v1-cargo-dev-{{ checksum "/tmp/cargo-build-env" }}-{{ checksum "litellm-rust/Cargo.lock" }} - paths: - - ~/.cargo/registry - - ~/project/litellm-rust/target/debug - start_postgres: - description: "Start a postgres-db container on port 5432 and wait until it accepts connections." - parameters: - db_name: - type: string - default: circle_test - image: - type: string - default: postgres:14@sha256:6a70deda415ec296f977890e11aba04a0db9f632a362e3fce45e845e3db74f26 - server_args: - type: string - default: "" - steps: - - run: - name: Start PostgreSQL - command: | - docker run -d \ - --name postgres-db \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_DB=<< parameters.db_name >> \ - -p 5432:5432 \ - << parameters.image >> << parameters.server_args >> - - wait_for_service: - url: tcp://localhost:5432 - timeout: "60" - start_redis: - description: "Start a redis container on port 6379 and wait until it accepts connections. Use this to isolate a job from the shared remote Redis so concurrent CI pipelines don't contend for pod locks or buffer keys." - steps: - - run: - name: Start Redis - command: | - docker run -d \ - --name redis-cache \ - -p 6379:6379 \ - redis:7-alpine@sha256:7aec734b2bb298a1d769fd8729f13b8514a41bf90fcdd1f38ec52267fbaa8ee6 - - wait_for_service: - url: tcp://localhost:6379 - timeout: "60" - install_codecov_cli: - steps: - - run: - name: Install Codecov CLI (pinned v11.3.1) - when: always - command: | - curl -sSLf -o /tmp/codecov https://cli.codecov.io/v11.3.1/linux/codecov - curl -sSLf -o /tmp/codecov.SHA256SUM https://cli.codecov.io/v11.3.1/linux/codecov.SHA256SUM - [ "$(cat /tmp/codecov.SHA256SUM)" = "ca1d64196d2d34771084afe76ea657d581bf628e31d993ff8e52ea09cc88a56d codecov" ] - (cd /tmp && sha256sum -c codecov.SHA256SUM) - chmod +x /tmp/codecov - mkdir -p "$HOME/.local/bin" - mv /tmp/codecov "$HOME/.local/bin/codecov" - start_openai_record_replay_proxy: - description: "Start the record/replay proxy (tests/_openai_record_replay_proxy.py) on host port 8090 and wait until healthy. Models whose api_base points here replay Redis cache hits. Cache misses call the live provider and store its response, so these legacy E2E jobs still require provider availability and may incur provider charges. The default upstream is OpenAI; a non-OpenAI model must point its api_base at /__recorder_upstream// so the recorder forwards there instead of defaulting to OpenAI. Run after uv deps are synced." - steps: - - run: - name: Start record/replay proxy - background: true - command: | - CASSETTE_REDIS_URL="$CASSETTE_REDIS_URL" \ - RECORDER_UPSTREAM_BASE_URL="https://api.openai.com" \ - uv run --no-sync python tests/_openai_record_replay_proxy.py --host 0.0.0.0 --port 8090 - - run: - name: Wait for record/replay proxy - command: | - for i in $(seq 1 30); do - if curl -sf http://localhost:8090/__recorder_health >/dev/null 2>&1; then - echo "record/replay proxy is up" - exit 0 - fi - sleep 1 - done - echo "record/replay proxy did not become ready" >&2 - exit 1 - start_fake_openai_endpoint: - description: "Start the canned OpenAI mock (tests/_fake_openai_endpoint_server.py) on host port 8190 and wait until healthy. Models whose api_base points here (via FAKE_OPENAI_API_BASE) get well-formed chat/text/embedding responses with realistic usage, so the E2E run neither pays for nor depends on the live provider. A request whose model is '429' returns HTTP 429 for rate-limit/cooldown tests. Run after uv deps are synced." - steps: - - run: - name: Start fake OpenAI endpoint - background: true - command: | - uv run --no-sync python tests/_fake_openai_endpoint_server.py --host 0.0.0.0 --port 8190 - - run: - name: Wait for fake OpenAI endpoint - command: | - for i in $(seq 1 30); do - if curl -sf http://localhost:8190/health >/dev/null 2>&1; then - echo "fake OpenAI endpoint is up" - exit 0 - fi - sleep 1 - done - echo "fake OpenAI endpoint did not become ready" >&2 - exit 1 - setup_litellm_enterprise_pip: - steps: - - run: - name: "Install local version of litellm-enterprise" - command: | - # litellm-enterprise is a uv workspace member and is already installed - # by the main `uv sync --all-groups --all-extras`. Do NOT run - # `uv sync --package litellm-enterprise` here — that overwrites the - # shared .venv and strips out dev/test deps (pytest, prisma, etc.). - uv run --no-sync python -c "import litellm_enterprise; print('litellm-enterprise OK:', litellm_enterprise.__file__)" - install_windows_toolchain: - steps: - - run: - name: Install Rust and uv - no_output_timeout: 30m - command: | - $rustupInit = Join-Path $env:TEMP "rustup-init.exe" - $rustupVersion = "1.28.2" - $rustupUrl = "https://static.rust-lang.org/rustup/archive/$rustupVersion/x86_64-pc-windows-msvc/rustup-init.exe" - Invoke-WebRequest -Uri $rustupUrl -OutFile $rustupInit - $rustupExpected = "88d8258dcf6ae4f7a80c7d1088e1f36fa7025a1cfd1343731b4ee6f385121fc0" - $rustupActual = (Get-FileHash -Path $rustupInit -Algorithm SHA256).Hash.ToLower() - if ($rustupActual -ne $rustupExpected) { - throw "rustup installer hash mismatch: expected $rustupExpected got $rustupActual" - } - & $rustupInit -y --profile minimal --default-toolchain 1.98.0 - if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE - } - Remove-Item $rustupInit - $cargoBin = Join-Path $HOME ".cargo\bin" - $env:Path = "$cargoBin;$env:Path" - rustc --version - cargo --version - $installer = Join-Path $env:TEMP "uv-install.ps1" - Invoke-WebRequest -Uri https://astral.sh/uv/0.10.9/install.ps1 -OutFile $installer - $expected = "d43ffff8d28e7d1e7d1831a212465f12b24a43c7f87f386e95e2a5915aee5d7d" - $actual = (Get-FileHash -Path $installer -Algorithm SHA256).Hash.ToLower() - if ($actual -ne $expected) { - throw "uv installer hash mismatch: expected $expected got $actual" - } - & $installer - Remove-Item $installer - $uvBin = Join-Path $HOME ".local\bin" - $env:Path = "$uvBin;$env:Path" - if (!(Test-Path $PROFILE)) { - New-Item -ItemType File -Force -Path $PROFILE | Out-Null - } - if (-not (Select-String -Path $PROFILE -SimpleMatch $uvBin -Quiet)) { - Add-Content -Path $PROFILE -Value "`$env:Path = `"$uvBin;`$env:Path`"" - } - if (-not (Select-String -Path $PROFILE -SimpleMatch $cargoBin -Quiet)) { - Add-Content -Path $PROFILE -Value "`$env:Path = `"$cargoBin;`$env:Path`"" - } - setup_litellm_test_deps: - parameters: - checkout: - type: boolean - default: true - steps: - - when: - condition: << parameters.checkout >> - steps: - - checkout_over_https - - setup_google_dns - - install_uv - - install_rust - - restore_cache: - keys: - - v3-integration-uv-cache-{{ checksum "uv.lock" }} - - run: - name: Install Dependencies - command: | - uv sync --frozen --all-groups --all-extras --python 3.12 - - setup_litellm_enterprise_pip - - save_cache: - paths: - - ~/.cache/uv - key: v3-integration-uv-cache-{{ checksum "uv.lock" }} - - save_cargo_target - -jobs: - windows_release_wheel: - executor: - name: win/default - shell: powershell.exe - size: xlarge - working_directory: ~/project - environment: - UV_PYTHON: "3.11" - CARGO_HTTP_MULTIPLEXING: "false" - CARGO_NET_RETRY: "5" - steps: - - checkout_over_https: - shell: bash.exe - - run: - name: Skip job when no windows-release-relevant files changed - shell: bash.exe - command: bash .circleci/scripts/path_filter.sh windows-release - - run: - name: Install Python 3.11.9 from python.org - no_output_timeout: 6m - command: | - $ProgressPreference = "SilentlyContinue" - $installer = Join-Path $env:TEMP "python-3.11.9-amd64.exe" - Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe -OutFile $installer -TimeoutSec 120 - $expected = "5ee42c4eee1e6b4464bb23722f90b45303f79442df63083f05322f1785f5fdde" - $actual = (Get-FileHash -Path $installer -Algorithm SHA256).Hash.ToLower() - if ($actual -ne $expected) { - throw "Python installer hash mismatch: expected $expected got $actual" - } - $arguments = "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0 Include_doc=0 Include_launcher=0 TargetDir=C:\Python311" - $process = Start-Process -FilePath $installer -ArgumentList $arguments -PassThru - if (-not $process.WaitForExit(300000)) { - $process.Kill() - throw "Python installer did not finish within 5 minutes" - } - if ($process.ExitCode -ne 0) { - throw "Python installer exited with $($process.ExitCode)" - } - Remove-Item $installer - & C:\Python311\python.exe --version - - install_windows_toolchain - - run: - name: Record the Rust build environment for the release cargo cache key - command: | - & "$HOME\.cargo\bin\rustc.exe" -vV | Out-File -Encoding ascii .cargo-build-env - - restore_cache: - keys: - - v1-cargo-release-windows-{{ checksum ".cargo-build-env" }}-{{ checksum "litellm-rust/Cargo.lock" }} - - v1-cargo-release-windows-{{ checksum ".cargo-build-env" }}- - - run: - name: Force a rebuild of the workspace crates restored from the cargo cache - command: | - $fingerprints = "litellm-rust/target/release/.fingerprint" - if (Test-Path $fingerprints) { - Get-ChildItem -Path $fingerprints -Filter "litellm-*" | Remove-Item -Recurse -Force - } - - run: - name: Build the release wheel and install it under a worst-case MAX_PATH prefix - no_output_timeout: 30m - environment: - UV_HTTP_TIMEOUT: "300" - command: | - $env:Path = "C:\Python311;C:\Python311\Scripts;$HOME\.cargo\bin;$HOME\.local\bin;$env:Path" - uv build --wheel --out-dir dist - if ($LASTEXITCODE -ne 0) { - exit $LASTEXITCODE - } - python tests/windows_tests/check_windows_wheel_install.py - - when: - condition: - equal: [main, << pipeline.git.branch >>] - steps: - - save_cache: - key: v1-cargo-release-windows-{{ checksum ".cargo-build-env" }}-{{ checksum "litellm-rust/Cargo.lock" }} - paths: - - ~/.cargo/registry - - ~/project/litellm-rust/target/release - - base_sdk_install: - docker: - - image: cimg/python:3.12@sha256:9c796c23c84e84a66a964acb508d39dc5433c81a47e07efd56dccbbc2427e07c - auth: - username: ${DOCKERHUB_USERNAME} - password: ${DOCKERHUB_PASSWORD} - working_directory: ~/project - steps: - - checkout_over_https - - setup_google_dns - - install_uv - - install_rust - - run: - name: Build the wheel - no_output_timeout: 30m - environment: - UV_HTTP_TIMEOUT: "300" - command: | - uv build --wheel --out-dir dist - - run: - name: Install the wheel with no extras and smoke-check it - environment: - UV_HTTP_TIMEOUT: "300" - command: | - uv venv /tmp/base-sdk --python 3.12 - VIRTUAL_ENV=/tmp/base-sdk uv pip install dist/*.whl - /tmp/base-sdk/bin/python tests/base_sdk_tests/check_base_sdk_install.py - - run: - name: Guard against MAX_PATH-busting packaged wheel paths - command: | - python3 tests/windows_tests/check_windows_wheel_install.py --lengths-only - - helm_chart_testing: - machine: - image: ubuntu-2204:2024.04.1 # Use machine executor instead of docker - resource_class: medium - working_directory: ~/project - - steps: - - checkout_over_https - - skip_if_unrelated_changes - - attach_workspace: - at: ~/project - - setup_google_dns - - install_helm - - install_kind - - # Install kubectl (pinned version with hardcoded checksum) - - run: - name: Install kubectl v1.31.4 - command: | - curl -sSLf -o /tmp/kubectl \ - https://dl.k8s.io/release/v1.31.4/bin/linux/amd64/kubectl - echo "298e19e9c6c17199011404278f0ff8168a7eca4217edad9097af577023a5620f /tmp/kubectl" | sha256sum -c - - chmod +x /tmp/kubectl - sudo mv /tmp/kubectl /usr/local/bin/ - - # Create kind cluster - - run: - name: Create Kind Cluster - command: | - kind create cluster --name litellm-test - - - run: - name: Load Docker Database Image for helm tests - command: | - zstd -d litellm-docker-database.tar.zst --stdout | docker load - IMAGE_TAG=${CIRCLE_SHA1:-ci} - docker tag litellm-docker-database:ci litellm-ci:${IMAGE_TAG} - - - run: - name: Load Docker image into Kind - command: | - IMAGE_TAG=${CIRCLE_SHA1:-ci} - kind load docker-image litellm-ci:${IMAGE_TAG} --name litellm-test - - - run: - name: Run helm lint - command: | - helm lint ./helm/litellm -f ./helm/litellm/ci/test-values.yaml - - - run: - name: Start PostgreSQL for the chart - command: | - kubectl apply -f ./helm/litellm/ci/postgres.yaml - kubectl rollout status deployment/litellm-ci-postgres --timeout=3m - - - run: - name: Run helm tests - command: | - IMAGE_TAG=${CIRCLE_SHA1:-ci} - helm install litellm ./helm/litellm -f ./helm/litellm/ci/test-values.yaml \ - --set image.repository=litellm-ci \ - --set image.tag=${IMAGE_TAG} \ - --set image.pullPolicy=Never \ - --wait --wait-for-jobs --timeout 10m || { - kubectl get pods -o wide - kubectl describe pods -l app.kubernetes.io/instance=litellm - kubectl logs -l app.kubernetes.io/component=proxy --tail=200 || true - kubectl logs -l app.kubernetes.io/component=migrations --tail=200 || true - exit 1 - } - - echo "Printing proxy pod logs..." - kubectl logs -l app.kubernetes.io/component=proxy --tail=200 - - helm test litellm --logs - - # Cleanup - - run: - name: Cleanup - command: | - kind delete cluster --name litellm-test - when: always # This ensures cleanup runs even if previous steps fail - - db_migration_disable_update_check: - machine: - image: ubuntu-2204:2024.04.1 - resource_class: medium - working_directory: ~/project - steps: - - checkout_over_https - - run: - name: Generate LiteLLM master key - command: | - key="$(openssl rand -hex 16)" - printf 'export LITELLM_MASTER_KEY=sk-%s\n' "$key" >> "$BASH_ENV" - - skip_if_unrelated_changes - - setup_google_dns - - install_uv - - install_rust - - run: - name: Install Dependencies - command: | - uv sync --frozen --all-groups --all-extras --python 3.12 - - start_fake_openai_endpoint - - start_postgres: - db_name: litellm_test - - attach_workspace: - at: ~/project - - run: - name: Load Docker Database Image - command: | - zstd -d litellm-docker-database.tar.zst --stdout | docker load - docker images | grep litellm-docker-database - - run: - name: Seed database with real schema - command: | - docker run -d \ - -p 4001:4000 \ - -e DATABASE_URL="postgresql://postgres:postgres@host.docker.internal:5432/litellm_test" \ - -e LITELLM_MASTER_KEY="$LITELLM_MASTER_KEY" \ - --name schema-seed \ - --add-host=host.docker.internal:host-gateway \ - -v $(pwd)/litellm/proxy/example_config_yaml/simple_config.yaml:/app/config.yaml \ - litellm-docker-database:ci \ - --config /app/config.yaml \ - --port 4000 \ - --use_prisma_db_push - - wait_for_service: - url: http://localhost:4001 - timeout: "300" - - run: - name: Stop schema seed container - command: docker stop schema-seed && docker rm schema-seed - - run: - name: Run Docker container with bad schema and disabled updates - command: | - docker run -d \ - -p 4000:4000 \ - -e LITELLM_DANGEROUSLY_PERMIT_WEAK_OR_UNSET_MASTER_KEY=true \ - -e DATABASE_URL="postgresql://postgres:postgres@host.docker.internal:5432/litellm_test" \ - -e DEFAULT_NUM_WORKERS_LITELLM_PROXY=1 \ - -e DISABLE_SCHEMA_UPDATE="True" \ - -e FAKE_OPENAI_API_BASE=http://host.docker.internal:8190 \ - --name my-app \ - --add-host=host.docker.internal:host-gateway \ - -v $(pwd)/litellm/proxy/example_config_yaml/bad_schema.prisma:/app/schema.prisma \ - -v $(pwd)/litellm/proxy/example_config_yaml/bad_schema.prisma:/app/litellm/proxy/schema.prisma \ - -v $(pwd)/litellm/proxy/example_config_yaml/disable_schema_update.yaml:/app/config.yaml \ - litellm-docker-database:ci \ - --config /app/config.yaml \ - --port 4000 - - wait_for_service: - url: http://localhost:4000 - timeout: "60" - - run: - name: Check container logs for expected message - command: | - echo "=== Printing Full Container Startup Logs ===" - LOG_OUTPUT="$(docker logs my-app 2>&1)" - printf '%s\n' "$LOG_OUTPUT" - echo "=== End of Full Container Startup Logs ===" - - if printf '%s\n' "$LOG_OUTPUT" | grep -q "prisma schema out of sync with db. Consider running these sql_commands to sync the two"; then - echo "Expected message found in logs. Test passed." - else - echo "Expected message not found in logs. Test failed." - exit 1 - fi - - run: - name: Run Basic Proxy Startup Tests (Health Readiness and Chat Completion) - command: | - mkdir -p test-results - TEST_FILES=$(circleci tests glob "tests/integration/configuration/test_basic_proxy_startup.py") - echo "$TEST_FILES" | circleci tests run \ - --verbose \ - --command="tr ' ' '\\n' | awk '/\\.py/ {print; next} {sub(/\\.[A-Z][^.]*$/, \"\"); gsub(/\\./, \"/\"); print \$0 \".py\"}' | xargs uv run --no-sync python -m pytest --tb=short \ - -v \ - --junitxml=test-results/junit-2.xml \ - --durations=5" - no_output_timeout: 15m - - store_test_results: - path: test-results - - proxy_logging_guardrails_model_info_tests: - machine: - image: ubuntu-2204:2024.04.1 - resource_class: large - working_directory: ~/project - steps: - - checkout_over_https - - run: - name: Generate LiteLLM master key - command: | - key="$(openssl rand -hex 16)" - printf 'export LITELLM_MASTER_KEY=sk-%s\n' "$key" >> "$BASH_ENV" - - skip_if_unrelated_changes - - setup_google_dns - - install_uv - - install_rust - - run: - name: Install Dependencies - command: | - uv sync --frozen --all-groups --all-extras --python 3.12 - - start_postgres - - attach_workspace: - at: ~/project - - run: - name: Load Docker Database Image - command: | - zstd -d litellm-docker-database.tar.zst --stdout | docker load - docker images | grep litellm-docker-database - - start_openai_record_replay_proxy - - start_fake_openai_endpoint - # Second Docker Container Run with Different Config - # NOTE: We intentionally pass a "bad" license here. We need to ensure proxy starts and serves request even with bad license - - run: - name: Run Second Docker container - command: | - docker run -d \ - -p 4000:4000 \ - -e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/circle_test \ - -e REDIS_HOST=$REDIS_HOST \ - -e REDIS_PASSWORD=$REDIS_PASSWORD \ - -e REDIS_PORT=$REDIS_PORT \ - -e LITELLM_MASTER_KEY="$LITELLM_MASTER_KEY" \ - -e OPENAI_API_KEY=$OPENAI_API_KEY \ - -e FAKE_OPENAI_API_BASE=http://host.docker.internal:8190 \ - -e LITELLM_LICENSE="bad-license" \ - -e LITELLM_LOG=ERROR \ - --add-host host.docker.internal:host-gateway \ - --name my-app-3 \ - -v $(pwd)/litellm/proxy/example_config_yaml/enterprise_config.yaml:/app/config.yaml \ - litellm-docker-database:ci \ - --config /app/config.yaml \ - --port 4000 - - - run: - name: Start outputting logs for second container - command: docker logs -f my-app-3 - background: true - - - wait_for_service: - url: http://localhost:4000 - timeout: "300" - - - run: - name: Run second round of tests - command: | - mkdir -p test-results - TEST_FILES=$(circleci tests glob "tests/integration/configuration/test_basic_proxy_startup.py") - echo "$TEST_FILES" | circleci tests run \ - --verbose \ - --command="tr ' ' '\\n' | awk '/\\.py/ {print; next} {sub(/\\.[A-Z][^.]*$/, \"\"); gsub(/\\./, \"/\"); print \$0 \".py\"}' | xargs uv run --no-sync python -m pytest --tb=short \ - -v \ - --junitxml=test-results/junit-2.xml \ - --durations=5" - no_output_timeout: 15m - - # Store test results - - store_test_results: - path: test-results - e2e_ui_build: - docker: - - image: cimg/python:3.12-browsers@sha256:b432899af01c9a311bf74f4f22e9ada2e5306d4b1b4383f8d29e1228a5844ef2 - auth: - username: ${DOCKERHUB_USERNAME} - password: ${DOCKERHUB_PASSWORD} - resource_class: large - working_directory: ~/project - steps: - - checkout_over_https - - skip_if_unrelated_changes: - category: client - - setup_google_dns - - install_node - - restore_cache: - keys: - - ui-dashboard-node-deps-v1-{{ checksum "ui/litellm-dashboard/package-lock.json" }} - - run: - name: Install dashboard dependencies - command: | - cd ui/litellm-dashboard - npm ci - - save_cache: - key: ui-dashboard-node-deps-v1-{{ checksum "ui/litellm-dashboard/package-lock.json" }} - paths: - - ui/litellm-dashboard/node_modules - - run: - name: Build UI bundle - command: | - cd ui/litellm-dashboard - npm run build - mkdir -p ../../ui-bundle - mv out ../../ui-bundle/out - find ../../ui-bundle/out -name '*.html' ! -name 'index.html' | while read -r f; do - d="${f%.html}"; mkdir -p "$d"; mv "$f" "$d/index.html" - done - - persist_to_workspace: - root: ~/project - paths: - - ui-bundle/out - - e2e_ui_testing: - docker: - - image: cimg/python:3.12-browsers@sha256:b432899af01c9a311bf74f4f22e9ada2e5306d4b1b4383f8d29e1228a5844ef2 - auth: - username: ${DOCKERHUB_USERNAME} - password: ${DOCKERHUB_PASSWORD} - - image: cimg/postgres:16.0@sha256:b125148bc76e8e8eee5eb3ad6020a3a14110a14e8192f1c645128afebe2e2f84 - environment: - POSTGRES_USER: e2euser - POSTGRES_PASSWORD: e2epassword - POSTGRES_DB: litellm_e2e - resource_class: xlarge - working_directory: ~/project - environment: - DATABASE_URL: "postgresql://e2euser:e2epassword@localhost:5432/litellm_e2e" - CI: "true" - # Boot the proxy with an external logout URL so proxyLogoutUrl.spec.ts can - # assert the redirect. Set at job level so both the proxy boot step and the - # Playwright step (whose skip guard reads this) see the same value. Safe for - # the rest of the suite: nothing else performs a logout. - PROXY_LOGOUT_URL: "https://www.example.com" - steps: - - checkout_over_https - - run: - name: Generate LiteLLM master key - command: | - key="$(openssl rand -hex 16)" - printf 'export LITELLM_MASTER_KEY=sk-%s\n' "$key" >> "$BASH_ENV" - - skip_if_unrelated_changes: - category: client - - attach_workspace: - at: ~/project - - setup_google_dns - - install_node - - install_uv - - install_rust - - restore_cache: - keys: - - v1-uv-cache-{{ checksum "uv.lock" }} - - run: - name: Install Python dependencies - command: | - uv sync --frozen --all-groups --all-extras --python 3.12 - uv run --no-sync python -m prisma generate --schema litellm/proxy/schema.prisma - - save_cache: - key: v1-uv-cache-{{ checksum "uv.lock" }} - paths: - - ~/.cache/uv - - restore_cache: - keys: - - ui-playwright-node-deps-v1-{{ checksum "tests/e2e/ui/package-lock.json" }} - - run: - name: Install Node dependencies and Playwright - # The cimg/python:3.12-browsers image already ships the Chromium system - # libraries Playwright needs (libnss3, libatk-bridge2.0-0, libcups2, etc.). - # `--with-deps` triggers a redundant apt-get update + install that adds - # 5-10 minutes to the job and frequently stalls on flaky Ubuntu mirrors, - # so we install just the browser binary. - command: | - cd tests/e2e/ui - npm ci - npx playwright install chromium - - save_cache: - key: ui-playwright-node-deps-v1-{{ checksum "tests/e2e/ui/package-lock.json" }} - paths: - - tests/e2e/ui/node_modules - - ~/.cache/ms-playwright - - run: - name: Use built UI bundle - command: | - rm -rf litellm/proxy/_experimental/out - cp -r ui-bundle/out litellm/proxy/_experimental/out - - wait_for_service: - url: tcp://localhost:5432 - timeout: "30" - - run: - name: Push Prisma schema - command: uv run --no-sync python -m prisma db push --schema litellm/proxy/schema.prisma --accept-data-loss - - run: - name: Seed database - command: | - PGPASSWORD=e2epassword psql -h localhost -p 5432 -U e2euser -d litellm_e2e \ - -f tests/e2e/ui/fixtures/seed.sql - - run: - name: Start mock LLM server - command: uv run --no-sync python tests/e2e/ui/fixtures/mock_llm_server/server.py - background: true - - run: - name: Start mock Presidio server - command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py - background: true - - run: - name: Wait for mock Presidio server - command: | - for i in $(seq 1 30); do - if curl -sf http://127.0.0.1:8091/health >/dev/null 2>&1; then exit 0; fi - sleep 1 - done - echo "Mock Presidio server never answered /health on port 8091" >&2 - exit 1 - - run: - name: Start LiteLLM proxy - environment: - MOCK_LLM_URL: "http://127.0.0.1:8090/v1" - DISABLE_SCHEMA_UPDATE: "true" - SERVER_ROOT_PATH: "" - # PROXY_LOGOUT_URL is inherited from the job-level environment so the - # proxy and proxyLogoutUrl.spec.ts agree on the logout target. - # LITELLM_LICENSE is forwarded from the project env so premium-gated - # UI flows can be exercised. license.spec.ts asserts the resulting - # JWT carries premium_user=true; if it ever stops being passed, that - # test fails loudly rather than silently regressing premium coverage. - command: | - LITELLM_LICENSE="$LITELLM_LICENSE" \ - uv run --no-sync python -m litellm.proxy.proxy_cli \ - --config tests/e2e/ui/fixtures/config.yml \ - --port 4000 - background: true - - run: - name: Wait for proxy to be ready - command: | - for i in $(seq 1 60); do - HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:4000/health -H "Authorization: Bearer $LITELLM_MASTER_KEY" 2>/dev/null || true) - if [ "$HTTP_CODE" = "200" ]; then - echo "Proxy is ready" - exit 0 - fi - sleep 2 - done - echo "Proxy failed to start" - exit 1 - - run: - name: Run Playwright E2E tests - # Forward LITELLM_LICENSE so license.spec.ts can detect that the - # proxy was launched with a license and assert premium_user=true. - command: | - cd tests/e2e/ui - LITELLM_LICENSE="$LITELLM_LICENSE" \ - npx playwright test --config playwright.config.ts --workers=3 --retries=0 - no_output_timeout: 10m - - store_artifacts: - path: tests/e2e/ui/test-results - destination: e2e-test-results - - store_artifacts: - path: tests/e2e/ui/playwright-report - destination: e2e-playwright-report - - e2e_ui_testing_server_root_path: - docker: - - image: cimg/python:3.12-browsers@sha256:b432899af01c9a311bf74f4f22e9ada2e5306d4b1b4383f8d29e1228a5844ef2 - auth: - username: ${DOCKERHUB_USERNAME} - password: ${DOCKERHUB_PASSWORD} - - image: cimg/postgres:16.0@sha256:b125148bc76e8e8eee5eb3ad6020a3a14110a14e8192f1c645128afebe2e2f84 - environment: - POSTGRES_USER: e2euser - POSTGRES_PASSWORD: e2epassword - POSTGRES_DB: litellm_e2e - resource_class: large - working_directory: ~/project - environment: - DATABASE_URL: "postgresql://e2euser:e2epassword@localhost:5432/litellm_e2e" - CI: "true" - # The whole job exercises the proxy mounted under a prefix. SERVER_ROOT_PATH - # is read both by the proxy at boot (to rewrite the built UI bundle in place) - # and by migration.serverRootPath.config.ts, which refuses to run without it. - SERVER_ROOT_PATH: "/litellm" - steps: - - checkout_over_https - - run: - name: Generate LiteLLM master key - command: | - key="$(openssl rand -hex 16)" - printf 'export LITELLM_MASTER_KEY=sk-%s\n' "$key" >> "$BASH_ENV" - - skip_if_unrelated_changes: - category: client - - attach_workspace: - at: ~/project - - setup_google_dns - - install_node - - install_uv - - install_rust - - restore_cache: - keys: - - v1-uv-cache-{{ checksum "uv.lock" }} - - run: - name: Install Python dependencies - command: | - uv sync --frozen --all-groups --all-extras --python 3.12 - uv run --no-sync python -m prisma generate --schema litellm/proxy/schema.prisma - - save_cache: - key: v1-uv-cache-{{ checksum "uv.lock" }} - paths: - - ~/.cache/uv - - restore_cache: - keys: - - ui-playwright-node-deps-v1-{{ checksum "tests/e2e/ui/package-lock.json" }} - - run: - name: Install Node dependencies and Playwright - command: | - cd tests/e2e/ui - npm ci - npx playwright install chromium - - save_cache: - key: ui-playwright-node-deps-v1-{{ checksum "tests/e2e/ui/package-lock.json" }} - paths: - - tests/e2e/ui/node_modules - - ~/.cache/ms-playwright - - run: - name: Use built UI bundle - command: | - rm -rf litellm/proxy/_experimental/out - cp -r ui-bundle/out litellm/proxy/_experimental/out - - wait_for_service: - url: tcp://localhost:5432 - timeout: "30" - - run: - name: Push Prisma schema - command: uv run --no-sync python -m prisma db push --schema litellm/proxy/schema.prisma --accept-data-loss - - run: - name: Seed database - command: | - PGPASSWORD=e2epassword psql -h localhost -p 5432 -U e2euser -d litellm_e2e \ - -f tests/e2e/ui/fixtures/seed.sql - - run: - name: Start mock LLM server - command: uv run --no-sync python tests/e2e/ui/fixtures/mock_llm_server/server.py - background: true - - run: - name: Start mock Presidio server - command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py - background: true - - run: - name: Wait for mock Presidio server - command: | - for i in $(seq 1 30); do - if curl -sf http://127.0.0.1:8091/health >/dev/null 2>&1; then exit 0; fi - sleep 1 - done - echo "Mock Presidio server never answered /health on port 8091" >&2 - exit 1 - - run: - name: Start LiteLLM proxy under a server root path - environment: - MOCK_LLM_URL: "http://127.0.0.1:8090/v1" - DISABLE_SCHEMA_UPDATE: "true" - # Output flows to this step's own log, so a boot crash is visible here - # rather than swallowed by a downstream readiness probe. - command: | - LITELLM_LICENSE="$LITELLM_LICENSE" \ - uv run --no-sync python -m litellm.proxy.proxy_cli \ - --config tests/e2e/ui/fixtures/config.yml \ - --port 4000 - background: true - - run: - name: Wait for prefixed proxy to be ready - command: | - for i in $(seq 1 60); do - HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://127.0.0.1:4000/litellm/health 2>/dev/null || true) - if [ "$HTTP_CODE" = "200" ]; then - echo "Prefixed proxy is ready" - exit 0 - fi - sleep 2 - done - echo "Prefixed proxy failed to start; see the 'Start LiteLLM proxy under a server root path' step for the boot log" - exit 1 - - run: - name: Run migration smoke under SERVER_ROOT_PATH - command: | - cd tests/e2e/ui - LITELLM_LICENSE="$LITELLM_LICENSE" \ - npx playwright test --config migration.serverRootPath.config.ts - no_output_timeout: 10m - - store_artifacts: - path: tests/e2e/ui/test-results - destination: e2e-server-root-path-test-results - - store_artifacts: - path: tests/e2e/ui/playwright-report - destination: e2e-server-root-path-playwright-report - - build_docker_database_image: - parameters: - migration_qualification: - type: boolean - default: false - machine: - image: ubuntu-2204:2024.04.1 - resource_class: large - working_directory: ~/project - steps: - - when: - condition: << parameters.migration_qualification >> - steps: - - checkout_over_https: - revision: << pipeline.parameters.migration_source_sha >> - - unless: - condition: << parameters.migration_qualification >> - steps: - - checkout_over_https - - skip_if_unrelated_changes - - - run: - name: Build Docker image - environment: - MIGRATION_CANDIDATE_IMAGE: << pipeline.parameters.migration_candidate_image >> - command: | - if [ -n "$MIGRATION_CANDIDATE_IMAGE" ]; then - [[ "$MIGRATION_CANDIDATE_IMAGE" =~ ^ghcr.io/berriai/[a-z0-9._/-]+@sha256:[0-9a-f]{64}$ ]] || exit 1 - docker pull "$MIGRATION_CANDIDATE_IMAGE" - docker tag "$MIGRATION_CANDIDATE_IMAGE" litellm-docker-database:ci - else - docker build \ - --label org.opencontainers.image.revision="$(git rev-parse HEAD)" \ - -t litellm-docker-database:ci \ - -f Dockerfile . - fi - python3 .circleci/scripts/run_migration_tests.py record-image - - - run: - name: Save Docker image to workspace root - command: | - docker save litellm-docker-database:ci | zstd -1 -T0 > litellm-docker-database.tar.zst - - - persist_to_workspace: - root: . - paths: - - litellm-docker-database.tar.zst - - migration-image.json - - migration_startup_tests: - parameters: - suite: - type: enum - enum: [startup, recovery, legacy, upgrade, shaped] - baseline: - type: boolean - default: false - machine: - image: ubuntu-2204:2024.04.1 - resource_class: large - working_directory: ~/project - environment: - LITELLM_MIGRATION_TESTS: "1" - LITELLM_MIGRATION_TEST_IMAGE: litellm-docker-database:ci - LITELLM_MIGRATION_BASELINE_IMAGE: << pipeline.parameters.migration_baseline_image >> - MIGRATION_TEST_ADMIN_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres - MIGRATION_TEST_CONTAINER_ADMIN_URL: postgresql://postgres:postgres@host.docker.internal:5432/postgres - MIGRATION_TEST_OUTPUT: /tmp/migration-results - PYTHONPATH: tests/e2e - steps: - - checkout_over_https: - revision: << pipeline.parameters.migration_source_sha >> - - run: - name: Generate LiteLLM master key - command: | - key="$(openssl rand -hex 16)" - printf 'export LITELLM_MASTER_KEY=sk-%s\n' "$key" >> "$BASH_ENV" - - install_uv - - install_rust - - restore_cache: - keys: - - v1-uv-cache-{{ checksum "uv.lock" }} - - run: - name: Install test dependencies - command: uv sync --frozen --all-groups --all-extras --python 3.12 - - attach_workspace: - at: ~/project - - run: - name: Load the shared candidate and start PostgreSQL - command: | - zstd -d litellm-docker-database.tar.zst --stdout | docker load - docker run -d --name migration-postgres \ - -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres \ - -p 5432:5432 \ - postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - - wait_for_service: - url: tcp://localhost:5432 - timeout: "60" - - when: - condition: << parameters.baseline >> - steps: - - run: - name: Pull the baseline release the upgrade starts from - environment: - BASELINE_IMAGE: << pipeline.parameters.migration_baseline_image >> - command: | - [[ "$BASELINE_IMAGE" =~ ^ghcr.io/berriai/[a-z0-9._/-]+(@sha256:[0-9a-f]{64}|:v[0-9][0-9a-z.-]*)$ ]] || exit 1 - docker pull "$BASELINE_IMAGE" - - run: - name: Run migration startup regressions - environment: - MIGRATION_TEST_SUITE: << parameters.suite >> - MIGRATION_CANDIDATE_IMAGE: << pipeline.parameters.migration_candidate_image >> - command: | - mkdir -p /tmp/migration-results - uv run --no-sync python .circleci/scripts/run_migration_tests.py - no_output_timeout: 15m - - store_test_results: - path: /tmp/migration-results/junit - - run: - name: Package migration diagnostics - when: always - command: | - mkdir -p /tmp/migration-artifacts - if [ -d /tmp/migration-results ]; then - tar -czf /tmp/migration-artifacts/diagnostics.tar.gz -C /tmp/migration-results . - if [ -f /tmp/migration-results/verdict.json ]; then - cp /tmp/migration-results/verdict.json /tmp/migration-artifacts/verdict.json - fi - fi - - store_artifacts: - path: /tmp/migration-artifacts - destination: migration-results - - run: - name: Remove migration test containers - when: always - command: | - docker ps -aq --filter label=litellm-migration-test=true | xargs -r docker rm -f - docker rm -f migration-postgres || true - - test_bad_database_url: - machine: - image: ubuntu-2204:2024.04.1 - resource_class: medium - working_directory: ~/project - steps: - - checkout_over_https - - skip_if_unrelated_changes - - attach_workspace: - at: ~/project - - setup_google_dns - - start_postgres - - run: - name: Load Docker Database Image - command: | - zstd -d litellm-docker-database.tar.zst --stdout | docker load - docker tag litellm-docker-database:ci myapp:latest - - run: - name: Run Docker container with bad DATABASE_URL - command: | - set +e - docker run --name my-app \ - -p 4000:4000 \ - -e LITELLM_DANGEROUSLY_PERMIT_WEAK_OR_UNSET_MASTER_KEY=true \ - -e DEFAULT_NUM_WORKERS_LITELLM_PROXY=1 \ - -e DATABASE_URL="postgresql://wrong:wrong@wrong:5432/wrong" \ - myapp:latest \ - --port 4000 > docker_output.log 2>&1 - echo "$?" > docker_exit_code - set -e - - run: - name: Display Docker logs - command: cat docker_output.log - - run: - name: Proxy must refuse to serve on an unreachable database - command: | - fail() { echo "FAILED: $1"; cat docker_output.log; exit 1; } - exit_code="$(cat docker_exit_code)" - [ "$exit_code" -ne 0 ] || fail "proxy exited 0 with an unreachable database" - grep -q "P1001" docker_output.log || fail "log does not name the unreachable database server" - ! grep -q "Application startup complete" docker_output.log || fail "proxy reached serving state" - ! docker exec my-app true 2>/dev/null || fail "container is still running" - echo "Proxy refused to serve (exit $exit_code) and never reached startup. Test passed." - - integration_contracts: - parameters: - suite: - type: string - mode: - type: enum - enum: [standard, replica] - default: standard - parallelism: - type: integer - default: 1 - resource_class: - type: enum - enum: [large, xlarge] - default: large - machine: - image: ubuntu-2204:2024.04.1 - resource_class: << parameters.resource_class >> - working_directory: ~/project - parallelism: << parameters.parallelism >> - steps: - - setup_litellm_test_deps - - when: - condition: - equal: [browser, << parameters.suite >>] - steps: - - install_node - - restore_cache: - keys: - - integration-ui-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }} - - run: - name: Install locked browser dependencies - command: | - cd ui/litellm-dashboard - npm ci - cd ../../tests/e2e/ui - npm ci - sudo env PATH="$PATH" DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l \ - timeout --signal=TERM --kill-after=20s 6m node node_modules/@playwright/test/cli.js install-deps chromium - timeout --signal=TERM --kill-after=20s 3m node node_modules/@playwright/test/cli.js install chromium - - save_cache: - key: integration-ui-v3-{{ checksum "ui/litellm-dashboard/package-lock.json" }}-{{ checksum "tests/e2e/ui/package-lock.json" }} - paths: - - ~/.npm - - ~/.cache/ms-playwright - - run: - name: Build the candidate dashboard - command: cd ui/litellm-dashboard && NEXT_TELEMETRY_DISABLED=1 npm run build - - when: - condition: - equal: [mcp, << parameters.suite >>] - steps: - - run: - name: Install MCP SDK1 peer - command: | - uv venv --python 3.12 .venv-mcp-peer - uv pip install --no-config --exclude-newer "3 days" --python .venv-mcp-peer 'mcp==1.28.1' 'langchain-mcp-adapters==0.2.1' - echo "export MCP_TEST_PEER_PYTHON=$PWD/.venv-mcp-peer/bin/python" >> "$BASH_ENV" - - when: - condition: - equal: [sdk, << parameters.suite >>] - steps: - - run: - name: Install redis-server 7.2.16 - command: | - mkdir -p /tmp/redis-bin - cid="$(docker create redis:7.2.16@sha256:0637954999d01b7c9ce9167db2da50656e2590d3b884f1c600c5f63bb6e6773c)" - docker cp "${cid}:/usr/local/bin/redis-server" /tmp/redis-bin/redis-server - docker rm "$cid" - /tmp/redis-bin/redis-server --version | grep -q 'v=7.2.16' - echo 'export PATH="/tmp/redis-bin:$PATH"' >> "$BASH_ENV" - - start_postgres: - image: postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - server_args: "-c max_connections=300 -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c pg_stat_statements.max=20000" - - start_redis - - run: - name: Run owned integration contracts - command: bash .circleci/scripts/run_integration.sh << parameters.suite >> << parameters.mode >> - no_output_timeout: 15m - - run: - name: Stop owned database and Redis - when: always - command: | - mkdir -p test-results/services-<< parameters.suite >>-<< parameters.mode >> - docker logs postgres-db > test-results/services-<< parameters.suite >>-<< parameters.mode >>/postgres.log 2>&1 || true - docker logs redis-cache > test-results/services-<< parameters.suite >>-<< parameters.mode >>/redis.log 2>&1 || true - docker rm -f postgres-db redis-cache - test -z "$(docker ps -aq --filter name=postgres-db --filter name=redis-cache)" - - when: - condition: - not: - equal: [1, << parameters.parallelism >>] - steps: - - run: - name: Prepare this shard's execution record - command: | - results="test-results/integration-<< parameters.suite >>" - if [ "<< parameters.mode >>" = replica ]; then - results="$results-replica" - fi - mkdir -p "/tmp/integration-shards/<< parameters.suite >>-<< parameters.mode >>/$CIRCLE_NODE_INDEX" - cp "$results/execution.json" "/tmp/integration-shards/<< parameters.suite >>-<< parameters.mode >>/$CIRCLE_NODE_INDEX/execution.json" - if [ "<< parameters.suite >>" = mcp ]; then - mkdir -p "/tmp/integration-shards/mcp-standard/$CIRCLE_NODE_INDEX/coverage" - cp test-results/integration-mcp/coverage/data "/tmp/integration-shards/mcp-standard/$CIRCLE_NODE_INDEX/coverage/data.$CIRCLE_NODE_INDEX" - fi - - persist_to_workspace: - root: /tmp/integration-shards - paths: - - << parameters.suite >>-<< parameters.mode >> - - store_test_results: - path: test-results - - store_artifacts: - path: test-results - - integration_shard_coverage: - parameters: - suite: - type: enum - enum: [management, accounting, database, extensions, providers, mcp] - mode: - type: enum - enum: [standard, replica] - default: standard - shards: - type: integer - docker: - - image: cimg/python:3.12@sha256:9c796c23c84e84a66a964acb508d39dc5433c81a47e07efd56dccbbc2427e07c - auth: - username: ${DOCKERHUB_USERNAME} - password: ${DOCKERHUB_PASSWORD} - resource_class: small - working_directory: ~/project - environment: - UV_PYTHON_DOWNLOADS: never - steps: - - checkout_over_https - - install_uv - - run: - name: Install the locked shard verifier and coverage dependencies - command: | - uv export --frozen --all-groups --all-extras --no-emit-project --no-emit-workspace --no-header --no-annotate \ - | awk '/^[^ ]/ { keep = $0 ~ /^(annotated-types|coverage|pydantic|pydantic-core|typing-extensions|typing-inspection)==/ } keep' \ - > /tmp/fan-in-requirements.txt - uv venv .venv --python 3.12 - uv pip install --no-config --python .venv --require-hashes -r /tmp/fan-in-requirements.txt - - attach_workspace: - at: /tmp/integration-shards - - run: - name: Verify every << parameters.suite >> case ran exactly once - command: | - .venv/bin/python -m tests.integration._support.sharding /tmp/integration-shards/<< parameters.suite >>-<< parameters.mode >> \ - --shards << parameters.shards >> - - when: - condition: - equal: [mcp, << parameters.suite >>] - steps: - - run: - name: Combine coverage from every MCP shard - command: | - mkdir -p test-results/integration-mcp/coverage - export COVERAGE_FILE="$PWD/test-results/integration-mcp/coverage/data" - .venv/bin/python -m coverage combine --rcfile=tests/integration/mcp_coverage.toml /tmp/integration-shards/mcp-standard/*/coverage - .venv/bin/python -m coverage report --rcfile=tests/integration/mcp_coverage.toml > test-results/integration-mcp/coverage/coverage.txt - .venv/bin/python -m coverage html --rcfile=tests/integration/mcp_coverage.toml -d test-results/integration-mcp/coverage/html - - store_artifacts: - path: test-results/integration-mcp/coverage - - routing_parity: - parameters: - suite: - type: string - machine: - image: ubuntu-2204:2024.04.1 - resource_class: large - working_directory: ~/project - steps: - - setup_litellm_test_deps - - run: - name: Check out base product code - environment: - ROUTING_PARITY_BASE: << pipeline.parameters.routing_parity_base >> - command: | - [[ "$ROUTING_PARITY_BASE" =~ ^[0-9a-f]{40}$ ]] || exit 1 - git fetch --depth 1 --no-filter origin "$ROUTING_PARITY_BASE" - git rm -r -f --quiet litellm enterprise litellm-proxy-extras - git checkout "$ROUTING_PARITY_BASE" -- litellm enterprise litellm-proxy-extras - git reset --quiet - test -f litellm/rust_bridge/_native.abi3.so - - start_postgres: - image: postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - server_args: "-c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c pg_stat_statements.max=20000" - - start_redis - - run: - name: Run base side - command: bash .circleci/scripts/run_integration.sh << parameters.suite >> parity base - no_output_timeout: 15m - - run: - name: Stop base database and Redis - when: always - command: | - mkdir -p test-results/services-<< parameters.suite >>-parity-base - docker logs postgres-db > test-results/services-<< parameters.suite >>-parity-base/postgres.log 2>&1 || true - docker logs redis-cache > test-results/services-<< parameters.suite >>-parity-base/redis.log 2>&1 || true - docker rm -f postgres-db redis-cache - test -z "$(docker ps -aq --filter name=postgres-db --filter name=redis-cache)" - - run: - name: Check out head product code - command: | - git rm -r -f --quiet litellm enterprise litellm-proxy-extras - git checkout "$CIRCLE_SHA1" -- litellm enterprise litellm-proxy-extras - git reset --quiet - test -f litellm/rust_bridge/_native.abi3.so - - start_postgres: - image: postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - server_args: "-c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c pg_stat_statements.max=20000" - - start_redis - - run: - name: Run head side - command: bash .circleci/scripts/run_integration.sh << parameters.suite >> parity head - no_output_timeout: 15m - - run: - name: Stop head database and Redis - when: always - command: | - mkdir -p test-results/services-<< parameters.suite >>-parity-head - docker logs postgres-db > test-results/services-<< parameters.suite >>-parity-head/postgres.log 2>&1 || true - docker logs redis-cache > test-results/services-<< parameters.suite >>-parity-head/redis.log 2>&1 || true - docker rm -f postgres-db redis-cache - test -z "$(docker ps -aq --filter name=postgres-db --filter name=redis-cache)" - - run: - name: Compare routing parity - command: PYTHONPATH="$PWD/tests" .venv/bin/python -m integration._support.routing check test-results/parity-<< parameters.suite >>/base test-results/parity-<< parameters.suite >>/head - - store_test_results: - path: test-results - - store_artifacts: - path: test-results - - postgres_suite: - parameters: - test_path: - type: string - seed: - type: boolean - coverage_flag: - type: string - default: "" - timeout_minutes: - type: integer - workers: - type: integer - default: 1 - machine: - image: ubuntu-2204:2024.04.1 - resource_class: large - working_directory: ~/project - environment: - DATABASE_URL: postgresql://postgres:postgres@localhost:5432/litellm_test - steps: - - checkout_over_https - - skip_if_unrelated_changes - - setup_litellm_test_deps: - checkout: false - - start_postgres: - db_name: litellm_test - image: postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - - run: - name: Generate Prisma client - command: uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma - - when: - condition: << parameters.seed >> - steps: - - run: - name: Seed database schema - command: uv run --no-sync prisma db push --schema litellm/proxy/schema.prisma --accept-data-loss - - run: - name: Run << parameters.test_path >> - command: | - mkdir -p test-results - coverage_args=() - worker_args=() - if [ "<< parameters.workers >>" -gt 1 ]; then - worker_args=(-n << parameters.workers >> --dist=worksteal) - fi - if [ -n "<< parameters.coverage_flag >>" ]; then - coverage_args=(--cov=./litellm --cov-report=xml:coverage.xml) - fi - timeout --signal=TERM << parameters.timeout_minutes >>m uv run --no-sync pytest \ - << parameters.test_path >> -vv --tb=short --durations=10 -o junit_family=xunit1 \ - --junitxml=test-results/junit.xml "${coverage_args[@]}" "${worker_args[@]}" - - when: - condition: << parameters.coverage_flag >> - steps: - - install_codecov_cli - - run: - name: Upload coverage - when: always - command: | - [ -f coverage.xml ] || { echo "no coverage.xml produced"; exit 1; } - codecov upload-process --disable-search --fail-on-error -f coverage.xml \ - -F << parameters.coverage_flag >> -C "$CIRCLE_SHA1" \ - -n "<< parameters.coverage_flag >>-${CIRCLE_BUILD_NUM}" --git-service github - - store_test_results: - path: test-results - - store_artifacts: - path: test-results - -workflows: - migration_startup_scheduled: - triggers: - - schedule: - cron: "17 0,6,12,18 * * *" - filters: - branches: - only: main - jobs: - - build_docker_database_image: - migration_qualification: true - - migration_startup_tests: - name: migration-startup - suite: startup - requires: [build_docker_database_image] - - migration_startup_tests: - name: migration-recovery - suite: recovery - requires: [build_docker_database_image] - - migration_startup_tests: - name: migration-legacy-and-pooling - suite: legacy - requires: [build_docker_database_image] - - migration_startup_tests: - name: migration-upgrade - suite: upgrade - baseline: true - requires: [build_docker_database_image] - - migration_startup_tests: - name: migration-upgrade-shaped - suite: shaped - baseline: true - requires: [build_docker_database_image] - integration: - jobs: - - integration_contracts: - name: integration-<< matrix.suite >> - filters: &integration_default_run not pipeline.parameters.run_migration_tests and pipeline.parameters.routing_parity_base == "" - matrix: - parameters: - suite: [sdk, cost, browser] - parallelism: 1 - - integration_contracts: - name: integration-security - suite: security - parallelism: 1 - resource_class: xlarge - filters: *integration_default_run - - integration_contracts: - name: integration-management - suite: management - parallelism: 4 - resource_class: xlarge - filters: *integration_default_run - - integration_shard_coverage: - name: integration-management-coverage - suite: management - shards: 4 - requires: [integration-management] - filters: *integration_default_run - - integration_contracts: - name: integration-accounting - suite: accounting - parallelism: 4 - resource_class: xlarge - filters: *integration_default_run - - integration_shard_coverage: - name: integration-accounting-coverage - suite: accounting - shards: 4 - requires: [integration-accounting] - filters: *integration_default_run - - integration_contracts: - name: integration-providers - suite: providers - parallelism: 4 - resource_class: xlarge - filters: *integration_default_run - - integration_shard_coverage: - name: integration-providers-coverage - suite: providers - shards: 4 - requires: - - integration-providers - filters: *integration_default_run - - integration_contracts: - name: integration-database - suite: database - parallelism: 2 - filters: *integration_default_run - - integration_shard_coverage: - name: integration-database-coverage - suite: database - shards: 2 - requires: [integration-database] - filters: *integration_default_run - - integration_contracts: - name: integration-mcp - suite: mcp - parallelism: 2 - filters: *integration_default_run - - integration_shard_coverage: - name: integration-mcp-coverage - suite: mcp - shards: 2 - requires: - - integration-mcp - filters: *integration_default_run - - integration_contracts: - name: integration-extensions - suite: extensions - parallelism: 8 - resource_class: xlarge - filters: *integration_default_run - - integration_shard_coverage: - name: integration-extensions-coverage - suite: extensions - shards: 8 - requires: - - integration-extensions - filters: *integration_default_run - - integration_contracts: - name: integration-management-replica - suite: management - mode: replica - parallelism: 4 - resource_class: xlarge - filters: *integration_default_run - - integration_shard_coverage: - name: integration-management-replica-coverage - suite: management - mode: replica - shards: 4 - requires: [integration-management-replica] - filters: *integration_default_run - - integration_contracts: - name: integration-database-replica - suite: database - mode: replica - parallelism: 2 - filters: *integration_default_run - - integration_shard_coverage: - name: integration-database-replica-coverage - suite: database - mode: replica - shards: 2 - requires: [integration-database-replica] - filters: *integration_default_run - - postgres_suite: - name: roi-database - test_path: tests/integration/database/test_roi_observed.py - seed: false - coverage_flag: roi-postgres - timeout_minutes: 10 - filters: *integration_default_run - - windows_release_wheel: - filters: *integration_default_run - - base_sdk_install: - filters: *integration_default_run - - build_docker_database_image: - filters: *integration_default_run - - proxy_logging_guardrails_model_info_tests: - requires: - - build_docker_database_image - filters: *integration_default_run - - db_migration_disable_update_check: - requires: - - build_docker_database_image - filters: *integration_default_run - - test_bad_database_url: - requires: - - build_docker_database_image - filters: *integration_default_run - - helm_chart_testing: - requires: - - build_docker_database_image - filters: *integration_default_run - - e2e_ui_build: - filters: *integration_default_run - - e2e_ui_testing: - requires: [e2e_ui_build] - filters: *integration_default_run - - e2e_ui_testing_server_root_path: - requires: [e2e_ui_build] - filters: *integration_default_run - - build_docker_database_image: - name: build_docker_database_image-migration - migration_qualification: true - filters: pipeline.parameters.run_migration_tests - - migration_startup_tests: - name: migration-startup - suite: startup - requires: [build_docker_database_image-migration] - filters: pipeline.parameters.run_migration_tests - - migration_startup_tests: - name: migration-recovery - suite: recovery - requires: [build_docker_database_image-migration] - filters: pipeline.parameters.run_migration_tests - - migration_startup_tests: - name: migration-legacy-and-pooling - suite: legacy - requires: [build_docker_database_image-migration] - filters: pipeline.parameters.run_migration_tests - - migration_startup_tests: - name: migration-upgrade - suite: upgrade - baseline: true - requires: [build_docker_database_image-migration] - filters: pipeline.parameters.run_migration_tests - - migration_startup_tests: - name: migration-upgrade-shaped - suite: shaped - baseline: true - requires: [build_docker_database_image-migration] - filters: pipeline.parameters.run_migration_tests - - routing_parity: - name: routing-parity-<< matrix.suite >> - matrix: - parameters: - suite: [management, accounting, database, providers, extensions, cost, mcp] - filters: pipeline.parameters.routing_parity_base != "" diff --git a/.circleci/scripts/run_migration_tests.py b/.circleci/scripts/run_migration_tests.py deleted file mode 100644 index 50d01f1d50b..00000000000 --- a/.circleci/scripts/run_migration_tests.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import annotations - -import json -import os -import re -import subprocess -import sys -from pathlib import Path -from typing import Final -from xml.etree import ElementTree - -SUITES: Final = { - "startup": (("test_startup.py",), 13), - "recovery": (("test_recovery.py",), 15), - "legacy": (("test_legacy.py", "test_pooling.py"), 11), - "upgrade": (("test_upgrade.py", "test_rolling_upgrade.py"), 5), - "shaped": (("test_shaped_database.py",), 1), -} - - -def successful_junit(path: Path, expected: int, exit_code: int) -> bool: - if exit_code != 0 or not path.is_file(): - return False - try: - root: Final = ElementTree.parse(path).getroot() - except ElementTree.ParseError: - return False - cases: Final = tuple(root.iter("testcase")) - identities: Final = frozenset((case.get("classname"), case.get("name")) for case in cases) - return len(cases) == len(identities) == expected and all( - not any(case.find(tag) is not None for tag in ("failure", "error", "skipped")) for case in cases - ) - - -def output(*command: str) -> str: - return subprocess.check_output(command, text=True, timeout=90).strip() - - -def record_image() -> None: - source: Final = output("git", "rev-parse", "HEAD") - image: Final = output("docker", "image", "inspect", "litellm-docker-database:ci", "--format", "{{.Id}}") - revision: Final = output( - "docker", - "image", - "inspect", - "litellm-docker-database:ci", - "--format", - '{{index .Config.Labels "org.opencontainers.image.revision"}}', - ) - assert re.fullmatch(r"[0-9a-f]{40}", source), "Invalid source revision" - assert revision == source, "Candidate image revision differs from the tested source" - Path("migration-image.json").write_text( - json.dumps( - { - "source_sha": source, - "image_id": image, - "candidate_image": os.environ.get("MIGRATION_CANDIDATE_IMAGE", ""), - } - ) - ) - - -def main() -> int: - suite: Final = os.environ["MIGRATION_TEST_SUITE"] - files, expected = SUITES[suite] - metadata: Final = json.loads(Path("migration-image.json").read_text()) - assert metadata["source_sha"] == output("git", "rev-parse", "HEAD"), "Image and test source revisions differ" - assert metadata["image_id"] == output( - "docker", "image", "inspect", os.environ["LITELLM_MIGRATION_TEST_IMAGE"], "--format", "{{.Id}}" - ), "Loaded image differs from the build output" - assert metadata["candidate_image"] == os.environ.get("MIGRATION_CANDIDATE_IMAGE", ""), "Wrong release candidate" - destination: Final = Path(os.environ["MIGRATION_TEST_OUTPUT"]) - junit: Final = destination / "junit" / "results.xml" - junit.parent.mkdir(parents=True, exist_ok=True) - result: Final = subprocess.run( - ( - sys.executable, - "-m", - "pytest", - *(f"tests/e2e/migrations/{name}" for name in files), - "-vv", - "--tb=short", - "--durations=10", - f"--junitxml={junit}", - "-o", - "addopts=", - "--reruns=0", - ), - check=False, - timeout=1200, - ) - passed: Final = successful_junit(junit, expected, result.returncode) - (destination / "verdict.json").write_text( - json.dumps( - { - **metadata, - "suite": suite, - "baseline_image": os.environ.get("LITELLM_MIGRATION_BASELINE_IMAGE", ""), - "expected_cases": expected, - "passed": passed, - "pytest_exit_code": result.returncode, - "test_revision": metadata["source_sha"], - "workflow_id": os.environ.get("CIRCLE_WORKFLOW_ID", ""), - "job_number": os.environ.get("CIRCLE_BUILD_NUM", ""), - }, - indent=2, - ) - ) - return 0 if passed else 1 - - -if __name__ == "__main__": - if sys.argv[1:] == ["record-image"]: - record_image() - else: - raise SystemExit(main()) diff --git a/.dockerignore b/.dockerignore index 8459d0cd482..d8eb72a057f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ docs -cookbook -.circleci +litellm/proxy/discovery_endpoints/skill_scanner_adapter .github tests .git diff --git a/.github/AGENTS.md b/.github/AGENTS.md new file mode 100644 index 00000000000..14bd461a8a0 --- /dev/null +++ b/.github/AGENTS.md @@ -0,0 +1,5 @@ +# CI + +Integration groups and replica runs remain in `workflows/test-integration.yml`. Do not duplicate them in another workflow. + +CI helpers used by existing workflows live in `scripts/ci/`. Jobs that need merge bases check out full history. Removing a CI job does not count its tests as covered. List tests that no remaining job invokes explicitly in `ci-coverage-allowlist.yml`. diff --git a/.github/actions/detect-changes/action.yml b/.github/actions/detect-changes/action.yml index b0f9b72f0ee..59c6ab28c30 100644 --- a/.github/actions/detect-changes/action.yml +++ b/.github/actions/detect-changes/action.yml @@ -1,6 +1,6 @@ name: "Detect relevant changes" description: >- - Classify the pull request's changed files with .circleci/scripts/classify_changes.sh + Classify the pull request's changed files with .github/scripts/ci/classify_changes.sh and expose decision=run|skip for one category. backend means anything outside ui/, docs/ and markdown; ui means the dashboard sources alone. decision=skip lets callers short-circuit expensive steps while the job still completes successfully and satisfies diff --git a/.github/ci-coverage-allowlist.yml b/.github/ci-coverage-allowlist.yml index 76f8e3ef7e7..3a714187325 100644 --- a/.github/ci-coverage-allowlist.yml +++ b/.github/ci-coverage-allowlist.yml @@ -4,6 +4,16 @@ description: >- by a job nor listed here, so every entry below is a decision on the record. test_paths: + - reason: ran only in CircleCI, removed + paths: + - tests/e2e/migrations/test_legacy.py + - tests/e2e/migrations/test_pooling.py + - tests/e2e/migrations/test_recovery.py + - tests/e2e/migrations/test_rolling_upgrade.py + - tests/e2e/migrations/test_shaped_database.py + - tests/e2e/migrations/test_startup.py + - tests/e2e/migrations/test_upgrade.py + - tests/integration/database/test_roi_observed.py - reason: >- litellm.agent() end-to-end suite. It drives the real claude, codex, opencode and pi CLIs and deepagents against a live LiteLLM AI Gateway, so it needs those binaries on PATH plus @@ -19,7 +29,7 @@ test_paths: - tests/rust-python-harness - reason: >- Owned by the open pull request that moves the Rust/Python parity checks (#45135). It ran in - the CircleCI build_and_test job that globbed tests/test_*.py, which this migration deletes, + the retired build_and_test job that globbed tests/test_*.py, and that pull request gives it a new home paths: - tests/test_rust_python_harness.py diff --git a/.github/scripts/assert_ci_coverage.py b/.github/scripts/assert_ci_coverage.py index b442948c3ca..9dcae329b59 100644 --- a/.github/scripts/assert_ci_coverage.py +++ b/.github/scripts/assert_ci_coverage.py @@ -10,6 +10,7 @@ import warnings from collections.abc import Callable, Iterable, Mapping, Sequence from dataclasses import dataclass from functools import lru_cache +from itertools import chain from types import MappingProxyType from typing import Final @@ -17,7 +18,6 @@ import yaml REPO_ROOT = pathlib.Path(__file__).resolve().parents[2] WORKFLOW_DIR = REPO_ROOT / ".github" / "workflows" -CIRCLECI_CONFIG = REPO_ROOT / ".circleci" / "config.yml" ALLOWLIST_FILE = REPO_ROOT / ".github" / "ci-coverage-allowlist.yml" TESTS_ROOT = REPO_ROOT / "tests" @@ -25,14 +25,18 @@ ALLOWLIST_KEYS = frozenset({"description", "test_paths", "dockerfiles"}) PATH_FILTER_KEYS = frozenset({"paths", "paths-ignore"}) TEST_PATH_KEYS = frozenset({"test-path", "test-paths", "test_path"}) DOCKERFILE_INPUT_KEYS = frozenset({"file", "dockerfile"}) -TEST_RUNNER_RE = re.compile(r"\bpytest\b|\bcircleci tests\b|\bhelm unittest\b|\bplaywright test\b|\bpython[0-9.]*\s") +TEST_RUNNER_RE = re.compile(r"\bpytest\b|\bhelm unittest\b|\bplaywright test\b|\bpython[0-9.]*\s") IMAGE_BUILD_RE = re.compile(r"\bdocker\s+(?:buildx\s+)?build\b") -TEST_TOKEN_RE = re.compile(r"tests/[A-Za-z0-9_./*?-]+") -IGNORE_ARG_RE: Final = re.compile(r"--ignore(?:-glob)?[= ](\S+)") +TEST_TOKEN_RE = re.compile(r"tests/[A-Za-z0-9_./*?\[\]-]+") +IGNORE_ARG_RE: Final = re.compile(r"--(?:ignore(?:-glob)?|deselect)[= ](\S+)") DOCKERFILE_TOKEN_RE = re.compile(r"[A-Za-z0-9_./-]*Dockerfile[A-Za-z0-9_.-]*") COMMENT_RE = re.compile(r"^\s*#.*$", re.MULTILINE) -GLOB_CHARS = frozenset("*?") -DEDICATED_INTEGRATION_WORKFLOWS: Final = MappingProxyType({"image-scan.yml": "tests/integration/database/image/"}) +GLOB_CHARS = frozenset("*?[") +DEDICATED_INTEGRATION_WORKFLOWS: Final = MappingProxyType( + { + "image-scan.yml": "tests/integration/database/image/", + } +) # Trees whose jobs are sharded with no catch-all bucket, so every child that holds # tests has to be named by some shard or it runs nowhere. A child listed here is @@ -115,9 +119,7 @@ def _scalars(node: object, key: str) -> tuple[Scalar, ...]: def _config_files() -> tuple[pathlib.Path, ...]: - workflows = tuple(sorted(path for path in WORKFLOW_DIR.iterdir() if path.suffix in (".yml", ".yaml"))) - circleci = (CIRCLECI_CONFIG,) if CIRCLECI_CONFIG.is_file() else () - return workflows + circleci + return tuple(sorted(path for path in WORKFLOW_DIR.iterdir() if path.suffix in (".yml", ".yaml"))) def _all_scalars() -> tuple[Scalar, ...]: @@ -243,7 +245,6 @@ def _describe(paths: tuple[str, ...]) -> str: return f"{len(paths)} test file(s) invoked by no job: {names}{suffix}" -GLOB_CALL_RE = re.compile(r'circleci tests glob "([^"]+)"') KEYWORD_RE = re.compile(r"-k\s+\\?[\"']([^\"'\\]+)") @@ -316,16 +317,14 @@ def _keyword_terms( def _slices() -> tuple[Slice, ...]: - if not CIRCLECI_CONFIG.exists(): - return () test_files: Final = frozenset(_test_files()) - jobs: Final = yaml.safe_load(CIRCLECI_CONFIG.read_text()).get("jobs", {}) return tuple( - Slice(job=job, globs=globs, named=named, required=required, excluded=excluded, understood=understood) - for job, body in jobs.items() + Slice(job=f"{path.name}:{job}", globs=globs, named=named, required=required, excluded=excluded, understood=understood) + for path in _config_files() + for job, body in yaml.safe_load(path.read_text()).get("jobs", {}).items() for text in ("\n".join(_strings(body)),) if "pytest" in text - for globs in (tuple(GLOB_CALL_RE.findall(text)),) + for globs in (tuple(token for token in TEST_TOKEN_RE.findall(text) if GLOB_CHARS & set(token)),) for named in (frozenset(TEST_TOKEN_RE.findall(text)) & test_files,) for required, excluded, understood in ( _keyword_terms(tuple(KEYWORD_RE.findall(text)), attributable=len(globs) < 2), @@ -352,16 +351,11 @@ def _matchable_names(relative_path: str) -> frozenset[str]: def _workflow_named_tokens() -> frozenset[str]: - """Test tokens a GitHub Actions job names directly. - - A CircleCI `-k` that deselects a file no longer means the file runs nowhere once a - workflow names it, so the slice check has to credit those the same way the census does. - """ return _invoked_test_tokens( scalar for path in _config_files() - if path != CIRCLECI_CONFIG for scalar in _scalars(yaml.safe_load(path.read_text(encoding="utf-8")), path.name) + if not KEYWORD_RE.search(scalar.value) ) @@ -566,13 +560,28 @@ def _owns(workflow: str, relative_path: str) -> bool: return owned_root is not None and relative_path.startswith(owned_root) +def _expression_suites(value: str) -> tuple[str, ...]: + suites: Final = chain.from_iterable(map(json.loads, re.findall(r"'(\[[^']*\])'", value))) + return tuple(suite for suite in suites if isinstance(suite, str) and "{" not in suite) + + +def _matrix_suites(value: object) -> tuple[str, ...]: + if isinstance(value, list): + return tuple(suite for suite in value if isinstance(suite, str)) + if isinstance(value, str): + return _expression_suites(value) + return () + + def _tokens_outside_owner(relative_path: str, workflow_tokens: Mapping[str, frozenset[str]]) -> frozenset[str]: return frozenset[str]().union( *(tokens for workflow, tokens in workflow_tokens.items() if not _owns(workflow, relative_path)) ) -def _integration_ownership(repo_root: pathlib.Path = REPO_ROOT) -> tuple[frozenset[str], tuple[Finding, ...]]: +def _integration_ownership( + repo_root: pathlib.Path = REPO_ROOT, *, allowlist: Allowlist | None = None +) -> tuple[frozenset[str], tuple[Finding, ...]]: runner: Final = repo_root / "tests/integration/run.py" if not runner.exists(): return frozenset(), () @@ -589,26 +598,19 @@ def _integration_ownership(repo_root: pathlib.Path = REPO_ROOT) -> tuple[frozens browser_manifest: Final = repo_root / "tests/e2e/ui/tests/integrationCritical/expected.json" browser_nodes: Final = json.loads(browser_manifest.read_text()) if browser_manifest.exists() else () browser_paths: Final = frozenset(node.split("::", 1)[0] for node in browser_nodes) - circle_path: Final = repo_root / ".circleci/config.yml" - circle: Final = yaml.safe_load(circle_path.read_text()) if circle_path.exists() else {} - circle_test_path_tokens: Final = _invoked_test_tokens( - scalar for scalar in _scalars(circle, "config.yml") if scalar.key == "test_path" - ) - steps: Final = circle.get("jobs", {}).get("integration_contracts", {}).get("steps", ()) + integration_path: Final = repo_root / ".github/workflows/test-integration.yml" + integration: Final = yaml.safe_load(integration_path.read_text()) if integration_path.exists() else {} + integration_jobs: Final = integration.get("jobs", {}) invoked: Final = any( - ".circleci/scripts/run_integration.sh" in scalar.value - for scalar in _scalars(steps, "integration_contracts") - if scalar.key == "command" + ".github/scripts/ci/run_integration.sh" in scalar.value + for scalar in _scalars(integration_jobs, "integration") + if scalar.key == "run" ) scheduled: Final = frozenset( suite - for job in circle.get("workflows", {}).get("integration", {}).get("jobs", ()) - if isinstance(job, dict) and "integration_contracts" in job - for suite in job["integration_contracts"] - .get("matrix", {}) - .get("parameters", {}) - .get("suite", (job["integration_contracts"].get("suite"),)) - if isinstance(suite, str) + for body in integration_jobs.values() + if any(".github/scripts/ci/run_integration.sh" in scalar.value for scalar in _scalars(body, "integration")) + for suite in _matrix_suites(body.get("strategy", {}).get("matrix", {}).get("suite", ())) ) required: Final = (frozenset({"browser"}) if browser_paths else frozenset()) | frozenset( group @@ -630,19 +632,27 @@ def _integration_ownership(repo_root: pathlib.Path = REPO_ROOT) -> tuple[frozens } ) gha_tokens: Final = frozenset[str]().union(*workflow_tokens.values()) - circle_owned: Final = ( + invoked_github_files: Final = frozenset( + path for path in github_files if any(_token_covers(token, path) for token in gha_tokens) + ) + grouped: Final = ( frozenset(str(path.relative_to(repo_root)) for path in integration_root.rglob("test_*.py")) - github_files ) findings: Final = ( tuple( Finding(path, "integration file outside GITHUB_FILES is selected by GitHub Actions") - for path in sorted(circle_owned) - if any(_token_covers(token, path) for token in gha_tokens) + for path in sorted(grouped) + if any( + _token_covers(token, path) + for workflow, tokens in workflow_tokens.items() + if workflow != "test-integration.yml" + for token in tokens + ) ) + tuple( Finding(path, "GitHub-owned integration contract has no invoking job") for path in sorted(github_files) - if not any(_token_covers(token, path) for token in gha_tokens | circle_test_path_tokens) + if path not in invoked_github_files and not (allowlist is not None and allowlist.covers_test(path)) ) + tuple( Finding(path, "GitHub-owned integration file is missing") @@ -658,6 +668,7 @@ def _integration_ownership(repo_root: pathlib.Path = REPO_ROOT) -> tuple[frozens browser_commands: Final = tuple( scalar.value for path in (repo_root / ".github/workflows").glob("*.y*ml") + if path.name != "test-integration.yml" for scalar in _scalars(yaml.safe_load(path.read_text()), path.name) if scalar.key in {"run", "command"} ) @@ -690,14 +701,14 @@ def _integration_ownership(repo_root: pathlib.Path = REPO_ROOT) -> tuple[frozens else () ) group_findings: Final = tuple( - Finding(group, "canonical integration group is not scheduled by CircleCI") + Finding(group, "canonical integration group is not scheduled by GitHub Actions") for group in sorted(required - scheduled) ) + tuple(Finding(path, "canonical node must have exactly one integration group") for path in sorted(ungrouped)) if not paths or not invoked or not scheduled: return frozenset(), findings + ( - Finding(str(runner.relative_to(repo_root)), "dedicated CircleCI runner is missing"), + Finding(str(runner.relative_to(repo_root)), "dedicated GitHub Actions runner is missing"), ) - return paths | browser_paths | github_files, findings + group_findings + browser_findings + exclusion_findings + return paths | browser_paths | invoked_github_files, findings + group_findings + browser_findings + exclusion_findings def main() -> int: @@ -709,7 +720,7 @@ def main() -> int: allowlist = _load_allowlist() scalars = _all_scalars() - integration_paths, ownership_findings = _integration_ownership() + integration_paths, ownership_findings = _integration_ownership(allowlist=allowlist) test_findings = _uncovered_tests( allowlist, _invoked_selections(scalars) + (Selection(included=integration_paths, ignored=frozenset()),), @@ -731,8 +742,8 @@ def main() -> int: ) if ownership_findings: browser_remedy = ( - " CircleCI's browser group owns the integrationCritical Playwright contracts, so no GitHub workflow may " - "select them and the default Playwright config must exclude them." + " The browser group in test-integration.yml owns the integrationCritical Playwright contracts. " + "Other workflows and the default Playwright config must exclude them." if any("browser" in finding.detail or "Playwright" in finding.detail for finding in ownership_findings) else "" ) diff --git a/.circleci/scripts/classify_changes.sh b/.github/scripts/ci/classify_changes.sh similarity index 86% rename from .circleci/scripts/classify_changes.sh rename to .github/scripts/ci/classify_changes.sh index a33695d0dbe..82851fa0a82 100755 --- a/.circleci/scripts/classify_changes.sh +++ b/.github/scripts/ci/classify_changes.sh @@ -14,22 +14,22 @@ outside_cost_map_set=false while IFS= read -r file || [ -n "$file" ]; do [ -n "$file" ] || continue case "$file" in - litellm/_redis.py | litellm/_redis_credential_provider.py | litellm/caching/redis_cache.py | litellm/caching/evicted_client_closer.py | tests/unit/test_redis.py | tests/integration/sdk/test_redis_cluster_iam_auth.py | tests/unit/caching/test_redis_connection_pool.py | tests/unit/caching/test_redis_cluster_cache.py | tests/unit/caching/test_evicted_client_closer.py | .github/workflows/test-unit.yml | .github/actions/detect-changes/* | .github/scripts/detect_changes.sh | .circleci/scripts/classify_changes.sh | tests/integration/run.py | pyproject.toml | uv.lock) + litellm/_redis.py | litellm/_redis_credential_provider.py | litellm/caching/redis_cache.py | litellm/caching/evicted_client_closer.py | tests/unit/test_redis.py | tests/integration/sdk/test_redis_cluster_iam_auth.py | tests/unit/caching/test_redis_connection_pool.py | tests/unit/caching/test_redis_cluster_cache.py | tests/unit/caching/test_evicted_client_closer.py | .github/workflows/test-unit.yml | .github/actions/detect-changes/* | .github/scripts/detect_changes.sh | .github/scripts/ci/classify_changes.sh | tests/integration/run.py | pyproject.toml | uv.lock) has_redis_compat=true ;; esac case "$file" in *.md | *.mdx) : ;; - pyproject.toml | */pyproject.toml | uv.lock | uv.toml | .python-version | rust-toolchain.toml | litellm-rust/* | litellm/__init__.py | litellm/proxy/proxy_server.py | litellm/*mcp* | tests/*mcp* | litellm/integrations/arize/* | tests/base_sdk_tests/* | scripts/check_mcp_sdk_install.py | .github/workflows/test-mcp-dependency-resolution.yml | .github/actions/detect-changes/* | .github/actions/setup-uv-with-retries/* | .github/actions/cache-cargo-build/* | .github/scripts/detect_changes.sh | .github/scripts/uv_sync_with_retries.sh | .circleci/scripts/classify_changes.sh | tests/unit/test_circleci_path_filter.py | tests/unit/test_detect_changes.py) + pyproject.toml | */pyproject.toml | uv.lock | uv.toml | .python-version | rust-toolchain.toml | litellm-rust/* | litellm/__init__.py | litellm/proxy/proxy_server.py | litellm/*mcp* | tests/*mcp* | litellm/integrations/arize/* | tests/base_sdk_tests/* | scripts/check_mcp_sdk_install.py | .github/workflows/test-mcp-dependency-resolution.yml | .github/actions/detect-changes/* | .github/actions/setup-uv-with-retries/* | .github/actions/cache-cargo-build/* | .github/scripts/detect_changes.sh | .github/scripts/uv_sync_with_retries.sh | .github/scripts/ci/classify_changes.sh | tests/unit/test_ci_path_filter.py | tests/unit/test_detect_changes.py) has_mcp_dependencies=true ;; esac case "$file" in - litellm-rust/* | litellm/rust_bridge/* | rust-toolchain.toml | pyproject.toml | uv.lock | tests/windows_tests/* | .circleci/*) + litellm-rust/* | litellm/rust_bridge/* | rust-toolchain.toml | pyproject.toml | uv.lock | tests/windows_tests/* | .github/scripts/ci/* | .github/actions/*) has_windows_release=true ;; esac case "$file" in ui/* | tests/e2e/ui/*) has_client=true ;; docs/* | *.md | *.mdx) : ;; - .github/* | .circleci/*) has_ci=true; has_backend=true ;; + .github/*) has_ci=true; has_backend=true ;; *) has_backend=true ;; esac case "$file" in diff --git a/.circleci/scripts/path_filter.sh b/.github/scripts/ci/path_filter.sh similarity index 78% rename from .circleci/scripts/path_filter.sh rename to .github/scripts/ci/path_filter.sh index c3cf6e566ff..e8ac6e5b918 100755 --- a/.circleci/scripts/path_filter.sh +++ b/.github/scripts/ci/path_filter.sh @@ -6,10 +6,12 @@ here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" run_full() { echo "path-filter[$category]: running job ($1)" + echo "decision=run" + [ -z "${GITHUB_OUTPUT:-}" ] || echo "decision=run" >> "$GITHUB_OUTPUT" exit 0 } -[ -n "${CIRCLE_PULL_REQUEST:-}" ] || run_full "not a pull request" +[ "${GITHUB_EVENT_NAME:-}" = pull_request ] || run_full "not a pull request" candidate_bases="${PATH_FILTER_BASE_BRANCH:-main}" merge_base="" @@ -36,5 +38,6 @@ if [ "$decision" = run ]; then run_full "$category-relevant changes detected" fi -echo "path-filter[$category]: only unrelated changes detected; halting job as successful" -circleci-agent step halt +echo "path-filter[$category]: only unrelated changes detected" +echo "decision=skip" +[ -z "${GITHUB_OUTPUT:-}" ] || echo "decision=skip" >> "$GITHUB_OUTPUT" diff --git a/.circleci/scripts/prepare_replica_roles.py b/.github/scripts/ci/prepare_replica_roles.py similarity index 100% rename from .circleci/scripts/prepare_replica_roles.py rename to .github/scripts/ci/prepare_replica_roles.py diff --git a/.circleci/scripts/run_integration.sh b/.github/scripts/ci/run_integration.sh similarity index 92% rename from .circleci/scripts/run_integration.sh rename to .github/scripts/ci/run_integration.sh index fb91bcce77f..ed405634796 100644 --- a/.circleci/scripts/run_integration.sh +++ b/.github/scripts/ci/run_integration.sh @@ -30,7 +30,7 @@ egress_cgroup=litellm-integration cleanup() { original_status=$? trap - EXIT INT TERM - sudo .venv/bin/python .circleci/scripts/stop_integration_processes.py \ + sudo .venv/bin/python .github/scripts/ci/stop_integration_processes.py \ "$integration_identity" "$(id -u)" "$proxy_pid" "$peer_pid" "$upstream_pid" \ > "$results/process-cleanup.txt" 2>&1 || original_status=1 for owned_pid in "$peer_pid" "$proxy_pid" "$upstream_pid"; do @@ -84,7 +84,7 @@ if [ "$suite" = browser ]; then export LITELLM_UI_PATH="$PWD/ui/litellm-dashboard/out" test -f "$LITELLM_UI_PATH/index.html" fi -export INTEGRATION_SEED="$(.venv/bin/python -c 'import hashlib,os; print(int(hashlib.sha256(((os.environ.get("CIRCLE_SHA1") or os.environ.get("GITHUB_SHA") or "local") + (os.environ.get("CIRCLE_WORKFLOW_ID") or os.environ.get("GITHUB_RUN_ID") or "local")).encode()).hexdigest()[:8],16))')" +export INTEGRATION_SEED="$(.venv/bin/python -c 'import hashlib,os; print(int(hashlib.sha256(((os.environ.get("GITHUB_SHA") or "local") + (os.environ.get("GITHUB_RUN_ID") or "local")).encode()).hexdigest()[:8],16))')" export INTEGRATION_ORDER_SEED="$INTEGRATION_SEED" uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma > "$results/prisma-generate.log" 2>&1 @@ -93,7 +93,7 @@ export INTEGRATION_PROXY_DATABASE_URL="" export INTEGRATION_PROXY_READ_REPLICA_URL="" export INTEGRATION_ROUTING="" if [ "$mode" = replica ] || [ "$mode" = parity ]; then - .venv/bin/python .circleci/scripts/prepare_replica_roles.py > "$results/prepare-replica-roles.log" 2>&1 + .venv/bin/python .github/scripts/ci/prepare_replica_roles.py > "$results/prepare-replica-roles.log" 2>&1 export INTEGRATION_PROXY_DATABASE_URL="postgresql://litellm_writer:litellm-writer@127.0.0.1:5432/circle_test" export INTEGRATION_PROXY_READ_REPLICA_URL="postgresql://litellm_reader:litellm-reader@127.0.0.1:5432/circle_test" fi @@ -202,7 +202,7 @@ start_proxy() { if [ "$isolated_workers" = false ]; then start_proxy 4000 proxy.log proxy_pid="$launched_pid" - .venv/bin/python .circleci/scripts/wait_integration_services.py + .venv/bin/python .github/scripts/ci/wait_integration_services.py curl --noproxy '*' -sSf -X POST "$INTEGRATION_PROXY_URL/config/update" \ -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' \ -d '{"router_settings": {"num_retries": 0}}' > "$results/seed-router-settings.json" @@ -210,7 +210,7 @@ if [ "$isolated_workers" = false ]; then export INTEGRATION_PEER_URL=http://127.0.0.1:4001 start_proxy 4001 peer.log peer_pid="$launched_pid" - .venv/bin/python .circleci/scripts/wait_integration_services.py + .venv/bin/python .github/scripts/ci/wait_integration_services.py fi fi @@ -233,14 +233,13 @@ if [ "$suite" = browser ]; then E2E_UI_BASE_URL="$E2E_UI_BASE_URL" E2E_UI_ARTIFACT_DIR="$E2E_UI_ARTIFACT_DIR" \ LITELLM_MASTER_KEY="$LITELLM_MASTER_KEY" CI=true \ node tests/e2e/ui/node_modules/@playwright/test/cli.js test --config tests/e2e/ui/integration.config.ts - .venv/bin/python .circleci/scripts/verify_integration_browser.py "$results/browser-results.json" + .venv/bin/python .github/scripts/ci/verify_integration_browser.py "$results/browser-results.json" exit 0 fi shard_arguments=() -if [ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ]; then - .venv/bin/python tests/integration/run.py "$suite" --list \ - | circleci tests split --split-by=timings --timings-type=filename > "$results/node-files.txt" +if [ -n "${INTEGRATION_SHARD_FILES:-}" ]; then + cp "$INTEGRATION_SHARD_FILES" "$results/node-files.txt" shard_arguments=(--shard-files "$results/node-files.txt") fi @@ -265,7 +264,7 @@ env -i PATH="$PATH" HOME="$HOME" PYTHONPATH="$PYTHONPATH" \ "${license_env[@]}" \ INTEGRATION_SEED="$INTEGRATION_SEED" \ INTEGRATION_ORDER_SEED="$INTEGRATION_ORDER_SEED" \ - INTEGRATION_CASE_SHARDS="${CIRCLE_NODE_TOTAL:-1}" INTEGRATION_CASE_SHARD_INDEX="${CIRCLE_NODE_INDEX:-0}" \ + INTEGRATION_CASE_SHARDS="${INTEGRATION_CASE_SHARDS:-1}" INTEGRATION_CASE_SHARD_INDEX="${INTEGRATION_CASE_SHARD_INDEX:-0}" \ LITELLM_LOCAL_MODEL_COST_MAP=True AWS_EC2_METADATA_DISABLED=true DO_NOT_TRACK=1 \ INTEGRATION_PROXY_DATABASE_URL="$INTEGRATION_PROXY_DATABASE_URL" \ INTEGRATION_PROXY_READ_REPLICA_URL="$INTEGRATION_PROXY_READ_REPLICA_URL" \ diff --git a/.circleci/scripts/stop_integration_processes.py b/.github/scripts/ci/stop_integration_processes.py similarity index 100% rename from .circleci/scripts/stop_integration_processes.py rename to .github/scripts/ci/stop_integration_processes.py diff --git a/.circleci/scripts/verify_integration_browser.py b/.github/scripts/ci/verify_integration_browser.py similarity index 94% rename from .circleci/scripts/verify_integration_browser.py rename to .github/scripts/ci/verify_integration_browser.py index 4468fadbcde..452a6cd43ae 100644 --- a/.circleci/scripts/verify_integration_browser.py +++ b/.github/scripts/ci/verify_integration_browser.py @@ -31,7 +31,7 @@ def main() -> None: result: Final = json.loads(Path(sys.argv[1]).read_text()) assert not result.get("errors"), result.get("errors") expected: Final = json.loads( - (Path(__file__).resolve().parents[2] / "tests/e2e/ui/tests/integrationCritical/expected.json").read_text() + (Path(__file__).resolve().parents[3] / "tests/e2e/ui/tests/integrationCritical/expected.json").read_text() ) assert expected and result["stats"]["expected"] == len(expected) assert all(result["stats"][name] == 0 for name in ("unexpected", "flaky", "skipped")) @@ -41,7 +41,7 @@ def main() -> None: suites: Final = TypeAdapter(list[BrowserSuite]).validate_python(result["suites"], strict=True) specs: Final = tuple(spec for suite in suites for spec in cases(suite)) - repository: Final = Path(__file__).resolve().parents[2] + repository: Final = Path(__file__).resolve().parents[3] report_root: Final = Path(result["config"]["rootDir"]) assert report_root.is_absolute(), "Playwright rootDir must be explicit" observed: Final = tuple( diff --git a/.circleci/scripts/wait_integration_services.py b/.github/scripts/ci/wait_integration_services.py similarity index 100% rename from .circleci/scripts/wait_integration_services.py rename to .github/scripts/ci/wait_integration_services.py diff --git a/.github/scripts/detect_changes.sh b/.github/scripts/detect_changes.sh index 2d427c92fb5..acc19be57f1 100755 --- a/.github/scripts/detect_changes.sh +++ b/.github/scripts/detect_changes.sh @@ -16,7 +16,7 @@ run_full() { } here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -classify="${here}/../../.circleci/scripts/classify_changes.sh" +classify="${here}/ci/classify_changes.sh" [ -n "${PR_NUMBER:-}" ] || run_full "not a pull_request event" [ -n "${REPO:-}" ] || run_full "no repository in the environment" diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 73159bd64d2..8be7b89e076 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -55,7 +55,6 @@ jobs: services: postgres: image: postgres:16@sha256:e17e86066e5ef83e0952a9347f5c792b7ece00972e2aa787a6986f471b3dd3d5 - command: -c max_connections=1000 -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c pg_stat_statements.max=20000 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -81,6 +80,17 @@ jobs: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false + - name: Configure PostgreSQL for integration workers + env: + POSTGRES_CONTAINER: ${{ job.services.postgres.id }} + run: | + docker exec "$POSTGRES_CONTAINER" sh -c 'printf "%s\n" "max_connections = 1000" "shared_preload_libraries = pg_stat_statements" "pg_stat_statements.track = all" "pg_stat_statements.max = 20000" >> "$PGDATA/postgresql.conf"' + docker restart "$POSTGRES_CONTAINER" + for attempt in $(seq 1 30); do + if docker exec "$POSTGRES_CONTAINER" pg_isready -U postgres; then exit 0; fi + sleep 1 + done + exit 1 - name: Set up Python timeout-minutes: 3 @@ -155,8 +165,8 @@ jobs: LITELLM_LICENSE: ${{ secrets.LITELLM_LICENSE }} run: | case "$SUITE" in - *-replica) bash .circleci/scripts/run_integration.sh "${SUITE%-replica}" replica ;; - *) bash .circleci/scripts/run_integration.sh "$SUITE" ;; + *-replica) bash .github/scripts/ci/run_integration.sh "${SUITE%-replica}" replica ;; + *) bash .github/scripts/ci/run_integration.sh "$SUITE" ;; esac - name: Verify every case ran exactly once diff --git a/.github/workflows/test-mcp-dependency-resolution.yml b/.github/workflows/test-mcp-dependency-resolution.yml index 20efb351985..90589cf1e6f 100644 --- a/.github/workflows/test-mcp-dependency-resolution.yml +++ b/.github/workflows/test-mcp-dependency-resolution.yml @@ -28,7 +28,7 @@ on: - ".github/actions/cache-cargo-build/**" - ".github/scripts/detect_changes.sh" - ".github/scripts/uv_sync_with_retries.sh" - - ".circleci/scripts/classify_changes.sh" + - ".github/scripts/ci/classify_changes.sh" permissions: contents: read diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index d0726e0daa0..914d984e541 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -460,7 +460,6 @@ jobs: tests/unit/ocr tests/unit/passthrough tests/unit/rag - tests/unit/cookbook tests/unit/realtime_api tests/unit/rerank_api tests/unit/search @@ -674,34 +673,30 @@ jobs: job-timeout-minutes: 60 dist: loadscope - - shard: proxy-infra-root + - shard: proxy-infra-root-a-p test-path: |- - tests/unit/proxy/test_*.py - --ignore=tests/unit/proxy/test_aproxy_startup.py - --ignore=tests/unit/proxy/test_credential_slot_registry.py - --ignore=tests/unit/proxy/test_custom_callback_input.py - --ignore=tests/unit/proxy/test_custom_logger_s3_gcs.py - --ignore=tests/unit/proxy/test_custom_tokenizer_bug.py - --ignore=tests/unit/proxy/test_db_schema_changes.py - --ignore=tests/unit/proxy/test_deprecated_key_grace_period.py - --ignore=tests/unit/proxy/test_get_favicon.py - --ignore=tests/unit/proxy/test_get_image.py - --ignore=tests/unit/proxy/test_prisma_client_backoff_retry.py - --ignore=tests/unit/proxy/test_prompt_test_endpoint.py - --ignore=tests/unit/proxy/test_proxy_config_unit_test.py - --ignore=tests/unit/proxy/test_proxy_custom_auth.py - --ignore=tests/unit/proxy/test_proxy_reject_logging.py - --ignore=tests/unit/proxy/test_proxy_server.py - --ignore=tests/unit/proxy/test_proxy_setting_guardrails.py - --ignore=tests/unit/proxy/test_proxy_token_counter.py - --ignore=tests/unit/proxy/test_proxy_utils.py - --ignore=tests/unit/proxy/test_reducto_ocr_route.py - --ignore=tests/unit/proxy/test_response_polling_pre_call_checks.py - --ignore=tests/unit/proxy/test_server_root_path.py - --ignore=tests/unit/proxy/test_ui_path_detection.py - --ignore=tests/unit/proxy/test_unit_test_proxy_hooks.py - --ignore=tests/unit/proxy/test_update_spend.py - --ignore=tests/unit/proxy/test_zero_cost_model_budget_bypass.py + tests/unit/proxy/test_[_a-p]*.py + --deselect=tests/unit/proxy/test_aproxy_startup.py + --deselect=tests/unit/proxy/test_component_allowlists.py + --deselect=tests/unit/proxy/test_credential_slot_registry.py + --deselect=tests/unit/proxy/test_custom_callback_input.py + --deselect=tests/unit/proxy/test_custom_logger_s3_gcs.py + --deselect=tests/unit/proxy/test_custom_tokenizer_bug.py + --deselect=tests/unit/proxy/test_db_schema_changes.py + --deselect=tests/unit/proxy/test_deprecated_key_grace_period.py + --deselect=tests/unit/proxy/test_get_favicon.py + --deselect=tests/unit/proxy/test_get_image.py + --deselect=tests/unit/proxy/test_prisma_client_backoff_retry.py + --deselect=tests/unit/proxy/test_prometheus_metrics_server.py + --deselect=tests/unit/proxy/test_prompt_test_endpoint.py + --deselect=tests/unit/proxy/test_proxy_cli.py + --deselect=tests/unit/proxy/test_proxy_config_unit_test.py + --deselect=tests/unit/proxy/test_proxy_custom_auth.py + --deselect=tests/unit/proxy/test_proxy_reject_logging.py + --deselect=tests/unit/proxy/test_proxy_server.py + --deselect=tests/unit/proxy/test_proxy_setting_guardrails.py + --deselect=tests/unit/proxy/test_proxy_token_counter.py + --deselect=tests/unit/proxy/test_proxy_utils.py python-version: "3.12" workers: 4 reruns: 0 @@ -709,6 +704,35 @@ jobs: job-timeout-minutes: 60 dist: loadscope + - shard: proxy-infra-root-q-z + test-path: |- + tests/unit/proxy/test_[q-z]*.py + --deselect=tests/unit/proxy/test_reducto_ocr_route.py + --deselect=tests/unit/proxy/test_response_polling_pre_call_checks.py + --deselect=tests/unit/proxy/test_server_root_path.py + --deselect=tests/unit/proxy/test_ui_path_detection.py + --deselect=tests/unit/proxy/test_unit_test_proxy_hooks.py + --deselect=tests/unit/proxy/test_update_spend.py + --deselect=tests/unit/proxy/test_zero_cost_model_budget_bypass.py + python-version: "3.12" + workers: 4 + reruns: 0 + timeout-minutes: 20 + job-timeout-minutes: 60 + dist: loadscope + + - shard: proxy-subprocess + test-path: |- + tests/unit/proxy/test_component_allowlists.py + tests/unit/proxy/test_prometheus_metrics_server.py + tests/unit/proxy/test_proxy_cli.py + python-version: "3.12" + workers: 2 + reruns: 0 + timeout-minutes: 20 + job-timeout-minutes: 60 + dist: loadscope + - shard: caching-local test-path: >- tests/unit/caching diff --git a/GEMINI.md b/GEMINI.md deleted file mode 100644 index 5fc00e0b5ae..00000000000 --- a/GEMINI.md +++ /dev/null @@ -1 +0,0 @@ -Read @AGENTS.md for coding guidelines diff --git a/ci_cd/cost_map_guard.py b/ci_cd/cost_map_guard.py index d5fd755ba18..09138bd6c14 100644 --- a/ci_cd/cost_map_guard.py +++ b/ci_cd/cost_map_guard.py @@ -20,7 +20,7 @@ import json import os import subprocess import sys -from collections.abc import Iterator, Mapping, Sequence +from collections.abc import Callable, Iterator, Mapping, Sequence from dataclasses import dataclass from types import MappingProxyType from typing import Final @@ -28,8 +28,13 @@ from typing import Final COST_MAP_PATH: Final = "model_prices_and_context_window.json" BACKUP_PATH: Final = "litellm/model_prices_and_context_window_backup.json" PINS_PATH: Final = "ci_cd/cost_map_pins.json" +PINS_PATHS: Final = ( + "litellm/scripts/ci_cd/cost_map_pins.json", + "scripts/ci_cd/cost_map_pins.json", + "ci_cd/cost_map_pins.json", +) GUARDED_PATHS: Final = (COST_MAP_PATH, BACKUP_PATH) -CHECKED_PATHS: Final = (*GUARDED_PATHS, PINS_PATH) +CHECKED_PATHS: Final = (*GUARDED_PATHS, *PINS_PATHS) BOT_BRANCH_PREFIX: Final = "litellm_cost_map_sync_" PRICE_SYNC_BRANCH_PREFIX: Final = "litellm-providers/price-sync" TARGET_ENV: Final = "COST_MAP_GUARD_TARGET" @@ -193,7 +198,7 @@ def _bot_failures(base: Snapshot, head_map: CostMap, changed_files: Sequence[str def pin_author_failures(head_ref: str, author_type: str, changed_files: Sequence[str]) -> tuple[str, ...]: - if PINS_PATH not in changed_files: + if not any(path in changed_files for path in PINS_PATHS): return () if head_ref.startswith(PRICE_SYNC_BRANCH_PREFIX): return (f"price sync PRs may not change {PINS_PATH}; a pin moves only in a human PR with new evidence",) @@ -251,8 +256,11 @@ def _git(*args: str) -> str | None: return result.stdout if result.returncode == 0 else None -def snapshot(revision: str) -> Snapshot: - return Snapshot(*(_git("show", f"{revision}:{path}") or "" for path in CHECKED_PATHS)) +def snapshot(revision: str, *, read_git: Callable[[str, str], str | None] = _git) -> Snapshot: + return Snapshot( + *(read_git("show", f"{revision}:{path}") or "" for path in GUARDED_PATHS), + next((text for path in PINS_PATHS if (text := read_git("show", f"{revision}:{path}")) is not None), ""), + ) def merged_tree(merge_base: str, target: str, head: str) -> str | MergeFailed | None: diff --git a/codecov.yaml b/codecov.yaml index 521088868bd..2fa8ea04f0e 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -6,7 +6,7 @@ codecov: ignore: - "litellm-rust/**" -# Uploads are flagged per workflow tier (GHA) or "circleci". carryforward makes +# Uploads are flagged per workflow tier. carryforward makes # a re-upload of a flag replace its prior session instead of accumulating a # conflicting one, and lets a commit reuse a flag from its parent when that flag # was not re-uploaded. Required because the same commit can receive the @@ -60,6 +60,12 @@ flag_management: carryforward: false - name: proxy-infra-root carryforward: false + - name: proxy-infra-root-a-p + carryforward: false + - name: proxy-infra-root-q-z + carryforward: false + - name: proxy-subprocess + carryforward: false - name: caching-local carryforward: false - name: proxy-extras diff --git a/cookbook/Benchmarking_LLMs_by_use_case.ipynb b/cookbook/Benchmarking_LLMs_by_use_case.ipynb deleted file mode 100644 index 6ea6211bfb6..00000000000 --- a/cookbook/Benchmarking_LLMs_by_use_case.ipynb +++ /dev/null @@ -1,753 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "4Cq-_Y-TKf0r" - }, - "source": [ - "# LiteLLM - Benchmark Llama2, Claude1.2 and GPT3.5 for a use case\n", - "In this notebook for a given use case we run the same question and view:\n", - "* LLM Response\n", - "* Response Time\n", - "* Response Cost\n", - "\n", - "## Sample output for a question\n", - "![Screenshot 2023-09-07 at 4.45.37 PM.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACXAAAALmCAYAAADhDS65AAAMP2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEAIEHoNvQkiNYCUEFoA6UWwEZIAocQYCCp2ZFHBtYsFbOiqiGIHxI7YWRR7X1BRUdbFgl15kwK67ivfm++bO//958x/zpw7c+8dAGgnuGJxHqoBQL6oUBIfFsQYnZrGID0FREADegAFRlxegZgVGxsFYBls/17e3QCIrL3qJNP6Z/9/LZp8QQEPACQW4gx+AS8f4gMA4NU8saQQAKKMt5xcKJZhWIG2BAYI8XwZzlLgahnOUOA9cpvEeDbErQCoqHG5kiwA1C9DnlHEy4Ia6n0Qu4j4QhEANAbE/vn5E/kQp0NsB23EEMv0mRk/6GT9TTNjSJPLzRrCirnIi0qwsECcx536f6bjf5f8POmgDxtY1bIl4fGyOcO83cqdGCnDahD3ijKiYyDWgviDkC+3hxilZEvDkxT2qDGvgA1zBnQhduFzgyMhNoY4VJQXHaXkMzKFoRyI4QpBpwgLOYkQ60M8X1AQkqC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TgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggRAUcFkLJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJjCcCCrjGE3h3KwEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAGXdUACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkMB4IqCAazyBd7cSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQUcFkHxgmBGWecMcw///zhkUceCZ999tk42ac7mTQITDnllGGxxRYLI0eODO+///4kcdDzzDNPmGaaacJTTz01SRyvBykBCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKYmAko4JqYz24vObbZZ589HHHEEbE0d955Zzj//PN7Sckm7GLMNddcYciQIWHyyScPH3/8cRg+fHj473//O2EfVAulP+OMMwIirtGjR4ef//znLeQwbjYZPHhwFDHme6PM119/fb6o2+kNNtggbLjhhjHd8ccfHx5//PFutxkfCWaaaaaw5pprhimmmKK2+88//zzceuut4aWXXqotK5toZ9uy/FwmAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAIS6M0EFHC1eHbmnHPOsNBCC4XnnnsujBo1qsVcJozNFlxwwfD888+H//3vfy0VeMkllww//vGP47bwOvzww1vKx426Ejj00EMD9TDZSSedFB599NE0O85+260f7Rb0N7/5TZhsssnCJ598Enbdddd2s+uR7aeaaqpw+umnl+a9ww47lC6vt3DHHXcMyy+/fFx9zTXXhGuvvbZe0i7Lx/V52mOPPcLiiy/epQzMPPzww+GUU04Za3m+oJ1t83xamf7Sl74UVl555TDffPOFOeaYI8wwwwyBG+ULL7wQhg0bFj788MNWsnUbCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQQF0C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E3DbbbBPwrgQrhHKUF09gN910U7jrrrvy5PG48GhEmDbsscceC3fccUfAu9Hss89eC7F38803h2uvvbbLtvVm4Ixg429/+1v417/+VS9ZS8s5D3g0m2GGGWrbw+fyyy+PHopqC8dMbL311gEPZoTwxKgrV199dbjvvvvifBJwEZZumWWWCUsttVSYdtppAx7iXnrppXDKKafULT/loN4iKIId2xHiDy9DL7/8cjjjjDNCI69WrdaPWPA2/u26665h3nnn7ZJD3r66rCjMzD///LFN4LWLeoZ9/PHHYfTo0bFtUd8OO+ywHvWk16yAi/RbbrllF49/lPnwww+vFLa1nfOE90Ha0VxzzRVo19RD9v3mm2+Giy66KDz77LMFwuWz7YiwutsWT4i0pxSW8oUXXgicZ+r0Z599Fr2zXXnlldHrGddQjPpNvohuc1t33XXjteaWW27JF0cPXMcff3xc9pe//CVceumlXdY7IwEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEmiVgAKuCuQITYdwAYHNbrvtFsULZZudfvrpUSSFcGbnnXeOYpqhQ4fWkr766qvhgAMOiPO5KCwluOeee6JnrzSffhGBIcCqZwh6EBMUBQeIGk488cSa4Kve9v/4xz8CHsaSrbfeelHUg7inO6sXDm3ppZeOrIrbX3/99WH48OHFxV3mCQ+33XbbdRGrdEkwZgaWRx99dE24loc+I23ygJZET/n2d955Zzj//PPzRWNNb7bZZmGNNdaoiaYefPDBKGYaK2GLCxDOIRIqGmIxPADllupVvuypp56qhXpLAq5iSM+UnuW77757qdCH+onoq55R5xHivf/++7UknagftcxanMADXvHcImY85JBDGuY4zzzzhF/+8pdjbVvcCLFPElsW13VivlkBF9eTb3zjG2PtmusJbaHMOnGeEKbyV2Sd76+eqDVPw3R3Iqxi+ny+u205rwcddFC+yVjTXBOKx4H47IgjjhgrbdmCVVddNWy11VZx1bBhw+qKXsu2dZkEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUigEQEFXI3ofLEuiUVGjhwZjjrqqLpb4KVmx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ISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCTQ2wgo4OptZ8TySEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAKTDAEFXJPMqfZAJSABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIIHeRkABV287I5ZHAhKQgAQkMJ4JfOUrXwkLLLBAGDlyZPjwww/Hc2ncvQQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAT+j4DjWNaEiZWAAq6J9cx6XBKQwCRBYM455wwrrrhimGaaaWrH+/nnn4c///nP4fXXX68t68TE0ksvHRZddNHQp0+fWnbs48Ybb6zNOzHhE/jGN74Rdt5553gg//rXv8Jee+014R+URyABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJDDBE3Aca4I/hR5AAwIKuBrAcZUEJCCB3k7gzDPPDFNMMcVYxbzrrrvCeeedN9byVhd87WtfC/vss0/p5jvssEPp8t60cJ555gkDBgwIo0aNCs8991xA5DYx2qyzzhpWXnnlKN678847WzrErbfeOqyyyipx288++yzstNNOLeXjRhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhLoJAHHsTpJc/znNd1004XFF188FuTFF18M//znP8OXv/zlsNxyy4URI0aE9957b/wX8osSDBw4MAwaNCg89NBD4ZlnnumRcing6hGsZioBCUyMBOgQfPOb3wxf+tKX4uFxwzjssMPCO++80+Vw11tvvbDOOuvUhFUff/xxOProo+MNp0vCDsycffbZYfLJJx8rp/vuuy+wrlO2zDLLhKFDh5Zm11sFXDPOOGPYe++9Q79+/cJkk01WKzvirbfffjuceOKJ4ZVXXqktnxgmTj311Nip4ViOPfbY8OSTTzZ9WN///vfDkCFD4nb//e9/a964ms7IDSQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSGCiJcDgOuMmU089dekx/u9//wsffPBB/LD6kksuCaNHjy5N58JJm4D1aOI//zvuuGNYdtllu0T4aXTUjOPhjOHII48sTeY4VimWCWoh47Y4kGD8OY27pwNgbJL7x5RTThnHc3/605+mVeP1F6HZCSecEMtAHaVe94TDEAVc4/U0u3MJSGBCInDWWWeNdRN59tlnwxFHHFE7DBTBp5xyShfBECs77REr7XD11VcPgwcPjp0ewikm67SAi3x33XXXwD5mnnnmMNVUU6Vdhd4o4EJot9122zXsDHJTveKKKyaqEJDnnntu7bxcf/31Yfjw4bX5qhMLLbRQDJtI5wkBWOqMVN3edBKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJDDxE/jlL38Z5p133koHyvv44447rqWPjivtwEQTLAHr0QR76ioX/KSTTgpf+cpXKqcnYSMHA45jNYWy1yWeffbZw7777hsQRHVnn376adhll126SzZO1uehO9nhgQce2COOQhRwjZPT6U4kIIGJgcB+++0XFlxwwS6HwkMHNw46EtgGG2wQNtxwwy5pmDn99NOjO8WxVnRwAcKxaaaZJubYEwKuVNQtt9wyrLbaamm21wm4ZplllnDUUUeNJaKrFbgwgRe1559/vrC0d8726dMnqs7rlS4XcN1www3hyiuvrJfU5RKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCCBlglssskmMRpJ1QyIVvKjH/2oavK20/GRMn94cplUjIgtn3322QR1uNaj3ne6Ol2PTjvttLqe+uodPeOvP/zhD+utdvkETKBM0Md1i2v1FFNM0eXIxrWAq1HdV8DV5dQ4IwEJSKB3EMCrEx6vcrvsssvCzTffHBchHJp11llrq+lg7L777uHDDz+sLWNivvnmC1tssUWYbbbZouqchwgUtW+99Va49tprw6OPPtolfT7DFy0rrbRSzANPWK+++mr405/+FL0mdSfgQgDEfhdddNEwwwwzRE9an3zySQwDeffdd4c//vGP+a5Kp3u7gOuggw4K88wzT63sHB/hEp9++ukw99xzB1xt5kp/wikm95vf/e53w1JLLVXztMY2559/fswreTtL3sfefPPN+MVQbUfZBEK/zTbbLNaFtC/OLyEbL7jggrquovv27Rvgu9hii8XObHq4xM30v/71r9C/f/8Y63nPPffM9vb/J9sRcPGQtPT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kIAEJSEACEpCABCZ8AogFllpqqbDbbrvVDgavLAigEAzgRUWTQBUCxYg8d999d7jhhhsCkWpyb3FV8jKNBCQggURAAVci4a8EJCABCUw0BNZZZ52wySabVD4e4h4T1lCTgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhg4iNAxIr999+/FrWjeIRE6SA0Vk950Cruz/kJkwAiwFNPPTVGT6l3BGeccUZ48MEH6612uQQkIIG6BBRw1UXjCglIQAISmFAJEMLvsMMOix64cF15//33R9fFCy+8cOCvf//+Ydppp41ulO+8887AlxGaBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEyeBjTbaKKy//voND46QeIwnaBKoR2C22WYLRx55ZL3VcTniLURcmgQkIIFmCSjgapaY6SUgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIYIIhwIffhxxySKnnpM8//zy89dZb4cADDzSM4gRzRsdfQXEggJALb1xFI3ziaaedFnAuoElAAhJoloACrmaJmV4CEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkECHCCjg6hBIs5GABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJNAsAQVczRIzvQQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggQ4RUMDVIZBmIwEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIoFkCCriaJWZ6CUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACHSKggKtDIM1GAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpBAswQUcDVLzPQSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQ6REABV4dAmo0EJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQ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O0/CUhg/BP40pe+FNZZZ53Qp0+fMGLEiPDPf/6z5UJNNdVUYe21147bP/jgg+Gll14Ka665Zvjyl78cnnvuufDoo4+GZZddNsw111wxTX6dKO6U6x3XPeypp56Kf8U0zH/1q18Niy66aFw1atSo8Le//S18+9vfDrPOOmt48803w0033VS2Wa9Y9s1vfjOW85133gm33357j5Rp+umnD0OGDInX5ZEjR4bHH3+80n46fd3+xje+Eeacc87w3nvvhVtuuaVSGcZnoqWWWioMHDgwlvnjjz+Odfmee+4Jo0eP7lKs1VdfPXzlK18Jqe59/etfD3PPPXf417/+FW699dYuaXvTzITSRrpjtuSSS9ba/7jo53RXnmbXV7lmkucCCywQllhiiZj9ddddF/773//G6XFxDWFH9fp39coVC9eD/7g3cO779+8fJp988vDqq6+Ghx9+OHCNyy3dR3gZ+pe//CXeU1j2+eefhz/+8Y81jvk2E9r0hN4GqvDmuWLdddcN9Fd66jmrSjlM838EJoU6N7Ge63buOeOyHda75/SGvmSjft9HH33U8fdBPf2OiWfAKaecMjTzLDLzzDOHwYMHx2Zy7733htdee62tJjO++hJtFfqLjcdlu+hEec1jwiMw9dRTh4033jg+y9922221d6yNjmRcPR80KoPrJCABCUigOQIKuCryUsBVEZTJJCABCUhAAhKoEfjRj34UB3sZ6P35z39eW96piS233DLw0hJDkMDAU3f2/e9/PwwaNCgm22OPPbpL3vZ6Bry32267mA9CrTRIn9iw4qc//Wn49NNPYxr/SWB8EGDwIgmIXn755UCbrWKtblcl7/GZZsYZZwwHHXRQLMLNN98cEAe0anPMMUft+sdg+R/+8Idw/PHHR3EYApcTTjgh7LbbbmHAgAFxF4888kg4//zzS3d31FFHBV5YYohmDjvssNJ0++yzTxTMsBLR2MUXXxyOPPLIKBr797//HQ444IDS7Tq5sNW6kcr54Ycfhl/84hedLFItLwRFW2+9dZx/+umnwxlnnFFb12ii3nW70bE2WverX/0qTDfddLG99cQ9stGxNLNuhhlmCEOHDo3CuuJ2iD4QcQ0bNqy26rjjjosCEq4lxxxzT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DAFDwBAwBAwBQ8AQMAQMAUPAEDAEDAFDwBAwBAwBQ8AQMAQKI2AEroJQGYGrIFD2mCFgCBgChoAhYAgYAoaAIWAIGAKGgCFgCBgChoAhYAgYAoaAIWAIGAKGgCFgCBgChoAhYAgYAoaAIWAIFEbACFwFoTICV0Gg7DFDwBAwBAwBQ8AQ6FYIrLvuum7vvff2af7zn//snnvuuW6V/u22285ts802Ps2//e1vu0TaDzzwQDdkyBD36KOPuvvvvz+ZJp7r27evu+eee9ycOXOSz5W50YowU/GvscYabq+99nLbbrutY65MXpYuXermzp3rnnzySffYY4+5Rx55xC1fvjwVRLe/vv/++7sBAwa4J554wk2bNs3nBywmTZrkevXq5e699143e/bspvI5fvx4N2HCBB/GXXfd5Z5//vlC4e2+++5u1KhRbt68ee6WW24p9E69h2J5rfd8V7q35ZZbOv4jl19++WpdJ8lj1XWQMHNk4MCB7qCDDnLrrbeeGzRokJs8ebLvG3LC4p3uXAdz89zV3ys63nX1fEj66LcPOOAAP57NmDHDTZ8+3d/aY4893Prrr+9eeukld91118njduwiCOy0005uzJgxbv78+Y65rEjZPmN1LedUvRac2nUcMWKEe8973uOju/vuu1dac+y7775u0003dUOHDvVz45tvvtm9853vdOPGjXMor6dMmdKupFo8PRyBnjZvLFLcsh5hXXfFFVe4FStWFHmt8DOpuWu99czYsWPdxIkTHfoM+rkf/vCHheNbnR/caKONHLghF110UcOyqnqM6Ir6mTLlfdhhh/n1PXqMv/71r2VetWcNgVWGQNk57ypLqEVsCBgChoAhUBgBI3AVhIqFhIkhYAgYAoaAIWAIGALdFYHRo0e7wYMHuwULFnQymGBIQUmFQICCcNKd5F//9V/d5ptv7pP8pS99qUsk/bTTTvNK5L///e/uZz/7WTJNp556qic1zJw5051++unJ58rcaEWYsfj3228/9773vc/nM3ZfrmFM/fGPf+xeeeUVubRaHX/yk5/4/EDgOuOMM/w5xsajjjrKn0MW0sZkf7Hkn8985jPuHe94h3/rd7/7nbvjjjsKhSB1YeHChe7EE0/seAf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AEPAEDAEDIEuhYARuAoWhxG4CgJljxkChoAhYAgYAoaAIWAIGAKGgCFgCBgChkCXQmDixIlu44039mm6+OKL3euvv96RPr7WPuCAA/zv2bNnu2uvvbbjHicYQrbffnu3fPly99vf/tYtWbKk4z7X99xzT+8Fiy1QFi5c6F555RU3ZcoU97e//a3jua222srtuuuu/vf06dPd1KlTO+7pEzw9DB482LEt3SWXXKJvdTrfYYcd3GabbeY4Ei/bet1zzz1+C8XLL7+807OTJk3y2yyus846rm/fvg4vIRiaf/e73zm2e9IyevRo9/73v99fIhyeJ02jRo3y4Ydh63dHjBjh+Podufnmmz2pbPfdd3cTJkxwa6yxhnv++ed9vu+66y79WqfzoUOHur333tuNGzfODRs2zKcVrxd33323e/HFFzs9q39svfXWbo899nDrrbeeGzRokMfhueeec1dccYV79tln9aOumXSKof6JJ55wZ5xxRqdw+UG6d9ttN7/VGuVInh966CGPXYj1Si+/dWGvvfZym2yyiS8zvDJQ7wiD/Fx99dWdXitTtp1eTPwYP368bwtgNGDAAIfSlHhvvPFGN2vWrE5vaQLXd77zHbfTTju57bbbzo0dO9bjTx2jHdCmYrLBBhv4uKiXlBntivjuu+8+d8stt/h86/f2339/X76U53XXXecOPPBA3y5J58knn6wfraQcdIB4X6Fukz8Ik5TLggUL3Jw5c9xVV13lMdLPkzeef+ONN9zkyZN9XZY+iHoxd+5c783l+uuv1691nPfu3du9+93vdltuuaVve/PmzXMPPvigx+aEE05wI0eO9PGfdNJJHe8UOdlvv/18e1x77bW9Rxn6mUceecT96U9/cmzBGgp9y6GHHurx5B0Ezxa8Q75D2fn/s3cmcP9OZf6/ZaZSjUojQiFiRIlJREKElCVrWUpJlK1lmmKmUqF9poVI1pCUrSIhS5YQIVtlCZGmlKlm2mf+/X/vk88z1+849/297/P9Ps/v+fG5Xq/n+d7bWe7POec6y/W5r7Pmms3KK6/cPPDAAylO9N5aa63VgAcY3nvvvcmDzXXXXTdX0NpwMZLnP//5U/WP62xjd8MNNzTXXntt0o/xWR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L/mc3+uD828EjIARMAJGYAgCJnANQcvPGgEjYASMgBEwAkbg4YuACVw9y9YErp5A+TEjYASMgBEwAkbACBgBI2AEjIARMAJGwAhkCIg4xJaJELkQtsX72Mc+lj05f57q/ci9tlCcjW8yv+RzNmLnPBkBI2AEjIARmC4ETOCaLmQdrxEwAkbACBgBI2AE5i8ETODqWV4mcPUEyo8ZASNgBIyAETACRsAIGAEjYASMgBEwAkYgQyASh7j1+9//vvnoRz/aPPDAA9mT8+dpfD8TuObPMnSujYARMAJGwAjMKwRM4JpXyDtdI2AEjIARMAJGwAjMLgRM4OpZHiZw9QTKjxkBI2AEjIARMAJGwAgYASNgBIyAETACRiBD4PGPf3yz4YYbNgsuuGBz9913NzfeeGPz5z//OXtq/j19zGMe06y++urpBW699dbml7/85ax8mfkln7MSPGfKCBgBI2AEjMA0IbD88ss3iy66aPO73/2u+d73vjdNqThaI2AEjIARMAJGwAgYgdmOgAlcPUvIBK6eQPkxI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBHojYAJXT6hM4OoJlB8zAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGoDcCJnD1hMoErp5A+TEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEeiNgAldPqEzg6gmUHzMCRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkagNwImcPWEygSunkD5MSNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYAR6I2ACV0+oTODqCZQfMwJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRqA3AiZw9YTKBK6eQPkxI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBHojYAJXT6hM4OoJlB8zAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGoDcCJnD1hMoErp5A+TEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEeiNgAldPqEzg6gmUHzMCRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkagNwImcPWEygSunkD5MSNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYAR6I2ACV0+oTODqCZQfMwJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRqA3AiZw9YTKBK6eQPkxI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBHojYAJXT6hM4OoJlB8zAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGoDcCJnD1hsoPGgEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEpgeB//7v/24WXHDBZoEFFmge9ahHpT+Odd431QXWWmutv/R92M8ZASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMQNOYwOVaYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARmEcImMA1j4B3skbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYARO4XAeMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMALzCAETuOYR8E7WCBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgApfrgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGYB4hYALXPALeyRoBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBEzgch0wAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAjMIwRM4JpHwDtZI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyACVyuA0bACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYgXmEgAlc8wh4J2sEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETCBy3XACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASMwjxAwgWseAe9kjYARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACJnC5DhgBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBOYRAiZwzSPgnawRMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAELtcBI2AEjIARMAJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIzAPELABK55BLyTNQJGwAgYASNgBIyAETACRsAIGAEjYASMgBEwAkbACBgBI2AEjIARMAJGwAgYASNgBIyAETACRsAImMDlOmAEjIARMAJGYD5H4OUvf3mz+OKLNz/72c+as846a9a+zQYbbNA89alPbR544IHm/PPPn7X5dMb+isCaa67ZLLPMMunkq1/9avP73//e0DzMEfjHf/zH5nnPe17zl7/8pTnmmGNm5ds+5jGPabbaaquUtyuuuKL58Y9/3GyxxRbNQgst1Nx2223Ntddem+6tsMIKzWqrrZaOTzvttOZ//ud/mgUWWKDZeuutm7/5m79pbr311ua6666btndceOGFm0033TSlefnllzf33ntvSmudddZpllpqqeZXv/pVc+65505b+ptttlnzd3/3d82dd97ZfOc732le+MIXNs94xjN6p/v3f//3zYYbbpjyd+mllzb33XfftOXVEY+HQG3fSl38h3/4h+b+++9v0PHjCu2S9hnb4bhxOvz4CNTWj/FT7hcDuvtVr3pV86hHPSrpROnKfqH9lBEwAkLgmc98ZrPGGmuk06uuuqq56667dKvq1+OAKthSoJLeXXnllZu11lor3T/66KN7R942nuwdwYQenB/mCLwqOK+yyirprb/85S83/+///b9qBGZy3lCdyRkMWKrXM5j8jCZVmq+1tcVHEi4zWgiPkMRG6SzWeldcccXmSU96UnPZZZc15513XvP85z+/WW655Zrf/OY3zTnnnDNfIsW6xMYbb9wsscQSab3kfe9733z5Hs60ETACRsAIGIHpRMAErulE13EbASNgBIyAEZgBBD796U83j3vc49IE/q1vfeu0p4iBdumll07p3H333c0f//jHXmkqn7/73e+affbZp1cYPzTvEPjwhz/cYLxBDjjggEQQVG5YMFpwwQWT4f8///M/ddm/8wkCbeX3T//0T81KK62U3mK33Xabkbdpy0tb4ksuuWTz/ve/P91mwfLUU09tPve5zyXj/49+9KPm4IMPTvfe9KY3pcVNTvbbb7+GSc/f/u3fNkcccUS6//3vf7/52Mc+lo75x+LhE57whPTcJMhKLKySB+RLX/rSFFnr3/7t35onPvGJzR/+8Idmr732Sven499nP/vZRFS75557mgMPPLA55JBDmsUWW6z505/+NJWvrnRf8pKXNDvttFN65KSTTmouvPDCrsfnm3tPfvKTm0UXXTQZ9G6//fb5Jt9dGa3tWz/4wQ8mUvWk+mQZpCFH0n9YZgcCtfVjpnIPifAd73hHSu7E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evueaa5vDDD58KtOmmmzZLLbVU88tf/nIub5tTD8zyAxHQ/vKXv6Q1G3lKnOXZni+zV9P3zZcv6kwbASNgBB6mCJjA9TAtWL+WETACRsAIPHIQmF8IXI+cEnl4vKkJXA+PcszfYn4ncPE+ELgwqsgDoMhKl112WXPsscemVy4RuHIs4vnDjcDF9pC4zJeXvH333bdZddVVGwi0kLkeqeJFzP8reRO4/g8LH807BEzgmnfYO+WHFwKTJnA9vNCZ929jAtewMuiarwyL6a9Pe/xXg9ojN8wQAtcjFyW/+XQi8IIXvKDZY489UhJf/epXm6985SvTmdyMxq32BXELT4mW6UPAfd/0YeuYjYARMAIzgYAJXDOBstMwAkbACBgBIxAQWGWVVZr11lsvXbnooouaW265Jdxt0kQdl9lMaI888si57i222GLNtttum659/etfb+68884mErj++Z//uVlnnXUavhB8+tOfntxR8wzbjN17771zxaWTpZdeutlmm22Sd6yFFlqo+dOf/tTgzevKK69szj///KkvV9m67DWveU2z5JJLNuQDIc6f//zn6cuv++67T1EWf/k68SlPeUrzk5/8pPnmN7851zMQDXbZZZcU9xOe8ITm97//ffMf//EfKQ+QMiwzj0CJwPXa1762YUH92c9+dsoQA8lbb701fRV41VVX9crkwgsv3Gy33XbNcsst11Cn5Db9Bz/4QfLMRpxRXvrSlzZLLLFE8gB08cUXN2ussUaz9tprp23Q2A6O+v3FL34x1dlJhItxvPCFL0xfctOWIAzdddddactQvkrni8GSDH0/Fud4J9rcCSec0HC++eabN8Tzuc99rsGDEjKJNjKq/PKv6yH8gAGem/iC/Z577mloj23bpg5591F5KWGra+DyqEc9Km0fQL3RV5x4ijrllFPSYyUCF2HQMwhfsuKFa+ONN26e9axnpa/1KWPe8/rrr2/QZ2eccUZ6Vv+os+uvv36zzDLLNI9//OPTM9/73vcSJuisKG1faWvB8g9/+EOz1157pSDEh7cr6tRJJ52UtnJk66LVV1895Qe80Zl4z6JvYPuwlVZaKelTvrwFg9NPP31KVxPpIYcckvQ0Wy0cf/zxze67796stdZaSf++5z3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fKP773/8W3/zmN3V5xK8NAZkDI9kETfMcdjpbZh33A3B9/vOfD57eeP7GG28s7rnnHiUd8WvbZS4yFQ5PPvShD4V0MShxRGYNThzA1YBpTZI4gKsJ1zzNaHPgwAMPLLbaaqtQDFDMoJljsmHzUgAuBllAQDEByAKRjDcsO8jmAFxx+vgcl4YCcF166aVZoZsK2xjnpfP111+/513slltuKW666SbdGvGrQakMFDUiwXsnOQAXHryQGdDvfve74AXrvSThZ4klluihypsCuMiI75KaBIlHGvDxqgVCG8qFnuQ7XnDBBSFGcFymkND/OQecA84B54BzwDngHHAOOAecA84B54BzwDngHHAOOAecA84B54BzwDngHHAOOAecA51zYLQAXNiPsVviOeuwww5L1gvQ1vLLLx/u8QzPTp48uZgyZUq4hj0SQMyTTz6ZTG8vYoskbB1pCA/IryVsu0cccUS4BCAMxx5Qk3SDthOHgrX4d9pppxWf/OQnQw6AyIiKZYmQiHwfbLjvvPNOcfTRR9vbyeOmeQ47XarwVQBcxx9/fEg6b968gmhXKTrmmGOKSZMmhVuESXz00UdHPLbiiisWRDGD/vrXvxbKc8RDLU4cwNWCeXWSOoCrDrf82bHCgY033jh4UqI8FmSl8q277roBuazzFICLewyKuA+0hIcm8ofuvvvu4mc/+1k4tgCuHGgsPBj9I+Qfof+gV155pQBYFpONxVxloLJI7pz7yR122KH46le/Gl6V4lFcBnsuABfXiMFsqQyxDkL6i1/8Yng8BktV9cBFYiZCgOgsWTeif/rTn4of/OAHYeLFt2WAZyIE8Iv3Wtp2222L/fbbL1xKgc7ss37sHHAOOAecA84B54BzwDngHHAOOAecA84B54BzwDngHHAOOAecA84B54BzwDngHHAOdMOB0QJw2ag+119/fXHDDTeMqJAFuxDpiYhPkHUQcvbZZxfPPPPMiHS5k+985zsFtkzo4YcfLi688MIRj5566qnFyiuvHK5ZO3OTdIO2E48oeIMTHJvg4AQiAhSRtSzttddexU477RQu/epXvypwSNKPmuY57HSpevQDcAH8A7MAYefG0xbOWSzhgAbQH89CgAGJvGVp7733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xrZ5Vp0/NNVNNJEn1Let7O6qrTads1qgJvOxefPmhXGaDayscSABtMcagAtPz8x/oZynWXRCrHmhso0Q4YEF/9rKYI0TkqPKt+1vbs2Sm1PkZELTfpiTv6m5s5WbXbXvtvzz9M4B54BzwDkwXA50BeD6/wAAAP//JaFXhgAAQABJREFU7J0J3G1T+ccXka4KCXEN1zxkCmXI0DUWEkUliQYRKipSZioqqSgaZGxEyJA5YzLPQqZryJSM/2TW/35XnrfnXXetc/beZ59z3/fe3/P5vO85Z++11177u9Z61vA8e61pVl555f8EiQiIgAiIgAiIQGUCRx55ZAx7xx13hO985zvx+1prrRU+/vGPx++//vWvwwUXXBC/b7zxxuEDH/hA/H7YYYeF6667Ln5/97vfHT7zmc/E73/5y1+CxRkPvPZvmmmmCZ/4xCfC9NNPHyZMmDAU5/e///0w88wzh+effz7suOOOQ5dYHD5du+yyS1hiiSViGLvf0AUTv5CmN7zhDeFf//pX2Gmnnfyp8La3vS0ccMAB8dgtt9wSfvCDHww773985CMfCTPMMEMg3PXXX+9Pjfjvm2yySXjrW98a7rvvvnD++ecPS+/rXve6mMdvectb4vHjjjsu/OMf/whwRW644Ybwox/9KH73/8i7n/3sZ4HrX3rppfC5z30unm47P4j/5z//eYz78ccfD1/96ld9Moa+r7/++mHs2LHh3//+d/jtb38bj88222xD5feqq66K6bULuqVzpplmGioPt956azj44IPjpf46nplnR2A044wzhmeeeSZ86Utfisf8v3XXXTdsvvnm8dCvfvWrcOGFF4Ytt9wyrLnmmvHY4YcfHq699lp/Sfy+zz77hPnmmy9+9/VrkoDuQKlOEqRbOjfYYIOw6aabxtgsneutt1746Ec/Go95FvHAa/+snv3nP/8J22yzzdCpTmkZCpT5YukkP7/whS+E6aabLmy11VaBcnfllVfGeugvo/x+97vfDdNOO208vP3224cXX3zRB5nku8/LnO4YM2ZM+PGPfxyvs+dG13AdUrdudCqPMcLMv7e//e3hK1/5Sjxz++23h4MOOmiSUDvvvHNYeuml4/Gvf/3r4ctf/nKYffb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d2Ld9Pn7kc5+xJk+Hzqv6dwEcdXVJ23q7vRZ6v5u0me1ORT0IXOAtBM4fJnQjjCfi9MuK26l87kWbnJ/km+UL3uBiLkpXp5C0tVtq6S1Hzq4yn3bCtNJJwyiHrb1HIpHBERABERgdBFgTMXYkT4JfTL++G6/qz6NtlCsSkrhREAEREAEREAEREAEBkaAySZW50BwQvPbDVkibOs0jDCscNDEGGNx6VMERKA/BPyqTr/85S/DRRdd1J8bKVYREAEREAEREIGBEbAth3Mrjw4sEbqRCIiACIiACEylBFj90V40wKE6la233jqu+sbxgw46KNx+++1pEP0WAREQAREQARFomYAcuFoGquhEQAREQAREQAREQARGDgHeyLZtO1mNgxW2/DYqbDmz6qqrxgTzNv3+++8/chKvlIjAVE6A+ssbymydyvamrE7DaiPbb7/9VE5Gjy8CIiACIiACo5/AaqutFthWjj46242ykq9EBERABERABERgcAQOOeSQoe1z2YKXlRRN/HbU6Za4FkafIiACIiACIiAC7ROQA1f7TBWjCIiACIiACIiACIjACCKw7777xu3wSBKra7G1DEuds8UlbxoiOInsueeek2xtFE/qnwiIwGQhsO2228atPFke2uTMM88MJ510kv3UpwiIgAiIgAiIwCglsMIKK4R11lknsLKmbdU0Sh9FyRYBERABERCBUUlgs802C+uvv/5Q2tnumy1hmS/jBSqEebRDDz00bn0+FFBfREAEREAEREAE+kZADlx9Q6uIRUAEREAEREAEREAERgKB6aefPuy9995h7Nix2eTIeSuLRQdFYLITwIFrpZVWGkrH/fffH/bbb7+h3/oiAiIgAiIgAiIgAiIgAiIgAiIgAiLQnMA222wTVl555eBfnLLYcN467LDDwvXXX2+H9CkCIiACIiACItBnAnLg6jNgRS8CIiACIiACIiACIjAyCMw///xh9dVXD3PMMUdM0N/+9rc4CfXggw+OjAQqFSIgAsMIjBs3Lm5xypZKt99++7DtHIYF1A8REAEREAEREAEREAEREAEREAEREIFGBGaaaaaw3nrrxRcfx4wZEyZMmBBX3GLeDCcuiQiIgAiIgAiIwOAIyIFrcKx1JxEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYRkAOXMNw6IcIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIDI6AHLgGx1p3EgEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREIFhBOTANQyHfoiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIjA4AjIgWtwrHUnERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERhGQA5cw3DohwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAgMjoAcuAbHWncSAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQgWEE5MA1DId+iIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMDgCMiBa3CsdScREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERGEZADlzDcOiHCIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACIiACAyOgBy4BsdadxIBERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERCBYQTkwDUMh36IgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIwOAIyIFrcKx1JxEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYRkAOXMNw6IcIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIDI6AHLi6sH7zm9/cJYROi4AIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiEA9Av/3f/8XL5ADVxducuDqAkinRUAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEahOQA1dFZHLgqghKwURABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCoTkANXRVRy4KoISsFEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQqE5ADV0VUcuCqCErBREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEKhOQA1dFVHLgqghKwURABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCoTkANXRVRy4KoISsFEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQqE5ADV0VUcuCqCErBREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEKhOQA1dFVHLgqghKwURABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCoTkANXRVRy4KoISsFEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQqE5ADV0VUcuCqCErBREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEKhOQA1dFVHLgqghKwURABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCoTkANXRVRy4KoISsFEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQqE5ADV0VUcuCqCErBREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEKhOQA1dFVHLgqghKwURABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCoTkANXRVRy4KoISsFEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQqE5ADV0VUcuCqCErBREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEKhOQA1dFVHLgqghKwURABERABERABIYRWHnllcOcc84Zj5166qnhP//5z7DzuR/TTDNN2HDDDcN0000X7r777nDzzTfngrVyjD7OWmutFbjnVVddFR566KEY74orrhjGjh0bnnnmmXDBBRe0cq+6kQySQ920dQuf4/fWt741rL766vHSK664IjzyyCPdoul4ft111w2zzz57eOyxx8J5553XMeyUcHLxxRcP/CGnnXZaePXVV3t6rEHzW3jhhcNSSy0V03z55ZeHRx99tFL6V1111ZjPTz75ZLj44osrXaNA3QmgXzfYYIMw7bTThuuuuy7cf//93S9SiKmGwHvf+96ob2adddYwZsyY8Pzzz4enn3463HPPPeGPf/xjePHFF6caFvagSy65ZFhkkUXCs88+O8W0OW9729vC2muvHR+Rvk7Vdrnt9twYT02f0sG95fbMM88cxwrEcuGFF4aHH364twhH4NUjfQy14IILhmWWWSaSO+OMM8LLL78cv+fGAIPCu8oqqwT0Wpvjx37E2SaP9dZbL8w444y12ibrkzOWOP300yuNz9tMM3FRTkjHE088Ec4+++y2o+8a35Q+vhg3blzgGZHf/va3kyWPu2bCKA/Qy1zN+9///jDTTDOF22+/PY7D+oWipKfbLP9N+5L9euY24u0lb3P3nxIZ5Z5Tx0RABERABESgTQJy4KpIUw5cFUEpmAiIgAiIgAiIwDAC3/jGN4L1I77yla+EV155Zdj53I/pp58+HHTQQfHUHXfcEQ4//PChYDiDMUn973//u7KhcejizJd3vOMd4ZOf/GQ8g1OMOWvtv//+cVLthRdeCLvttlvmyv4f6sSh/3fv7Q45fjhvbbrppjHik046KVx66aU93eTAAw+MjgX/+te/wp577lk5rhlmmCHMPffcMfyDDz4YyOPRIDvssENYdNFFY1J33XXX8NJLL/WU7EHz+8xnPhOWXnrpmOYTTzwxXHbZZZXSb+l87rnnwte//vVK14yGQPPPP390nsJw9dRTTw08yW95y1vCPvvsE+97/vnnB4yvEhHASXSrrbaK7WyJBgZf9Pcpp5xSCjJFHv/Sl74UMIjipLDLLruMqmcs9Z18u/yb3/wmOrJXeTB/XRvteZV7DiIMTkE4p/GywYQJE/p6S+ng3vDSn6Bfg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ssSMJ46hNy2jvD41a8Eq4CIiACLxGQA5cFYuCHLgqglIwERABERABERABEahBYEp14DrqqKMqbetUA5WCViTA1g4YXljq/6yzzhq6qjTpOhSgD19KaenDrRpHiTPbW97ylmio/OpXv9q3lWmqJrCpA9doYF2VwUgP542hU7uuYxtgVvZLZaeddorby3Cc1QlYlTGVZ555JqyyyipaRSkFU+F3XQeuZZdddmhlP5yd+rWF4iDbGW8wlANXhUIz4CBtljm2xNt8883D6173unD77beHa665ZsBP0/12cuDqzmhQIUZDeRkUC+5Tt8+y0korhY997GMxid/+9rdbWbW3H3G2xXCkOHAxdqMvj1x00UXh73//e1uPWDmeun2LyhFPhoBt83z7298ett122/gkvKTGy2pTm5T6eG2zHklc5cA1knJj8GmRA9fgmeuOIiACIuAJyIHL0+jwXQ5cHeDolAiIgAiIgAiIgAg0JCAHrobgdFltAqVJ19oRTWEX2ApCbCnG1mKTW5o6cE3udE9N969rDJ2a2Nizss3I7LPPHn8efPDB4YEHHrBTwz7lhDMMR+UfI9XIOsh2RmWncnFRwAEQkAPXACDrFo0INOmz0G7jMHnTTTcFHNXbkH7E2Ua6RooDVxvP0mscI7Vv0etztXH9csstF7beeusY1dlnnx34m9pkkH28kcJWDlwjJScmTzrkwDV5uOuuIiACImAE5MBlJLp8yoGrCyCdFgEREAEREAERGFUE5p133rDhhhuGOeaYI4wZMya8+OKLgY7htddeGy6++OJJVqfYeOONA0uT33vvveGCCy4IGA6XXnrpMOecc4YXXngh3H///fFt2ZKRep555gm8fbzggguGaaedNtxzzz3hqquuCq9//evDjjvuGNnV2S6NC0jDyiuvHGaZZZYYJ1tdsMrJKaecEljWH1liiSXiCid8v/nmm8PVV1/N10mElQ1YReVf//pXOOGEE4bOV7nHm970pvCRj3wkzDXXXEMG+4cffjg89thj4cwzzxz25jbPvs466wQc1zDu4zRz5513xtUUYJKKcZ8wYULki4GMZx47dmx8M/kvf/lLfC6uI87VVlstjBs3LuYfby5fcskl4a677kqjLf7u5/14Xsrc3HPPHbcc49lh9Oc//zmWuzRRlpa6ZY63tymrDz30UHz+8ePHx3JHeWVVAlZeueWWW2K+kD9e1lprrViuqRdsFcEKOZRtyubzzz/vg8ayv8EGG8Rjp512WgxPOeI5r7zyysCxNC0Epu5x/JVXXgm/+93vYvldc801wwILLBDLIExYYePcc88ddj//Y4011ghLLrlkmHXWWQNljfvdeuutgcl1ygZpxuj0/+ydCdgtRXH+x7+JS/QB44qoeBEia1BBFNAoiIIgF1AERHABEcGIe6LgHhU31CCIgODCIotKUFBEFkFAEJSgKIsREVcEBfExmsQk/u+vue+X9/btPmemzzl3rXqe75s5Mz093dXd1TVVb1ePok022ST1GY5st/PnP/855fOHP/whld2fnTZfPO/8vBXAVeI14+3FL35xegXbfNx4443dtttu26299trdAx/4wO6OO+5IMo1IbZIZJEYu7bnnnqm/wMdStJNtttmmQ67deuutafsQzrkG0cdOPvnkJBvThYX/4DX9kK0qaSPGZx/qI4cmlXXwhPHJ2LnnPe+Z5oNbbrmlO++88xKPKOfyKOsYx89+9rNTX+ebnrb59a9/neQi277Q72dBrQAu5jCicq2zzjpJHvzqV79KY5t2qNGqq67abb311t28efOSPEFuIUMuv/zyVNfac6OuE2nhCU94QpIn5Md2JMyfzHP0YebKCxdEyMiJ55BPpEO3QJ7Qj84888xiFDI9v/HGG3dPfepTUzRA5NEf//jHtH3V+eef333/+99XsrnjUCcrshGeoq+gIzhNo4/Map7xcubnyIVddtklXSYC19C+AzgBuUmkKLYBZX6kvZhTvvSlLy2iuwCAYG6BvvCFL6QIl+mH/SMaHUAACJ3la1/7mt3tusc//vHpXegAEPoi8vWqq65qGoeM5/nz56e58z73uU8a28hxdKpcpi9SkMIP9FPmVOrPvMxYgr/oVeiW6KvMs+gtyEj4xpxNH6d/Mz6YY5xKfa51TuI59Ezo6quvTuObc+kTyDG2yKIvU+6NNtoo8YMoKcwzjGHu0Y6PfvSjk+5w++23J17R1qWIdEP6B2VpBXD1HX/oIbQLdM455xTlCX1i1113TWmY7/meEfWZR9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GUDmBqyFQfpkj4Ag4Ao7AqCHwute9rlpmmWWq+++/vzrvvPNGLR/dHrzRRhuFfD744IPVxRdf3O1yPz/GENh8882rxRZbrPrDH/5QXX/99Y1zv95661WTJk2qHnjggeqcc87pet9qq61WTZkyJVz3ox/9qOv1g7zguc99bvWqV70qPGLWrFnVvffeO8jHjdm0F1lkkWqLLbaoFl100WrOnDnVDTfcMGbLMtIZf8YznlFttdVW1XLLLVctvvji1cknn1zdcccdI50Nf15DBF784hdXkydPrh5++OHqwgsvbHhX/WWDSLP+id3P0pfR+U996lPDxdgef//732tvfMpTnlJtueWWFZ+I68xauAZ2ciyOW69+9aurF7zgBdVf//rX6txzzx0YNk0SXnbZZavXvOY14dKZM2f6uN8ENL8mILDSSitVzIWQk046qfrf//4Xvtf9K53jjeU51zDoqNI5TV1d+rmFG4FhaNcLdw146dsi0NZH0zb9hf36sTxO5+oOvxi6rkSwqfF1lNjY41W/pmyRXFk33njjaumll67++Mc/Vtdcc01JFfg9joAj4Ag4AkOEgBO4GlaGE7gaAuWXOQKOgCPgCIwaAl/5ylfCZPdvf/tb9ZnPfGbg+YCks8IKK4Tn/OlPf6oef/zxRs9UPh999NFqn332aXSPXzR2EPjOd74TMguB6+CDD26ccdrs8573vOof//hHte+++3a9793vfne1zjrrhOv23HPPrtcP8gKcVNttt114xE9/+tPq0ksvHeTjhj7tJZdcMjjtCErOnTu3k9+nPe1p1YEHHhh+33rrrdWhhx7aOedf8gg8/elPr770pS9VfEpOOOGE6qqrrtJP/xwyBKxO+OIXvxgIJ71mcRBp9ponSJlf/vKXqyWWWCIkddttt1Xf+973apN9+9vfXk2dOjVc85///Kfab7/9qscee6z2Hj/ZfwRsexor49bnPve5aqmllgokQdrNSMiECRNC+8Y2seRsix8k8iuuuGIksrNQPyNnW4w1UKwO3GuvvSr0YDfR3KntHE/39TrnKp3zdStX3Xnbx0ZLR5XOaerKNRrnRqP+RqOcI/nMiRMnBiI6Lx499NBDjR89DO06l9nSMuXSG+vHS/tN6X3DildbH82wlmM081XXJvo1To9m+eJnMzd85jOfGR9u9Pu4444L98q31sbGHmb92qjwmYtStkiurF//+teDzwj/vPxumWT9sCPgCDgCjsAYQMAJXA0ryQlcDYHyyxwBR8ARcARGDQFN/ts690sz/MY3vrHiDznmmGOq6667rlFSymevwYRGD/OLRhyBlIOhSSbaOgedwNUE1dG55uMf/3j1whe+MKwq8bGPfayTCSdwdaBo9QWiIu0dgRSHjj/xxBOrm2++uVU6fvHIIcDqUjhNWZnq6quvro4//vieHz6INHvO1LwEWBlst9126yR1yCGHVL///e87v+0X3hZG10P8Qk477bTqkksusZf49xFCIOf4H6HHFz1mNAhc9GPGLlbTmz59eiffFr82waVOAv6lNQI526J1QqN8w1gkcJXO+XqB2vYxJ3D1gmQV5uslc/benjp+78aW2X///UMBf/vb31Y//OEPGxd2GNp1KrO9lCmV3ng4Vqr3Su8bVsza+miGtRyjma+6NjEefaNf+MIXqmc/+9lFkDuBa0HYUv7V3FjiBK4F8fMjjoAj4AiMZQScwNWw9pzA1RAov8wRcAQcAUdg1BDQ5H80CFw/+MEPGm+XxzYgbD3DFjhnn332qOHlDx4MAikHQ5MntXUODhOBi/ZMu0Yuuuii6q677mpS5HF7TS7ICmmDwCWkFshHvoJUsyaw4447Vq94xSvCxQSJCBa5DD8CO++8c7XGGmtU//rXv6q99967LxkeRJr9yNguu+xSrb766iGpOhsEHLRy53333VcdcMAB/Xi8p1GAwFgct5zAVVDR4+iWnG0x1oo4kgSufs25bPC5zZyvl7oZBh1VOqfppdyDuHc06m8Q5RiWNHshOw1Du07h2EuZUumNh2Ol/ab0vmHFrK2PZljLMZr5qmsT/RqnR7N88bOf8YxndFZntuemTZtWsZoqcvTRR1esEhXLI488Um2wwQad1e3bvCQxrPo1LmPb3ylbJFdWJ3C1RdevdwQcAUdguBFwAlfD+nECV0Og/DJHwBFwBByBUUNgrBC4Rg0gf/CIIJByMDR5cFvn4DARuJqUb2G6ZrwEWYelzt73vvdVa621VshOv7bjG5ayjed8QFQScYu3ia+55pqeizuINHvO1LwE2N4TMtaiiy4akjvnnHMq/qy8/OUvr3baaadwiJXk2BYUIreLI9AUASdwNUVqfF43XmyLkSRw9asl1AWf+/WMYUyndE4zbGVZWOtvUPUwHslO47FMvdZ/ab8pva/X/A7q/rY+mkHlYyynO97aRGldsP35MsssE27/5je/Wd15553JpOzqUm0IXMnExsHBNraIE7jGQYV7ERwBR8ARMAg4gcuAUffVCVx16Pg5R8ARcAQcgRIEVltttWrDDTcMt/7qV7+qbr311vmSec973hOCoazeEW+/xMR3q622Cteff/751R//+MfKErg+//nPV+utt14I+hPw/cc//hGuueCCC6q77757vufox4orrlhtscUW1fOf//xq8cUXr/75z39WGAps/3TxxRdX//3vf8Olz3rWs6q3ve1t1XLLLdeZgN9zzz3V/fffX5111lnVvffeqySTn7xlhpOQfMRbJy211FLVW9/61pD2M5/5zOqxxx6rWKWDlXp+85vfJNNbGA/yVttb3vKWauLEieEttv/85z+hrsDzsssuS0LCSjCvfvWrA7bUL22CujrzzDMXePuNYPy73vWusM3V9ddfn1wp6fWvf331ghe8INTPjBkzOs+sczCwBdgrX/nKirZPG37wwQfD1pu0sU984hPV8573vJCvfffdt5Ne7ktM4MLRM2XKlLC6G33mz3/+czVz5szabebAjz7Idn9LLLFEuOfGG28MbY2211SWX375gC3XQ1p46KGHwq3bbLNNaOtz584NK3NBYJg6dWrF9azS9etf/7q64YYbwrVsQwY2K620UuhrnKc+b7vttnBe/7bbbruwndPs2bOrW265JaS39tprd/DkGHUKQSIlTft5fC965E1velNYPQes0A+QL37+859Xf/jDH8Ll0mkveclLKtooQvuhPnC+kSd0B3Lttdd26mb99devJk+eXD3wwAPV6aefHlbyASfyympdYIEOyK08xbNe+9rXhq3c+D5nzpyALfdxnGPcm3rLM2TG/Nt4441DH8GhSP1QZ+hS2gjbvt5xxx0hj5pEmVs7X1ktC8IVmCGkBQ4QeOJ6oe74I70f//jH4fsb3vCGirkHbYk0Vl111WrppZcOaVGOxx9/vKLPsd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aKebjsssvCww8/PCb5Ge/tFFA233zzMPfcc4c//OEP4ZZbbhkTnDzR7hB4xSteETbYYINAG0APH3LIIQE9uOmmm4Y555wzXH/99eH+++/vLsGKmNr02V4HK0D0y+MOgVxdrdLzO+ywQ9Stt99+e/jNb34z7sqSZmi8jNvSfPnvsUVgzTXXDEsttVScH1544YVDz0zT9NZee+3YzzFn7WqOMYw4uwJs4sSJcb5OfGeffXb43//+1yjqddddN84HHn/88XD55Zc3eqYq0HgZW1flr+R613pv5ZVXDiussELMyg9/+MOSLPkzY4SAt5UxAn7EyebGcSPOgifnCDgCjoAjMEYIOIGrIfBO4GoIlAdzBBwBR8ARcAQcAUdgCAhss802YcMNN6yN+d///nc47bTTxoXRKc0vg+4DDjgg7Lzzzj0C10EHHRRYnJ7VBIIdRneIdU888USveB/4wAfC0ksvHX9//OMfD88880zv3ng4ef7znx++/vWvx6zcdddd4fDDDx+TbL3mNa8Je++9d0z7zDPPDFdeeeWY5GMYiUK6gayBPPDAA4E2K/nyl78c5plnnvD3v/89fOYzn9Hl2eb4hje8IWA8RzCgXHvttWNS9vHeTgHl29/+dsQGAtd3vvOdoeJUpc+GmmgSeV27SYLOdD8hkuy5556RuKXMf+hDHwrLL7982GOPPeKlCy64IEyePFm3h3Js22ePsg4OpcAe6dAQGA86wxYuV1er9Py3vvWt2BYhcB111FE2mnF5Pl7GbeMSnNk4U4whF1xwwfDUU0+FSZMmDR2Jpump3TH23X///TvJ1zDi7CRjUyP5whe+EGRL+ehHPxr+85//NIpa8wE+0vrUpz7V6JmqQIOMrflYbN555431aKw+qsiVq2u9pzpEWoy/2sh46+/a5H1WCFvVVkrq7iBtZVbAcjyXITeOG8/59bw5Ao6AI+AIdIeAE7gaYqlJR8PgHswRcAQcAUfAEXAEHAFHoAME8LK17777Rs9Vio4veFmUh+jxohe9KP7xNark+OOPDzfddJN+jsnRLlr/61//Cn/605/CYYcdNssTuPA2BlENwXvDCSec0MPfLhA7gasHywwnszKB601velPgDznuuOPCzT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ChGgC2gVl555bDAAgsEPPf89re/jYboJ554ojhOPSgEhMDwEZhzzjnDxhtvHJZaaqm4iMv2qHfccUf0CvSvf/1r+BkaYynOM888Ya211oq5uuuuu8Lf/va3MZZDZWcsI8D6zCabbBIgP0+aNCncd999sW/dfffd8lI5litOeRMCQkAICAEhUIiA5tb1wGl+VI+RQgiBQSLAeh5eAx999NH4bjJjxoxBJqe4hYAQEAJCYAIjIAJXw8oVgashUAomBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEQGMEROBqCJUIXA2BUjAhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEGiMgAldDqETgagiUggkBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASHQGAERuBpCJQJXQ6AUTAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICIHGCIjA1RAqEbgaAqVgQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACDRGQASuhlCJwNUQKAUTAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCoDECInA1hEoEroZAKZgQEAJCQAgIASEgBAaIwCte8Yqw9tprh5e+9KXhwQcfDKeddtoAUxs7Uc8xxxxhu+22C3PNNVe45557wvTp08dO5mZxTtZdd90wZcqU8Mgjj4TLL7+8dW6e97znhfXWWy8sv/zyYckllwzzzTdfeOaZZ8ITTzwRHnroofCjH/0o3H///dl4eWbVVVfN3rOLjz76aPj9738f/vjHP4b//e9/drnzu9FGG4UFFlggpnnRRRd1rucOaAfbbLNNmHvuucNf//rXcO211+aC6ZoQmGUIrLHGGp0+ceaZZ86yfCjh8YkA6y6bbbZZQNfdcMMNYcaMGeOzIAPO9ViaE4ylvAw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EhIAQEAJCYCYCRuAyMJ566qm47dEjjzxilybkrwhcE7JaVaghILDHHnuEtddee4RhxJKFvHXSSSeF6dOn2yX9CgEhMBshAJnGDCbPPPNMOOWUU8Ktt946GyEwexV1LIwHanOzV5tTaYWAEBAC3RCwd3wLc80114Tzzz/fTvUrBITABEcAAhdrFSazw8epVlb9CgEhIASEwKxBQASuhriLwNUQKAUTAkJACAgBISAEhMBMBNgODY86c845Z7jvvvsi8QKPGRNdpkyZEhZaaKHw5JNPhl//+tcTvbgqnxDoKwK8c22yySZh0UUXDZMmTYq64ze/+U24++67oweuviamyISAEBg3CGyxxRZh/vnnDw8++GCcTzzxxBPjJu/KaBkCs3o8UJsrqzc9JQSEgBCYiAiwpTvv+Y8++mj0BjxjxoyJWEyVSQgIgQoEllpqqbDOOusEtk1kbeLOO++sCKnLQkAICAEhIAT6g4AIXA1xFIGrIVAKJgSEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhEBjBETgagiVCFwNgVIwISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBBojIAJXQ6hE4GoIlIIJASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEh0BgBEbgaQiUCV0OgFEwICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAiBxgg0IXBNnjy5cXxzrL/++v9rHHocBRSBaxxVlrIqBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIATGCQJtCFzPe97zakslAlctRAogBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBB4FoGmBC7IWy94wQtqYROBqxYiBRACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACDyLgAhcDVuCtlBsCJSCCQEhIASEgBAQAkJACAgBISAEhIAQEAJ9Q2CllVYK/CEXXXRReOaZZ/oW97Aj2n777cO8884b7rzzznDzzTcPO/nwqle9Kiy00ELh0UcfDVdfffXQ0x90gksvvXQsI+mcddZZ4X//+1+jJPlic+rUqWGxxRYLkyZNCmeffXa47777Gj07kQPtvPPOYZ555gl33HFH+NWvfjXLi0o9ve51rwtzzDFHmDZtWpgxY0ajPJU+1yjyikCzuq9XZEuXxykC6667bpgyZUp45JFHwuWXXz5OS6FsC4HBIcC4sN1224W55por3HPPPWH69OmDS6zHmNuOD/PNN1/YZJNN4tj3u9/9Ltx+++2NcjCR5s+NCvxcoFmtL2dX3OvqaI011girrrpqDHbmmWfWBdd9ISAEhIAQmM0REIGrYQMQgashUAomBISAEBACQkAICAEhIASEgBAQAkJACPQNgfe///1hhRVWiPF9/OMfD//+97/jMcSSJZZYIh7/6U9/Ck8//XTf0hxUREceeWQ0wP32t78Nxx577KCSqYz3sMMOiwSlp556Kuy3336V4cbrjV133TWsv/76Mfsf/ehHw3//+9/aosw999zhkEMOCfyanH766eGmm26y09n219orBK7jjz9+luOw/PLLhw984AMxH+eee2647rrrGuWp9LlGkVcEMuxmVV+vyFbry+NRz7Yu5Dh44NOf/nRYcMEFw5NPPhn233//cZBjZXF2R2Dy5MmBLW0gHT722GMDh+P5z39++MpXvhLTueuuu8Ixxxwz8DRLE2g7Przyla8Me+yxR0yuzZhSNX8uzfd4eW5W68vZFfe69uFx2XfffeuC674QEAJCQAjM5giIwNWwAYjA1RAoBRMCQkAICAEhIASEgBAQAkJACAgBISAE+oaAX/D3BK7Xvva1gT/k5JNPDr/+9a/7luagImprtOt3PkTgGo3o2muvHd7ylrfEG3js+vvf/x7OOOOM6CVtdOjZ64q1VxG42te7YdfG2N4+lcE/MR717OBRGX4Ks5qQMPwSK8XxjMBLX/rScOCBB8Yi4L3x1FNPHXhxROAaDXHV/Hl0yIl1ZVbry9kV97pW5H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ooIACCiiggAIKKKCAAgqMRuDXX3+tpk6dWu2zzz7VlClT6n8859+sWbPq1/vvv3/fhe8zb968/+07lRMooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgqMCRjgGqPwiQIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiwewUMcO1eb5emgAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCowJGOAao/CJAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKLB7BQxw7V5vl6aAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKjAkY4Bqj8MkoBQ455JDq2GOPrT799NPqr7/+GuWinLcCCiiwVwtY3+7Vu9+NV0ABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUECBSShggGsS7rTJtspHHHFE9eCDD9ar/eGHH1ZPP/30ZNuECbm+Rx55ZHXuuedWU6dOrX7//ffqlVdeqf78888Jua7DWqkFCxZUHE+UDRs2VJ999tmwZj3y+Zx11ll1iDEv6Oeff67WrFmT32r9fN99960uvvjiavr06fV32Pcvv/xytWPHjtbzcMI9T8D6ds/bp26RAgoooIACCiiggAIKKKCAAgoooIACCiiggAIKKKCAAgrs+QIGuAr38YwZM6o5c+ZUmzdvrrZu3Vo4l8nxtdmzZ1dbtmyp/v7776IVnjt3brV48eL6u3g98MADRfPxSzsL3H///RXHYZQlS5ZMqkBTrHfbx5kzZ1b33Xff2OS//PJLdffdd4+9nshP/vOf/1RLly7tuIqLFi3q+H6/N88777xq4cKFO032yCOP1L3c7fSmL/YqgdL6dtB6fq9CdmMVUEABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUECBIQsMK8D1f24uqiazdlIEAAAAAElFTkSuQmCC)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "O3ENsWYB27Mb" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "Pk55Mjq_3DiR" - }, - "source": [ - "## Example Use Case 1 - Code Generator\n", - "### For this use case enter your system prompt and questions\n" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "id": "_1SZYJFB3HmQ" - }, - "outputs": [], - "source": [ - "# enter your system prompt if you have one\n", - "system_prompt = \"\"\"\n", - "You are a coding assistant helping users using litellm.\n", - "litellm is a light package to simplify calling OpenAI, Azure, Cohere, Anthropic, Huggingface API Endpoints\n", - "--\n", - "Sample Usage:\n", - "```\n", - "pip install litellm\n", - "from litellm import completion\n", - "## set ENV variables\n", - "os.environ[\"OPENAI_API_KEY\"] = \"openai key\"\n", - "os.environ[\"COHERE_API_KEY\"] = \"cohere key\"\n", - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "# openai call\n", - "response = completion(model=\"gpt-3.5-turbo\", messages=messages)\n", - "# cohere call\n", - "response = completion(\"command-nightly\", messages)\n", - "```\n", - "\n", - "\"\"\"\n", - "\n", - "\n", - "# qustions/logs you want to run the LLM on\n", - "questions = [\n", - " \"what is litellm?\",\n", - " \"why should I use LiteLLM\",\n", - " \"does litellm support Anthropic LLMs\",\n", - " \"write code to make a litellm completion call\",\n", - "]" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "AHH3cqeU3_ZT" - }, - "source": [ - "## Running questions\n", - "### Select from 100+ LLMs here: https://docs.litellm.ai/docs/providers" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "BpQD4A5339L3" - }, - "outputs": [], - "source": [ - "from litellm import completion, completion_cost\n", - "import os\n", - "import time\n", - "\n", - "# optional use litellm dashboard to view logs\n", - "# litellm.use_client = True\n", - "# litellm.token = \"ishaan_2@berri.ai\" # set your email\n", - "\n", - "\n", - "# set API keys\n", - "os.environ['TOGETHERAI_API_KEY'] = \"\"\n", - "os.environ['OPENAI_API_KEY'] = \"\"\n", - "os.environ['ANTHROPIC_API_KEY'] = \"\"\n", - "\n", - "\n", - "# select LLMs to benchmark\n", - "# using https://api.together.xyz/playground for llama2\n", - "# try any supported LLM here: https://docs.litellm.ai/docs/providers\n", - "\n", - "models = ['togethercomputer/llama-2-70b-chat', 'gpt-3.5-turbo', 'claude-instant-1.2']\n", - "data = []\n", - "\n", - "for question in questions: # group by question\n", - " for model in models:\n", - " print(f\"running question: {question} for model: {model}\")\n", - " start_time = time.time()\n", - " # show response, response time, cost for each question\n", - " response = completion(\n", - " model=model,\n", - " max_tokens=500,\n", - " messages = [\n", - " {\n", - " \"role\": \"system\", \"content\": system_prompt\n", - " },\n", - " {\n", - " \"role\": \"user\", \"content\": question\n", - " }\n", - " ],\n", - " )\n", - " end = time.time()\n", - " total_time = end-start_time # response time\n", - " # print(response)\n", - " cost = completion_cost(response) # cost for completion\n", - " raw_response = response['choices'][0]['message']['content'] # response string\n", - "\n", - "\n", - " # add log to pandas df\n", - " data.append(\n", - " {\n", - " 'Model': model,\n", - " 'Question': question,\n", - " 'Response': raw_response,\n", - " 'ResponseTime': total_time,\n", - " 'Cost': cost\n", - " })" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "apOSV3PBLa5Y" - }, - "source": [ - "## View Benchmarks for LLMs" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 1000 - }, - "id": "CJqBlqUh_8Ws", - "outputId": "e02c3427-d8c6-4614-ff07-6aab64247ff6" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: does litellm support Anthropic LLMs\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
6togethercomputer/llama-2-70b-chatdoes litellm support Anthropic LLMsYes, litellm supports Anthropic LLMs.\\n\\nIn the example usage you provided, the `completion` function is called with the `model` parameter set to `\"gpt-3.5-turbo\"` for OpenAI and `\"command-nightly\"` for Cohere.\\n\\nTo use an Anthropic LLM with litellm, you would set the `model` parameter to the name of the Anthropic model you want to use, followed by the version number, if applicable. For example:\\n```\\nresponse = completion(model=\"anthropic-gpt-2\", messages=messages)\\n```\\nThis would call the Anthropic GPT-2 model to generate a completion for the given input messages.\\n\\nNote that you will need to set the `ANTHROPIC_API_KEY` environment variable to your Anthropic API key before making the call. You can do this by running the following command in your terminal:\\n```\\nos.environ[\"ANTHROPIC_API_KEY\"] = \"your-anthropic-api-key\"\\n```\\nReplace `\"your-anthropic-api-key\"` with your actual Anthropic API key.\\n\\nOnce you've set the environment variable, you can use the `completion` function with the `model` parameter set to an Anthropic model name to call the Anthropic API and generate a completion.21.5130090.001347
7gpt-3.5-turbodoes litellm support Anthropic LLMsNo, currently litellm does not support Anthropic LLMs. It mainly focuses on simplifying the usage of OpenAI, Azure, Cohere, and Huggingface API endpoints.8.6565100.000342
8claude-instant-1.2does litellm support Anthropic LLMsYes, litellm supports calling Anthropic LLMs through the completion function.\\n\\nTo use an Anthropic model with litellm:\\n\\n1. Set the ANTHROPIC_API_KEY environment variable with your Anthropic API key\\n\\n2. Pass the model name as the 'model' argument to completion(). Anthropic model names follow the format 'anthropic/<model_name>'\\n\\nFor example:\\n\\n```python \\nimport os\\nfrom litellm import completion\\n\\nos.environ[\"ANTHROPIC_API_KEY\"] = \"your_anthropic_api_key\"\\n\\nmessages = [{\"content\": \"Hello\", \"role\": \"user\"}]\\n\\nresponse = completion(model=\"anthropic/constitutional\", messages=messages)\\n```\\n\\nThis would call the Constitutional AI model from Anthropic.\\n\\nSo in summary, litellm provides a simple interface to call any Anthropic models as long as you specify the model name correctly and set the ANTHROPIC_API_KEY env variable.9.6981950.001342
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: what is litellm?\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
0togethercomputer/llama-2-70b-chatwhat is litellm?Litellm is a lightweight Python package that simplifies calling various AI API endpoints, including OpenAI, Azure, Cohere, Anthropic, and Hugging Face. It provides a convenient interface for making requests to these APIs, allowing developers to easily integrate them into their applications. With Litellm, developers can quickly and easily interact with multiple AI models and services, without having to handle the details of authentication, API calls, and response parsing. This makes it easier to build and deploy AI-powered applications, and can help developers save time and effort.13.4796440.000870
1gpt-3.5-turbowhat is litellm?litellm is a light package that provides a simplified interface for making API calls to various language models and APIs. It abstracts away the complexities of handling network requests, authentication, and response parsing, making it easier for developers to integrate powerful language models into their applications.\\n\\nWith litellm, you can quickly make API calls to models like OpenAI's GPT-3.5 Turbo, Azure's Text Analytics, Cohere's Command API, Anthropic's API, and Huggingface's models. It also supports additional functionality like conversational AI, summarization, translation, and more.\\n\\nBy using litellm, you can focus on your application logic without getting tangled in the details of API integration, allowing you to quickly build intelligent and conversational applications.8.3243320.000566
2claude-instant-1.2what is litellm?litellm is a Python library that simplifies calling various AI API endpoints like OpenAI, Azure, Cohere, Anthropic, and Huggingface. \\n\\nSome key things to know about litellm:\\n\\n- It provides a consistent interface for completing prompts and generating responses from different AI models through a single method called completion().\\n\\n- You specify the API (e.g. OpenAI, Cohere etc.) and model either by name or by setting environment variables before making the completion call.\\n\\n- This avoids having to use different SDKs or APIs for each provider and standardizes the call structure. \\n\\n- It handles things like setting headers, encoding inputs, parsing responses so the user doesn't have to deal with those details.\\n\\n- The goal is to make it easy to try different AI APIs and models without having to change code or learn different interfaces.\\n\\n- It's lightweight with no other dependencies required besides what's needed for each API (e.g. openai, azure SDKs etc.).\\n\\nSo in summary, litellm is a small library that provides a common way to interact with multiple conversational AI APIs through a single Python method, avoiding the need to directly use each provider's specific SDK.10.3164880.001603
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: why should I use LiteLLM\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
3togethercomputer/llama-2-70b-chatwhy should I use LiteLLM\\nThere are several reasons why you might want to use LiteLLM:\\n\\n1. Simplified API calls: LiteLLM provides a simple and consistent API for calling various language models, making it easier to use multiple models and switch between them.\\n2. Environment variable configuration: LiteLLM allows you to set environment variables for API keys and model names, making it easier to manage and switch between different models and APIs.\\n3. Support for multiple models and APIs: LiteLLM supports a wide range of language models and APIs, including OpenAI, Azure, Cohere, Anthropic, and Hugging Face.\\n4. Easy integration with popular frameworks: LiteLLM can be easily integrated with popular frameworks such as PyTorch and TensorFlow, making it easy to use with your existing codebase.\\n5. Lightweight: LiteLLM is a lightweight package, making it easy to install and use, even on resource-constrained devices.\\n6. Flexible: LiteLLM allows you to define your own models and APIs, making it easy to use with custom models and APIs.\\n7. Extensive documentation: LiteLLM has extensive documentation, making it easy to get started and learn how to use the package.\\n8. Active community: LiteLLM has an active community of developers and users, making it easy to get help and feedback on your projects.\\n\\nOverall, LiteLLM can help you to simplify your workflow, improve your productivity, and make it easier to work with multiple language models and APIs.23.7778850.001443
4gpt-3.5-turbowhy should I use LiteLLMLiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\\n\\n1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\\n\\n2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\\n\\n3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\\n\\n4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\\n\\n5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\\n\\n6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\\n\\nOverall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenience.12.1098810.000881
5claude-instant-1.2why should I use LiteLLMHere are some key reasons why you may want to consider using LiteLLM:\\n\\n- Simplifies calling multiple large language models - LiteLLM provides a unified API to call models from different providers like OpenAI, Azure, HuggingFace, Anthropic etc. This avoids having to deal with different APIs from each provider.\\n\\n- Easy to get started - LiteLLM is very lightweight and simple to install with just one pip install. It has minimal configuration needed with just API keys. This lowers the barrier to start experimenting with LLMs.\\n\\n- Standard interface - The completion API provides a standard way to send messages and get responses back regardless of underlying model. This keeps the code interface consistent. \\n\\n- Model agnostic - Your code doesn't need to change to switch between different models. You can easily compare performance of models from different providers.\\n\\n- Open source - As it is open source, the library can be expanded to support more models and providers over time via community contributions.\\n\\n- Cost effective - LiteLLM helps avoid vendor lock-in. You can optimize costs by testing multiple models and choosing the best suitable and cost-effective option for your needs.\\n\\nSo in summary, L12.6102590.001568
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: write code to make a litellm completion call\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
9togethercomputer/llama-2-70b-chatwrite code to make a litellm completion call\\nTo make a completion call using litellm, you can use the `completion` function from the litellm package. Here's an example of how to use it:\\n```\\nfrom litellm import completion\\n\\n# Set ENV variables\\nos.environ[\"OPENAI_API_KEY\"] = \"your_openai_api_key\"\\nos.environ[\"COHERE_API_KEY\"] = \"your_cohere_api_key\"\\n\\n# Define the messages to be completed\\nmessages = [\\n {\\n \"content\": \"Hello, how are you?\",\\n \"role\": \"user\"\\n }\\n]\\n\\n# Make a completion call using OpenAI\\nresponse = completion(model=\"gpt-3.5-turbo\", messages=messages)\\n\\n# Make a completion call using Cohere\\nresponse = completion(\"command-nightly\", messages)\\n```\\nIn this example, we first set the ENV variables for the OpenAI and Cohere API keys. Then, we define a list of messages to be completed, which in this case contains a single message with the content \"Hello, how are you?\" and the role \"user\".\\n\\nNext, we make two completion calls using the `completion` function from litellm. The first call uses the OpenAI model `gpt-3.5-turbo` and passes in the list of messages. The second call uses the Cohere model `command-nightly` and passes in the same list of messages.\\n\\nThe `completion` function returns a response object that contains the completed messages. You can then use the `response.messages` attribute to access the completed messages.\\n\\nHere's an example of how to access the completed messages:\\n```\\n# Print the completed messages\\nprint(response.messages)\\n```\\nThis will print the completed messages, which should look something like this:\\n```\\n[{'content': 'Hello, how are you?', 'role': 'user', 'completion': 'I am doing well, thanks for asking.'}]\\n```\\nNote that the `completion` attribute contains the completed message. You can use this attribute to retrieve the completed message and use it in your application.32.1924530.001821
10gpt-3.5-turbowrite code to make a litellm completion callSure! Here's an example code to make a completion call using the litellm package:\\n\\n```python\\nfrom litellm import completion\\n\\n# Set the model and messages\\nmodel = \"gpt-3.5-turbo\"\\nmessages = [\\n {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\\n {\"role\": \"user\", \"content\": \"Who won the world series in 2020?\"},\\n {\"role\": \"assistant\", \"content\": \"The Los Angeles Dodgers won the World Series in 2020.\"},\\n {\"role\": \"user\", \"content\": \"Where was it played?\"}\\n]\\n\\n# Make the completion call\\nresponse = completion(model=model, messages=messages)\\n\\n# Print the assistant's reply\\nassistant_reply = response[\"choices\"][0][\"message\"][\"content\"]\\nprint(\"Assistant: \", assistant_reply)\\n```\\n\\nMake sure you have the litellm package installed (`pip install litellm`) and set the necessary environment variables for the API keys before running this code.9.3771550.000686
11claude-instant-1.2write code to make a litellm completion callHere is an example of making a completion call using litellm:\\n\\n```python\\nimport os\\nfrom litellm import completion\\n\\n# Set API keys as environment variables\\nos.environ[\"OPENAI_API_KEY\"] = \"your openai api key\" \\n\\n# Conversation context \\nmessages = [{\\n \"content\": \"Hello, how can I help you today?\",\\n \"role\": \"assistant\"\\n}]\\n\\n# Make completion call with GPT-3 model\\nresponse = completion(\\n model=\"gpt-3.5-turbo\", \\n messages=messages\\n)\\n\\nprint(response)\\n```\\n\\nTo break it down:\\n\\n- Import completion from litellm\\n- Set the OPENAI_API_KEY env var \\n- Define a messages list with the conversation context\\n- Call completion(), specifying the model (\"gpt-3.5-turbo\") and messages\\n- It will return the response from the API\\n- Print the response\\n\\nThis makes a simple completion call to OpenAI GPT-3 using litellm to handle the API details. You can also call other models like Cohere or Anthropic by specifying their name instead of the OpenAI9.8399880.001578
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from IPython.core.interactiveshell import InteractiveShell\n", - "InteractiveShell.ast_node_interactivity = \"all\"\n", - "from IPython.display import HTML\n", - "import pandas as pd\n", - "\n", - "df = pd.DataFrame(data)\n", - "grouped_by_question = df.groupby('Question')\n", - "\n", - "for question, group_data in grouped_by_question:\n", - " print(f\"Question: {question}\")\n", - " HTML(group_data.to_html())\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "bmtAbC1rGVAm" - }, - "source": [ - "## Use Case 2 - Rewrite user input concisely" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "id": "boiHO1PhGXSL" - }, - "outputs": [], - "source": [ - "# enter your system prompt if you have one\n", - "system_prompt = \"\"\"\n", - "For a given user input, rewrite the input to make be more concise.\n", - "\"\"\"\n", - "\n", - "# user input for re-writing questions\n", - "questions = [\n", - " \"LiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\\n\\n1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\\n\\n2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\\n\\n3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\\n\\n4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\\n\\n5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\\n\\n6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\\n\\nOverall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenience\",\n", - " \"Hi everyone! I'm [your name] and I'm currently working on [your project/role involving LLMs]. I came across LiteLLM and was really excited by how it simplifies working with different LLM providers. I'm hoping to use LiteLLM to [build an app/simplify my code/test different models etc]. Before finding LiteLLM, I was struggling with [describe any issues you faced working with multiple LLMs]. With LiteLLM's unified API and automatic translation between providers, I think it will really help me to [goals you have for using LiteLLM]. Looking forward to being part of this community and learning more about how I can build impactful applications powered by LLMs!Let me know if you would like me to modify or expand on any part of this suggested intro. I'm happy to provide any clarification or additional details you need!\",\n", - " \"Traceloop is a platform for monitoring and debugging the quality of your LLM outputs. It provides you with a way to track the performance of your LLM application; rollout changes with confidence; and debug issues in production. It is based on OpenTelemetry, so it can provide full visibility to your LLM requests, as well vector DB usage, and other infra in your stack.\"\n", - "]" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "fwNcC_obICUc" - }, - "source": [ - "## Run Questions" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "KtBjZ1mUIBiJ" - }, - "outputs": [], - "source": [ - "from litellm import completion, completion_cost\n", - "import os\n", - "import time\n", - "\n", - "# optional use litellm dashboard to view logs\n", - "# litellm.use_client = True\n", - "# litellm.token = \"ishaan_2@berri.ai\" # set your email\n", - "\n", - "os.environ['TOGETHERAI_API_KEY'] = \"\"\n", - "os.environ['OPENAI_API_KEY'] = \"\"\n", - "os.environ['ANTHROPIC_API_KEY'] = \"\"\n", - "\n", - "models = ['togethercomputer/llama-2-70b-chat', 'gpt-3.5-turbo', 'claude-instant-1.2'] # enter llms to benchmark\n", - "data_2 = []\n", - "\n", - "for question in questions: # group by question\n", - " for model in models:\n", - " print(f\"running question: {question} for model: {model}\")\n", - " start_time = time.time()\n", - " # show response, response time, cost for each question\n", - " response = completion(\n", - " model=model,\n", - " max_tokens=500,\n", - " messages = [\n", - " {\n", - " \"role\": \"system\", \"content\": system_prompt\n", - " },\n", - " {\n", - " \"role\": \"user\", \"content\": \"User input:\" + question\n", - " }\n", - " ],\n", - " )\n", - " end = time.time()\n", - " total_time = end-start_time # response time\n", - " # print(response)\n", - " cost = completion_cost(response) # cost for completion\n", - " raw_response = response['choices'][0]['message']['content'] # response string\n", - " #print(raw_response, total_time, cost)\n", - "\n", - " # add to pandas df\n", - " data_2.append(\n", - " {\n", - " 'Model': model,\n", - " 'Question': question,\n", - " 'Response': raw_response,\n", - " 'ResponseTime': total_time,\n", - " 'Cost': cost\n", - " })\n", - "\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "-PCYIzG5M0II" - }, - "source": [ - "## View Logs - Group by Question" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 1000 - }, - "id": "-3R5-2q8IiL2", - "outputId": "c4a0d9e5-bb21-4de0-fc4c-9f5e71d0f177" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: Hi everyone! I'm [your name] and I'm currently working on [your project/role involving LLMs]. I came across LiteLLM and was really excited by how it simplifies working with different LLM providers. I'm hoping to use LiteLLM to [build an app/simplify my code/test different models etc]. Before finding LiteLLM, I was struggling with [describe any issues you faced working with multiple LLMs]. With LiteLLM's unified API and automatic translation between providers, I think it will really help me to [goals you have for using LiteLLM]. Looking forward to being part of this community and learning more about how I can build impactful applications powered by LLMs!Let me know if you would like me to modify or expand on any part of this suggested intro. I'm happy to provide any clarification or additional details you need!\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
3togethercomputer/llama-2-70b-chatHi everyone! I'm [your name] and I'm currently working on [your project/role involving LLMs]. I came across LiteLLM and was really excited by how it simplifies working with different LLM providers. I'm hoping to use LiteLLM to [build an app/simplify my code/test different models etc]. Before finding LiteLLM, I was struggling with [describe any issues you faced working with multiple LLMs]. With LiteLLM's unified API and automatic translation between providers, I think it will really help me to [goals you have for using LiteLLM]. Looking forward to being part of this community and learning more about how I can build impactful applications powered by LLMs!Let me know if you would like me to modify or expand on any part of this suggested intro. I'm happy to provide any clarification or additional details you need!\\nHere's a more concise version of the user input:\\n\\n\"Hi everyone! I'm [your name] and I'm working on [your project/role involving LLMs]. I recently discovered LiteLLM and I'm excited to use it to [build an app/simplify my code/test different models etc]. Before LiteLLM, I struggled with [describe any issues you faced working with multiple LLMs]. I'm looking forward to using LiteLLM's unified API and automatic translation to achieve my goals. I'm eager to learn more about building impactful applications powered by LLMs and to be part of this community. Let me know if you have any questions or need further clarification.\"\\n\\nIn this revised version, we've kept the essential information and removed some of the extraneous language. We've also rephrased some of the sentences to make them more concise and easier to read.18.3006200.001200
4gpt-3.5-turboHi everyone! I'm [your name] and I'm currently working on [your project/role involving LLMs]. I came across LiteLLM and was really excited by how it simplifies working with different LLM providers. I'm hoping to use LiteLLM to [build an app/simplify my code/test different models etc]. Before finding LiteLLM, I was struggling with [describe any issues you faced working with multiple LLMs]. With LiteLLM's unified API and automatic translation between providers, I think it will really help me to [goals you have for using LiteLLM]. Looking forward to being part of this community and learning more about how I can build impactful applications powered by LLMs!Let me know if you would like me to modify or expand on any part of this suggested intro. I'm happy to provide any clarification or additional details you need!User input: Hi, I'm [your name] and I'm excited about using LiteLLM to simplify working with different LLM providers. Before finding LiteLLM, I faced challenges working with multiple LLMs. With LiteLLM's unified API and automatic translation, I believe it will help me achieve my goals of [state your goals]. I look forward to being part of this community and learning how to build impactful applications with LLMs. Let me know if you need any further clarification or details.7.3854720.000525
5claude-instant-1.2Hi everyone! I'm [your name] and I'm currently working on [your project/role involving LLMs]. I came across LiteLLM and was really excited by how it simplifies working with different LLM providers. I'm hoping to use LiteLLM to [build an app/simplify my code/test different models etc]. Before finding LiteLLM, I was struggling with [describe any issues you faced working with multiple LLMs]. With LiteLLM's unified API and automatic translation between providers, I think it will really help me to [goals you have for using LiteLLM]. Looking forward to being part of this community and learning more about how I can build impactful applications powered by LLMs!Let me know if you would like me to modify or expand on any part of this suggested intro. I'm happy to provide any clarification or additional details you need!Here is a more concise rewrite of the user input:\\n\\nHi everyone, I'm [your name]. I'm currently [your project/role] and came across LiteLLM, which simplifies working with different LLMs through its unified API. I hope to [build an app/simplify code/test models] with LiteLLM since I previously struggled with [issues]. LiteLLM's automatic translation between providers will help me [goals] and build impactful LLM applications. Looking forward to learning more as part of this community. Let me know if you need any clarification on my plans to use LiteLLM.8.6282170.001022
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: LiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\n", - "\n", - "1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\n", - "\n", - "2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\n", - "\n", - "3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\n", - "\n", - "4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\n", - "\n", - "5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\n", - "\n", - "6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\n", - "\n", - "Overall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenience\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
0togethercomputer/llama-2-70b-chatLiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\\n\\n1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\\n\\n2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\\n\\n3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\\n\\n4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\\n\\n5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\\n\\n6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\\n\\nOverall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenienceHere's a more concise version of the user input:\\n\\nLiteLLM is a lightweight Python package that simplifies API calls to various language models. It abstracts away complexity, integrates seamlessly, supports multiple models, and handles authentication. It's ideal for rapid prototyping and has community support. It saves time and effort while providing flexibility and convenience.11.2942500.001251
1gpt-3.5-turboLiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\\n\\n1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\\n\\n2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\\n\\n3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\\n\\n4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\\n\\n5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\\n\\n6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\\n\\nOverall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenienceLiteLLM is a lightweight Python package that simplifies API calls to various language models. Here's why you should use it:\\n1. Simplified API Calls: Works with multiple models (OpenAI, Azure, Cohere, Anthropic, Huggingface).\\n2. Easy Integration: Import and start using it quickly in your codebase.\\n3. Flexibility: Supports GPT-3, GPT-Neo, chatGPT, etc. easily switch between models.\\n4. Convenience: Handles authentication and connection details, just set environment variables.\\n5. Quick Prototyping: Great for rapid prototyping and building interactive applications.\\n6. Community Support: Actively maintained and supported by a developer community.9.7783150.000795
2claude-instant-1.2LiteLLM is a lightweight Python package that simplifies the process of making API calls to various language models. Here are some reasons why you should use LiteLLM:\\n\\n1. **Simplified API Calls**: LiteLLM abstracts away the complexity of making API calls to different language models. It provides a unified interface for invoking models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more.\\n\\n2. **Easy Integration**: LiteLLM seamlessly integrates with your existing codebase. You can import the package and start making API calls with just a few lines of code.\\n\\n3. **Flexibility**: LiteLLM supports a variety of language models, including GPT-3, GPT-Neo, chatGPT, and more. You can choose the model that suits your requirements and easily switch between them.\\n\\n4. **Convenience**: LiteLLM handles the authentication and connection details for you. You just need to set the relevant environment variables, and the package takes care of the rest.\\n\\n5. **Quick Prototyping**: LiteLLM is ideal for rapid prototyping and experimentation. With its simple API, you can quickly generate text, chat with models, and build interactive applications.\\n\\n6. **Community Support**: LiteLLM is actively maintained and supported by a community of developers. You can find help, share ideas, and collaborate with others to enhance your projects.\\n\\nOverall, LiteLLM simplifies the process of making API calls to language models, saving you time and effort while providing flexibility and convenienceHere is a concise rewrite of the user input:\\n\\nLiteLLM is a lightweight Python package that simplifies accessing various language models. It provides a unified interface for models from OpenAI, Azure, Cohere, Anthropic, Huggingface, and more. Key benefits include simplified API calls, easy integration, flexibility to use different models, automated handling of authentication, and support for quick prototyping. The actively maintained package saves time by abstracting away complexity while offering convenience and a collaborative community.7.6975200.001098
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Question: Traceloop is a platform for monitoring and debugging the quality of your LLM outputs. It provides you with a way to track the performance of your LLM application; rollout changes with confidence; and debug issues in production. It is based on OpenTelemetry, so it can provide full visibility to your LLM requests, as well vector DB usage, and other infra in your stack.\n" - ] - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
ModelQuestionResponseResponseTimeCost
6togethercomputer/llama-2-70b-chatTraceloop is a platform for monitoring and debugging the quality of your LLM outputs. It provides you with a way to track the performance of your LLM application; rollout changes with confidence; and debug issues in production. It is based on OpenTelemetry, so it can provide full visibility to your LLM requests, as well vector DB usage, and other infra in your stack.\\nRewritten input: Traceloop is a platform for monitoring and debugging LLM outputs. It allows users to track performance, rollout changes confidently, and debug issues in production. It uses OpenTelemetry for full visibility into LLM requests, vector DB usage, and other infrastructure.9.0604440.000525
7gpt-3.5-turboTraceloop is a platform for monitoring and debugging the quality of your LLM outputs. It provides you with a way to track the performance of your LLM application; rollout changes with confidence; and debug issues in production. It is based on OpenTelemetry, so it can provide full visibility to your LLM requests, as well vector DB usage, and other infra in your stack.Traceloop is a platform for monitoring and debugging the quality of your LLM outputs. It helps track performance, rollout changes, and debug issues in production. It is based on OpenTelemetry, providing visibility to LLM requests, vector DB usage, and other infrastructure in your stack.7.3046610.000283
8claude-instant-1.2Traceloop is a platform for monitoring and debugging the quality of your LLM outputs. It provides you with a way to track the performance of your LLM application; rollout changes with confidence; and debug issues in production. It is based on OpenTelemetry, so it can provide full visibility to your LLM requests, as well vector DB usage, and other infra in your stack.Here is a more concise rewrite of the user input:\\n\\nTraceloop monitors and debugs LLM quality. It tracks LLM performance, enables confident changes, and debugs production issues. Based on OpenTelemetry, Traceloop provides full visibility into LLM requests, vector DB usage, and other stack infrastructure.7.9761580.000538
" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from IPython.core.interactiveshell import InteractiveShell\n", - "InteractiveShell.ast_node_interactivity = \"all\"\n", - "from IPython.display import HTML\n", - "import pandas as pd\n", - "\n", - "df = pd.DataFrame(data_2)\n", - "grouped_by_question = df.groupby('Question')\n", - "\n", - "for question, group_data in grouped_by_question:\n", - " print(f\"Question: {question}\")\n", - " HTML(group_data.to_html())\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/Claude_(Anthropic)_with_Streaming_liteLLM_Examples.ipynb b/cookbook/Claude_(Anthropic)_with_Streaming_liteLLM_Examples.ipynb deleted file mode 100644 index 338785ea5e3..00000000000 --- a/cookbook/Claude_(Anthropic)_with_Streaming_liteLLM_Examples.ipynb +++ /dev/null @@ -1,406 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "ZwuaylskLxFu", - "outputId": "d684d6a3-32fe-4beb-c378-c39134bcf8cc" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting litellm==0.1.363\n", - " Downloading litellm-0.1.363-py3-none-any.whl (34 kB)\n", - "Requirement already satisfied: openai<0.28.0,>=0.27.8 in /usr/local/lib/python3.10/dist-packages (from litellm==0.1.363) (0.27.8)\n", - "Requirement already satisfied: python-dotenv<2.0.0,>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from litellm==0.1.363) (1.0.0)\n", - "Requirement already satisfied: tiktoken<0.5.0,>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from litellm==0.1.363) (0.4.0)\n", - "Requirement already satisfied: requests>=2.20 in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm==0.1.363) (2.31.0)\n", - "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm==0.1.363) (4.65.0)\n", - "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm==0.1.363) (3.8.5)\n", - "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken<0.5.0,>=0.4.0->litellm==0.1.363) (2022.10.31)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm==0.1.363) (3.2.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm==0.1.363) (3.4)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm==0.1.363) (1.26.16)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm==0.1.363) (2023.7.22)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (4.0.2)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (1.4.0)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm==0.1.363) (1.3.1)\n", - "Installing collected packages: litellm\n", - " Attempting uninstall: litellm\n", - " Found existing installation: litellm 0.1.362\n", - " Uninstalling litellm-0.1.362:\n", - " Successfully uninstalled litellm-0.1.362\n", - "Successfully installed litellm-0.1.363\n" - ] - } - ], - "source": [ - "!pip install litellm==\"0.1.363\"" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "W216G__XL19Q" - }, - "outputs": [], - "source": [ - "# @title Import litellm & Set env variables\n", - "import litellm\n", - "import os\n", - "\n", - "os.environ[\"ANTHROPIC_API_KEY\"] = \" \" #@param" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "ff1lKwUMMLJj", - "outputId": "bfddf6f8-36d4-45e5-92dc-349083fa41b8" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "\n", - " Result from claude-instant-1 {'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': \" The Los Angeles Dodgers won the 2020 World Series, defeating the Tampa Bay Rays 4-2. It was the Dodgers' first World Series title since 1988.\"}}], 'created': 1691536677.2676156, 'model': 'claude-instant-1', 'usage': {'prompt_tokens': 30, 'completion_tokens': 32, 'total_tokens': 62}}\n", - "\n", - "\n", - " Result from claude-2 {'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': ' The Los Angeles Dodgers won'}}], 'created': 1691536677.944753, 'model': 'claude-2', 'usage': {'prompt_tokens': 30, 'completion_tokens': 5, 'total_tokens': 35}}\n" - ] - } - ], - "source": [ - "# @title Request Claude Instant-1 and Claude-2\n", - "messages = [\n", - " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n", - " {\"role\": \"user\", \"content\": \"Who won the world series in 2020?\"}\n", - " ]\n", - "\n", - "result = litellm.completion('claude-instant-1', messages)\n", - "print(\"\\n\\n Result from claude-instant-1\", result)\n", - "result = litellm.completion('claude-2', messages, max_tokens=5, temperature=0.2)\n", - "print(\"\\n\\n Result from claude-2\", result)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "06hWKnNQMrV-", - "outputId": "7fdec0eb-d4a9-4882-f9c4-987ff9a31114" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " Here\n", - "'s\n", - " a\n", - " quick\n", - " overview\n", - " of\n", - " how\n", - " a\n", - " court\n", - " case\n", - " can\n", - " reach\n", - " the\n", - " U\n", - ".\n", - "S\n", - ".\n", - " Supreme\n", - " Court\n", - ":\n", - "\n", - "\n", - "-\n", - " The\n", - " case\n", - " must\n", - " first\n", - " be\n", - " heard\n", - " in\n", - " a\n", - " lower\n", - " trial\n", - " court\n", - " (\n", - "either\n", - " a\n", - " state\n", - " court\n", - " or\n", - " federal\n", - " district\n", - " court\n", - ").\n", - " The\n", - " trial\n", - " court\n", - " makes\n", - " initial\n", - " r\n", - "ulings\n", - " and\n", - " produces\n", - " a\n", - " record\n", - " of\n", - " the\n", - " case\n", - ".\n", - "\n", - "\n", - "-\n", - " The\n", - " losing\n", - " party\n", - " can\n", - " appeal\n", - " the\n", - " decision\n", - " to\n", - " an\n", - " appeals\n", - " court\n", - " (\n", - "a\n", - " state\n", - " appeals\n", - " court\n", - " for\n", - " state\n", - " cases\n", - ",\n", - " or\n", - " a\n", - " federal\n", - " circuit\n", - " court\n", - " for\n", - " federal\n", - " cases\n", - ").\n", - " The\n", - " appeals\n", - " court\n", - " reviews\n", - " the\n", - " trial\n", - " court\n", - "'s\n", - " r\n", - "ulings\n", - " and\n", - " can\n", - " affirm\n", - ",\n", - " reverse\n", - ",\n", - " or\n", - " modify\n", - " the\n", - " decision\n", - ".\n", - "\n", - "\n", - "-\n", - " If\n", - " a\n", - " party\n", - " is\n", - " still\n", - " unsat\n", - "isf\n", - "ied\n", - " after\n", - " the\n", - " appeals\n", - " court\n", - " rules\n", - ",\n", - " they\n", - " can\n", - " petition\n", - " the\n", - " Supreme\n", - " Court\n", - " to\n", - " hear\n", - " the\n", - " case\n", - " through\n", - " a\n", - " writ\n", - " of\n", - " cert\n", - "ior\n", - "ari\n", - ".\n", - " \n", - "\n", - "\n", - "-\n", - " The\n", - " Supreme\n", - " Court\n", - " gets\n", - " thousands\n", - " of\n", - " cert\n", - " petitions\n", - " every\n", - " year\n", - " but\n", - " usually\n", - " only\n", - " agrees\n", - " to\n", - " hear\n", - " about\n", - " 100\n", - "-\n", - "150\n", - " of\n", - " cases\n", - " that\n", - " have\n", - " significant\n", - " national\n", - " importance\n", - " or\n", - " where\n", - " lower\n", - " courts\n", - " disagree\n", - " on\n", - " federal\n", - " law\n", - ".\n", - " \n", - "\n", - "\n", - "-\n", - " If\n", - " 4\n", - " out\n", - " of\n", - " the\n", - " 9\n", - " Just\n", - "ices\n", - " vote\n", - " to\n", - " grant\n", - " cert\n", - " (\n", - "agree\n", - " to\n", - " hear\n", - " the\n", - " case\n", - "),\n", - " it\n", - " goes\n", - " on\n", - " the\n", - " Supreme\n", - " Court\n", - "'s\n", - " do\n", - "cket\n", - " for\n", - " arguments\n", - ".\n", - "\n", - "\n", - "-\n", - " The\n", - " Supreme\n", - " Court\n", - " then\n", - " hears\n", - " oral\n", - " arguments\n", - ",\n", - " considers\n", - " written\n", - " brief\n", - "s\n", - ",\n", - " examines\n", - " the\n", - " lower\n", - " court\n", - " records\n", - ",\n", - " and\n", - " issues\n", - " a\n", - " final\n", - " ruling\n", - " on\n", - " the\n", - " case\n", - ",\n", - " which\n", - " serves\n", - " as\n", - " binding\n", - " precedent\n" - ] - } - ], - "source": [ - "# @title Streaming Example: Request Claude-2\n", - "messages = [\n", - " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n", - " {\"role\": \"user\", \"content\": \"how does a court case get to the Supreme Court?\"}\n", - " ]\n", - "\n", - "result = litellm.completion('claude-2', messages, stream=True)\n", - "for part in result:\n", - " print(part.choices[0].delta.content or \"\")\n", - "\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/Evaluating_LLMs.ipynb b/cookbook/Evaluating_LLMs.ipynb deleted file mode 100644 index e27e8934f76..00000000000 --- a/cookbook/Evaluating_LLMs.ipynb +++ /dev/null @@ -1,579 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "Ys9n20Es2IzT" - }, - "source": [ - "# Evaluate Multiple LLM Providers with LiteLLM\n", - "\n", - "\n", - "\n", - "* Quality Testing\n", - "* Load Testing\n", - "* Duration Testing\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ZXOXl23PIIP6" - }, - "outputs": [], - "source": [ - "!pip install litellm python-dotenv" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "id": "LINuBzXDItq2" - }, - "outputs": [], - "source": [ - "from litellm import load_test_model, testing_batch_completion" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "EkxMhsWdJdu4" - }, - "outputs": [], - "source": [ - "import os \n", - "os.environ[\"OPENAI_API_KEY\"] = \"...\"\n", - "os.environ[\"ANTHROPIC_API_KEY\"] = \"...\"\n", - "os.environ[\"REPLICATE_API_KEY\"] = \"...\"" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "mv5XdnqeW5I_" - }, - "source": [ - "# Quality Test endpoint\n", - "\n", - "## Test the same prompt across multiple LLM providers\n", - "\n", - "In this example, let's ask some questions about Paul Graham" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "id": "XpzrR5m4W_Us" - }, - "outputs": [], - "source": [ - "models = [\"gpt-3.5-turbo\", \"gpt-3.5-turbo-16k\", \"gpt-4\", \"claude-instant-1\", {\"model\": \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\", \"custom_llm_provider\": \"replicate\"}]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompts = [\"Who is Paul Graham?\", \"What is Paul Graham known for?\" , \"Is paul graham a writer?\" , \"Where does Paul Graham live?\", \"What has Paul Graham done?\"]\n", - "messages = [[{\"role\": \"user\", \"content\": context + \"\\n\" + prompt}] for prompt in prompts] # pass in a list of messages we want to test\n", - "result = testing_batch_completion(models=models, messages=messages)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "9nzeLySnvIIW" - }, - "source": [ - "## Visualize the data" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 403 - }, - "id": "X-2n7hdAuVAY", - "outputId": "69cc0de1-68e3-4c12-a8ea-314880010d94" - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
Model Nameclaude-instant-1gpt-3.5-turbo-0613gpt-3.5-turbo-16k-0613gpt-4-0613replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781
Prompt
\\nIs paul graham a writer?Yes, Paul Graham is considered a writer in ad...Yes, Paul Graham is a writer. He has written s...Yes, Paul Graham is a writer. He has authored ...Yes, Paul Graham is a writer. He is an essayis...Yes, Paul Graham is an author. According to t...
\\nWhat has Paul Graham done?Paul Graham has made significant contribution...Paul Graham has achieved several notable accom...Paul Graham has made significant contributions...Paul Graham is known for his work on the progr...Paul Graham has had a diverse career in compu...
\\nWhat is Paul Graham known for?Paul Graham is known for several things:\\n\\n-...Paul Graham is known for his work on the progr...Paul Graham is known for his work on the progr...Paul Graham is known for his work on the progr...Paul Graham is known for many things, includi...
\\nWhere does Paul Graham live?Based on the information provided:\\n\\n- Paul ...According to the given information, Paul Graha...Paul Graham currently lives in England, where ...The text does not provide a current place of r...Based on the information provided, Paul Graha...
\\nWho is Paul Graham?Paul Graham is an influential computer scient...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist,...
\n", - "
\n", - " \n", - "\n", - "\n", - "\n", - "
\n", - " \n", - "
\n", - "\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - " \n", - "\n", - " \n", - "
\n", - "
\n" - ], - "text/plain": [ - "Model Name claude-instant-1 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is considered a writer in ad... \n", - "\\nWhat has Paul Graham done? Paul Graham has made significant contribution... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for several things:\\n\\n-... \n", - "\\nWhere does Paul Graham live? Based on the information provided:\\n\\n- Paul ... \n", - "\\nWho is Paul Graham? Paul Graham is an influential computer scient... \n", - "\n", - "Model Name gpt-3.5-turbo-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He has written s... \n", - "\\nWhat has Paul Graham done? Paul Graham has achieved several notable accom... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? According to the given information, Paul Graha... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name gpt-3.5-turbo-16k-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He has authored ... \n", - "\\nWhat has Paul Graham done? Paul Graham has made significant contributions... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? Paul Graham currently lives in England, where ... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name gpt-4-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He is an essayis... \n", - "\\nWhat has Paul Graham done? Paul Graham is known for his work on the progr... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? The text does not provide a current place of r... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781 \n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is an author. According to t... \n", - "\\nWhat has Paul Graham done? Paul Graham has had a diverse career in compu... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for many things, includi... \n", - "\\nWhere does Paul Graham live? Based on the information provided, Paul Graha... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist,... " - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import pandas as pd\n", - "\n", - "# Create an empty list to store the row data\n", - "table_data = []\n", - "\n", - "# Iterate through the list and extract the required data\n", - "for item in result:\n", - " prompt = item['prompt'][0]['content'].replace(context, \"\") # clean the prompt for easy comparison\n", - " model = item['response']['model']\n", - " response = item['response']['choices'][0]['message']['content']\n", - " table_data.append([prompt, model, response])\n", - "\n", - "# Create a DataFrame from the table data\n", - "df = pd.DataFrame(table_data, columns=['Prompt', 'Model Name', 'Response'])\n", - "\n", - "# Pivot the DataFrame to get the desired table format\n", - "table = df.pivot(index='Prompt', columns='Model Name', values='Response')\n", - "table" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "zOxUM40PINDC" - }, - "source": [ - "# Load Test endpoint\n", - "\n", - "Run 100+ simultaneous queries across multiple providers to see when they fail + impact on latency" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ZkQf_wbcIRQ9" - }, - "outputs": [], - "source": [ - "models=[\"gpt-3.5-turbo\", \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\", \"claude-instant-1\"]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompt = \"Where does Paul Graham live?\"\n", - "final_prompt = context + prompt\n", - "result = load_test_model(models=models, prompt=final_prompt, num_calls=5)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "8vSNBFC06aXY" - }, - "source": [ - "## Visualize the data" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 552 - }, - "id": "SZfiKjLV3-n8", - "outputId": "00f7f589-b3da-43ed-e982-f9420f074b8d" - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAIXCAYAAACy1HXAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABn5UlEQVR4nO3dd1QT2d8G8Cf0ojQBEUFRsSv2FXvvvSx2saNi7733ihXELotd7KuIir33sjZUsIuKVGmS+/7hy/yM6K7RYEZ4PufkaO5Mkm/IJHly594ZhRBCgIiIiEiGdLRdABEREdG3MKgQERGRbDGoEBERkWwxqBAREZFsMagQERGRbDGoEBERkWwxqBAREZFsMagQERGRbDGoEBERkWwxqBCR7Dk5OaFLly7aLkNtc+fORd68eaGrq4uSJUtquxyNO3bsGBQKBbZv367tUtSmUCgwadIktW8XGhoKhUKBdevWabwm+joGFVKxfPlyKBQKlC9fXtulyI6TkxMUCoV0MTU1xR9//IENGzZou7TfTuoX3PdcfleHDh3CiBEjUKlSJaxduxYzZszQdkmys27dOul1PnXqVJrlQgg4OjpCoVCgcePGWqiQ5E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Bnx8fHpUQ8RERGRRO1dP25ubti0aRNsbW3h5OQEfX19leVXrlzRWHFERESUuakdVNzd3XH58mV07NiRg2mJiIgoXakdVPbv34/AwEBUrlw5PeohIiIikqg9RsXR0RFmZmbpUQsRERGRCrWDyvz58zFixAiEhoamQzlERERE/6P2rp+OHTviw4cPyJcvH0xMTNIMpo2IiNBYcUSZndOo/dougbQsdFYjbZdApFVqBxUvL690KIOIiIgorR+a9UNERET0K3xXUImOjpYG0EZHR//ruhxoS0RERJryXUHF0tISL1++hK2tLSwsLL567BQhBBQKBVJSUjReJBEREWVO3xVUjh49CisrKwBAcHBwuhZERERElOq7gkq1atWQN29eXLx4EdWqVUvvmoiIiIgAqHEcldDQUO7WISIiol9K7QO+aZK3tzdcXFxgZmYGMzMzVKhQAQcOHNBmSURERCQjak1PDgwMhLm5+b+u07Rp0+++PwcHB8yaNQv58+eHEALr169Hs2bNcPXqVRQtWlSd0oiIiCgDUiuo/NcxVNSd9dOkSROV69OnT4e3tzfOnTvHoEJERETqBZVXr17B1tY2XQpJSUnBtm3bEBcXhwoVKnx1ncTERCQmJkrX/+uYLkRERPR7++4xKl87doom3Lx5E1myZIGhoSF69+6NnTt3okiRIl9dd+bMmTA3N5cujo6O6VITERERycN3BxUhRLoUULBgQVy7dg3nz59Hnz594O7ujn/++eer644ePRpRUVHS5enTp+lSExEREcnDd+/6cXd3h7GxscYLMDAwgLOzMwCgTJkyuHjxIhYtWoQVK1akWdfQ0BCGhoYar4GIiIjk6buDytq1a9OzDolSqVQZh0JERESZl9pnT9ak0aNHo0GDBsiVKxdiYmKwceNGHDt2DIGBgdosi4iIiGRCq0ElPDwcnTt3xsuXL2Fubg4XFxcEBgaiTp062iyLiIiIZEKrQWX16tXafHgiIiKSuR8+hH5ISAgCAwMRHx8PIP1mBREREVHmpXZQeffuHWrXro0CBQqgYcOGePnyJQCge/fuGDp0qMYLJCIiosxL7aAyePBg6Onp4cmTJzAxMZHa27Rpg4MHD2q0OCIiIsrc1B6jcuj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8eWbNmxfz58zF69GgAgL29PSZNmoQBAwZovEAiIiLKvNQOKgqFAoMHD8bgwYMRExMDAMiaNavGCyMiIiL6oeOoAEB4eDju3bsHAChUqBBsbGw0VhQRERER8AODaWNiYtCpUyfY29ujWrVqqFatGuzt7dGxY0dERUWlR41ERESUSakdVHr06IHz589j//79iIyMRGRkJPbt24dLly7Bw8MjPWokIiKiTErtXT/79u1DYGAgKleuLLXVq1cPK1euRP369TVaHBEREWVuaveoZMuWDebm5mnazc3NYWlpqZGiiIiIiIAfCCrjxo3DkCFD8OrVK6nt1atXGD58OMaPH6/R4oiIiChzU3vXj7e3N0JCQpArVy7kypULAPDkyRMYGhrizZs3WLFihbTulStXNFcpERERZTpqB5XmzZunQxlEREREaakdVCZOnJgedRARERGlofYYladPn+LZs2fS9QsXLmDQoEHw9fXVaGFEREREageV9u3bIzg4GMCnQbS1a9fGhQsXMHbsWEyZMkXjBRIREVHmpXZQuXXrFv744w8AwNatW1G8eHGcOXMG/v7+WLdunabrIyIiokxM7aCSnJwMQ0NDAMDhw4fRtGlTAJ/O9/Py5UvNVkdERESZmtpBpWjRovDx8cHJkycRFBQkHY32xYsXyJYtm8YLJCIiosxL7aAye/ZsrFixAtWrV0e7du1QokQJAMCePXukXUJEREREmqD29OTq1avj7du3iI6OVjlkfq9evWBiYqLR4oiIiChzU7tHBQCEELh8+TJWrFiBmJgYAICBgQGDChEREWmU2j0qYWFhqF+/Pp48eYLExETUqVMHWbNmxezZs5GYmAgfH5/0qJOIiIgyIbV7VAYOHIiyZcvi/fv3MDY2ltpbtGiBI0eOaLQ4IiIiytzU7lE5efIkzpw5AwMDA5V2JycnPH/+XGOFEREREando6JUKpGSkpKm/dmzZ8iaNatGiiIiIiICfiCo1K1bF15eXtJ1hUKB2NhYTJw4EQ0bNtRkbURERJTJqb3rZ/78+ahXrx6KFCmChIQEtG/fHg8ePIC1tTU2bdqUHjUSERFRJqV2UHFwcMD169exZcsWXL9+HbGxsejevTs6dOigMriWiIiI6G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zqhXrx4iIiIAAE+fPkXLli3RpEkTXLt2DT169MCoUaNU7uPhw4eoX78+WrVqhRs3bmDLli04deoU+vXrl/5PkojSHYMKEaWLjh074tSpUwgLC0NYWBhOnz6Njh07Ssvj4uLg7e2NuXPnokGDBihSpAhWrlwJY2NjrF69GgDg7e2NfPnyYf78+ShYsCA6dOiQZnzLzJkz0aFDBwwaNAj58+dHxYoVsXjxYmzYsAEJCQm/8ikTUTrgSQmJKF3Y2NigUaNGWLduHYQQaNSoEaytraXlDx8+RHJyMipVqiS16evr448//sCdO3cAAHfu3EH58uVV7rdChQoq169fv44bN27A399fahNCQKlU4vHjxyhcuHB6PD0i+kUYVIgo3XTr1k3aBbNs2bJ0eYzY2Fh4eHhgwIABaZZx4C7R749BhYjSTf369ZGUlASFQoF69eqpLMuXLx8MDAxw+vRp5M6dG8CnM+devHgRgwYNAgAULlwYe/bsUbnduXPnVK6XLl0a//zzD5ydndPviRCR1nCMChGlG11dXdy5cwf//PMPdHV1VZaZmpqiT58+GD58OA4ePIh//vkHPXv2xIcPH9C9e3cAQO/evfHgwQMMHz4c9+7dw8aNG7Fu3TqV+xk5ciTOnDmDfv364dq1a3jw4AF2797NwbREGQSDChGlKzMzM5iZmX112axZs9CqVSt06tQJpUuXRkhICAIDA2FpaQng066bHTt2YNeuXShRogR8fHwwY8YMlftwcXHB8ePHcf/+fVSpUgWlSpXChAkTYG9vn+7PjYjSn0IIIbRdBBEREdHXsEeFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhk6/8AHoK08GWUizwAAAAASUVORK5CYII=", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import matplotlib.pyplot as plt\n", - "\n", - "## calculate avg response time\n", - "unique_models = set(result[\"response\"]['model'] for result in result[\"results\"])\n", - "model_dict = {model: {\"response_time\": []} for model in unique_models}\n", - "for completion_result in result[\"results\"]:\n", - " model_dict[completion_result[\"response\"][\"model\"]][\"response_time\"].append(completion_result[\"response_time\"])\n", - "\n", - "avg_response_time = {}\n", - "for model, data in model_dict.items():\n", - " avg_response_time[model] = sum(data[\"response_time\"]) / len(data[\"response_time\"])\n", - "\n", - "models = list(avg_response_time.keys())\n", - "response_times = list(avg_response_time.values())\n", - "\n", - "plt.bar(models, response_times)\n", - "plt.xlabel('Model', fontsize=10)\n", - "plt.ylabel('Average Response Time')\n", - "plt.title('Average Response Times for each Model')\n", - "\n", - "plt.xticks(models, [model[:15]+'...' if len(model) > 15 else model for model in models], rotation=45)\n", - "plt.show()" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "inSDIE3_IRds" - }, - "source": [ - "# Duration Test endpoint\n", - "\n", - "Run load testing for 2 mins. Hitting endpoints with 100+ queries every 15 seconds." - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "id": "ePIqDx2EIURH" - }, - "outputs": [], - "source": [ - "models=[\"gpt-3.5-turbo\", \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\", \"claude-instant-1\"]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompt = \"Where does Paul Graham live?\"\n", - "final_prompt = context + prompt\n", - "result = load_test_model(models=models, prompt=final_prompt, num_calls=100, interval=15, duration=120)" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 552 - }, - "id": "k6rJoELM6t1K", - "outputId": "f4968b59-3bca-4f78-a88b-149ad55e3cf7" - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAIXCAYAAABghH+YAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABwdUlEQVR4nO3dd1QU198G8GfpoNKUooKCYuwIaiL2GrGLJnYFOxrsNZbYFTsYG2JDjV2xRKOIir33EhsWLBGwUaXJ3vcPX+bnCiYsLi6Oz+ecPbp37ux+lx3YZ+/cmVEIIQSIiIiIZEJH2wUQERERaRLDDREREckKww0RERHJCsMNERERyQrDDREREckKww0RERHJCsMNERERyQrDDREREckKww0RERHJCsMNEcmSg4MDunfvru0y1DZnzhyUKFECurq6cHFx0XY5GnfkyBEoFAps27ZN26WoTaFQYNKkSWqv9+jRIygUCgQFBWm8Jsoaww19tiVLlkChUKBatWraLiXPcXBwgEKhkG758uXDDz/8gLVr12q7tK9Oxodidm5fqwMHDmDUqFGoWbMmVq9ejRkzZmi7pDwnKChIep9PnDiRabkQAvb29lAoFGjRooUWKqS8QE/bBdDXb/369XBwcMC5c+cQHh4OJycnbZeUp7i4uGD48OEAgOfPn2PFihXw8vJCSkoK+vTpo+Xqvh5ly5bFunXrVNrGjBmD/PnzY9y4cZn637lzBzo6X9f3t8OHD0NHRwcrV66EgYGBtsvJ04yMjLBhwwbUqlVLpf3o0aN4+vQpDA0NtVQZ5QUMN/RZHj58iFOnTiE4OBje3t5Yv349Jk6c+EVrUCqVSE1NhZGR0Rd93uwqWrQounbtKt3v3r07SpQoAT8/P4YbNdjY2Kj8HAFg5syZKFSoUKZ2AF/lh1t0dDSMjY01FmyEEEhOToaxsbFGHi8vadasGbZu3Yrff/8denr/+yjbsGEDqlSpgp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LaLICIiItIUjtwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGs/B+XLE52CERTBAAAAABJRU5ErkJggg==", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import matplotlib.pyplot as plt\n", - "\n", - "## calculate avg response time\n", - "unique_models = set(unique_result[\"response\"]['model'] for unique_result in result[0][\"results\"])\n", - "model_dict = {model: {\"response_time\": []} for model in unique_models}\n", - "for iteration in result:\n", - " for completion_result in iteration[\"results\"]:\n", - " model_dict[completion_result[\"response\"][\"model\"]][\"response_time\"].append(completion_result[\"response_time\"])\n", - "\n", - "avg_response_time = {}\n", - "for model, data in model_dict.items():\n", - " avg_response_time[model] = sum(data[\"response_time\"]) / len(data[\"response_time\"])\n", - "\n", - "models = list(avg_response_time.keys())\n", - "response_times = list(avg_response_time.values())\n", - "\n", - "plt.bar(models, response_times)\n", - "plt.xlabel('Model', fontsize=10)\n", - "plt.ylabel('Average Response Time')\n", - "plt.title('Average Response Times for each Model')\n", - "\n", - "plt.xticks(models, [model[:15]+'...' if len(model) > 15 else model for model in models], rotation=45)\n", - "plt.show()" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_Azure_and_OpenAI_example.ipynb b/cookbook/LiteLLM_Azure_and_OpenAI_example.ipynb deleted file mode 100644 index 7df1c47eb11..00000000000 --- a/cookbook/LiteLLM_Azure_and_OpenAI_example.ipynb +++ /dev/null @@ -1,422 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "BmX0b5Ueh91v" - }, - "source": [ - "# LiteLLM - Azure OpenAI + OpenAI Calls\n", - "This notebook covers the following for Azure OpenAI + OpenAI:\n", - "* Completion - Quick start\n", - "* Completion - Streaming\n", - "* Completion - Azure, OpenAI in separate threads\n", - "* Completion - Stress Test 10 requests in parallel\n", - "* Completion - Azure, OpenAI in the same thread" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "iHq4d0dpfawS" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "mnveHO5dfcB0" - }, - "outputs": [], - "source": [ - "import os" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "eo88QUdbiDIE" - }, - "source": [ - "## Completion - Quick start" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "5OSosWNCfc_2", - "outputId": "c52344b1-2458-4695-a7eb-a9b076893348" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Openai Response\n", - "\n", - "{\n", - " \"id\": \"chatcmpl-7yjVOEKCPw2KdkfIaM3Ao1tIXp8EM\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1694708958,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"I'm an AI, so I don't have feelings, but I'm here to help you. How can I assist you?\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 13,\n", - " \"completion_tokens\": 26,\n", - " \"total_tokens\": 39\n", - " }\n", - "}\n", - "Azure Response\n", - "\n", - "{\n", - " \"id\": \"chatcmpl-7yjVQ6m2R2HRtnKHRRFp6JzL4Fjez\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1694708960,\n", - " \"model\": \"gpt-35-turbo\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"finish_reason\": \"stop\",\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello there! As an AI language model, I don't have feelings but I'm functioning well. How can I assist you today?\"\n", - " }\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"completion_tokens\": 27,\n", - " \"prompt_tokens\": 14,\n", - " \"total_tokens\": 41\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "# openai configs\n", - "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", - "\n", - "# azure openai configs\n", - "os.environ[\"AZURE_API_KEY\"] = \"\"\n", - "os.environ[\"AZURE_API_BASE\"] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - "os.environ[\"AZURE_API_VERSION\"] = \"2023-05-15\"\n", - "\n", - "\n", - "# openai call\n", - "response = completion(\n", - " model = \"gpt-3.5-turbo\",\n", - " messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - ")\n", - "print(\"Openai Response\\n\")\n", - "print(response)\n", - "\n", - "\n", - "\n", - "# azure call\n", - "response = completion(\n", - " model = \"azure/your-azure-deployment\",\n", - " messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - ")\n", - "print(\"Azure Response\\n\")\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "dQMkM-diiKdE" - }, - "source": [ - "## Completion - Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "uVvJDVn4g1i1" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "# openai configs\n", - "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", - "\n", - "# azure openai configs\n", - "os.environ[\"AZURE_API_KEY\"] = \"\"\n", - "os.environ[\"AZURE_API_BASE\"] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - "os.environ[\"AZURE_API_VERSION\"] = \"2023-05-15\"\n", - "\n", - "\n", - "# openai call\n", - "response = completion(\n", - " model = \"gpt-3.5-turbo\",\n", - " messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True\n", - ")\n", - "print(\"OpenAI Streaming response\")\n", - "for chunk in response:\n", - " print(chunk)\n", - "\n", - "# azure call\n", - "response = completion(\n", - " model = \"azure/your-azure-deployment\",\n", - " messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True\n", - ")\n", - "print(\"Azure Streaming response\")\n", - "for chunk in response:\n", - " print(chunk)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "4xrOPnt-oqwm" - }, - "source": [ - "## Completion - Azure, OpenAI in separate threads" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "V5b5taJPjvC3" - }, - "outputs": [], - "source": [ - "import os\n", - "import threading\n", - "from litellm import completion\n", - "\n", - "# Function to make a completion call\n", - "def make_completion(model, messages):\n", - " response = completion(\n", - " model=model,\n", - " messages=messages\n", - " )\n", - "\n", - " print(f\"Response for {model}: {response}\")\n", - "\n", - "# openai configs\n", - "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", - "\n", - "# azure openai configs\n", - "os.environ[\"AZURE_API_KEY\"] = \"\"\n", - "os.environ[\"AZURE_API_BASE\"] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - "os.environ[\"AZURE_API_VERSION\"] = \"2023-05-15\"\n", - "\n", - "# Define the messages for the completions\n", - "messages = [{\"content\": \"Hello, how are you?\", \"role\": \"user\"}]\n", - "\n", - "# Create threads for making the completions\n", - "thread1 = threading.Thread(target=make_completion, args=(\"gpt-3.5-turbo\", messages))\n", - "thread2 = threading.Thread(target=make_completion, args=(\"azure/your-azure-deployment\", messages))\n", - "\n", - "# Start both threads\n", - "thread1.start()\n", - "thread2.start()\n", - "\n", - "# Wait for both threads to finish\n", - "thread1.join()\n", - "thread2.join()\n", - "\n", - "print(\"Both completions are done.\")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "lx8DbMBqoAoN" - }, - "source": [ - "## Completion - Stress Test 10 requests in parallel\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "pHYANOlOkoDh" - }, - "outputs": [], - "source": [ - "import os\n", - "import threading\n", - "from litellm import completion\n", - "\n", - "# Function to make a completion call\n", - "def make_completion(model, messages):\n", - " response = completion(\n", - " model=model,\n", - " messages=messages\n", - " )\n", - "\n", - " print(f\"Response for {model}: {response}\")\n", - "\n", - "# Set your API keys\n", - "os.environ[\"OPENAI_API_KEY\"] = \"\"\n", - "os.environ[\"AZURE_API_KEY\"] = \"\"\n", - "os.environ[\"AZURE_API_BASE\"] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - "os.environ[\"AZURE_API_VERSION\"] = \"2023-05-15\"\n", - "\n", - "# Define the messages for the completions\n", - "messages = [{\"content\": \"Hello, how are you?\", \"role\": \"user\"}]\n", - "\n", - "# Create and start 10 threads for making completions\n", - "threads = []\n", - "for i in range(10):\n", - " thread = threading.Thread(target=make_completion, args=(\"gpt-3.5-turbo\" if i % 2 == 0 else \"azure/your-azure-deployment\", messages))\n", - " threads.append(thread)\n", - " thread.start()\n", - "\n", - "# Wait for all threads to finish\n", - "for thread in threads:\n", - " thread.join()\n", - "\n", - "print(\"All completions are done.\")\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "yB2NDOO4oxrp" - }, - "source": [ - "## Completion - Azure, OpenAI in the same thread" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "HTBqwzxpnxab", - "outputId": "f3bc0efe-e4d5-44d5-a193-97d178cfbe14" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OpenAI Response: {\n", - " \"id\": \"chatcmpl-7yjzrDeOeVeSrQ00tApmTxEww3vBS\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1694710847,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello! I'm an AI, so I don't have feelings, but I'm here to help you. How can I assist you today?\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 13,\n", - " \"completion_tokens\": 29,\n", - " \"total_tokens\": 42\n", - " }\n", - "}\n", - "Azure OpenAI Response: {\n", - " \"id\": \"chatcmpl-7yjztAQ0gK6IMQt7cvLroMSOoXkeu\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1694710849,\n", - " \"model\": \"gpt-35-turbo\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"finish_reason\": \"stop\",\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"As an AI language model, I don't have feelings but I'm functioning properly. Thank you for asking! How can I assist you today?\"\n", - " }\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"completion_tokens\": 29,\n", - " \"prompt_tokens\": 14,\n", - " \"total_tokens\": 43\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "# Function to make both OpenAI and Azure completions\n", - "def make_completions():\n", - " # Set your OpenAI API key\n", - " os.environ[\"OPENAI_API_KEY\"] = \"\"\n", - "\n", - " # OpenAI completion\n", - " openai_response = completion(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages=[{\"content\": \"Hello, how are you?\", \"role\": \"user\"}]\n", - " )\n", - "\n", - " print(\"OpenAI Response:\", openai_response)\n", - "\n", - " # Set your Azure OpenAI API key and configuration\n", - " os.environ[\"AZURE_API_KEY\"] = \"\"\n", - " os.environ[\"AZURE_API_BASE\"] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - " os.environ[\"AZURE_API_VERSION\"] = \"2023-05-15\"\n", - "\n", - " # Azure OpenAI completion\n", - " azure_response = completion(\n", - " model=\"azure/your-azure-deployment\",\n", - " messages=[{\"content\": \"Hello, how are you?\", \"role\": \"user\"}]\n", - " )\n", - "\n", - " print(\"Azure OpenAI Response:\", azure_response)\n", - "\n", - "# Call the function to make both completions in one thread\n", - "make_completions()\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/LiteLLM_Bedrock.ipynb b/cookbook/LiteLLM_Bedrock.ipynb deleted file mode 100644 index eed6036392d..00000000000 --- a/cookbook/LiteLLM_Bedrock.ipynb +++ /dev/null @@ -1,310 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "fNkMBurtxawJ" - }, - "source": [ - "# LiteLLM Bedrock Usage\n", - "Important Note: For Bedrock Requests you need to ensure you have `pip install boto3>=1.28.57`, boto3 supports bedrock from `boto3>=1.28.57` and higher " - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "htAufI28xeSy" - }, - "source": [ - "## Pre-Requisites" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "jT5GbPjAuDTp" - }, - "outputs": [], - "source": [ - "!pip install litellm\n", - "!pip install boto3>=1.28.57 # this version onwards has bedrock support" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "H4Vu4er2xnfI" - }, - "source": [ - "## Set Bedrock/AWS Credentials" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "id": "CtTrBthWxp-t" - }, - "outputs": [], - "source": [ - "import os\n", - "os.environ[\"AWS_ACCESS_KEY_ID\"] = \"\" # Access key\n", - "os.environ[\"AWS_SECRET_ACCESS_KEY\"] = \"\" # Secret access key\n", - "os.environ[\"AWS_REGION_NAME\"] = \"\"" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "ycRK9NUdx1EI" - }, - "source": [ - "## Anthropic Requests" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "tgkuoHa5uLOy", - "outputId": "27a78e86-c6a7-4bcc-8559-0813cb978426" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Claude instant 1, response\n", - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" I'm doing well, thanks for asking!\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-4f2e64a1-56d2-43f2-90d3-60ffd6f5086d\",\n", - " \"created\": 1696256761.3265705,\n", - " \"model\": \"anthropic.claude-instant-v1\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 11,\n", - " \"completion_tokens\": 9,\n", - " \"total_tokens\": 20\n", - " },\n", - " \"finish_reason\": \"stop_sequence\"\n", - "}\n", - "Claude v2, response\n", - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" I'm doing well, thanks for asking!\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-34f59b33-f94e-40c2-8bdb-f4af0813405e\",\n", - " \"created\": 1696256762.2137017,\n", - " \"model\": \"anthropic.claude-v2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 11,\n", - " \"completion_tokens\": 9,\n", - " \"total_tokens\": 20\n", - " },\n", - " \"finish_reason\": \"stop_sequence\"\n", - "}\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(\n", - " model=\"bedrock/anthropic.claude-instant-v1\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - ")\n", - "print(\"Claude instant 1, response\")\n", - "print(response)\n", - "\n", - "\n", - "response = completion(\n", - " model=\"bedrock/anthropic.claude-v2\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - ")\n", - "print(\"Claude v2, response\")\n", - "print(response)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "HnM-HtM3yFMT" - }, - "source": [ - "## Anthropic Requests - With Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "_JZvg2yovRsU" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(\n", - " model=\"bedrock/anthropic.claude-instant-v1\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True,\n", - ")\n", - "print(\"Claude instant 1, response\")\n", - "for chunk in response:\n", - " print(chunk)\n", - "\n", - "\n", - "response = completion(\n", - " model=\"bedrock/anthropic.claude-v2\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True\n", - ")\n", - "print(\"Claude v2, response\")\n", - "print(response)\n", - "for chunk in response:\n", - " print(chunk)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "zj1U1mh9zEhP" - }, - "source": [ - "## A121 Requests" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "6wK6MZLovU7r", - "outputId": "4cf80c04-f15d-4066-b4c7-113b551538de" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "J2 ultra response\n", - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"\\nHi, I'm doing well, thanks for asking! How about you?\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-f2de678f-0e70-4e36-a01f-8b184c2e4d50\",\n", - " \"created\": 1696257116.044311,\n", - " \"model\": \"ai21.j2-ultra\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 16,\n", - " \"total_tokens\": 22\n", - " }\n", - "}\n", - "J2 mid response\n", - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"\\nGood. And you?\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-420d6bf9-36d8-484b-93b4-4c9e00f7ce2e\",\n", - " \"created\": 1696257116.5756805,\n", - " \"model\": \"ai21.j2-mid\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 6,\n", - " \"total_tokens\": 12\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "response = completion(\n", - " model=\"bedrock/ai21.j2-ultra\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - ")\n", - "print(\"J2 ultra response\")\n", - "print(response)\n", - "\n", - "response = completion(\n", - " model=\"bedrock/ai21.j2-mid\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - ")\n", - "print(\"J2 mid response\")\n", - "print(response)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "Y5gGZIwzzSON" - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_CometAPI.ipynb b/cookbook/LiteLLM_CometAPI.ipynb deleted file mode 100644 index 0a7ab581ae3..00000000000 --- a/cookbook/LiteLLM_CometAPI.ipynb +++ /dev/null @@ -1,474 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "iFEmsVJI_2BR" - }, - "source": [ - "# LiteLLM CometAPI Cookbook" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "id": "cBlUhCEP_xj4" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: litellm in /Users/xmx/.miniforge3/lib/python3.12/site-packages (1.78.2)\n", - "Requirement already satisfied: aiohttp>=3.10 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (3.11.18)\n", - "Requirement already satisfied: click in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (8.3.0)\n", - "Requirement already satisfied: fastuuid>=0.13.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (0.13.3)\n", - "Requirement already satisfied: httpx>=0.23.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (0.28.1)\n", - "Requirement already satisfied: importlib-metadata>=6.8.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (8.6.1)\n", - "Requirement already satisfied: jinja2<4.0.0,>=3.1.2 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (3.1.6)\n", - "Requirement already satisfied: jsonschema<5.0.0,>=4.22.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (4.25.1)\n", - "Requirement already satisfied: openai>=2.8.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (1.109.1)\n", - "Requirement already satisfied: pydantic<3.0.0,>=2.5.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (2.11.10)\n", - "Requirement already satisfied: python-dotenv>=0.2.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (1.1.1)\n", - "Requirement already satisfied: tiktoken>=0.7.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (0.12.0)\n", - "Requirement already satisfied: tokenizers in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from litellm) (0.22.1)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (2.6.1)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (1.4.0)\n", - "Requirement already satisfied: attrs>=17.3.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (25.3.0)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (1.6.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (6.6.3)\n", - "Requirement already satisfied: propcache>=0.2.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (0.3.1)\n", - "Requirement already satisfied: yarl<2.0,>=1.17.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from aiohttp>=3.10->litellm) (1.20.0)\n", - "Requirement already satisfied: anyio in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from httpx>=0.23.0->litellm) (4.11.0)\n", - "Requirement already satisfied: certifi in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from httpx>=0.23.0->litellm) (2025.10.5)\n", - "Requirement already satisfied: httpcore==1.* in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from httpx>=0.23.0->litellm) (1.0.9)\n", - "Requirement already satisfied: idna in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from httpx>=0.23.0->litellm) (3.10)\n", - "Requirement already satisfied: h11>=0.16 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from httpcore==1.*->httpx>=0.23.0->litellm) (0.16.0)\n", - "Requirement already satisfied: zipp>=3.20 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from importlib-metadata>=6.8.0->litellm) (3.21.0)\n", - "Requirement already satisfied: MarkupSafe>=2.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from jinja2<4.0.0,>=3.1.2->litellm) (3.0.3)\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (2025.9.1)\n", - "Requirement already satisfied: referencing>=0.28.4 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (0.36.2)\n", - "Requirement already satisfied: rpds-py>=0.7.1 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (0.27.1)\n", - "Requirement already satisfied: distro<2,>=1.7.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from openai>=2.8.0->litellm) (1.9.0)\n", - "Requirement already satisfied: jiter<1,>=0.4.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from openai>=2.8.0->litellm) (0.11.0)\n", - "Requirement already satisfied: sniffio in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from openai>=2.8.0->litellm) (1.3.1)\n", - "Requirement already satisfied: tqdm>4 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from openai>=2.8.0->litellm) (4.67.1)\n", - "Requirement already satisfied: typing-extensions<5,>=4.11 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from openai>=2.8.0->litellm) (4.15.0)\n", - "Requirement already satisfied: annotated-types>=0.6.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.5.0->litellm) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.33.2 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.5.0->litellm) (2.33.2)\n", - "Requirement already satisfied: typing-inspection>=0.4.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.5.0->litellm) (0.4.2)\n", - "Requirement already satisfied: regex>=2022.1.18 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from tiktoken>=0.7.0->litellm) (2025.9.18)\n", - "Requirement already satisfied: requests>=2.26.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from tiktoken>=0.7.0->litellm) (2.32.2)\n", - "Requirement already satisfied: huggingface-hub<2.0,>=0.16.4 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from tokenizers->litellm) (0.25.2)\n", - "Requirement already satisfied: filelock in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from huggingface-hub<2.0,>=0.16.4->tokenizers->litellm) (3.15.4)\n", - "Requirement already satisfied: fsspec>=2023.5.0 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from huggingface-hub<2.0,>=0.16.4->tokenizers->litellm) (2025.9.0)\n", - "Requirement already satisfied: packaging>=20.9 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from huggingface-hub<2.0,>=0.16.4->tokenizers->litellm) (25.0)\n", - "Requirement already satisfied: pyyaml>=5.1 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from huggingface-hub<2.0,>=0.16.4->tokenizers->litellm) (6.0.3)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from requests>=2.26.0->tiktoken>=0.7.0->litellm) (3.4.0)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/xmx/.miniforge3/lib/python3.12/site-packages (from requests>=2.26.0->tiktoken>=0.7.0->litellm) (1.26.20)\n" - ] - } - ], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Completion" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "p-MQqWOT_1a7" - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "os.environ['COMETAPI_KEY'] = \"Your_CometAPI_Key_Here\"\n", - "api_key = os.getenv('COMETAPI_KEY')" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Ze8JqMqWAARO", - "outputId": "64f3e836-69fa-4f8e-fb35-088a913bbe98" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "ModelResponse(id='msg_017L3DDDit8AkEgHRe2DQBc9', created=1760589916, model='claude-sonnet-4-5-20250929', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='I\\'ll create a simple Python script that says hi.\\n\\n\\nhello.py\\n#!/usr/bin/env python3\\n\"\"\"\\nA simple script that says hi!\\n\"\"\"\\n\\ndef say_hi(name=None):\\n \"\"\"Say hi to someone, or just say hi generally.\"\"\"\\n if name:\\n print(f\"Hi, {name}!\")\\n else:\\n print(\"Hi!\")\\n\\nif __name__ == \"__main__\":\\n # Say hi generally\\n say_hi()\\n \\n # Say hi to someone specific\\n say_hi(\"World\")\\n\\n\\n\\nI\\'ve created a simple Python script called `hello.py` that:\\n\\n1. Defines a `say_hi()` function that can optionally take a name parameter\\n2. Prints \"Hi!\" if no name is provided\\n3. Prints \"Hi, [name]!\" if a name is provided\\n4. Demonstrates both usages when run\\n\\nYou can run it with:\\n```bash\\npython hello.py\\n```\\n\\nThis will output:\\n```\\nHi!\\nHi, World!\\n```\\n\\nWould you like me to create versions in other programming languages, or modify this in any way?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields=None), provider_specific_fields={})], usage=Usage(completion_tokens=290, prompt_tokens=26, total_tokens=316, completion_tokens_details=None, prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=None, text_tokens=None, image_tokens=None, cached_tokens_details={})))" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from litellm import completion\n", - "response = completion(\n", - " model=\"cometapi/claude-sonnet-4-5-20250929\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-LnhELrnAM_J", - "outputId": "d51c7ab7-d761-4bd1-f849-1534d9df4cd0" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "ModelResponse(id='chatcmpl-CRA9Uo6nsQ9C7kMJv1J4kyNDFJym7', created=1760589916, model='gpt-5-chat-latest', object='chat.completion', system_fingerprint='fp_2da73a467a', choices=[Choices(finish_reason='stop', index=0, message=Message(content='Sure! I can help you write a simple code that prints out \"Hi\" in different programming languages. \\n\\nHere’s an example in **Python**:\\n\\n```python\\n# Simple Python program to say \"Hi\"\\nprint(\"Hi\")\\n```\\n\\nExample in **JavaScript**:\\n\\n```javascript\\n// Simple JavaScript program to say \"Hi\"\\nconsole.log(\"Hi\");\\n```\\n\\nExample in **C**:\\n\\n```c\\n#include \\n\\nint main() {\\n printf(\"Hi\\\\n\");\\n return 0;\\n}\\n```\\n\\nExample in **Java**:\\n\\n```java\\npublic class SayHi {\\n public static void main(String[] args) {\\n System.out.println(\"Hi\");\\n }\\n}\\n```\\n\\nWhich language would you like me to focus on, or do you want me to make it interactive so the program greets the user by name?', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={})], usage=Usage(completion_tokens=174, prompt_tokens=12, total_tokens=186, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)))" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "response = completion(\n", - " model=\"cometapi/gpt-5-chat-latest\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "dJBOUYdwCEn1", - "outputId": "ffa18679-ec15-4dad-fe2b-68665cdf36b0" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "ModelResponse(id='02176058998406949c23b3bf3d52941de23f13565a086747738f0', created=1760589991, model='deepseek-v3.2-exp', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Here are several ways to say \"hi\" in different programming languages:\\n\\n## Python\\n```python\\nprint(\"Hi!\")\\n```\\n\\n## JavaScript (Browser)\\n```javascript\\nconsole.log(\"Hi!\");\\n// or\\nalert(\"Hi!\");\\n```\\n\\n## JavaScript (Node.js)\\n```javascript\\nconsole.log(\"Hi!\");\\n```\\n\\n## Java\\n```java\\npublic class Hello {\\n public static void main(String[] args) {\\n System.out.println(\"Hi!\");\\n }\\n}\\n```\\n\\n## C\\n```c\\n#include \\n\\nint main() {\\n printf(\"Hi!\\\\n\");\\n return 0;\\n}\\n```\\n\\n## C++\\n```cpp\\n#include \\n\\nint main() {\\n std::cout << \"Hi!\" << std::endl;\\n return 0;\\n}\\n```\\n\\n## C#\\n```csharp\\nusing System;\\n\\nclass Program {\\n static void Main() {\\n Console.WriteLine(\"Hi!\");\\n }\\n}\\n```\\n\\n## PHP\\n```php\\n\\n```\\n\\n## Ruby\\n```ruby\\nputs \"Hi!\"\\n```\\n\\n## Go\\n```go\\npackage main\\n\\nimport \"fmt\"\\n\\nfunc main() {\\n fmt.Println(\"Hi!\")\\n}\\n```\\n\\n## Rust\\n```rust\\nfn main() {\\n println!(\"Hi!\");\\n}\\n```\\n\\n## Swift\\n```swift\\nprint(\"Hi!\")\\n```\\n\\n## Kotlin\\n```kotlin\\nfun main() {\\n println(\"Hi!\")\\n}\\n```\\n\\n## HTML (webpage)\\n```html\\n\\n\\n\\n Hi Page\\n\\n\\n

Hi!

\\n\\n\\n```\\n\\nThe Python version is probably the simplest if you\\'re just getting started!', role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}), provider_specific_fields={})], usage=Usage(completion_tokens=347, prompt_tokens=10, total_tokens=357, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=0, rejected_prediction_tokens=None, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=None, cached_tokens=0, text_tokens=None, image_tokens=None)), service_tier='default')" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "response = completion(\n", - " model=\"cometapi/deepseek-v3.2-exp\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Streaming" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Streaming Responses" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "I'm\n", - " doing\n", - " well\n", - " —\n", - " thanks\n", - " for\n", - " asking\n", - "!\n", - " How\n", - " can\n", - " I\n", - " help\n", - " you\n", - " today\n", - "?\n", - "\n" - ] - } - ], - "source": [ - "messages = [{\"role\": \"user\", \"content\": \"Hey, how's it going?\"}]\n", - "response = completion(model=\"cometapi/gpt-5-mini\", messages=messages, stream=True)\n", - "for part in response:\n", - " print(part.choices[0].delta.content or \"\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Async Completion" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ModelResponse(id='chatcmpl-CRAAkmfczlmCEnCM55D9CKexbRenn', created=1760589994, model='gpt-5-mini-2025-08-07', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"I'm doing well, thanks — how are you? How can I help today?\", role='assistant', tool_calls=None, function_call=None, provider_specific_fields={'refusal': None}, annotations=[]), provider_specific_fields={'content_filter_results': {'hate': {'filtered': False, 'severity': 'safe'}, 'protected_material_code': {'filtered': False, 'detected': False}, 'protected_material_text': {'filtered': False, 'detected': False}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}})], usage=Usage(completion_tokens=26, prompt_tokens=12, total_tokens=38, completion_tokens_details=CompletionTokensDetailsWrapper(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0, text_tokens=None), prompt_tokens_details=PromptTokensDetailsWrapper(audio_tokens=0, cached_tokens=0, text_tokens=None, image_tokens=None)), prompt_filter_results=[{'prompt_index': 0, 'content_filter_results': {'hate': {'filtered': False, 'severity': 'safe'}, 'jailbreak': {'filtered': False, 'detected': False}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}])\n" - ] - } - ], - "source": [ - "from litellm import acompletion\n", - "import asyncio\n", - "\n", - "async def test_get_response():\n", - " user_message = \"Hello, how are you?\"\n", - " messages = [{\"content\": user_message, \"role\": \"user\"}]\n", - " response = await acompletion(model=\"cometapi/gpt-5-mini\", messages=messages)\n", - " return response\n", - "\n", - "response = await test_get_response()\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Async Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "test acompletion + streaming\n", - "response: \n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content='Hi', role='assistant', function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' —', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' I', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content='’m', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' doing', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' well', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=',', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' thanks', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content='!', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' How', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' are', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' you', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content='?', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' What', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' can', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' I', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' help', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' you', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' with', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content=' today', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(provider_specific_fields=None, content='?', role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None, citations=None)\n", - "ModelResponseStream(id='chatcmpl-CRAAl9VMDBB5skZt638Qx86K9h1Hb', created=1760589996, model='gpt-5-mini', object='chat.completion.chunk', system_fingerprint=None, choices=[StreamingChoices(finish_reason='stop', index=0, delta=Delta(provider_specific_fields=None, content=None, role=None, function_call=None, tool_calls=None, audio=None), logprobs=None)], provider_specific_fields=None)\n" - ] - } - ], - "source": [ - "from litellm import acompletion\n", - "import asyncio, os, traceback\n", - "\n", - "async def completion_call():\n", - " try:\n", - " print(\"test acompletion + streaming\")\n", - " response = await acompletion(\n", - " model=\"cometapi/gpt-5-mini\", \n", - " messages=[{\"content\": \"Hello, how are you?\", \"role\": \"user\"}], \n", - " stream=True\n", - " )\n", - " print(f\"response: {response}\")\n", - " async for chunk in response:\n", - " print(chunk)\n", - " except:\n", - " print(f\"error occurred: {traceback.format_exc()}\")\n", - " pass\n", - "\n", - "await completion_call()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Embedding" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "EmbeddingResponse(model='text-embedding-3-small', data=[{'object': 'embedding', 'index': 0, 'embedding': [-0.018048199, 0.0047550877, -0.013976435, -0.021936804, -0.038773336, -0.03708264, 0.03854791, -0.0007172257, 0.026473511, -0.0027438616, -0.019823432, -0.011947598, -0.013426959, -0.0059914105, 0.020485623, 0.04269012, -0.028276922, -0.015216281, -0.03325039, 0.045057096, 0.0037477135, 0.015793936, -0.005188329, -0.0071713766, 0.008446445, 0.0070938864, 0.0027632343, 0.025656339, 0.022091785, -0.026797561, -0.029840818, -0.0542714, 0.017907308, -0.03454659, -0.014582269, 0.0429719, 0.03575826, 0.007939235, -0.010123054, -0.029587213, 0.018921727, 0.022556728, 0.019598005, 0.008819807, 0.01655475, 0.043310042, -0.034321167, 0.004441604, 0.032686826, 0.047226828, -0.0043253684, 0.006681779, 0.008995921, 0.06593721, 0.0066078105, -0.023190739, -0.00777721, 0.049875587, -0.028023317, -0.019386668, -0.0013252605, 0.009214303, -0.0055828253, -0.007432026, -0.01199691, 0.0054384116, -0.024247425, 0.047255006, -0.013743965, 0.012799991, 0.009883538, -0.005579303, -0.012616833, -0.014709071, -0.004473305, -0.022204498, 0.010454148, -0.02202134, 0.034631126, 0.0097567355, 0.041478455, -0.010750021, -0.0005340668, -0.041450277, -0.04516981, 0.014709071, -0.06142869, 0.021640932, -0.0008752884, -0.0012671428, -0.045254346, -0.004216178, -0.028220564, -0.011074071, 0.010693664, -0.0029481545, -0.039590508, -0.030178957, -0.019062618, -0.03539194, 0.019978413, 0.019161243, -0.025924034, 0.0058329077, -0.029305428, 0.028840488, 0.02731886, -0.0008048426, -0.056582022, 0.003043256, -0.08459125, -0.012560476, 0.00081100664, 0.0015771041, 0.015188103, -0.0049206354, 0.046888687, -0.027107522, 0.019245777, -0.011412211, 0.039336905, -0.018611765, 0.0429719, -0.04302826, -0.018132735, -0.0074883825, -0.02035882, -0.073038146, -0.042380158, 0.04485985, 0.03361671, -0.033842135, -0.0017259207, -0.0017091898, -0.049199305, -0.024148801, -0.044803493, 0.040943068, -0.03093977, 0.045057096, -0.0186963, -0.014053926, -0.009848315, -0.0070480965, -0.0060054995, -0.02813603, -0.022105874, 0.010235767, -0.004476827, 0.027220234, -0.026290352, 0.0216832, -0.05559578, 0.042464696, 0.0253182, -0.0031594916, 0.02266944, -0.030798879, -0.02896729, -0.0005891025, 0.004061197, -0.042295624, -0.008383043, 0.017146494, -0.025797231, -0.046522368, 0.044127215, 0.021105545, -0.04302826, 0.024430584, -0.014934498, -0.01556851, -0.075743265, -0.022415835, -0.028586883, 0.032743182, 0.03539194, -0.0034483192, -0.04669144, 0.051932603, 0.021626843, 0.03127791, 0.015610777, -0.016470214, -0.0056744046, -0.012743635, 0.060132485, 0.017428277, -0.0039942735, -0.017118316, 0.025106862, 0.008974788, 0.018513141, 0.0016035212, -0.0049593803, 0.0017514573, 0.031221554, -0.034856554, -0.011461522, 0.04621241, 0.044239927, 0.034715664, -0.0121941585, -0.012053267, -0.08526753, -0.011813751, -0.025769053, 0.0125182085, -0.0046670306, 0.038266126, 0.1187997, 0.005787118, -0.030038064, -0.054553185, -0.041506633, -0.024078354, 0.0071854657, -0.013391736, 0.03192601, -0.059625275, 0.0023458432, 0.027924692, 0.09163582, 0.030967949, 0.017639615, 0.01489223, 0.029559033, 0.042943723, 0.0003306547, 0.0047198646, 0.029897174, 0.00012603184, 0.0046811197, -0.0427183, 0.01789322, 0.018175002, -0.0081857955, 0.02581132, 0.009890582, 0.03840702, -0.094453655, -0.01076411, 0.06858598, 0.041647524, 0.033532172, 0.007467249, -0.008235107, -0.030967949, 0.0151317455, 0.027361127, 0.011834885, 0.008707094, 0.008178751, -0.022458103, 0.02844599, 0.003605061, -0.02399382, 0.05212985, 0.06041427, -0.023317542, -0.013335379, -0.044099037, -0.040802173, -0.0047656544, -0.023909286, 0.017315563, 0.017428277, 0.00736158, -0.0016070436, -0.055454887, -0.038012523, -0.020626513, 0.018273626, 0.03260229, -0.016991513, 0.038463376, -0.022458103, -0.0109613575, -0.021810003, 0.04846667, -0.042521052, 0.008601425, -0.019259866, -0.0040048403, -0.03308132, -0.02499415, 0.026783472, -0.032884073, 0.021824092, 0.013145176, -0.009186125, -0.01769597, 0.03240504, -0.015343083, -0.012539342, 0.03578644, -0.012299826, 0.011898286, 0.035730083, 0.058441788, 0.032010544, 0.048720278, 0.012926794, -0.0015207474, -0.03313768, 0.014540002, 0.020189751, 0.00029058868, 0.011531969, -0.022514459, 0.019752987, -0.037956167, 0.005272864, -0.042295624, -0.08521117, -0.03494109, 0.053313337, 0.029981708, -0.008150573, -0.053200625, 0.059681635, -0.035476476, 0.034828376, 0.00087881065, 0.025712697, 0.018668123, 0.03212326, 0.008474623, 0.017836861, 0.004910068, 0.016174342, -0.059681635, 0.04004136, 0.00753065, 0.008150573, -0.038012523, 0.0051178834, 0.012525253, 0.022119964, 0.030235313, 0.008242152, -0.01835816, -0.003150686, 0.010714797, -0.0033162334, -0.028882755, -0.06836055, 0.056159347, 0.013624207, 0.0077349427, 0.0066183778, 0.018583586, -0.008883208, -0.046550546, 0.046945043, -0.07393985, -0.017343743, 0.029530855, -0.010982491, 0.008129438, 0.009700378, -0.024613742, -0.0030097943, 0.0078053884, -0.006438741, 0.04770586, -0.008221018, 0.01654066, 0.02498006, -0.015793936, -0.010827511, 0.02399382, 0.03192601, 0.022923045, -0.029192716, 0.006724046, -0.04601516, 0.038519733, 0.031531516, 0.019443026, 0.000109466084, 0.03525105, -0.027248414, -0.038125236, 0.011771483, -0.007467249, 0.010285079, 0.01670973, -0.007861745, 0.026868006, 0.052327096, 0.026374886, -0.03905512, 0.031193376, -0.053566944, 0.04257741, -0.004670553, 0.0168788, 0.035166513, -0.057878222, 0.07095295, -0.009749691, -0.0137510095, -0.02151413, -0.02431787, 0.010073741, -0.05176353, -0.02083785, 0.003959051, -0.02682574, 0.062104966, -0.011461522, 0.04170388, 0.0076363184, 0.026177637, 0.0144413775, 0.014821785, -0.00046890447, 0.0050544823, 0.00032228927, -0.038970586, -0.011355854, -0.056300238, -0.04302826, -0.003545182, 0.04021043, 0.0051108385, -0.048438493, 0.00252548, -0.07692675, -0.0012433673, 0.0054278444, 0.029305428, -0.016188432, -0.003263399, -0.046156053, 6.031917e-05, 0.060977835, -0.016611107, -0.010637308, -0.012602744, 0.016442036, -0.051509928, -0.016991513, 0.0019407802, 0.019161243, 0.045282524, 0.031869654, -0.036941748, -0.035814617, -0.017850952, -0.027192056, -0.049734693, -0.020964652, 0.0228526, -0.025050506, 0.023472521, 0.025740875, -0.017738238, -0.009813092, -0.030883415, -0.012405495, -0.03277136, -0.029502677, 0.016780175, -0.04421175, -0.0020816717, 0.010341435, 0.059230782, -0.041901127, -0.04119667, 0.025924034, 0.02334572, -0.0008435878, 0.020654691, -0.022753974, 0.010700708, -0.013856677, -0.0121941585, -0.011391076, 0.006590199, 0.0050227814, -0.007960369, 0.0008418266, -0.0198657, 0.10781016, -0.0384352, -0.019147152, 0.0057237167, -0.0038181592, -0.047424074, -0.009341106, 0.018499052, -0.016906979, 0.005642704, -0.01837225, -0.038125236, -0.024895526, -0.010285079, -0.055708494, 0.014173684, -0.019724809, 0.00024215724, 0.04500074, 0.048804812, 0.009777869, -0.006572588, 0.008277375, 0.012328005, -0.012609788, 0.026079014, -0.012990195, 0.017963665, -0.007312268, -0.0015682983, 0.05446865, -0.01258161, 0.00035376972, -0.011299497, -0.036321826, -0.0071854657, 0.012969062, 0.026558045, -0.051819887, -0.0029146927, -0.044606246, -0.010383703, -0.03919601, 0.013624207, 0.0030978515, 0.0121941585, -0.0022225631, 0.0512845, -0.0029780937, -0.025191398, -0.015751667, -0.021006921, 0.0039520063, 0.04418357, 0.020570157, 0.00083390146, 0.020541979, -0.004807922, -0.0114263, -0.036152754, 0.018428607, -0.032658648, -0.002035882, 0.013828499, 0.03144698, -0.0003275727, -0.029756282, 0.008488712, 0.0041879993, 0.027826069, 0.0007273523, -0.018949905, -0.0029023646, 0.007861745, 0.011398122, 0.0125322975, 0.014976765, 0.006318983, -0.0066536004, -0.042915545, 0.025867676, -0.015272637, 0.034602948, 0.050241902, 0.014582269, 0.005987888, 0.015244459, -0.050213724, -0.003212326, 0.01315222, -0.022866689, -0.004772699, 0.035673723, -0.024796901, -0.00699174, -0.002072866, 0.022077696, 0.021147812, 0.005093227, -0.039618686, -0.0049241576, 0.012264604, -0.062104966, -0.0022613083, -0.004339458, 0.065486364, -0.0033320836, 0.02944632, 0.017498722, 0.0033039053, -0.020260196, -0.0154980635, -0.05460954, -0.03626547, 0.0072629564, 0.0028900367, 1.2954037e-05, 0.01769597, -0.0045930627, 0.022260854, 0.0027192058, -0.0010566862, -0.0005212985, 0.012158935, -0.0017312041, -0.035110157, -0.0036032998, -0.02317665, -0.01639977, 0.010327346, 0.018259536, -0.011095204, -0.00061904197, -0.023134382, -0.011989865, 0.0025924034, 0.0056708823, 0.03110884, -0.013462181, -0.021105545, 0.010376658, -0.010017385, -0.025106862, 0.026093103, 0.018456785, -0.02134506, 0.0066993902, 0.011891241, -0.010017385, -0.012687278, -0.017132405, 0.04717047, 0.012475941, -0.018752657, -0.008657781, 0.005276386, -0.02582541, 0.02913636, -0.0193444, -0.01101067, 0.029305428, 0.011736261, 0.043140974, 0.02135915, 0.00089422066, 0.009827181, 0.013638296, 0.013884856, -0.014004614, 0.010285079, 0.008108305, -0.04035132, -0.02978446, 0.008481667, -0.022289034, 0.01621661, -0.0057941624, -0.019090796, -0.01852723, -0.022923045, 0.0077208537, -0.039985005, -0.017428277, -0.009460864, 0.018301804, 0.0014397348, 0.04815671, -0.012187114, 0.018879458, 0.021739556, 0.018414518, -0.013462181, -0.06368295, 0.0057096276, 0.013088819, 0.0061640027, 0.031193376, -0.008728228, -0.019245777, 0.010735931, 0.012454808, 0.0397314, -0.017597347, 0.012278693, 0.0130465515, -0.025473181, -0.03215144, -0.0053292206, -0.0027068777, 0.014068015, -0.028079674, 0.016498392, 0.015159924, -0.009207259, -0.02334572, -0.0013710503, 0.008488712, 0.0012231142, 0.0020464489, -0.025149131, -0.021063277, -0.014427288, -0.035222873, 0.051030897, 0.016103897, 0.0063401167, -0.03093977, -0.004684642, -0.0070199184, -0.008495756, -0.0038674714, -0.012222337, -0.022556728, 0.0036015387, -0.040943068, -0.011362898, 0.016794264, 0.017766416, -0.014194817, 0.0011755633, -0.039759576, 0.011384032, -0.0006318103, 0.008298509, 0.04449353, 0.0004838742, 0.016935157, -0.011341765, 0.016864711, -0.00027892113, 0.0009140335, -0.031306088, -0.049452912, -0.0068367594, -0.00011216283, -0.005079138, -0.014420244, 0.01803411, 0.03984411, -0.026276262, -0.0011077593, -0.00063313113, -0.006301372, -0.019992502, 0.0064316965, -0.024289692, 0.0120039545, 0.0068649375, -0.017724149, -0.015667133, -0.0036490895, -0.007953324, 0.024627833, 0.024402406, 0.021810003, -0.015977094, 0.010524594, -0.0060054995, 0.0414221, -0.048551206, 0.01472316, 0.015427617, 0.0029217373, 0.012666144, 0.0048995013, 0.007326357, -0.04187295, -0.0064176074, -0.00674518, 0.0047762212, -0.053059734, -0.09541172, 0.022063607, 0.029530855, 0.01556851, 0.011292453, -0.0038709936, -0.0055370354, -0.016005272, -0.0035170037, -0.0572583, 0.038632445, 0.007981502, -0.005434889, -0.023895197, 0.0021380284, -0.0015084195, 0.016117986, 0.005434889, -0.014694982, -0.007104453, 0.011595369, -0.055229463, 0.0036455672, 0.0027104, -0.010052607, -0.023697948, -0.016315235, -0.002757951, 0.039505973, 0.011095204, 0.0002681341, 0.058948997, -0.0074883825, 0.0050122146, 0.040604927, 0.012912705, -0.025078684, 0.040464036, -0.008925476, -0.00876345, -0.040633105, -0.009024099, 0.024796901, 0.03592733, 0.03626547, -0.029474499, -0.00055431994, 0.0010839839, 0.016737908, 0.013286067, -0.005441934, 0.0059420983, -0.0121941585, 0.015089478, -0.010186454, -0.03477202, -0.0076363184, -0.0087141385, 0.0018439173, 0.028065585, -0.022331301, 0.0029516767, -0.045789734, 0.0010672531, 0.018287715, -0.015948916, 0.04849485, 0.0057589393, 0.0066219, 0.002196146, -0.047255006, 0.012116668, 0.02085194, 0.025924034, -0.0036737456, -0.02877004, 0.016906979, -0.037336245, -0.016258877, 0.010883868, -0.003765325, -0.0049523357, -0.002613537, -0.03263047, 0.023204828, 0.0049946033, -0.007692675, -0.034236632, 0.034095738, 0.020133393, 0.019259866, -0.014103238, 0.024599653, 0.005889264, 0.02430378, 0.0111233825, -0.018780835, -0.00040550332, 0.020232018, 0.03806888, 0.009890582, 0.032376863, 0.031052483, 0.01871039, 0.03891423, -0.0009739124, 0.002759712, 0.017498722, -0.01158128, -0.0045578396, 0.02744566, 0.06497915, 0.024853257, 0.004709298, 0.016667463, -0.00066263025, -0.018132735, -0.013138131, -0.01124314, -0.0125182085, -0.0038111147, 0.03361671, -0.007270001, 0.0012011, -0.01771006, -0.00039999973, 0.024021998, 0.0027896515, 0.0024744067, 0.0013965869, -0.05939985, 0.0014150789, -0.0052517303, 0.052524347, 0.015779847, -0.03327857, 0.042633764, 0.0059420983, -0.023387987, 0.0039097387, -0.028023317, -0.011863063, 0.004378203, 0.02052789, -0.063626595, -0.014864052, 0.014293442, -0.00015938349, -0.007932191, -0.0010954313, 0.023528878, -0.007467249, 0.0059667546, 0.017132405, 0.005730761, -0.00020495309, -0.032038722, 0.0036631785, 0.042915545, -0.029925352, 0.015667133, 0.018935816, -0.0072065997, 0.01556851, -0.025473181, 0.017625526, -0.0026698937, -0.007446115, -0.008622559, -0.043422755, -0.020133393, -0.0039801844, 0.01489223, -0.021655021, 0.015357172, -0.03640636, -0.005663838, -0.028530527, 0.0022648307, -0.00043015933, 0.043591827, -0.015526242, 0.011870108, -0.02530411, -0.016315235, -0.00032316984, -0.030150779, -0.0052552526, 0.020372909, 0.0075024716, 0.0104330145, -0.00055608107, -0.026248084, -0.015202192, -0.03341946, 0.031559695, -0.0012046222, 0.07185466, -0.039590508, 0.022979401, 0.05810365, 0.014025748, -0.029756282, -0.022866689, 0.0073897582, 0.037618026, -0.004180955, -0.0051566283, 0.009728557, -0.03604004, 0.040633105, 0.0026963109, -0.0054172776, 0.034095738, -0.00595971, 0.040943068, -0.031390622, 0.055962097, 0.02117599, -0.012912705, -0.019626183, 0.055877563, 0.017343743, -0.0035416598, 0.013257889, -0.0186963, 0.01656884, -0.06396473, -0.0055405577, 0.020767406, -0.0046564634, 0.045085277, -0.009221348, 0.013645341, 0.008777539, 0.004730432, -0.018625854, -0.011067026, 0.021500042, -0.015047211, 0.004600107, -0.0014344514, -0.0023740216, -0.016188432, 0.006209792, 0.0011993388, 0.004180955, -0.017160583, 0.014497734, 0.015371261, 0.018259536, -0.028333278, -0.008390088, 0.041929305, 0.003923828, 0.02550136, -0.003300383, -0.008058993, -0.010418925, 0.058216363, 0.01885128, -0.02020384, 0.002858336, -0.009806047, -0.022274945, 0.0070445742, 0.026670758, 0.008213974, -0.035307407, -0.027713355, 0.042915545, -0.039675042, -0.0029217373, 0.012053267, -0.003853382, 0.01133472, -0.010073741, 0.005878697, 0.0070938864, -0.035673723, 0.024205158, 0.005896309, 0.030573452, 0.02416289, -0.0072911344, 0.01738601, 0.017005602, -0.02846008, 0.0030344503, 0.018794924, -0.0148076955, -0.0344057, 0.025430914, 0.033503994, -0.0050580045, 0.0077138087, 0.03243322, 0.01372283, -0.005441934, 0.0073404466, -0.0007832686, -0.04767768, 0.0070480965, 0.015145835, 0.026233995, -0.01670973, -0.019513471, -0.014849963, 0.007953324, -0.0032176094, 0.006572588, -0.0012477703, 0.004230267, 0.004476827, -0.021810003, -0.030009886, -0.019273955, -0.0030414949, -0.002918215, 0.060639694, 0.024641922, 0.010327346, 0.026558045, 0.018921727, -0.025867676, -0.016117986, 0.023881108, 0.025360467, 0.009770825, 0.03792799, -0.022429924, 0.033363104, -0.0018914682, 0.04040768, 0.018484963, 0.0070199184, -0.017583257, 0.016258877, 0.010954313, -0.008939565, -0.024148801, -0.02498006, -0.007889924, 0.02748793, 0.0307707, 0.029756282, 0.0051425393, 0.0045719286, -0.03046074, 0.013596028, 0.025684519, -0.0033197557, 0.006967084, 0.03677268, 0.0120039545, -0.0032792494, -0.0032211316, -0.02399382, -0.026924362, -0.013920079, -0.0042197, 0.025346378, -0.0027015943, -0.016991513, 0.0031594916, -0.007579962, 0.018978084, 0.017681882, 0.0126591, 0.028939111, 0.008833896, 0.10183637, 0.0059632324, -0.05196078, -0.023697948, 0.011045893, -0.008777539, -0.013807366, 0.019273955, -0.025346378, 0.0074742935, 0.009961028, -0.010813422, 0.018597675, 0.009636978, 0.014948587, 0.024064265, -0.008693005, -0.020570157, 0.014194817, -0.026219906, -0.02299349, 0.011067026, 0.032066904, 0.013391736, -0.05148175, -0.009489042, -0.03062981, -0.0012847543, 0.07286908, 0.026529867, -0.00025008238, 0.013638296, 0.016089808, 0.018654034, -0.0020394044, -0.024543297, 0.0147795165, -0.009601755, 0.0018791402, -0.040520392, -0.003360262, 0.02216223, 0.0137650985, 0.0059914105, 0.0048361, -0.0009844792, 0.016977424, -0.00934815, 0.024233336, -0.013088819, -0.017555078, -0.0050263037, 0.010595039, -0.027516108, 0.0071537653, -0.023247095, -0.0017655464, -0.015948916, 0.058160007, -0.025966302, 0.0121941585, -0.012384362, -0.0015612538, 0.009946939, 0.00628376, 0.011327676, 0.0109613575, 0.008601425, -0.018329982, 0.055680316, -0.012778858, -0.0100807855, -0.011067026, -0.0036490895, -0.01356785, 0.0073193125, -0.014272308, -0.027403394, -0.030742522, 0.02862915, 0.03062981, -0.014596358, 0.021697288, 0.0042408337, 0.027572464, 0.0019601528, -0.037138995, -0.031306088, 0.041929305, 0.017738238, 0.004857234, 0.008256241, 0.0118278405, 0.021753646, -0.00160176, -0.0018333505, -0.0047374764, 0.042239267, 0.0058329077, -0.026459422, 0.015075389, 0.021147812, -0.005212985, 0.01281408, 0.017738238, 0.008242152, -0.020372909, -0.011081115, -0.011017715, 0.007706764, 0.01834407, 0.01954165, 0.037477136, -0.010278034, 0.015808025, 0.00031590514, -0.017681882, -0.008967743, -0.020612424, -0.025416825, -0.0037970257, -0.029868996, 0.01720285, -0.0144554665, 0.026727116, 0.00414221, 0.0040154075, 0.05838543, 0.0005622451, -0.025219576, 0.004180955, -0.002932304, -0.0090663675, 0.011574236, 0.02450103, -0.012553431, -0.020612424, -0.032095082, 0.015526242, 0.008974788, 0.0053151315, -0.0003112821, -0.017935487, -0.0076222294, 0.03358853, 0.029474499, -0.011496745, -0.012835215, -0.020739228, -0.012482986, -0.037871633, 0.0052517303, -0.012926794, -0.0025237189, 0.0020323596, 0.045113456, -0.04835396, -0.027755624, -0.0079955915, 0.007896968, 0.0072559114, 0.015047211, -0.0014573464, -0.014032792, 0.021091456, -0.0046071517, -0.0065232757, -0.02582541, -0.035870973, -0.015343083, 0.03254593, -0.028431902, -0.003286294, 0.014328664, 0.008840941, 0.015948916, 0.012835215, 0.019400757, -0.012342094, -0.010693664, 0.004772699, -0.03254593, 0.010707753, -0.016822444, -0.0032827717, 0.021246437, -0.04485985, -0.04384543, -0.015906649, -0.009707424, 0.02299349, 0.019513471, -0.010151232, 0.018963994, -0.0057976847, 0.05739919, -0.019922055, -0.029108182, -0.0106232185, 0.021077367, 0.0036455672, -0.026614401, 0.04497256, -0.04446535, -0.0004556959, -0.004578973, 0.003962573, -0.004910068, 0.015089478, -0.0301226, 0.007664497, 0.008375999, 0.031982366, 0.006135824, 0.02152822, -0.015469885, -0.007210122, 0.034715664, -0.01233505, 0.0004490916, -0.0144413775, -0.003150686, -0.02003477, -0.027924692, -0.0015850292, -0.009376328, -0.0035997776, -0.03240504, -0.010912046, 0.0031999978, 0.022303123, -0.008988877, 0.00024633997, -0.0035698381, 0.0070974086, -0.002599448, -0.042267445, -0.016935157, -0.0002481011, -0.041393917, 0.014483645, 0.019006262, -0.02813603, 0.0072030774, -7.3032425e-05, 0.01802002, -0.017188761, 0.015991183, 0.020401087, 0.03542012, 0.04469078, 0.04071764, 0.011095204, -0.031390622, -0.03254593, 0.014187773, 0.016272966, -0.009721513, -0.026388975, -0.014849963, -0.005642704, -0.022556728, 0.0064457855, -0.043450933, 0.010834555, -0.015977094, 0.020880118, -0.02385293, -0.054806788, 0.03789981, 0.0013516777, -0.026431242, -0.015540331, 0.016695641, -0.037167173, -0.021190079, 0.023881108, -0.0045860177, 0.0064105624, -0.007763121, -0.013053596, 0.024472851, -0.0004962022, -0.00976378, 0.060019772, -0.0057624616, -0.04384543, 0.010313257, 0.0076715415, 0.0025888812, -0.03589915, 0.008791628, -0.012785902, 0.01042597, 0.015653044, 0.04767768, -0.009869449, 0.0064457855, -0.010947268, -0.0077349427, -0.032715004, -0.023867019, -0.011327676, -0.00046274049, -0.036998104, 0.013913034, 0.012250515, -0.009996251, 0.021204168, 0.020091126, -0.003740669, -0.0049769916, -0.0140891485, 0.024064265, 0.0038815604, 0.025684519, 0.041788414, -0.013553761, 0.006681779, -0.0050826604, -0.018175002, 0.008228063, -0.006230926, -0.018907638, 0.0154839745, -0.028713685, -0.015047211, -0.019682541, 0.02516322, 0.040802173, 0.007213644, 0.011743305, -0.015963005, -0.03818159, 0.01191942, -0.031728763, -0.011863063, 0.023881108, 0.0053116092, -0.020992832, -0.017991843, -0.00405063, -0.017780505, -0.0057659843, 0.02978446, 0.031165197, 0.0014221234, 0.021316882, 0.026008569, -0.0018544842, -0.032658648, 0.028474169, 0.013109953, 0.018076377, 0.0007991189, -0.0042373114, 0.028910933, -0.0029358263, 0.021866359, 0.024472851, -0.002576553, -0.033532172, 0.01920351, -0.0095665315, -0.03093977, 0.0034817809, 0.018654034, -0.0074038478, 0.021443684, 0.0038604268, -0.02745975, 0.031587873, 0.0061146906, 0.022711707, -0.019795254, -0.016991513, -0.04471896, -0.007875834, -0.0034941088, -0.043789074, 0.021091456, 0.024909616, -0.013194487, -0.0042690123, 0.027896514, -0.018414518, -0.023303451, -0.025797231, -0.009524264]}], object='list', usage=Usage(completion_tokens=0, prompt_tokens=3, total_tokens=3, completion_tokens_details=None, prompt_tokens_details=None))\n" - ] - } - ], - "source": [ - "import litellm\n", - "\n", - "\n", - "async def main():\n", - " response = await litellm.aembedding(\n", - " model=\"cometapi/text-embedding-3-small\", # The model name must include prefix \"openai\" + the model name from ai/ml api\n", - " api_key=api_key, # your aiml api-key\n", - " api_base=\"https://api.cometapi.com/v1\", # 👈 the URL has changed from v2 to v1\n", - " input=\"Your text string\",\n", - " )\n", - " print(response)\n", - "\n", - "await main()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "EmbeddingResponse(model='text-embedding-3-small', data=[{'object': 'embedding', 'index': 0, 'embedding': [-0.018048199, 0.0047550877, -0.013976435, -0.021936804, -0.038773336, -0.03708264, 0.03854791, -0.0007172257, 0.026473511, -0.0027438616, -0.019823432, -0.011947598, -0.013426959, -0.0059914105, 0.020485623, 0.04269012, -0.028276922, -0.015216281, -0.03325039, 0.045057096, 0.0037477135, 0.015793936, -0.005188329, -0.0071713766, 0.008446445, 0.0070938864, 0.0027632343, 0.025656339, 0.022091785, -0.026797561, -0.029840818, -0.0542714, 0.017907308, -0.03454659, -0.014582269, 0.0429719, 0.03575826, 0.007939235, -0.010123054, -0.029587213, 0.018921727, 0.022556728, 0.019598005, 0.008819807, 0.01655475, 0.043310042, -0.034321167, 0.004441604, 0.032686826, 0.047226828, -0.0043253684, 0.006681779, 0.008995921, 0.06593721, 0.0066078105, -0.023190739, -0.00777721, 0.049875587, -0.028023317, -0.019386668, -0.0013252605, 0.009214303, -0.0055828253, -0.007432026, -0.01199691, 0.0054384116, -0.024247425, 0.047255006, -0.013743965, 0.012799991, 0.009883538, -0.005579303, -0.012616833, -0.014709071, -0.004473305, -0.022204498, 0.010454148, -0.02202134, 0.034631126, 0.0097567355, 0.041478455, -0.010750021, -0.0005340668, -0.041450277, -0.04516981, 0.014709071, -0.06142869, 0.021640932, -0.0008752884, -0.0012671428, -0.045254346, -0.004216178, -0.028220564, -0.011074071, 0.010693664, -0.0029481545, -0.039590508, -0.030178957, -0.019062618, -0.03539194, 0.019978413, 0.019161243, -0.025924034, 0.0058329077, -0.029305428, 0.028840488, 0.02731886, -0.0008048426, -0.056582022, 0.003043256, -0.08459125, -0.012560476, 0.00081100664, 0.0015771041, 0.015188103, -0.0049206354, 0.046888687, -0.027107522, 0.019245777, -0.011412211, 0.039336905, -0.018611765, 0.0429719, -0.04302826, -0.018132735, -0.0074883825, -0.02035882, -0.073038146, -0.042380158, 0.04485985, 0.03361671, -0.033842135, -0.0017259207, -0.0017091898, -0.049199305, -0.024148801, -0.044803493, 0.040943068, -0.03093977, 0.045057096, -0.0186963, -0.014053926, -0.009848315, -0.0070480965, -0.0060054995, -0.02813603, -0.022105874, 0.010235767, -0.004476827, 0.027220234, -0.026290352, 0.0216832, -0.05559578, 0.042464696, 0.0253182, -0.0031594916, 0.02266944, -0.030798879, -0.02896729, -0.0005891025, 0.004061197, -0.042295624, -0.008383043, 0.017146494, -0.025797231, -0.046522368, 0.044127215, 0.021105545, -0.04302826, 0.024430584, -0.014934498, -0.01556851, -0.075743265, -0.022415835, -0.028586883, 0.032743182, 0.03539194, -0.0034483192, -0.04669144, 0.051932603, 0.021626843, 0.03127791, 0.015610777, -0.016470214, -0.0056744046, -0.012743635, 0.060132485, 0.017428277, -0.0039942735, -0.017118316, 0.025106862, 0.008974788, 0.018513141, 0.0016035212, -0.0049593803, 0.0017514573, 0.031221554, -0.034856554, -0.011461522, 0.04621241, 0.044239927, 0.034715664, -0.0121941585, -0.012053267, -0.08526753, -0.011813751, -0.025769053, 0.0125182085, -0.0046670306, 0.038266126, 0.1187997, 0.005787118, -0.030038064, -0.054553185, -0.041506633, -0.024078354, 0.0071854657, -0.013391736, 0.03192601, -0.059625275, 0.0023458432, 0.027924692, 0.09163582, 0.030967949, 0.017639615, 0.01489223, 0.029559033, 0.042943723, 0.0003306547, 0.0047198646, 0.029897174, 0.00012603184, 0.0046811197, -0.0427183, 0.01789322, 0.018175002, -0.0081857955, 0.02581132, 0.009890582, 0.03840702, -0.094453655, -0.01076411, 0.06858598, 0.041647524, 0.033532172, 0.007467249, -0.008235107, -0.030967949, 0.0151317455, 0.027361127, 0.011834885, 0.008707094, 0.008178751, -0.022458103, 0.02844599, 0.003605061, -0.02399382, 0.05212985, 0.06041427, -0.023317542, -0.013335379, -0.044099037, -0.040802173, -0.0047656544, -0.023909286, 0.017315563, 0.017428277, 0.00736158, -0.0016070436, -0.055454887, -0.038012523, -0.020626513, 0.018273626, 0.03260229, -0.016991513, 0.038463376, -0.022458103, -0.0109613575, -0.021810003, 0.04846667, -0.042521052, 0.008601425, -0.019259866, -0.0040048403, -0.03308132, -0.02499415, 0.026783472, -0.032884073, 0.021824092, 0.013145176, -0.009186125, -0.01769597, 0.03240504, -0.015343083, -0.012539342, 0.03578644, -0.012299826, 0.011898286, 0.035730083, 0.058441788, 0.032010544, 0.048720278, 0.012926794, -0.0015207474, -0.03313768, 0.014540002, 0.020189751, 0.00029058868, 0.011531969, -0.022514459, 0.019752987, -0.037956167, 0.005272864, -0.042295624, -0.08521117, -0.03494109, 0.053313337, 0.029981708, -0.008150573, -0.053200625, 0.059681635, -0.035476476, 0.034828376, 0.00087881065, 0.025712697, 0.018668123, 0.03212326, 0.008474623, 0.017836861, 0.004910068, 0.016174342, -0.059681635, 0.04004136, 0.00753065, 0.008150573, -0.038012523, 0.0051178834, 0.012525253, 0.022119964, 0.030235313, 0.008242152, -0.01835816, -0.003150686, 0.010714797, -0.0033162334, -0.028882755, -0.06836055, 0.056159347, 0.013624207, 0.0077349427, 0.0066183778, 0.018583586, -0.008883208, -0.046550546, 0.046945043, -0.07393985, -0.017343743, 0.029530855, -0.010982491, 0.008129438, 0.009700378, -0.024613742, -0.0030097943, 0.0078053884, -0.006438741, 0.04770586, -0.008221018, 0.01654066, 0.02498006, -0.015793936, -0.010827511, 0.02399382, 0.03192601, 0.022923045, -0.029192716, 0.006724046, -0.04601516, 0.038519733, 0.031531516, 0.019443026, 0.000109466084, 0.03525105, -0.027248414, -0.038125236, 0.011771483, -0.007467249, 0.010285079, 0.01670973, -0.007861745, 0.026868006, 0.052327096, 0.026374886, -0.03905512, 0.031193376, -0.053566944, 0.04257741, -0.004670553, 0.0168788, 0.035166513, -0.057878222, 0.07095295, -0.009749691, -0.0137510095, -0.02151413, -0.02431787, 0.010073741, -0.05176353, -0.02083785, 0.003959051, -0.02682574, 0.062104966, -0.011461522, 0.04170388, 0.0076363184, 0.026177637, 0.0144413775, 0.014821785, -0.00046890447, 0.0050544823, 0.00032228927, -0.038970586, -0.011355854, -0.056300238, -0.04302826, -0.003545182, 0.04021043, 0.0051108385, -0.048438493, 0.00252548, -0.07692675, -0.0012433673, 0.0054278444, 0.029305428, -0.016188432, -0.003263399, -0.046156053, 6.031917e-05, 0.060977835, -0.016611107, -0.010637308, -0.012602744, 0.016442036, -0.051509928, -0.016991513, 0.0019407802, 0.019161243, 0.045282524, 0.031869654, -0.036941748, -0.035814617, -0.017850952, -0.027192056, -0.049734693, -0.020964652, 0.0228526, -0.025050506, 0.023472521, 0.025740875, -0.017738238, -0.009813092, -0.030883415, -0.012405495, -0.03277136, -0.029502677, 0.016780175, -0.04421175, -0.0020816717, 0.010341435, 0.059230782, -0.041901127, -0.04119667, 0.025924034, 0.02334572, -0.0008435878, 0.020654691, -0.022753974, 0.010700708, -0.013856677, -0.0121941585, -0.011391076, 0.006590199, 0.0050227814, -0.007960369, 0.0008418266, -0.0198657, 0.10781016, -0.0384352, -0.019147152, 0.0057237167, -0.0038181592, -0.047424074, -0.009341106, 0.018499052, -0.016906979, 0.005642704, -0.01837225, -0.038125236, -0.024895526, -0.010285079, -0.055708494, 0.014173684, -0.019724809, 0.00024215724, 0.04500074, 0.048804812, 0.009777869, -0.006572588, 0.008277375, 0.012328005, -0.012609788, 0.026079014, -0.012990195, 0.017963665, -0.007312268, -0.0015682983, 0.05446865, -0.01258161, 0.00035376972, -0.011299497, -0.036321826, -0.0071854657, 0.012969062, 0.026558045, -0.051819887, -0.0029146927, -0.044606246, -0.010383703, -0.03919601, 0.013624207, 0.0030978515, 0.0121941585, -0.0022225631, 0.0512845, -0.0029780937, -0.025191398, -0.015751667, -0.021006921, 0.0039520063, 0.04418357, 0.020570157, 0.00083390146, 0.020541979, -0.004807922, -0.0114263, -0.036152754, 0.018428607, -0.032658648, -0.002035882, 0.013828499, 0.03144698, -0.0003275727, -0.029756282, 0.008488712, 0.0041879993, 0.027826069, 0.0007273523, -0.018949905, -0.0029023646, 0.007861745, 0.011398122, 0.0125322975, 0.014976765, 0.006318983, -0.0066536004, -0.042915545, 0.025867676, -0.015272637, 0.034602948, 0.050241902, 0.014582269, 0.005987888, 0.015244459, -0.050213724, -0.003212326, 0.01315222, -0.022866689, -0.004772699, 0.035673723, -0.024796901, -0.00699174, -0.002072866, 0.022077696, 0.021147812, 0.005093227, -0.039618686, -0.0049241576, 0.012264604, -0.062104966, -0.0022613083, -0.004339458, 0.065486364, -0.0033320836, 0.02944632, 0.017498722, 0.0033039053, -0.020260196, -0.0154980635, -0.05460954, -0.03626547, 0.0072629564, 0.0028900367, 1.2954037e-05, 0.01769597, -0.0045930627, 0.022260854, 0.0027192058, -0.0010566862, -0.0005212985, 0.012158935, -0.0017312041, -0.035110157, -0.0036032998, -0.02317665, -0.01639977, 0.010327346, 0.018259536, -0.011095204, -0.00061904197, -0.023134382, -0.011989865, 0.0025924034, 0.0056708823, 0.03110884, -0.013462181, -0.021105545, 0.010376658, -0.010017385, -0.025106862, 0.026093103, 0.018456785, -0.02134506, 0.0066993902, 0.011891241, -0.010017385, -0.012687278, -0.017132405, 0.04717047, 0.012475941, -0.018752657, -0.008657781, 0.005276386, -0.02582541, 0.02913636, -0.0193444, -0.01101067, 0.029305428, 0.011736261, 0.043140974, 0.02135915, 0.00089422066, 0.009827181, 0.013638296, 0.013884856, -0.014004614, 0.010285079, 0.008108305, -0.04035132, -0.02978446, 0.008481667, -0.022289034, 0.01621661, -0.0057941624, -0.019090796, -0.01852723, -0.022923045, 0.0077208537, -0.039985005, -0.017428277, -0.009460864, 0.018301804, 0.0014397348, 0.04815671, -0.012187114, 0.018879458, 0.021739556, 0.018414518, -0.013462181, -0.06368295, 0.0057096276, 0.013088819, 0.0061640027, 0.031193376, -0.008728228, -0.019245777, 0.010735931, 0.012454808, 0.0397314, -0.017597347, 0.012278693, 0.0130465515, -0.025473181, -0.03215144, -0.0053292206, -0.0027068777, 0.014068015, -0.028079674, 0.016498392, 0.015159924, -0.009207259, -0.02334572, -0.0013710503, 0.008488712, 0.0012231142, 0.0020464489, -0.025149131, -0.021063277, -0.014427288, -0.035222873, 0.051030897, 0.016103897, 0.0063401167, -0.03093977, -0.004684642, -0.0070199184, -0.008495756, -0.0038674714, -0.012222337, -0.022556728, 0.0036015387, -0.040943068, -0.011362898, 0.016794264, 0.017766416, -0.014194817, 0.0011755633, -0.039759576, 0.011384032, -0.0006318103, 0.008298509, 0.04449353, 0.0004838742, 0.016935157, -0.011341765, 0.016864711, -0.00027892113, 0.0009140335, -0.031306088, -0.049452912, -0.0068367594, -0.00011216283, -0.005079138, -0.014420244, 0.01803411, 0.03984411, -0.026276262, -0.0011077593, -0.00063313113, -0.006301372, -0.019992502, 0.0064316965, -0.024289692, 0.0120039545, 0.0068649375, -0.017724149, -0.015667133, -0.0036490895, -0.007953324, 0.024627833, 0.024402406, 0.021810003, -0.015977094, 0.010524594, -0.0060054995, 0.0414221, -0.048551206, 0.01472316, 0.015427617, 0.0029217373, 0.012666144, 0.0048995013, 0.007326357, -0.04187295, -0.0064176074, -0.00674518, 0.0047762212, -0.053059734, -0.09541172, 0.022063607, 0.029530855, 0.01556851, 0.011292453, -0.0038709936, -0.0055370354, -0.016005272, -0.0035170037, -0.0572583, 0.038632445, 0.007981502, -0.005434889, -0.023895197, 0.0021380284, -0.0015084195, 0.016117986, 0.005434889, -0.014694982, -0.007104453, 0.011595369, -0.055229463, 0.0036455672, 0.0027104, -0.010052607, -0.023697948, -0.016315235, -0.002757951, 0.039505973, 0.011095204, 0.0002681341, 0.058948997, -0.0074883825, 0.0050122146, 0.040604927, 0.012912705, -0.025078684, 0.040464036, -0.008925476, -0.00876345, -0.040633105, -0.009024099, 0.024796901, 0.03592733, 0.03626547, -0.029474499, -0.00055431994, 0.0010839839, 0.016737908, 0.013286067, -0.005441934, 0.0059420983, -0.0121941585, 0.015089478, -0.010186454, -0.03477202, -0.0076363184, -0.0087141385, 0.0018439173, 0.028065585, -0.022331301, 0.0029516767, -0.045789734, 0.0010672531, 0.018287715, -0.015948916, 0.04849485, 0.0057589393, 0.0066219, 0.002196146, -0.047255006, 0.012116668, 0.02085194, 0.025924034, -0.0036737456, -0.02877004, 0.016906979, -0.037336245, -0.016258877, 0.010883868, -0.003765325, -0.0049523357, -0.002613537, -0.03263047, 0.023204828, 0.0049946033, -0.007692675, -0.034236632, 0.034095738, 0.020133393, 0.019259866, -0.014103238, 0.024599653, 0.005889264, 0.02430378, 0.0111233825, -0.018780835, -0.00040550332, 0.020232018, 0.03806888, 0.009890582, 0.032376863, 0.031052483, 0.01871039, 0.03891423, -0.0009739124, 0.002759712, 0.017498722, -0.01158128, -0.0045578396, 0.02744566, 0.06497915, 0.024853257, 0.004709298, 0.016667463, -0.00066263025, -0.018132735, -0.013138131, -0.01124314, -0.0125182085, -0.0038111147, 0.03361671, -0.007270001, 0.0012011, -0.01771006, -0.00039999973, 0.024021998, 0.0027896515, 0.0024744067, 0.0013965869, -0.05939985, 0.0014150789, -0.0052517303, 0.052524347, 0.015779847, -0.03327857, 0.042633764, 0.0059420983, -0.023387987, 0.0039097387, -0.028023317, -0.011863063, 0.004378203, 0.02052789, -0.063626595, -0.014864052, 0.014293442, -0.00015938349, -0.007932191, -0.0010954313, 0.023528878, -0.007467249, 0.0059667546, 0.017132405, 0.005730761, -0.00020495309, -0.032038722, 0.0036631785, 0.042915545, -0.029925352, 0.015667133, 0.018935816, -0.0072065997, 0.01556851, -0.025473181, 0.017625526, -0.0026698937, -0.007446115, -0.008622559, -0.043422755, -0.020133393, -0.0039801844, 0.01489223, -0.021655021, 0.015357172, -0.03640636, -0.005663838, -0.028530527, 0.0022648307, -0.00043015933, 0.043591827, -0.015526242, 0.011870108, -0.02530411, -0.016315235, -0.00032316984, -0.030150779, -0.0052552526, 0.020372909, 0.0075024716, 0.0104330145, -0.00055608107, -0.026248084, -0.015202192, -0.03341946, 0.031559695, -0.0012046222, 0.07185466, -0.039590508, 0.022979401, 0.05810365, 0.014025748, -0.029756282, -0.022866689, 0.0073897582, 0.037618026, -0.004180955, -0.0051566283, 0.009728557, -0.03604004, 0.040633105, 0.0026963109, -0.0054172776, 0.034095738, -0.00595971, 0.040943068, -0.031390622, 0.055962097, 0.02117599, -0.012912705, -0.019626183, 0.055877563, 0.017343743, -0.0035416598, 0.013257889, -0.0186963, 0.01656884, -0.06396473, -0.0055405577, 0.020767406, -0.0046564634, 0.045085277, -0.009221348, 0.013645341, 0.008777539, 0.004730432, -0.018625854, -0.011067026, 0.021500042, -0.015047211, 0.004600107, -0.0014344514, -0.0023740216, -0.016188432, 0.006209792, 0.0011993388, 0.004180955, -0.017160583, 0.014497734, 0.015371261, 0.018259536, -0.028333278, -0.008390088, 0.041929305, 0.003923828, 0.02550136, -0.003300383, -0.008058993, -0.010418925, 0.058216363, 0.01885128, -0.02020384, 0.002858336, -0.009806047, -0.022274945, 0.0070445742, 0.026670758, 0.008213974, -0.035307407, -0.027713355, 0.042915545, -0.039675042, -0.0029217373, 0.012053267, -0.003853382, 0.01133472, -0.010073741, 0.005878697, 0.0070938864, -0.035673723, 0.024205158, 0.005896309, 0.030573452, 0.02416289, -0.0072911344, 0.01738601, 0.017005602, -0.02846008, 0.0030344503, 0.018794924, -0.0148076955, -0.0344057, 0.025430914, 0.033503994, -0.0050580045, 0.0077138087, 0.03243322, 0.01372283, -0.005441934, 0.0073404466, -0.0007832686, -0.04767768, 0.0070480965, 0.015145835, 0.026233995, -0.01670973, -0.019513471, -0.014849963, 0.007953324, -0.0032176094, 0.006572588, -0.0012477703, 0.004230267, 0.004476827, -0.021810003, -0.030009886, -0.019273955, -0.0030414949, -0.002918215, 0.060639694, 0.024641922, 0.010327346, 0.026558045, 0.018921727, -0.025867676, -0.016117986, 0.023881108, 0.025360467, 0.009770825, 0.03792799, -0.022429924, 0.033363104, -0.0018914682, 0.04040768, 0.018484963, 0.0070199184, -0.017583257, 0.016258877, 0.010954313, -0.008939565, -0.024148801, -0.02498006, -0.007889924, 0.02748793, 0.0307707, 0.029756282, 0.0051425393, 0.0045719286, -0.03046074, 0.013596028, 0.025684519, -0.0033197557, 0.006967084, 0.03677268, 0.0120039545, -0.0032792494, -0.0032211316, -0.02399382, -0.026924362, -0.013920079, -0.0042197, 0.025346378, -0.0027015943, -0.016991513, 0.0031594916, -0.007579962, 0.018978084, 0.017681882, 0.0126591, 0.028939111, 0.008833896, 0.10183637, 0.0059632324, -0.05196078, -0.023697948, 0.011045893, -0.008777539, -0.013807366, 0.019273955, -0.025346378, 0.0074742935, 0.009961028, -0.010813422, 0.018597675, 0.009636978, 0.014948587, 0.024064265, -0.008693005, -0.020570157, 0.014194817, -0.026219906, -0.02299349, 0.011067026, 0.032066904, 0.013391736, -0.05148175, -0.009489042, -0.03062981, -0.0012847543, 0.07286908, 0.026529867, -0.00025008238, 0.013638296, 0.016089808, 0.018654034, -0.0020394044, -0.024543297, 0.0147795165, -0.009601755, 0.0018791402, -0.040520392, -0.003360262, 0.02216223, 0.0137650985, 0.0059914105, 0.0048361, -0.0009844792, 0.016977424, -0.00934815, 0.024233336, -0.013088819, -0.017555078, -0.0050263037, 0.010595039, -0.027516108, 0.0071537653, -0.023247095, -0.0017655464, -0.015948916, 0.058160007, -0.025966302, 0.0121941585, -0.012384362, -0.0015612538, 0.009946939, 0.00628376, 0.011327676, 0.0109613575, 0.008601425, -0.018329982, 0.055680316, -0.012778858, -0.0100807855, -0.011067026, -0.0036490895, -0.01356785, 0.0073193125, -0.014272308, -0.027403394, -0.030742522, 0.02862915, 0.03062981, -0.014596358, 0.021697288, 0.0042408337, 0.027572464, 0.0019601528, -0.037138995, -0.031306088, 0.041929305, 0.017738238, 0.004857234, 0.008256241, 0.0118278405, 0.021753646, -0.00160176, -0.0018333505, -0.0047374764, 0.042239267, 0.0058329077, -0.026459422, 0.015075389, 0.021147812, -0.005212985, 0.01281408, 0.017738238, 0.008242152, -0.020372909, -0.011081115, -0.011017715, 0.007706764, 0.01834407, 0.01954165, 0.037477136, -0.010278034, 0.015808025, 0.00031590514, -0.017681882, -0.008967743, -0.020612424, -0.025416825, -0.0037970257, -0.029868996, 0.01720285, -0.0144554665, 0.026727116, 0.00414221, 0.0040154075, 0.05838543, 0.0005622451, -0.025219576, 0.004180955, -0.002932304, -0.0090663675, 0.011574236, 0.02450103, -0.012553431, -0.020612424, -0.032095082, 0.015526242, 0.008974788, 0.0053151315, -0.0003112821, -0.017935487, -0.0076222294, 0.03358853, 0.029474499, -0.011496745, -0.012835215, -0.020739228, -0.012482986, -0.037871633, 0.0052517303, -0.012926794, -0.0025237189, 0.0020323596, 0.045113456, -0.04835396, -0.027755624, -0.0079955915, 0.007896968, 0.0072559114, 0.015047211, -0.0014573464, -0.014032792, 0.021091456, -0.0046071517, -0.0065232757, -0.02582541, -0.035870973, -0.015343083, 0.03254593, -0.028431902, -0.003286294, 0.014328664, 0.008840941, 0.015948916, 0.012835215, 0.019400757, -0.012342094, -0.010693664, 0.004772699, -0.03254593, 0.010707753, -0.016822444, -0.0032827717, 0.021246437, -0.04485985, -0.04384543, -0.015906649, -0.009707424, 0.02299349, 0.019513471, -0.010151232, 0.018963994, -0.0057976847, 0.05739919, -0.019922055, -0.029108182, -0.0106232185, 0.021077367, 0.0036455672, -0.026614401, 0.04497256, -0.04446535, -0.0004556959, -0.004578973, 0.003962573, -0.004910068, 0.015089478, -0.0301226, 0.007664497, 0.008375999, 0.031982366, 0.006135824, 0.02152822, -0.015469885, -0.007210122, 0.034715664, -0.01233505, 0.0004490916, -0.0144413775, -0.003150686, -0.02003477, -0.027924692, -0.0015850292, -0.009376328, -0.0035997776, -0.03240504, -0.010912046, 0.0031999978, 0.022303123, -0.008988877, 0.00024633997, -0.0035698381, 0.0070974086, -0.002599448, -0.042267445, -0.016935157, -0.0002481011, -0.041393917, 0.014483645, 0.019006262, -0.02813603, 0.0072030774, -7.3032425e-05, 0.01802002, -0.017188761, 0.015991183, 0.020401087, 0.03542012, 0.04469078, 0.04071764, 0.011095204, -0.031390622, -0.03254593, 0.014187773, 0.016272966, -0.009721513, -0.026388975, -0.014849963, -0.005642704, -0.022556728, 0.0064457855, -0.043450933, 0.010834555, -0.015977094, 0.020880118, -0.02385293, -0.054806788, 0.03789981, 0.0013516777, -0.026431242, -0.015540331, 0.016695641, -0.037167173, -0.021190079, 0.023881108, -0.0045860177, 0.0064105624, -0.007763121, -0.013053596, 0.024472851, -0.0004962022, -0.00976378, 0.060019772, -0.0057624616, -0.04384543, 0.010313257, 0.0076715415, 0.0025888812, -0.03589915, 0.008791628, -0.012785902, 0.01042597, 0.015653044, 0.04767768, -0.009869449, 0.0064457855, -0.010947268, -0.0077349427, -0.032715004, -0.023867019, -0.011327676, -0.00046274049, -0.036998104, 0.013913034, 0.012250515, -0.009996251, 0.021204168, 0.020091126, -0.003740669, -0.0049769916, -0.0140891485, 0.024064265, 0.0038815604, 0.025684519, 0.041788414, -0.013553761, 0.006681779, -0.0050826604, -0.018175002, 0.008228063, -0.006230926, -0.018907638, 0.0154839745, -0.028713685, -0.015047211, -0.019682541, 0.02516322, 0.040802173, 0.007213644, 0.011743305, -0.015963005, -0.03818159, 0.01191942, -0.031728763, -0.011863063, 0.023881108, 0.0053116092, -0.020992832, -0.017991843, -0.00405063, -0.017780505, -0.0057659843, 0.02978446, 0.031165197, 0.0014221234, 0.021316882, 0.026008569, -0.0018544842, -0.032658648, 0.028474169, 0.013109953, 0.018076377, 0.0007991189, -0.0042373114, 0.028910933, -0.0029358263, 0.021866359, 0.024472851, -0.002576553, -0.033532172, 0.01920351, -0.0095665315, -0.03093977, 0.0034817809, 0.018654034, -0.0074038478, 0.021443684, 0.0038604268, -0.02745975, 0.031587873, 0.0061146906, 0.022711707, -0.019795254, -0.016991513, -0.04471896, -0.007875834, -0.0034941088, -0.043789074, 0.021091456, 0.024909616, -0.013194487, -0.0042690123, 0.027896514, -0.018414518, -0.023303451, -0.025797231, -0.009524264]}], object='list', usage=Usage(completion_tokens=0, prompt_tokens=3, total_tokens=3, completion_tokens_details=None, prompt_tokens_details=None))\n" - ] - } - ], - "source": [ - "import litellm\n", - "\n", - "\n", - "async def main():\n", - " response = await litellm.aembedding(\n", - " model=\"cometapi/text-embedding-3-small\", # The model name must include prefix \"cometapi/\" + the model name from CometAPI\n", - " api_key=api_key, # your CometAPI api-key\n", - " api_base=\"https://api.cometapi.com/v1\",\n", - " input=\"Your text string\",\n", - " )\n", - " print(response)\n", - "\n", - "\n", - "await main()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Async Image Generation" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ImageResponse(created=1760591151, background=None, data=[ImageObject(b64_json=None, revised_prompt=\"Generate an image of an adorable baby sea otter. It should be floating on its back in a calm, clear ocean, playfully grasping a colorful shell in its small paws. The sun is setting in the background, casting a peaceful orange and purple hue across the sky and reflecting upon the ocean waves. The otter's fur is a deep, rich brown and appears silky and wet, with glints of sunlight catching on it. Its eyes are bright, expressing joy and curiosity as it examines its newfound treasure.\", url='https://oaidalleapiprodscus.blob.core.windows.net/private/org-OKnsK88id12jfvnKByup1O0l/user-3GxuMyEg9YMU8LFCPHi31prf/img-7PUEF8Wb6thGDAuZWLJjSnfP.png?st=2025-10-16T04%3A05%3A51Z&se=2025-10-16T06%3A05%3A51Z&sp=r&sv=2024-08-04&sr=b&rscd=inline&rsct=image/png&skoid=38e27a3b-6174-4d3e-90ac-d7d9ad49543f&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2025-10-16T02%3A51%3A01Z&ske=2025-10-17T02%3A51%3A01Z&sks=b&skv=2024-08-04&sig=IZKG2VE%2B6VdOe5Tq0Zk/5bVyGK/oK/yO8g%2BDX4krpug%3D')], output_format=None, quality=None, size=None, usage=Usage(completion_tokens=0, prompt_tokens=0, total_tokens=0, completion_tokens_details=None, prompt_tokens_details=None, input_tokens=0, input_tokens_details={'image_tokens': 0, 'text_tokens': 0}, output_tokens=0))\n" - ] - } - ], - "source": [ - "import asyncio\n", - "\n", - "import litellm\n", - "\n", - "\n", - "async def main():\n", - " response = await litellm.aimage_generation(\n", - " model=\"cometapi/dall-e-3\", # The model name must include prefix \"cometapi/\" + the model name from CometAPI\n", - " api_key=api_key, # your cometapi api-key\n", - " api_base=\"https://api.cometapi.com/v1\",\n", - " prompt=\"A cute baby sea otter\",\n", - " )\n", - " print(response)\n", - "\n", - "\n", - "await main()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "base", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.8" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_Comparing_LLMs.ipynb b/cookbook/LiteLLM_Comparing_LLMs.ipynb deleted file mode 100644 index 0b2e4e8c776..00000000000 --- a/cookbook/LiteLLM_Comparing_LLMs.ipynb +++ /dev/null @@ -1,441 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "L-W4C3SgClxl" - }, - "source": [ - "## Comparing LLMs on a Test Set using LiteLLM\n", - "LiteLLM allows you to use any LLM as a drop in replacement for `gpt-3.5-turbo`\n", - "\n", - "This notebook walks through how you can compare GPT-4 vs Claude-2 on a given test set using litellm" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "fBkbl4Qo9pvz" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "id": "tzS-AXWK8lJC" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "\n", - "# init your test set questions\n", - "questions = [\n", - " \"how do i call completion() using LiteLLM\",\n", - " \"does LiteLLM support VertexAI\",\n", - " \"how do I set my keys on replicate llama2?\",\n", - "]\n", - "\n", - "\n", - "# set your prompt\n", - "prompt = \"\"\"\n", - "You are a coding assistant helping users using litellm.\n", - "litellm is a light package to simplify calling OpenAI, Azure, Cohere, Anthropic, Huggingface API Endpoints. It manages:\n", - "\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "id": "vMlqi40x-KAA" - }, - "outputs": [], - "source": [ - "import os\n", - "os.environ['OPENAI_API_KEY'] = \"\"\n", - "os.environ['ANTHROPIC_API_KEY'] = \"\"" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "-HOzUfpK-H8J" - }, - "source": [] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "Ktn25dfKEJF1" - }, - "source": [ - "## Calling gpt-3.5-turbo and claude-2 on the same questions\n", - "\n", - "## LiteLLM `completion()` allows you to call all LLMs in the same format\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "DhXwRlc-9DED" - }, - "outputs": [], - "source": [ - "results = [] # for storing results\n", - "\n", - "models = ['gpt-3.5-turbo', 'claude-2'] # define what models you're testing, see: https://docs.litellm.ai/docs/providers\n", - "for question in questions:\n", - " row = [question]\n", - " for model in models:\n", - " print(\"Calling:\", model, \"question:\", question)\n", - " response = completion( # using litellm.completion\n", - " model=model,\n", - " messages=[\n", - " {'role': 'system', 'content': prompt},\n", - " {'role': 'user', 'content': question}\n", - " ]\n", - " )\n", - " answer = response.choices[0].message['content']\n", - " row.append(answer)\n", - " print(print(\"Calling:\", model, \"answer:\", answer))\n", - "\n", - " results.append(row) # save results\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "RkEXhXxCDN77" - }, - "source": [ - "## Visualizing Results" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 761 - }, - "id": "42hrmW6q-n4s", - "outputId": "b763bf39-72b9-4bea-caf6-de6b2412f86d" - }, - "outputs": [ - { - "data": { - "application/vnd.google.colaboratory.module+javascript": "\n import \"https://ssl.gstatic.com/colaboratory/data_table/881c4a0d49046431/data_table.js\";\n\n const table = window.createDataTable({\n data: [[{\n 'v': 0,\n 'f': \"0\",\n },\n\"how do i call completion() using LiteLLM\",\n\"To call the `completion()` function using LiteLLM, you need to follow these steps:\\n\\n1. Install the `litellm` package by running `pip install litellm` in your terminal.\\n2. Import the `Completion` class from the `litellm` module.\\n3. Initialize an instance of the `Completion` class by providing the required parameters like the API endpoint URL and your API key.\\n4. Call the `complete()` method on the `Completion` instance and pass the text prompt as a string.\\n5. Retrieve the generated completion from the response object and use it as desired.\\n\\nHere's an example:\\n\\n```python\\nfrom litellm.completion import Completion\\n\\n# Initialize the Completion client\\ncompletion_client = Completion(\\n model_name='gpt-3.5-turbo',\\n api_key='your_api_key',\\n endpoint='https://your_endpoint_url'\\n)\\n\\n# Call the completion() method\\nresponse = completion_client.complete(\\\"Once upon a time\\\")\\n\\n# Retrieve the generated completion\\ncompletion = response['choices'][0]['text']\\n\\nprint(completion)\\n```\\n\\nMake sure to replace `'gpt-3.5-turbo'` with the desired model name, `'your_api_key'` with your actual API key, and `'https://your_endpoint_url'` with the correct API endpoint URL provided by your service provider.\\n\\nNote: The above example assumes you have a valid API key and endpoint URL for the OpenAI GPT-3.5-turbo model. Make sure to obtain the necessary credentials according to the API you are using.\",\n\" Here is how you can call the completion() method using LiteLLM:\\n\\nFirst, import LiteLLM:\\n\\n```python\\nimport litellm as lm\\n```\\n\\nThen create a LiteLLM object, specifying the API you want to use (e.g. \\\"openai\\\"):\\n\\n```python \\nai = lm.LiteLLM(\\\"openai\\\")\\n```\\n\\nNow you can call the completion() method on the ai object:\\n\\n```python\\nresponse = ai.completion(\\n prompt=\\\"Hello\\\", \\n model=\\\"text-davinci-003\\\",\\n max_tokens=100\\n)\\n```\\n\\nThe completion() method takes parameters like:\\n\\n- prompt (str): The prompt text to complete \\n- model (str): The AI model to use\\n- max_tokens (int): The maximum number of tokens to generate\\n\\nIt returns a Python dictionary with the AI's response.\\n\\nYou can then access the generated text using:\\n\\n```python\\nprint(response[\\\"choices\\\"][0][\\\"text\\\"]) \\n```\\n\\nSo LiteLLM provides a simple unified interface to call the underlying AI APIs. The completion() method works similarly for OpenAI\"],\n [{\n 'v': 1,\n 'f': \"1\",\n },\n\"does LiteLLM support VertexAI\",\n\"Yes, LiteLLM does support Google Cloud Vertex AI. It provides convenient wrappers and simplified functions to call Vertex AI API endpoints for natural language processing tasks such as text classification, entity extraction, sentiment analysis, etc. You can easily integrate LiteLLM with Vertex AI in your code to leverage its capabilities.\",\n\" Unfortunately, LiteLLM does not currently support VertexAI. LiteLLM focuses on providing a simple interface to call the APIs of services like OpenAI, Azure, Cohere, Anthropic, and Hugging Face. \\n\\nVertexAI is Google's managed machine learning platform. Integrating VertexAI would require additional development work to wrap the VertexAI SDK in a simple interface like LiteLLM provides for other services. \\n\\nHowever, LiteLLM is open source, so it is possible for someone to contribute support for VertexAI. The maintainers would likely welcome a pull request to add VertexAI as an option if implemented well. But out of the box, LiteLLM does not have built-in support for calling VertexAI APIs.\\n\\nThe key services LiteLLM supports are:\\n\\n- OpenAI (GPT, Codex, DALL-E)\\n- Azure Cognitive Services (Text Analytics, Computer Vision, Speech) \\n- Cohere\\n- Anthropic AI\\n- Hugging Face Transformers\\n\\nSo while it doesn't cover every ML API provider, it does make it easy to use the most popular natural language, speech, and vision APIs through a simple interface. Adding VertexAI\"],\n [{\n 'v': 2,\n 'f': \"2\",\n },\n\"how do I set my keys on replicate llama2?\",\n\"To set your keys on Replicate Llama2, follow these steps:\\n\\n1. Open the Llama2 dashboard in your browser.\\n2. Click on the \\\"Settings\\\" tab in the top menu.\\n3. Scroll down to the \\\"API Keys\\\" section.\\n4. Click on the \\\"Add a Key\\\" button.\\n5. Enter a name for your API key to help you identify it later.\\n6. Select the provider for your API key from the dropdown menu. For example, you can select \\\"OpenAI\\\" for OpenAI GPT-3 access.\\n7. Enter your API key in the provided input field. Make sure to copy it correctly.\\n8. Click on the \\\"Save\\\" button to save your API key.\\n\\nNote: The actual steps may vary slightly depending on the platform or interface you are using to access Llama2.\",\n\" Here are the steps to set your API keys on Replicate for litellm:\\n\\n1. Go to your Replicate project settings and select the Environment tab.\\n\\n2. Under Environment Variables, click Add Variable.\\n\\n3. Add variables for the API keys you want to use. The variable names should match the ones used in litellm:\\n\\n- `OPENAI_API_KEY` for OpenAI \\n- `AZURE_API_KEY` for Azure Cognitive Services\\n- `COHERE_API_KEY` for Cohere\\n- `ANTHROPIC_API_KEY` for Anthropic\\n- `HUGGINGFACE_API_KEY` for Hugging Face\\n\\n4. Set the value to your actual API key for each service. Make sure to treat the values as secrets.\\n\\n5. Make sure your litellm code is referencing the environment variable names, for example:\\n\\n```python\\nimport litellm as lm\\n\\nlm.auth(openai_key=os.getenv(\\\"OPENAI_API_KEY\\\")) \\n```\\n\\n6. Restart your Replicate runtime to load the new environment variables.\\n\\nNow litellm will use your\"]],\n columns: [[\"number\", \"index\"], [\"string\", \"Question\"], [\"string\", \"gpt-3.5-turbo\"], [\"string\", \"claude-2\"]],\n columnOptions: [{\"width\": \"1px\", \"className\": \"index_column\"}],\n rowsPerPage: 25,\n helpUrl: \"https://colab.research.google.com/notebooks/data_table.ipynb\",\n suppressOutputScrolling: true,\n minimumWidth: undefined,\n });\n\n function appendQuickchartButton(parentElement) {\n let quickchartButtonContainerElement = document.createElement('div');\n quickchartButtonContainerElement.innerHTML = `\n
\n \n \n\n\n \n
`;\n parentElement.appendChild(quickchartButtonContainerElement);\n }\n\n appendQuickchartButton(table);\n ", - "text/html": [ - "\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
Questiongpt-3.5-turboclaude-2
0how do i call completion() using LiteLLMTo call the `completion()` function using Lite...Here is how you can call the completion() met...
1does LiteLLM support VertexAIYes, LiteLLM does support Google Cloud Vertex ...Unfortunately, LiteLLM does not currently sup...
2how do I set my keys on replicate llama2?To set your keys on Replicate Llama2, follow t...Here are the steps to set your API keys on Re...
\n", - "
\n", - "
\n", - "\n", - "
\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "
\n", - "\n", - "\n", - "
\n", - " \n", - "\n", - "\n", - "\n", - " \n", - "
\n", - "
\n", - "
\n" - ], - "text/plain": [ - " Question \\\n", - "0 how do i call completion() using LiteLLM \n", - "1 does LiteLLM support VertexAI \n", - "2 how do I set my keys on replicate llama2? \n", - "\n", - " gpt-3.5-turbo \\\n", - "0 To call the `completion()` function using Lite... \n", - "1 Yes, LiteLLM does support Google Cloud Vertex ... \n", - "2 To set your keys on Replicate Llama2, follow t... \n", - "\n", - " claude-2 \n", - "0 Here is how you can call the completion() met... \n", - "1 Unfortunately, LiteLLM does not currently sup... \n", - "2 Here are the steps to set your API keys on Re... " - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Create a table to visualize results\n", - "import pandas as pd\n", - "\n", - "columns = ['Question'] + models\n", - "df = pd.DataFrame(results, columns=columns)\n", - "\n", - "df" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/LiteLLM_Completion_Cost.ipynb b/cookbook/LiteLLM_Completion_Cost.ipynb deleted file mode 100644 index b8f5eb36a5c..00000000000 --- a/cookbook/LiteLLM_Completion_Cost.ipynb +++ /dev/null @@ -1,241 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# Use LiteLLM to calculate costs for all your completion calls\n", - "In this notebook we'll use `litellm.completion_cost` to get completion costs" - ], - "metadata": { - "id": "BgWr0PsUR3vV" - } - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ViczFTjsDzSI" - }, - "outputs": [], - "source": [ - "!pip install litellm==0.1.549 # use 0.1.549 or later" - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Calculating costs for gpt-3.5 turbo completion()" - ], - "metadata": { - "id": "k_1CWUwmSNtj" - } - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion, completion_cost\n", - "import os\n", - "os.environ['OPENAI_API_KEY'] = \"\"\n", - "\n", - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "response = completion(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages=messages,\n", - ")\n", - "\n", - "print(response)\n", - "\n", - "cost = completion_cost(completion_response=response)\n", - "formatted_string = f\"Cost for completion call: ${float(cost):.10f}\"\n", - "print(formatted_string)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Tp0fyk-jD0pP", - "outputId": "ce885fb3-3237-41b2-9d8b-3fb30bba498b" - }, - "execution_count": 6, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "got response\n", - "{\n", - " \"id\": \"chatcmpl-7vyCApIZaCxP36kb9meUMN2DFSJPh\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1694050442,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello! I'm an AI and I don't have feelings, but I'm here to help you. How can I assist you today?\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 13,\n", - " \"completion_tokens\": 28,\n", - " \"total_tokens\": 41\n", - " }\n", - "}\n", - "Cost for completion call: $0.0000755000\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Calculating costs for Together Computer completion()" - ], - "metadata": { - "id": "AjDs4G-uS6PS" - } - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion, completion_cost\n", - "import os\n", - "os.environ['TOGETHERAI_API_KEY'] = \"\"\n", - "\n", - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "response = completion(\n", - " model=\"togethercomputer/llama-2-70b-chat\",\n", - " messages=messages,\n", - ")\n", - "\n", - "print(response)\n", - "\n", - "cost = completion_cost(completion_response=response)\n", - "formatted_string = f\"Cost for completion call: ${float(cost):.10f}\"\n", - "print(formatted_string)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "jMPsUV-KEa6a", - "outputId": "7a69b291-f149-4b9c-8a78-9c8142bac759" - }, - "execution_count": 7, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "{\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"Hello! I'm doing well, thanks for asking. I hope you're having a great\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1694050771.2821715,\n", - " \"model\": \"togethercomputer/llama-2-70b-chat\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 12,\n", - " \"completion_tokens\": 18,\n", - " \"total_tokens\": 30\n", - " }\n", - "}\n", - "Cost for completion call: $0.0000900000\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Calculating costs for Replicate Llama2 completion()" - ], - "metadata": { - "id": "vEa4s6-7TANS" - } - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion, completion_cost\n", - "import os\n", - "os.environ['REPLICATE_API_KEY'] = \"\"\n", - "\n", - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "response = completion(\n", - " model=\"replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf\",\n", - " messages=messages,\n", - ")\n", - "\n", - "print(response)\n", - "\n", - "cost = completion_cost(completion_response=response)\n", - "formatted_string = f\"Cost for completion call: ${float(cost):.10f}\"\n", - "print(formatted_string)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Xf1TKRDuS1bR", - "outputId": "cfb2b484-a6e5-41ad-86c5-7e66aba27648" - }, - "execution_count": 8, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "{\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" Hello! I'm doing well, thanks for asking. How about you? Is there anything you need help with today?\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1694050893.4534576,\n", - " \"model\": \"replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 24,\n", - " \"total_tokens\": 30\n", - " },\n", - " \"ended\": 1694050896.6689413\n", - "}\n", - "total_replicate_run_time 3.2154836654663086\n", - "Cost for completion call: $0.0045016771\n" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/cookbook/LiteLLM_HuggingFace.ipynb b/cookbook/LiteLLM_HuggingFace.ipynb deleted file mode 100644 index bf8482a5f11..00000000000 --- a/cookbook/LiteLLM_HuggingFace.ipynb +++ /dev/null @@ -1,252 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "9dKM5k8qsMIj" - }, - "source": [ - "## LiteLLM Hugging Face\n", - "\n", - "Docs for huggingface: https://docs.litellm.ai/docs/providers/huggingface\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "BVDdmCp-o97j" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "yp5UXRqtpu9f" - }, - "source": [ - "## Serverless Inference Providers\n", - "\n", - "Read more about Inference Providers here: https://huggingface.co/blog/inference-providers.\n", - "\n", - "In order to use litellm with Hugging Face Inference Providers, you need to set `model=huggingface//`.\n", - "\n", - "Example: `huggingface/together/deepseek-ai/DeepSeek-R1` to run DeepSeek-R1 (https://huggingface.co/deepseek-ai/DeepSeek-R1) through Together AI.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Pi5Oww8gpCUm", - "outputId": "659a67c7-f90d-4c06-b94e-2c4aa92d897a" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "# You can create a HF token here: https://huggingface.co/settings/tokens\n", - "os.environ[\"HF_TOKEN\"] = \"hf_xxxxxx\"\n", - "\n", - "# Call DeepSeek-R1 model through Together AI\n", - "response = completion(\n", - " model=\"huggingface/together/deepseek-ai/DeepSeek-R1\",\n", - " messages=[{\"content\": \"How many r's are in the word `strawberry`?\", \"role\": \"user\"}],\n", - ")\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "EU0UubrKzTFe" - }, - "source": [ - "## Streaming\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "y-QfIvA-uJKX", - "outputId": "b007bb98-00d0-44a4-8264-c8a2caed6768" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "os.environ[\"HF_TOKEN\"] = \"hf_xxxxxx\"\n", - "\n", - "response = completion(\n", - " model=\"huggingface/together/deepseek-ai/DeepSeek-R1\",\n", - " messages=[\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"How many r's are in the word `strawberry`?\",\n", - " \n", - " }\n", - " ],\n", - " stream=True,\n", - ")\n", - "\n", - "for chunk in response:\n", - " print(chunk)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## With images as input\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from litellm import completion\n", - "\n", - "# Set your Hugging Face Token\n", - "os.environ[\"HF_TOKEN\"] = \"hf_xxxxxx\"\n", - "\n", - "messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": [\n", - " {\"type\": \"text\", \"text\": \"What's in this image?\"},\n", - " {\n", - " \"type\": \"image_url\",\n", - " \"image_url\": {\n", - " \"url\": \"https://awsmp-logos.s3.amazonaws.com/seller-xw5kijmvmzasy/c233c9ade2ccb5491072ae232c814942.png\",\n", - " },\n", - " },\n", - " ],\n", - " }\n", - "]\n", - "\n", - "response = completion(\n", - " model=\"huggingface/sambanova/meta-llama/Llama-3.3-70B-Instruct\",\n", - " messages=messages,\n", - ")\n", - "print(response.choices[0])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Tools - Function Calling\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "\n", - "# Set your Hugging Face Token\n", - "os.environ[\"HF_TOKEN\"] = \"hf_xxxxxx\"\n", - "\n", - "tools = [\n", - " {\n", - " \"type\": \"function\",\n", - " \"function\": {\n", - " \"name\": \"get_current_weather\",\n", - " \"description\": \"Get the current weather in a given location\",\n", - " \"parameters\": {\n", - " \"type\": \"object\",\n", - " \"properties\": {\n", - " \"location\": {\n", - " \"type\": \"string\",\n", - " \"description\": \"The city and state, e.g. San Francisco, CA\",\n", - " },\n", - " \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n", - " },\n", - " \"required\": [\"location\"],\n", - " },\n", - " },\n", - " }\n", - "]\n", - "messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}]\n", - "\n", - "response = completion(\n", - " model=\"huggingface/sambanova/meta-llama/Llama-3.1-8B-Instruct\", messages=messages, tools=tools, tool_choice=\"auto\"\n", - ")\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Hugging Face Dedicated Inference Endpoints\n", - "\n", - "Steps to use\n", - "\n", - "- Create your own Hugging Face dedicated endpoint here: https://ui.endpoints.huggingface.co/\n", - "- Set `api_base` to your deployed api base\n", - "- set the model to `huggingface/tgi` so that litellm knows it's a huggingface Deployed Inference Endpoint.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "import litellm\n", - "\n", - "\n", - "response = litellm.completion(\n", - " model=\"huggingface/tgi\",\n", - " messages=[{\"content\": \"Hello, how are you?\", \"role\": \"user\"}],\n", - " api_base=\"https://my-endpoint.endpoints.huggingface.cloud/v1/\",\n", - ")\n", - "print(response)" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.0" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_NovitaAI_Cookbook.ipynb b/cookbook/LiteLLM_NovitaAI_Cookbook.ipynb deleted file mode 100644 index 8fa7d0b987a..00000000000 --- a/cookbook/LiteLLM_NovitaAI_Cookbook.ipynb +++ /dev/null @@ -1,97 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "iFEmsVJI_2BR" - }, - "source": [ - "# LiteLLM NovitaAI Cookbook" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "cBlUhCEP_xj4" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "p-MQqWOT_1a7" - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "os.environ['NOVITA_API_KEY'] = \"\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "Ze8JqMqWAARO" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "response = completion(\n", - " model=\"novita/deepseek/deepseek-r1\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "-LnhELrnAM_J" - }, - "outputs": [], - "source": [ - "response = completion(\n", - " model=\"novita/deepseek/deepseek-r1\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "dJBOUYdwCEn1" - }, - "outputs": [], - "source": [ - "response = completion(\n", - " model=\"mistralai/mistral-7b-instruct\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_OpenRouter.ipynb b/cookbook/LiteLLM_OpenRouter.ipynb deleted file mode 100644 index 6444b23b294..00000000000 --- a/cookbook/LiteLLM_OpenRouter.ipynb +++ /dev/null @@ -1,179 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "iFEmsVJI_2BR" - }, - "source": [ - "# LiteLLM OpenRouter Cookbook" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "cBlUhCEP_xj4" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "id": "p-MQqWOT_1a7" - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "os.environ['OPENROUTER_API_KEY'] = \"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Ze8JqMqWAARO", - "outputId": "64f3e836-69fa-4f8e-fb35-088a913bbe98" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"id\": \"gen-W8FTMSIEorCp3vG5iYIgNMR4IeBv\",\n", - " \"model\": \"chat-bison@001\",\n", - " \"choices\": [\n", - " {\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"```\\n#include \\n\\nint main() {\\n printf(\\\"Hi!\\\\n\\\");\\n return 0;\\n}\\n```\"\n", - " }\n", - " }\n", - " ],\n", - " \"response_ms\": 7817.777999999999\n", - "}" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from litellm import completion\n", - "response = completion(\n", - " model=\"openrouter/google/palm-2-chat-bison\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-LnhELrnAM_J", - "outputId": "d51c7ab7-d761-4bd1-f849-1534d9df4cd0" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \" Here is some simple code to print \\\"Hi\\\":\\n\\n```python\\nprint(\\\"Hi\\\")\\n```\\n\\nThis uses the print() function in Python to output the text \\\"Hi\\\".\"\n", - " },\n", - " \"finish_reason\": \"stop_sequence\"\n", - " }\n", - " ],\n", - " \"model\": \"claude-2.0\",\n", - " \"id\": \"gen-IiuV7ZNimDufVeutBHrl8ajPuzEh\",\n", - " \"response_ms\": 8112.443000000001\n", - "}" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "response = completion(\n", - " model=\"openrouter/anthropic/claude-2\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "dJBOUYdwCEn1", - "outputId": "ffa18679-ec15-4dad-fe2b-68665cdf36b0" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"id\": \"gen-PyMd3yyJ0aQsCgIY9R8XGZoAtPbl\",\n", - " \"model\": \"togethercomputer/llama-2-70b-chat\",\n", - " \"choices\": [\n", - " {\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"*gives a sly smile as they type*\\n\\nHey there, handsome. \\ud83d\\ude0f\\n\\nWhat brings you to my neck of the woods today? \\ud83d\\ude18\"\n", - " }\n", - " }\n", - " ],\n", - " \"response_ms\": 9618.775\n", - "}" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "response = completion(\n", - " model=\"openrouter/meta-llama/llama-2-70b-chat\",\n", - " messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n", - ")\n", - "response" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/LiteLLM_Petals.ipynb b/cookbook/LiteLLM_Petals.ipynb deleted file mode 100644 index aacc22dd1b9..00000000000 --- a/cookbook/LiteLLM_Petals.ipynb +++ /dev/null @@ -1,568 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "dwGtLi_tvM6N" - }, - "source": [ - "# Using LiteLLM with Petals" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "bdlgaWQqDpzj" - }, - "outputs": [], - "source": [ - "!pip install litellm # 0.1.715 and upwards" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "5Id2QKwOEH8X" - }, - "outputs": [], - "source": [ - "# install petals\n", - "!pip install git+https://github.com/bigscience-workshop/petals" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "k42fldw3veSN" - }, - "source": [ - "## petals-team/StableBeluga2" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "tIHcEHdSDqju", - "outputId": "485dbf54-395c-433a-bbf4-8eb70a9fa624" - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "You are using the default legacy behaviour of the . If you see this, DO NOT PANIC! This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thouroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565\n", - "Sep 19 18:39:50.634 [\u001b[1m\u001b[34mINFO\u001b[0m] Make sure you follow the LLaMA's terms of use: https://bit.ly/llama2-license for LLaMA 2, https://bit.ly/llama-license for LLaMA 1\n", - "Sep 19 18:39:50.639 [\u001b[1m\u001b[34mINFO\u001b[0m] Using DHT prefix: StableBeluga2-hf\n", - "Sep 19 18:40:13.920 [\u001b[1m\u001b[34mINFO\u001b[0m] Route found: 0:40 via …HfQWVM => 40:80 via …Zj98Se\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"Hello, how are you?\\nI'm doing well, thank you. I'm just getting ready to go to the gym.\\nOh, that's great. I'm trying to get back into a workout routine myself.\\nYeah,\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-f09d79b3-c1d1-49b7-b55f-cd8dfa1043bf\",\n", - " \"created\": 1695148897.473613,\n", - " \"model\": \"petals-team/StableBeluga2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 45,\n", - " \"total_tokens\": 51\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(model=\"petals/petals-team/StableBeluga2\", messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}], max_tokens=50)\n", - "\n", - "print(response)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "J8DubRnHvh_j" - }, - "source": [ - "## huggyllama/llama-65b" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 538, - "referenced_widgets": [ - "2fec5cc400424671a3d517327117d18a", - "3687c76fe84d464baaf35366b21e83b3", - "c29d4460dbaa441cae110b58e0014151", - "6560449a38bf4a7bacd97ccaacf01c4c", - "5fbd6ae281984d28ba59ebfd0279eda7", - "323e30e275434aeea241163e5f1f9031", - "48f4adec51c94f9da6e4c4564daeff84", - "2a672981a44b4a7fb30674f97f4c10c6", - "d75ae8d22ea74840b4c80c8f386384c4", - "54c06312ecff4e7588665e8b0cb7118b", - "300078a9d1a6483fba81a4be63793ff7" - ] - }, - "id": "IlTCJwDsNvgF", - "outputId": "2e84d125-d982-48ed-8a92-6ca438a50d0c" - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Sep 19 18:41:37.912 [\u001b[1m\u001b[34mINFO\u001b[0m] Make sure you follow the LLaMA's terms of use: https://bit.ly/llama2-license for LLaMA 2, https://bit.ly/llama-license for LLaMA 1\n", - "Sep 19 18:41:37.914 [\u001b[1m\u001b[34mINFO\u001b[0m] Using DHT prefix: llama-65b-hf\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "2fec5cc400424671a3d517327117d18a", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Loading checkpoint shards: 0%| | 0/2 [00:00 JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" Good morning!\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1694030351.309254,\n", - " \"model\": \"claude-2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 11,\n", - " \"completion_tokens\": 3,\n", - " \"total_tokens\": 14\n", - " }\n", - " },\n", - " JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" I'm an AI assistant created by Anthropic. I don't actually have a concept of the current time.\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1694030352.1215081,\n", - " \"model\": \"claude-2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 13,\n", - " \"completion_tokens\": 22,\n", - " \"total_tokens\": 35\n", - " }\n", - " }]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import os\n", - "\n", - "os.environ['ANTHROPIC_API_KEY'] = \"\"\n", - "\n", - "\n", - "responses = batch_completion(\n", - " model=\"claude-2\",\n", - " messages = [\n", - " [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"good morning? \"\n", - " }\n", - " ],\n", - " [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what's the time? \"\n", - " }\n", - " ]\n", - " ]\n", - ")\n", - "responses" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/Migrating_to_LiteLLM_Proxy_from_OpenAI_Azure_OpenAI.ipynb b/cookbook/Migrating_to_LiteLLM_Proxy_from_OpenAI_Azure_OpenAI.ipynb deleted file mode 100644 index d89f2b67c56..00000000000 --- a/cookbook/Migrating_to_LiteLLM_Proxy_from_OpenAI_Azure_OpenAI.ipynb +++ /dev/null @@ -1,568 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "kccfk0mHZ4Ad" - }, - "source": [ - "# Migrating to LiteLLM Proxy from OpenAI/Azure OpenAI\n", - "\n", - "Covers:\n", - "\n", - "* /chat/completion\n", - "* /embedding\n", - "\n", - "\n", - "These are **selected examples**. LiteLLM Proxy is **OpenAI-Compatible**, it works with any project that calls OpenAI. Just change the `base_url`, `api_key` and `model`.\n", - "\n", - "Set `LITELLM_MASTER_KEY` in the notebook environment to the same key configured on the proxy before running authenticated examples\n", - "\n", - "For more examples, [go here](https://docs.litellm.ai/docs/proxy/user_keys)\n", - "\n", - "To pass provider-specific args, [go here](https://docs.litellm.ai/docs/completion/provider_specific_params#proxy-usage)\n", - "\n", - "To drop unsupported params (E.g. frequency_penalty for bedrock with librechat), [go here](https://docs.litellm.ai/docs/completion/drop_params#openai-proxy-usage)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "nmSClzCPaGH6" - }, - "source": [ - "## /chat/completion\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "_vqcjwOVaKpO" - }, - "source": [ - "### OpenAI Python SDK" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "x1e_Ok3KZzeP" - }, - "outputs": [], - "source": [ - "import openai\n", - "client = openai.OpenAI(\n", - " api_key=\"anything\",\n", - " base_url=\"http://0.0.0.0:4000\"\n", - ")\n", - "\n", - "# request sent to model set on litellm proxy, `litellm --model`\n", - "response = client.chat.completions.create(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"this is a test request, write a short poem\"\n", - " }\n", - " ],\n", - " extra_body={ # pass in any provider-specific param, if not supported by openai, https://docs.litellm.ai/docs/completion/input#provider-specific-params\n", - " \"metadata\": { # 👈 use for logging additional params (e.g. to langfuse)\n", - " \"generation_name\": \"ishaan-generation-openai-client\",\n", - " \"generation_id\": \"openai-client-gen-id22\",\n", - " \"trace_id\": \"openai-client-trace-id22\",\n", - " \"trace_user_id\": \"openai-client-user-id2\"\n", - " }\n", - " }\n", - ")\n", - "\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "AqkyKk9Scxgj" - }, - "source": [ - "## Function Calling" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "wDg10VqLczE1" - }, - "outputs": [], - "source": [ - "import os\n", - "from openai import OpenAI\n", - "client = OpenAI(\n", - " api_key=os.environ[\"LITELLM_MASTER_KEY\"],\n", - " base_url=\"http://0.0.0.0:4000\",\n", - ")\n", - "\n", - "tools = [\n", - " {\n", - " \"type\": \"function\",\n", - " \"function\": {\n", - " \"name\": \"get_current_weather\",\n", - " \"description\": \"Get the current weather in a given location\",\n", - " \"parameters\": {\n", - " \"type\": \"object\",\n", - " \"properties\": {\n", - " \"location\": {\n", - " \"type\": \"string\",\n", - " \"description\": \"The city and state, e.g. San Francisco, CA\",\n", - " },\n", - " \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n", - " },\n", - " \"required\": [\"location\"],\n", - " },\n", - " }\n", - " }\n", - "]\n", - "messages = [{\"role\": \"user\", \"content\": \"What's the weather like in Boston today?\"}]\n", - "completion = client.chat.completions.create(\n", - " model=\"gpt-4o\", # use 'model_name' from config.yaml\n", - " messages=messages,\n", - " tools=tools,\n", - " tool_choice=\"auto\"\n", - ")\n", - "\n", - "print(completion)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "YYoxLloSaNWW" - }, - "source": [ - "### Azure OpenAI Python SDK" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "yA1XcgowaSRy" - }, - "outputs": [], - "source": [ - "import openai\n", - "client = openai.AzureOpenAI(\n", - " api_key=\"anything\",\n", - " base_url=\"http://0.0.0.0:4000\"\n", - ")\n", - "\n", - "# request sent to model set on litellm proxy, `litellm --model`\n", - "response = client.chat.completions.create(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"this is a test request, write a short poem\"\n", - " }\n", - " ],\n", - " extra_body={ # pass in any provider-specific param, if not supported by openai, https://docs.litellm.ai/docs/completion/input#provider-specific-params\n", - " \"metadata\": { # 👈 use for logging additional params (e.g. to langfuse)\n", - " \"generation_name\": \"ishaan-generation-openai-client\",\n", - " \"generation_id\": \"openai-client-gen-id22\",\n", - " \"trace_id\": \"openai-client-trace-id22\",\n", - " \"trace_user_id\": \"openai-client-user-id2\"\n", - " }\n", - " }\n", - ")\n", - "\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "yl9qhDvnaTpL" - }, - "source": [ - "### Langchain Python" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "5MUZgSquaW5t" - }, - "outputs": [], - "source": [ - "from langchain.chat_models import ChatOpenAI\n", - "from langchain.prompts.chat import (\n", - " ChatPromptTemplate,\n", - " HumanMessagePromptTemplate,\n", - " SystemMessagePromptTemplate,\n", - ")\n", - "from langchain.schema import HumanMessage, SystemMessage\n", - "import os\n", - "\n", - "os.environ[\"OPENAI_API_KEY\"] = \"anything\"\n", - "\n", - "chat = ChatOpenAI(\n", - " openai_api_base=\"http://0.0.0.0:4000\",\n", - " model = \"gpt-3.5-turbo\",\n", - " temperature=0.1,\n", - " extra_body={\n", - " \"metadata\": {\n", - " \"generation_name\": \"ishaan-generation-langchain-client\",\n", - " \"generation_id\": \"langchain-client-gen-id22\",\n", - " \"trace_id\": \"langchain-client-trace-id22\",\n", - " \"trace_user_id\": \"langchain-client-user-id2\"\n", - " }\n", - " }\n", - ")\n", - "\n", - "messages = [\n", - " SystemMessage(\n", - " content=\"You are a helpful assistant that im using to make a test request to.\"\n", - " ),\n", - " HumanMessage(\n", - " content=\"test from litellm. tell me why it's amazing in 1 sentence\"\n", - " ),\n", - "]\n", - "response = chat(messages)\n", - "\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "B9eMgnULbRaz" - }, - "source": [ - "### Curl" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "VWCCk5PFcmhS" - }, - "source": [ - "\n", - "\n", - "```\n", - "curl -X POST 'http://0.0.0.0:4000/chat/completions' \\\n", - " -H 'Content-Type: application/json' \\\n", - " -d '{\n", - " \"model\": \"gpt-3.5-turbo\",\n", - " \"messages\": [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what llm are you\"\n", - " }\n", - " ],\n", - " \"metadata\": {\n", - " \"generation_name\": \"ishaan-test-generation\",\n", - " \"generation_id\": \"gen-id22\",\n", - " \"trace_id\": \"trace-id22\",\n", - " \"trace_user_id\": \"user-id2\"\n", - " }\n", - "}'\n", - "```\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "drBAm2e1b6xe" - }, - "source": [ - "### LlamaIndex" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "d0bZcv8fb9mL" - }, - "outputs": [], - "source": [ - "import os, dotenv\n", - "\n", - "from llama_index.llms import AzureOpenAI\n", - "from llama_index.embeddings import AzureOpenAIEmbedding\n", - "from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext\n", - "\n", - "llm = AzureOpenAI(\n", - " engine=\"azure-gpt-3.5\", # model_name on litellm proxy\n", - " temperature=0.0,\n", - " azure_endpoint=\"http://0.0.0.0:4000\", # litellm proxy endpoint\n", - " api_key=os.environ[\"LITELLM_MASTER_KEY\"],\n", - " api_version=\"2023-07-01-preview\",\n", - ")\n", - "\n", - "embed_model = AzureOpenAIEmbedding(\n", - " deployment_name=\"azure-embedding-model\",\n", - " azure_endpoint=\"http://0.0.0.0:4000\",\n", - " api_key=os.environ[\"LITELLM_MASTER_KEY\"],\n", - " api_version=\"2023-07-01-preview\",\n", - ")\n", - "\n", - "\n", - "documents = SimpleDirectoryReader(\"llama_index_data\").load_data()\n", - "service_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model)\n", - "index = VectorStoreIndex.from_documents(documents, service_context=service_context)\n", - "\n", - "query_engine = index.as_query_engine()\n", - "response = query_engine.query(\"What did the author do growing up?\")\n", - "print(response)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "xypvNdHnb-Yy" - }, - "source": [ - "### Langchain JS" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "R55mK2vCcBN2" - }, - "outputs": [], - "source": [ - "import { ChatOpenAI } from \"@langchain/openai\";\n", - "\n", - "\n", - "const model = new ChatOpenAI({\n", - " modelName: \"gpt-4\",\n", - " openAIApiKey: process.env.LITELLM_MASTER_KEY,\n", - " modelKwargs: {\"metadata\": \"hello world\"} // 👈 PASS Additional params here\n", - "}, {\n", - " basePath: \"http://0.0.0.0:4000\",\n", - "});\n", - "\n", - "const message = await model.invoke(\"Hi there!\");\n", - "\n", - "console.log(message);\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "nC4bLifCcCiW" - }, - "source": [ - "### OpenAI JS" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "MICH8kIMcFpg" - }, - "outputs": [], - "source": [ - "const { OpenAI } = require('openai');\n", - "\n", - "const openai = new OpenAI({\n", - " apiKey: process.env.LITELLM_MASTER_KEY,\n", - " baseURL: \"http://0.0.0.0:4000\"\n", - "});\n", - "\n", - "async function main() {\n", - " const chatCompletion = await openai.chat.completions.create({\n", - " messages: [{ role: 'user', content: 'Say this is a test' }],\n", - " model: 'gpt-3.5-turbo',\n", - " }, {\"metadata\": {\n", - " \"generation_name\": \"ishaan-generation-openaijs-client\",\n", - " \"generation_id\": \"openaijs-client-gen-id22\",\n", - " \"trace_id\": \"openaijs-client-trace-id22\",\n", - " \"trace_user_id\": \"openaijs-client-user-id2\"\n", - " }});\n", - "}\n", - "\n", - "main();\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "D1Q07pEAcGTb" - }, - "source": [ - "### Anthropic SDK" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "qBjFcAvgcI3t" - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "from anthropic import Anthropic\n", - "\n", - "client = Anthropic(\n", - " base_url=\"http://localhost:4000\", # proxy endpoint\n", - " api_key=\"sk-test-proxy-key-123\", # litellm proxy virtual key (example)\n", - ")\n", - "\n", - "message = client.messages.create(\n", - " max_tokens=1024,\n", - " messages=[\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"Hello, Claude\",\n", - " }\n", - " ],\n", - " model=\"claude-3-opus-20240229\",\n", - ")\n", - "print(message.content)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "dFAR4AJGcONI" - }, - "source": [ - "## /embeddings" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "lgNoM281cRzR" - }, - "source": [ - "### OpenAI Python SDK" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "NY3DJhPfcQhA" - }, - "outputs": [], - "source": [ - "import openai\n", - "from openai import OpenAI\n", - "\n", - "# set base_url to your proxy server\n", - "# set api_key to send to proxy server\n", - "client = OpenAI(api_key=\"\", base_url=\"http://0.0.0.0:4000\")\n", - "\n", - "response = client.embeddings.create(\n", - " input=[\"hello from litellm\"],\n", - " model=\"text-embedding-ada-002\"\n", - ")\n", - "\n", - "print(response)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "hmbg-DW6cUZs" - }, - "source": [ - "### Langchain Embeddings" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "lX2S8Nl1cWVP" - }, - "outputs": [], - "source": [ - "from langchain.embeddings import OpenAIEmbeddings\n", - "\n", - "embeddings = OpenAIEmbeddings(model=\"sagemaker-embeddings\", openai_api_base=\"http://0.0.0.0:4000\", openai_api_key=\"temp-key\")\n", - "\n", - "\n", - "text = \"This is a test document.\"\n", - "\n", - "query_result = embeddings.embed_query(text)\n", - "\n", - "print(f\"SAGEMAKER EMBEDDINGS\")\n", - "print(query_result[:5])\n", - "\n", - "embeddings = OpenAIEmbeddings(model=\"bedrock-embeddings\", openai_api_base=\"http://0.0.0.0:4000\", openai_api_key=\"temp-key\")\n", - "\n", - "text = \"This is a test document.\"\n", - "\n", - "query_result = embeddings.embed_query(text)\n", - "\n", - "print(f\"BEDROCK EMBEDDINGS\")\n", - "print(query_result[:5])\n", - "\n", - "embeddings = OpenAIEmbeddings(model=\"bedrock-titan-embeddings\", openai_api_base=\"http://0.0.0.0:4000\", openai_api_key=\"temp-key\")\n", - "\n", - "text = \"This is a test document.\"\n", - "\n", - "query_result = embeddings.embed_query(text)\n", - "\n", - "print(f\"TITAN EMBEDDINGS\")\n", - "print(query_result[:5])" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "oqGbWBCQcYfd" - }, - "source": [ - "### Curl Request" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7rkIMV9LcdwQ" - }, - "source": [ - "\n", - "\n", - "```curl\n", - "curl -X POST 'http://0.0.0.0:4000/embeddings' \\\n", - " -H 'Content-Type: application/json' \\\n", - " -d ' {\n", - " \"model\": \"text-embedding-ada-002\",\n", - " \"input\": [\"write a litellm poem\"]\n", - " }'\n", - "```\n", - "\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/Parallel_function_calling.ipynb b/cookbook/Parallel_function_calling.ipynb deleted file mode 100644 index cb7fbaface2..00000000000 --- a/cookbook/Parallel_function_calling.ipynb +++ /dev/null @@ -1,478 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "This is a tutorial on using Parallel function calling with LiteLLM" - ], - "metadata": { - "id": "gHwFJ-srdnku" - } - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "RrtHuVHlZmUe" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "source": [ - "This tutorial walks through the steps doing parallel function calling using\n", - " - OpenAI\n", - " - Azure OpenAI" - ], - "metadata": { - "id": "sG5ANaazjU0g" - } - }, - { - "cell_type": "code", - "source": [ - "# set openai api key\n", - "import os\n", - "os.environ['OPENAI_API_KEY'] = \"\" # litellm reads OPENAI_API_KEY from .env and sends the request" - ], - "metadata": { - "id": "l4GQ-M5yZ5UW" - }, - "execution_count": 3, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "\n", - "# OpenAI gpt-3.5-turbo-1106\n", - "## Step 1: send the conversation and available functions to the model" - ], - "metadata": { - "id": "AxgR2fCgaRoW" - } - }, - { - "cell_type": "code", - "source": [ - "import litellm\n", - "import json\n", - "# Example dummy function hard coded to return the same weather\n", - "# In production, this could be your backend API or an external API\n", - "def get_current_weather(location, unit=\"fahrenheit\"):\n", - " \"\"\"Get the current weather in a given location\"\"\"\n", - " if \"tokyo\" in location.lower():\n", - " return json.dumps({\"location\": \"Tokyo\", \"temperature\": \"10\", \"unit\": \"celsius\"})\n", - " elif \"san francisco\" in location.lower():\n", - " return json.dumps({\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": \"fahrenheit\"})\n", - " elif \"paris\" in location.lower():\n", - " return json.dumps({\"location\": \"Paris\", \"temperature\": \"22\", \"unit\": \"celsius\"})\n", - " else:\n", - " return json.dumps({\"location\": location, \"temperature\": \"unknown\"})\n", - "\n", - "messages = [{\"role\": \"user\", \"content\": \"What's the weather like in San Francisco, Tokyo, and Paris?\"}]\n", - "tools = [\n", - " {\n", - " \"type\": \"function\",\n", - " \"function\": {\n", - " \"name\": \"get_current_weather\",\n", - " \"description\": \"Get the current weather in a given location\",\n", - " \"parameters\": {\n", - " \"type\": \"object\",\n", - " \"properties\": {\n", - " \"location\": {\n", - " \"type\": \"string\",\n", - " \"description\": \"The city and state, e.g. San Francisco, CA\",\n", - " },\n", - " \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n", - " },\n", - " \"required\": [\"location\"],\n", - " },\n", - " },\n", - " }\n", - "]\n", - "\n", - "response = litellm.completion(\n", - " model=\"gpt-3.5-turbo-1106\",\n", - " messages=messages,\n", - " tools=tools,\n", - " tool_choice=\"auto\", # auto is default, but we'll be explicit\n", - ")\n", - "print(\"\\nLLM Response1:\\n\", response)\n", - "response_message = response.choices[0].message\n", - "tool_calls = response.choices[0].message.tool_calls\n", - "print(\"\\nTool Choice:\\n\", tool_calls)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Y3qteFo8ZrZP", - "outputId": "ee6c1183-55c1-4111-cdc0-967b8fed9db3" - }, - "execution_count": 18, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "LLM Response1:\n", - " ModelResponse(id='chatcmpl-8MNdPbrhtnwiPK1x3PEoGwrH144TW', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[ChatCompletionMessageToolCall(id='call_K2Giwoq3NloGPfSv25MJVFZG', function=Function(arguments='{\"location\": \"San Francisco\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function'), ChatCompletionMessageToolCall(id='call_6K8bYCZK6qsbMY3n51FzE5Nz', function=Function(arguments='{\"location\": \"Tokyo\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function'), ChatCompletionMessageToolCall(id='call_cKSmUEJGufDwS7TaUHWzp7qx', function=Function(arguments='{\"location\": \"Paris\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function')]))], created=1700344759, model='gpt-3.5-turbo-1106', object='chat.completion', system_fingerprint='fp_eeff13170a', usage={'completion_tokens': 77, 'prompt_tokens': 88, 'total_tokens': 165}, _response_ms=1049.913)\n", - "\n", - "Tool Choice:\n", - " [ChatCompletionMessageToolCall(id='call_K2Giwoq3NloGPfSv25MJVFZG', function=Function(arguments='{\"location\": \"San Francisco\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function'), ChatCompletionMessageToolCall(id='call_6K8bYCZK6qsbMY3n51FzE5Nz', function=Function(arguments='{\"location\": \"Tokyo\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function'), ChatCompletionMessageToolCall(id='call_cKSmUEJGufDwS7TaUHWzp7qx', function=Function(arguments='{\"location\": \"Paris\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function')]\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Step 2 - Parse the Model Response and Execute Functions" - ], - "metadata": { - "id": "tD4lJQ40cU44" - } - }, - { - "cell_type": "code", - "source": [ - "# Check if the model wants to call a function\n", - "if tool_calls:\n", - " # Execute the functions and prepare responses\n", - " available_functions = {\n", - " \"get_current_weather\": get_current_weather,\n", - " }\n", - "\n", - " messages.append(response_message) # Extend conversation with assistant's reply\n", - "\n", - " for tool_call in tool_calls:\n", - " print(f\"\\nExecuting tool call\\n{tool_call}\")\n", - " function_name = tool_call.function.name\n", - " function_to_call = available_functions[function_name]\n", - " function_args = json.loads(tool_call.function.arguments)\n", - " # calling the get_current_weather() function\n", - " function_response = function_to_call(\n", - " location=function_args.get(\"location\"),\n", - " unit=function_args.get(\"unit\"),\n", - " )\n", - " print(f\"Result from tool call\\n{function_response}\\n\")\n", - "\n", - " # Extend conversation with function response\n", - " messages.append(\n", - " {\n", - " \"tool_call_id\": tool_call.id,\n", - " \"role\": \"tool\",\n", - " \"name\": function_name,\n", - " \"content\": function_response,\n", - " }\n", - " )\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "af4oXQvicV_n", - "outputId": "abf6ac3e-4a21-4a4f-b8d7-809b763d0632" - }, - "execution_count": 21, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Executing tool call\n", - "ChatCompletionMessageToolCall(id='call_K2Giwoq3NloGPfSv25MJVFZG', function=Function(arguments='{\"location\": \"San Francisco\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function')\n", - "Result from tool call\n", - "{\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": \"fahrenheit\"}\n", - "\n", - "\n", - "Executing tool call\n", - "ChatCompletionMessageToolCall(id='call_6K8bYCZK6qsbMY3n51FzE5Nz', function=Function(arguments='{\"location\": \"Tokyo\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function')\n", - "Result from tool call\n", - "{\"location\": \"Tokyo\", \"temperature\": \"10\", \"unit\": \"celsius\"}\n", - "\n", - "\n", - "Executing tool call\n", - "ChatCompletionMessageToolCall(id='call_cKSmUEJGufDwS7TaUHWzp7qx', function=Function(arguments='{\"location\": \"Paris\", \"unit\": \"celsius\"}', name='get_current_weather'), type='function')\n", - "Result from tool call\n", - "{\"location\": \"Paris\", \"temperature\": \"22\", \"unit\": \"celsius\"}\n", - "\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Step 3 - Second litellm.completion() call" - ], - "metadata": { - "id": "E3OL1fqUdFdv" - } - }, - { - "cell_type": "code", - "source": [ - "second_response = litellm.completion(\n", - " model=\"gpt-3.5-turbo-1106\",\n", - " messages=messages,\n", - ")\n", - "print(\"Second Response\\n\", second_response)\n", - "print(\"Second Response Message\\n\", second_response.choices[0].message.content)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "8KYB2n-jc1_f", - "outputId": "6c6448ae-1c09-43ae-eb90-208b118e6179" - }, - "execution_count": 26, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Second Response\n", - " ModelResponse(id='chatcmpl-8MNhat166ZqjO6egXcUh85Pd0s7KV', choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"The current weather in San Francisco is 72°F, in Tokyo it's 10°C, and in Paris it's 22°C.\", role='assistant'))], created=1700345018, model='gpt-3.5-turbo-1106', object='chat.completion', system_fingerprint='fp_eeff13170a', usage={'completion_tokens': 28, 'prompt_tokens': 465, 'total_tokens': 493}, _response_ms=999.246)\n", - "Second Response Message\n", - " The current weather in San Francisco is 72°F, in Tokyo it's 10°C, and in Paris it's 22°C.\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Using Azure OpenAI" - ], - "metadata": { - "id": "1cIIFEvXjofp" - } - }, - { - "cell_type": "code", - "source": [ - "# set Azure env variables\n", - "import os\n", - "os.environ['AZURE_API_KEY'] = \"\" # litellm reads AZURE_API_KEY from .env and sends the request\n", - "os.environ['AZURE_API_BASE'] = \"https://openai-gpt-4-test-v-1.openai.azure.com/\"\n", - "os.environ['AZURE_API_VERSION'] = \"2023-07-01-preview\"" - ], - "metadata": { - "id": "lG9mUnModeeE" - }, - "execution_count": 32, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "## Step 1" - ], - "metadata": { - "id": "17S-Ysksj-E_" - } - }, - { - "cell_type": "code", - "source": [ - "import litellm\n", - "import json\n", - "# Example dummy function hard coded to return the same weather\n", - "# In production, this could be your backend API or an external API\n", - "def get_current_weather(location, unit=\"fahrenheit\"):\n", - " \"\"\"Get the current weather in a given location\"\"\"\n", - " if \"tokyo\" in location.lower():\n", - " return json.dumps({\"location\": \"Tokyo\", \"temperature\": \"10\", \"unit\": \"celsius\"})\n", - " elif \"san francisco\" in location.lower():\n", - " return json.dumps({\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": \"fahrenheit\"})\n", - " elif \"paris\" in location.lower():\n", - " return json.dumps({\"location\": \"Paris\", \"temperature\": \"22\", \"unit\": \"celsius\"})\n", - " else:\n", - " return json.dumps({\"location\": location, \"temperature\": \"unknown\"})\n", - "\n", - "messages = [{\"role\": \"user\", \"content\": \"What's the weather like in San Francisco, Tokyo, and Paris?\"}]\n", - "tools = [\n", - " {\n", - " \"type\": \"function\",\n", - " \"function\": {\n", - " \"name\": \"get_current_weather\",\n", - " \"description\": \"Get the current weather in a given location\",\n", - " \"parameters\": {\n", - " \"type\": \"object\",\n", - " \"properties\": {\n", - " \"location\": {\n", - " \"type\": \"string\",\n", - " \"description\": \"The city and state, e.g. San Francisco, CA\",\n", - " },\n", - " \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n", - " },\n", - " \"required\": [\"location\"],\n", - " },\n", - " },\n", - " }\n", - "]\n", - "\n", - "response = litellm.completion(\n", - " model=\"azure/chatgpt-functioncalling\", # model = azure/\n", - " messages=messages,\n", - " tools=tools,\n", - " tool_choice=\"auto\", # auto is default, but we'll be explicit\n", - ")\n", - "print(\"\\nLLM Response1:\\n\", response)\n", - "response_message = response.choices[0].message\n", - "tool_calls = response.choices[0].message.tool_calls\n", - "print(\"\\nTool Choice:\\n\", tool_calls)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "boAIHLEXj80m", - "outputId": "00afcf09-5b6b-4805-c374-ba089cc6eb43" - }, - "execution_count": 33, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "LLM Response1:\n", - " ModelResponse(id='chatcmpl-8MOBPvEnqG7qitkmVqZmCrzSGEmDj', choices=[Choices(finish_reason='tool_calls', index=0, message=Message(content=None, role='assistant', tool_calls=[ChatCompletionMessageToolCall(id='call_7gZ0PkmmmgzTOxfF01ATp0U5', function=Function(arguments='{\\n \"location\": \"San Francisco, CA\"\\n}', name='get_current_weather'), type='function')]))], created=1700346867, model='gpt-35-turbo', object='chat.completion', system_fingerprint=None, usage={'completion_tokens': 19, 'prompt_tokens': 88, 'total_tokens': 107}, _response_ms=833.4319999999999)\n", - "\n", - "Tool Choice:\n", - " [ChatCompletionMessageToolCall(id='call_7gZ0PkmmmgzTOxfF01ATp0U5', function=Function(arguments='{\\n \"location\": \"San Francisco, CA\"\\n}', name='get_current_weather'), type='function')]\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Step 2" - ], - "metadata": { - "id": "hqh1y1IMkmGO" - } - }, - { - "cell_type": "code", - "source": [ - "# Check if the model wants to call a function\n", - "if tool_calls:\n", - " # Execute the functions and prepare responses\n", - " available_functions = {\n", - " \"get_current_weather\": get_current_weather,\n", - " }\n", - "\n", - " messages.append(response_message) # Extend conversation with assistant's reply\n", - "\n", - " for tool_call in tool_calls:\n", - " print(f\"\\nExecuting tool call\\n{tool_call}\")\n", - " function_name = tool_call.function.name\n", - " function_to_call = available_functions[function_name]\n", - " function_args = json.loads(tool_call.function.arguments)\n", - " # calling the get_current_weather() function\n", - " function_response = function_to_call(\n", - " location=function_args.get(\"location\"),\n", - " unit=function_args.get(\"unit\"),\n", - " )\n", - " print(f\"Result from tool call\\n{function_response}\\n\")\n", - "\n", - " # Extend conversation with function response\n", - " messages.append(\n", - " {\n", - " \"tool_call_id\": tool_call.id,\n", - " \"role\": \"tool\",\n", - " \"name\": function_name,\n", - " \"content\": function_response,\n", - " }\n", - " )\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "FGu7DY7PkOiG", - "outputId": "96d39ae7-7fc8-4dd8-c82f-5ee9a486724c" - }, - "execution_count": 34, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\n", - "Executing tool call\n", - "ChatCompletionMessageToolCall(id='call_7gZ0PkmmmgzTOxfF01ATp0U5', function=Function(arguments='{\\n \"location\": \"San Francisco, CA\"\\n}', name='get_current_weather'), type='function')\n", - "Result from tool call\n", - "{\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": \"fahrenheit\"}\n", - "\n" - ] - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Step 3" - ], - "metadata": { - "id": "4MjYyeajkpBl" - } - }, - { - "cell_type": "code", - "source": [ - "second_response = litellm.completion(\n", - " model=\"azure/chatgpt-functioncalling\",\n", - " messages=messages,\n", - ")\n", - "print(\"Second Response\\n\", second_response)\n", - "print(\"Second Response Message\\n\", second_response.choices[0].message.content)\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "qHgXyZq1kqGn", - "outputId": "61a30470-d7f5-484d-c42b-681c9b60b34a" - }, - "execution_count": 36, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Second Response\n", - " ModelResponse(id='chatcmpl-8MOC90vwZ2LHX0DE796XYtsOxdGcc', choices=[Choices(finish_reason='stop', index=0, message=Message(content='The current weather in San Francisco is 72°F.', role='assistant'))], created=1700346913, model='gpt-35-turbo', object='chat.completion', system_fingerprint=None, usage={'completion_tokens': 11, 'prompt_tokens': 69, 'total_tokens': 80}, _response_ms=824.882)\n", - "Second Response Message\n", - " The current weather in San Francisco is 72°F.\n" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/cookbook/Proxy_Batch_Users.ipynb b/cookbook/Proxy_Batch_Users.ipynb deleted file mode 100644 index bd18de5e988..00000000000 --- a/cookbook/Proxy_Batch_Users.ipynb +++ /dev/null @@ -1,208 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "680oRk1af-xJ" - }, - "source": [ - "# Environment Setup\n", - "\n", - "Set `LITELLM_MASTER_KEY` in the notebook environment to the same key configured on the proxy before running the cells" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "X7TgJFn8f88p" - }, - "outputs": [], - "source": [ - "import os\n", - "import csv\n", - "from typing import Optional\n", - "import httpx\n", - "import json\n", - "import asyncio\n", - "\n", - "proxy_base_url = \"http://0.0.0.0:4000\" # 👈 SET TO PROXY URL\n", - "master_key = os.environ[\"LITELLM_MASTER_KEY\"]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "rauw8EOhgBz5" - }, - "outputs": [], - "source": [ - "## GLOBAL HTTP CLIENT ## - faster http calls\n", - "class HTTPHandler:\n", - " def __init__(self, concurrent_limit=1000):\n", - " # Create a client with a connection pool\n", - " self.client = httpx.AsyncClient(\n", - " limits=httpx.Limits(\n", - " max_connections=concurrent_limit,\n", - " max_keepalive_connections=concurrent_limit,\n", - " )\n", - " )\n", - "\n", - " async def close(self):\n", - " # Close the client when you're done with it\n", - " await self.client.aclose()\n", - "\n", - " async def get(\n", - " self, url: str, params: Optional[dict] = None, headers: Optional[dict] = None\n", - " ):\n", - " response = await self.client.get(url, params=params, headers=headers)\n", - " return response\n", - "\n", - " async def post(\n", - " self,\n", - " url: str,\n", - " data: Optional[dict] = None,\n", - " params: Optional[dict] = None,\n", - " headers: Optional[dict] = None,\n", - " ):\n", - " try:\n", - " response = await self.client.post(\n", - " url, data=data, params=params, headers=headers\n", - " )\n", - " return response\n", - " except Exception as e:\n", - " raise e\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "7LXN8zaLgOie" - }, - "source": [ - "# Import Sheet\n", - "\n", - "\n", - "Format: | ID | Name | Max Budget |" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "oiED0usegPGf" - }, - "outputs": [], - "source": [ - "async def import_sheet():\n", - " tasks = []\n", - " http_client = HTTPHandler()\n", - " with open('my-batch-sheet.csv', 'r') as file:\n", - " csv_reader = csv.DictReader(file)\n", - " for row in csv_reader:\n", - " task = create_user(client=http_client, user_id=row['ID'], max_budget=row['Max Budget'], user_name=row['Name'])\n", - " tasks.append(task)\n", - " # print(f\"ID: {row['ID']}, Name: {row['Name']}, Max Budget: {row['Max Budget']}\")\n", - "\n", - " keys = await asyncio.gather(*tasks)\n", - "\n", - " with open('my-batch-sheet_new.csv', 'w', newline='') as new_file:\n", - " fieldnames = ['ID', 'Name', 'Max Budget', 'keys']\n", - " csv_writer = csv.DictWriter(new_file, fieldnames=fieldnames)\n", - " csv_writer.writeheader()\n", - "\n", - " with open('my-batch-sheet.csv', 'r') as file:\n", - " csv_reader = csv.DictReader(file)\n", - " for i, row in enumerate(csv_reader):\n", - " row['keys'] = keys[i] # Add the 'keys' value from the corresponding task result\n", - " csv_writer.writerow(row)\n", - "\n", - " await http_client.close()\n", - "\n", - "asyncio.run(import_sheet())" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "E7M0Li_UgJeZ" - }, - "source": [ - "# Create Users + Keys\n", - "\n", - "- Creates a user\n", - "- Creates a key with max budget" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "NZudRFujf7j-" - }, - "outputs": [], - "source": [ - "\n", - "async def create_key_with_alias(client: HTTPHandler, user_id: str, max_budget: float):\n", - " global proxy_base_url\n", - " if not proxy_base_url.endswith(\"/\"):\n", - " proxy_base_url += \"/\"\n", - " url = proxy_base_url + \"key/generate\"\n", - "\n", - " # call /key/generate\n", - " print(\"CALLING /KEY/GENERATE\")\n", - " response = await client.post(\n", - " url=url,\n", - " headers={\"Authorization\": f\"Bearer {master_key}\"},\n", - " data=json.dumps({\n", - " \"user_id\": user_id,\n", - " \"key_alias\": f\"{user_id}-key\",\n", - " \"max_budget\": max_budget # 👈 KEY CHANGE: SETS MAX BUDGET PER KEY\n", - " })\n", - " )\n", - " print(f\"response: {response.text}\")\n", - " return response.json()[\"key\"]\n", - "\n", - "async def create_user(client: HTTPHandler, user_id: str, max_budget: float, user_name: str):\n", - " \"\"\"\n", - " - call /user/new\n", - " - create key for user\n", - " \"\"\"\n", - " global proxy_base_url\n", - " if not proxy_base_url.endswith(\"/\"):\n", - " proxy_base_url += \"/\"\n", - " url = proxy_base_url + \"user/new\"\n", - "\n", - " # call /user/new\n", - " await client.post(\n", - " url=url,\n", - " headers={\"Authorization\": f\"Bearer {master_key}\"},\n", - " data=json.dumps({\n", - " \"user_id\": user_id,\n", - " \"user_alias\": user_name,\n", - " \"auto_create_key\": False,\n", - " # \"max_budget\": max_budget # 👈 [OPTIONAL] Sets max budget per user (if you want to set a max budget across keys)\n", - " })\n", - " )\n", - "\n", - " # create key for user\n", - " return await create_key_with_alias(client=client, user_id=user_id, max_budget=max_budget)\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/TogetherAI_liteLLM.ipynb b/cookbook/TogetherAI_liteLLM.ipynb deleted file mode 100644 index d4700914910..00000000000 --- a/cookbook/TogetherAI_liteLLM.ipynb +++ /dev/null @@ -1,1006 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "WemkFEdDAnJL" - }, - "source": [ - "## liteLLM Together AI Tutorial\n", - "https://together.ai/\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "pc6IO4V99O25", - "outputId": "2d69da44-010b-41c2-b38b-5b478576bb8b" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting litellm\n", - " Downloading litellm-0.1.482-py3-none-any.whl (69 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m69.3/69.3 kB\u001b[0m \u001b[31m757.5 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: importlib-metadata<7.0.0,>=6.8.0 in /usr/local/lib/python3.10/dist-packages (from litellm) (6.8.0)\n", - "Collecting openai<0.28.0,>=0.27.8 (from litellm)\n", - " Downloading openai-0.27.9-py3-none-any.whl (75 kB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.5/75.5 kB\u001b[0m \u001b[31m3.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hCollecting python-dotenv<2.0.0,>=1.0.0 (from litellm)\n", - " Downloading python_dotenv-1.0.0-py3-none-any.whl (19 kB)\n", - "Collecting tiktoken<0.5.0,>=0.4.0 (from litellm)\n", - " Downloading tiktoken-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m17.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25hRequirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata<7.0.0,>=6.8.0->litellm) (3.16.2)\n", - "Requirement already satisfied: requests>=2.20 in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm) (2.31.0)\n", - "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm) (4.66.1)\n", - "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from openai<0.28.0,>=0.27.8->litellm) (3.8.5)\n", - "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.10/dist-packages (from tiktoken<0.5.0,>=0.4.0->litellm) (2023.6.3)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm) (3.2.0)\n", - "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm) (3.4)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm) (2.0.4)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai<0.28.0,>=0.27.8->litellm) (2023.7.22)\n", - "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (23.1.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (6.0.4)\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (4.0.3)\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (1.9.2)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (1.4.0)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai<0.28.0,>=0.27.8->litellm) (1.3.1)\n", - "Installing collected packages: python-dotenv, tiktoken, openai, litellm\n", - "Successfully installed litellm-0.1.482 openai-0.27.9 python-dotenv-1.0.0 tiktoken-0.4.0\n" - ] - } - ], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "TMI3739_9q97" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "os.environ[\"TOGETHERAI_API_KEY\"] = \"\" #@param\n", - "user_message = \"Hello, whats the weather in San Francisco??\"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "bEqJ2HHjBJqq" - }, - "source": [ - "## Calling togethercomputer/llama-2-70b-chat\n", - "https://api.together.xyz/playground/chat?model=togethercomputer%2Fllama-2-70b-chat" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Jrrt8puj523f", - "outputId": "24494dea-816f-47a6-ade4-1b04f2e9085b" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " 'choices': [\n", - "{\n", - " 'finish_reason': 'stop',\n", - " 'index': 0,\n", - " 'message': {\n", - " 'role': 'assistant',\n", - " 'content': \"\n", - "\n", - "I'm not able to provide real-time weather information. However, I can suggest some ways for you to find out the current weather in San Francisco.\n", - "\n", - "1. Check online weather websites: There are many websites that provide up-to-date weather information, such as AccuWeather, Weather.com, or the National Weather Service. You can enter \"San Francisco\" in the search bar and get the current weather conditions, forecast, and radar imagery.\n", - "2. Use a weather app: You can download a weather app on your smartphone that provides real-time weather information. Some popular weather apps include Dark Sky, Weather Underground, and The Weather Channel.\n", - "3. Tune into local news: You can watch local news channels or listen to local radio stations to get the latest weather forecast and current conditions.\n", - "4. Check social media: Follow local weather accounts on social media platforms like Twitter or Facebook to\"\n", - "}\n", - "}\n", - " ],\n", - " 'created': 1692323365.8261144,\n", - " 'model': 'togethercomputer/llama-2-70b-chat',\n", - " 'usage': {'prompt_tokens': 9, 'completion_tokens': 176, 'total_tokens': 185}\n", - "}\n" - ] - } - ], - "source": [ - "model_name = \"togethercomputer/llama-2-70b-chat\"\n", - "response = completion(model=model_name, messages=messages, max_tokens=200)\n", - "print(response)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "GIUevHlMvPb8", - "outputId": "ad930a12-16e3-4400-fff4-38151e4f6da5" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[92mHere's your LiteLLM Dashboard 👉 \u001b[94m\u001b[4mhttps://admin.litellm.ai/6c0f0403-becb-44af-9724-7201c7d381d0\u001b[0m\n", - "{\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"\\nI'm in San Francisco, and I'm not sure what the weather is like.\\nI'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and I'm not sure what the weather is like. I'm in San Francisco, and\",\n", - " \"role\": \"assistant\"\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1692934243.8663018,\n", - " \"model\": \"togethercomputer/CodeLlama-34b-Instruct\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 9,\n", - " \"completion_tokens\": 178,\n", - " \"total_tokens\": 187\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "model_name = \"togethercomputer/CodeLlama-34b-Instruct\"\n", - "response = completion(model=model_name, messages=messages, max_tokens=200)\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "sfWtgf-mBQcM" - }, - "source": [ - "## With Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "background_save": true, - "base_uri": "https://localhost:8080/" - }, - "id": "wuBhlZtC6MH5", - "outputId": "8f4a408c-25eb-4434-cdd4-7b4ae4f6d3aa" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Com'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'bin'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ator'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ('}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ')'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' are'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' two'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' popular'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceler'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ators'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' have'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' gained'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' recognition'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' their'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' effect'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'iveness'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'urt'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'uring'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' scaling'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' early'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'stage'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ities'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' they'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' also'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' have'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' distinct'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' differences'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' set'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' them'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' apart'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' In'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' this'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ess'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ay'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' we'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' will'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' explore'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' key'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' features'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' discuss'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' which'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' might'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Com'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'bin'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ator'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' one'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' most'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' successful'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceler'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ators'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' world'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' port'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'folio'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' includes'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Air'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'b'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'nb'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Drop'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'box'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Red'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'dit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' F'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ounded'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' '}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '2'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '5'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' has'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' over'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' '}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '1'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '9'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' start'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ups'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' combined'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' valu'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ation'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' over'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' $'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '1'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' billion'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' The'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' known'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' its'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' inten'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'se'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' three'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'month'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' boot'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' camp'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'style'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' format'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' where'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' found'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ers'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' work'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' closely'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' experienced'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ment'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ors'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' develop'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' their'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' products'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ref'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ine'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' their'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' business'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' models'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' prepare'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ra'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ising'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' software'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' technology'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' internet'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' start'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ups'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' has'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' strong'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' track'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' record'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ident'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ifying'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'urt'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'uring'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' successful'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' these'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' spaces'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' other'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' hand'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' relatively'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' new'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceler'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ator'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' was'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' founded'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' '}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '2'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '1'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '7'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' While'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' it'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' not'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' have'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' same'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' level'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' brand'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' recognition'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' as'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' has'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' quickly'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' gained'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' reputation'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' its'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' unique'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' approach'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceleration'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' The'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'es'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' supporting'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' under'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 're'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'present'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' found'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ers'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' particularly'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' women'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' people'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' color'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' provides'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' range'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' resources'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' support'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' help'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' these'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' found'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ers'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' succeed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' designed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' more'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' flexible'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' personal'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ized'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' than'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' traditional'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceler'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ators'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' connecting'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' found'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ers'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ment'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ors'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' resources'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' are'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' tail'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ored'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' their'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' specific'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' needs'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'One'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' key'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' difference'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' between'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' type'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' they'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' support'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'es'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' primarily'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' software'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' technology'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' internet'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' start'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ups'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' while'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' has'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' bro'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ader'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' includes'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' range'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' indust'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ries'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' such'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' as'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' health'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'care'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fin'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ance'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' consumer'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' products'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' This'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' means'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' if'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' non'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'tech'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' industry'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'An'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'other'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' difference'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' between'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' two'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' programs'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' their'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' approach'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ing'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' provides'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' seed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ing'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' all'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' its'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' port'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'folio'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' typically'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' range'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' of'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' $'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '1'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' $'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '2'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '0'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' In'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' contrast'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' does'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' not'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' provide'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ing'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' its'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' port'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'folio'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' but'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' instead'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'es'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' connecting'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' found'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ers'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' invest'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ors'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' resources'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' can'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' help'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' them'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' raise'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' capital'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' This'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' means'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' if'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' looking'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ing'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' option'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'So'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' which'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' right'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '?'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' It'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' ultimately'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' depends'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' on'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' specific'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' needs'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' goals'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' If'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' non'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'tech'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' industry'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' bro'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ader'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' focus'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Additionally'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' if'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 're'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' looking'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' more'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' personal'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ized'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' flexible'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' approach'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceleration'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' choice'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' On'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' other'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' hand'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' if'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' software'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' technology'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' or'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' internet'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' space'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 're'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' looking'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' seed'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fund'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ing'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' may'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' be'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' a'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' better'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '\\n'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'In'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' conclusion'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Y'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'C'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' l'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ite'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'LL'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'M'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' are'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' both'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' excellent'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' acceler'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ators'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' can'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' provide'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' valuable'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' resources'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' support'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' early'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'stage'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' companies'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' While'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' they'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' share'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' some'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' similar'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'ities'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' they'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' also'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' have'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' distinct'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' differences'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' that'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' set'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' them'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' apart'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' By'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' considering'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' startup'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 's'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' specific'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' needs'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' goals'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' can'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' determine'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' which'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' program'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' is'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' the'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' best'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' fit'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' business'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n" - ] - } - ], - "source": [ - "user_message = \"Write 1page essay on YC + liteLLM\"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]\n", - "\n", - "\n", - "async def parse_stream(stream):\n", - " async for elem in stream:\n", - " print(elem)\n", - " return\n", - "\n", - "stream = completion(model=\"togethercomputer/llama-2-70b-chat\", messages=messages, stream=True, max_tokens=800)\n", - "print(stream)\n", - "\n", - "# Await the asynchronous function directly in the notebook cell\n", - "await parse_stream(stream)\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/Using_Nemo_Guardrails_with_LiteLLM_Server.ipynb b/cookbook/Using_Nemo_Guardrails_with_LiteLLM_Server.ipynb deleted file mode 100644 index 0c3ff97a373..00000000000 --- a/cookbook/Using_Nemo_Guardrails_with_LiteLLM_Server.ipynb +++ /dev/null @@ -1,157 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "eKXncoQbU_2j" - }, - "source": [ - "# Using Nemo-Guardrails with LiteLLM Server\n", - "\n", - "[Call Bedrock, TogetherAI, Huggingface, etc. on the server](https://docs.litellm.ai/docs/providers)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ZciYaLwvuFbu" - }, - "source": [ - "## Using with Bedrock\n", - "\n", - "`docker run -e PORT=8000 -e AWS_ACCESS_KEY_ID= -e AWS_SECRET_ACCESS_KEY= -p 8000:8000 ghcr.io/berriai/litellm:latest`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "vOUwGSJ2Vsy3" - }, - "outputs": [], - "source": [ - "pip install nemoguardrails langchain" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "xXEJNxe7U0IN" - }, - "outputs": [], - "source": [ - "from langchain.chat_models import ChatOpenAI\n", - "\n", - "llm = ChatOpenAI(model_name=\"anthropic.claude-v2\", openai_api_base=\"http://0.0.0.0:8000\", openai_api_key=\"my-fake-key\")\n", - "\n", - "from nemoguardrails import LLMRails, RailsConfig\n", - "\n", - "config = RailsConfig.from_path(\"./config.yml\")\n", - "app = LLMRails(config, llm=llm)\n", - "\n", - "new_message = app.generate(messages=[{\n", - " \"role\": \"user\",\n", - " \"content\": \"Hello! What can you do for me?\"\n", - "}])" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "vz5n00qyuKjp" - }, - "source": [ - "## Using with TogetherAI\n", - "\n", - "1. You can either set this in the server environment:\n", - "`docker run -e PORT=8000 -e TOGETHERAI_API_KEY= -p 8000:8000 ghcr.io/berriai/litellm:latest`\n", - "\n", - "2. **Or** Pass this in as the api key `(...openai_api_key=\"\")`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "XK1sk-McuhpE" - }, - "outputs": [], - "source": [ - "from langchain.chat_models import ChatOpenAI\n", - "\n", - "llm = ChatOpenAI(model_name=\"together_ai/togethercomputer/CodeLlama-13b-Instruct\", openai_api_base=\"http://0.0.0.0:8000\", openai_api_key=\"my-together-ai-api-key\")\n", - "\n", - "from nemoguardrails import LLMRails, RailsConfig\n", - "\n", - "config = RailsConfig.from_path(\"./config.yml\")\n", - "app = LLMRails(config, llm=llm)\n", - "\n", - "new_message = app.generate(messages=[{\n", - " \"role\": \"user\",\n", - " \"content\": \"Hello! What can you do for me?\"\n", - "}])" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "8A1KWKnzuxAS" - }, - "source": [ - "### CONFIG.YML\n", - "\n", - "save this example `config.yml` in your current directory" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "NKN1GmSvu0Cx" - }, - "outputs": [], - "source": [ - "# instructions:\n", - "# - type: general\n", - "# content: |\n", - "# Below is a conversation between a bot and a user about the recent job reports.\n", - "# The bot is factual and concise. If the bot does not know the answer to a\n", - "# question, it truthfully says it does not know.\n", - "\n", - "# sample_conversation: |\n", - "# user \"Hello there!\"\n", - "# express greeting\n", - "# bot express greeting\n", - "# \"Hello! How can I assist you today?\"\n", - "# user \"What can you do for me?\"\n", - "# ask about capabilities\n", - "# bot respond about capabilities\n", - "# \"I am an AI assistant that helps answer mathematical questions. My core mathematical skills are powered by wolfram alpha.\"\n", - "# user \"What's 2+2?\"\n", - "# ask math question\n", - "# bot responds to math question\n", - "# \"2+2 is equal to 4.\"\n", - "\n", - "# models:\n", - "# - type: main\n", - "# engine: openai\n", - "# model: claude-instant-1" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/VLLM_Model_Testing.ipynb b/cookbook/VLLM_Model_Testing.ipynb deleted file mode 100644 index 0cacac66133..00000000000 --- a/cookbook/VLLM_Model_Testing.ipynb +++ /dev/null @@ -1,404 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [], - "machine_shape": "hm", - "gpuType": "V100" - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - }, - "accelerator": "GPU" - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# Set up Environment" - ], - "metadata": { - "id": "vDOm5wfjdFLP" - } - }, - { - "cell_type": "code", - "source": [ - "!pip install --upgrade litellm" - ], - "metadata": { - "id": "Bx6mAA6MHiy_" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "zIYv7JTyxSxR", - "outputId": "53890320-f9fa-4bf4-8362-0f17f52c6ed4" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Successfully installed fastapi-0.103.1 h11-0.14.0 huggingface-hub-0.16.4 ninja-1.11.1 pydantic-1.10.12 ray-2.6.3 safetensors-0.3.3 sentencepiece-0.1.99 starlette-0.27.0 tokenizers-0.13.3 transformers-4.33.1 uvicorn-0.23.2 vllm-0.1.4 xformers-0.0.21\n" - ] - } - ], - "source": [ - "!pip install vllm" - ] - }, - { - "cell_type": "markdown", - "source": [ - "# Load the Logs" - ], - "metadata": { - "id": "RMcoAni6WKEx" - } - }, - { - "cell_type": "code", - "source": [ - "import pandas as pd" - ], - "metadata": { - "id": "zchxB8c7WJe5" - }, - "execution_count": 4, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# path of the csv file\n", - "file_path = 'Model-prompts-example.csv'\n", - "\n", - "# load the csv file as a pandas DataFrame\n", - "data = pd.read_csv(file_path)\n", - "\n", - "data.head()" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 81 - }, - "id": "aKcWr015WNPm", - "outputId": "6e226773-333f-46a2-9fc8-4f54f309d204" - }, - "execution_count": 6, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - " Success Timestamp Input \\\n", - "0 True 1694041195 This is the templated query input \n", - "\n", - " Output RunId (Wandb Runid) \\\n", - "0 This is the query output from the model 8hlumwuk \n", - "\n", - " Model ID (or Name) \n", - "0 OpenAI/Turbo-3.5 " - ], - "text/html": [ - "\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
SuccessTimestampInputOutputRunId (Wandb Runid)Model ID (or Name)
0True1694041195This is the templated query inputThis is the query output from the model8hlumwukOpenAI/Turbo-3.5
\n", - "
\n", - "
\n", - "\n", - "
\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "
\n", - "\n", - "\n", - "
\n", - "
\n" - ] - }, - "metadata": {}, - "execution_count": 6 - } - ] - }, - { - "cell_type": "code", - "source": [ - "input_texts = data['Input'].values" - ], - "metadata": { - "id": "0DbL-kirWUyn" - }, - "execution_count": 7, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "messages = [[{\"role\": \"user\", \"content\": input_text}] for input_text in input_texts]" - ], - "metadata": { - "id": "cqpAvy8hWXyC" - }, - "execution_count": 8, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Running Inference" - ], - "metadata": { - "id": "SugCyom0Xy8U" - } - }, - { - "cell_type": "code", - "source": [ - "from litellm import batch_completion\n", - "model_name = \"facebook/opt-125m\"\n", - "provider = \"vllm\"\n", - "response_list = batch_completion(\n", - " model=model_name,\n", - " custom_llm_provider=provider, # can easily switch to huggingface, replicate, together ai, sagemaker, etc.\n", - " messages=messages,\n", - " temperature=0.2,\n", - " max_tokens=80,\n", - " )" - ], - "metadata": { - "id": "qpikx3uxHns3" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "response_list" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QDPikHtwKJJ2", - "outputId": "06f47c44-e258-452a-f9db-232a5b6d2810" - }, - "execution_count": 10, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "[ JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \".\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1694053363.6139505,\n", - " \"model\": \"facebook/opt-125m\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 9,\n", - " \"completion_tokens\": 80,\n", - " \"total_tokens\": 89\n", - " }\n", - " }]" - ] - }, - "metadata": {}, - "execution_count": 10 - } - ] - }, - { - "cell_type": "code", - "source": [ - "response_values = [response['choices'][0]['message']['content'] for response in response_list]" - ], - "metadata": { - "id": "SYqTcCiJbQDF" - }, - "execution_count": 11, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "response_values" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "wqs-Oy9FbiPo", - "outputId": "16a6a7b7-97c8-4b5b-eff8-09ea5eb5ad06" - }, - "execution_count": 12, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "['.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is used to query the data.\\n\\nThe query input is the query input that is']" - ] - }, - "metadata": {}, - "execution_count": 12 - } - ] - }, - { - "cell_type": "code", - "source": [ - "data[f\"{model_name}_output\"] = response_values" - ], - "metadata": { - "id": "mElNbBehbkrz" - }, - "execution_count": 13, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "data.to_csv('model_responses.csv', index=False)" - ], - "metadata": { - "id": "F06NXssDc45k" - }, - "execution_count": 14, - "outputs": [] - } - ] -} \ No newline at end of file diff --git a/cookbook/ai_coding_tool_guides/chatgpt_subscription_passthrough.md b/cookbook/ai_coding_tool_guides/chatgpt_subscription_passthrough.md deleted file mode 100644 index 538a5f8a404..00000000000 --- a/cookbook/ai_coding_tool_guides/chatgpt_subscription_passthrough.md +++ /dev/null @@ -1,114 +0,0 @@ -# Use your ChatGPT subscription through LiteLLM - -Sign into ChatGPT in Codex or Pi and send model requests through your existing LiteLLM proxy. The client keeps your login and refreshes it. Each request uses that client's ChatGPT account, while a separate LiteLLM virtual key controls gateway access and usage attribution. - -An administrator adds a `chatgpt/` model using the usual model configuration. No ChatGPT login needs to be added to the proxy. This uses the same separate-key convention as provider passthrough, including Claude Code subscription forwarding. - -## Add a model to the proxy - -Reuse your existing proxy. If you need one, follow the [proxy quickstart](https://docs.litellm.ai/docs/proxy/docker_quick_start). Merge this entry into its model list and restart the proxy: - -```yaml -model_list: - - model_name: gpt-6-luna - litellm_params: - model: chatgpt/gpt-6-luna - model_info: - mode: responses -``` - -Use a model available to the caller's subscription. The virtual key must allow the exposed model name. Leave saved ChatGPT logins and API credentials unset for a client-only deployment. Explicit cross-provider fallbacks can incur separate API charges; do not configure them for subscription-only traffic. - -## Configure Codex - -Use your existing LiteLLM URL and a virtual key assigned to your gateway user. Export that key as `LITELLM_API_KEY` in the environment that launches Codex. Keep the value out of committed configuration. - -Add this provider to `~/.codex/config.toml`, preserving your other settings: - -```toml -model = "gpt-6-luna" -model_provider = "litellm_subscription" - -[model_providers.litellm_subscription] -name = "LiteLLM subscription" -base_url = "https://litellm.example.com/v1" -wire_api = "responses" -supports_websockets = false -requires_openai_auth = true -env_http_headers = { "x-litellm-api-key" = "LITELLM_API_KEY" } -``` - -Replace `https://litellm.example.com` with your proxy URL. A local proxy normally uses `http://localhost:4000/v1`. Launch Codex, sign into ChatGPT if needed, and send a prompt with a model available to your subscription. The selected model must match the name exposed by the gateway. - -The `lite` CLI can set up this provider each time it starts Codex, with no `config.toml` edit. Export `LITELLM_PROXY_URL` and `LITELLM_PROXY_API_KEY`, then run `lite codex --subscription`. Run `lite config set codex_subscription true` to make it the default. - -For a managed workspace rollout, use OpenAI's [gateway configuration guide](https://learn.chatgpt.com/docs/enterprise/sign-in-with-chatgpt-through-a-gateway). - -## Native compatibility and Pi - -For a native Codex model catalog and request format, change Codex's `base_url` to `https://litellm.example.com/backend-api/codex`. This route uses the same credentials. A ChatGPT model keeps its upstream name and needs no deployment of its own. - -### Mix ChatGPT and LiteLLM models - -On the native route, Codex's model picker shows OpenAI's catalog first and then the other chat and responses models the virtual key can use. Pick one of those and Codex's requests go through LiteLLM's `/v1/responses` with the key's usual routing, budgets, guardrails, and logging. The proxy removes the ChatGPT bearer and account header from that request, so the other provider and your callbacks never receive them. A name is routed this way when another provider serves it as an exact `model_name`, through a router `model_group_alias`, or as a team's public model name. A ChatGPT model, a name that only a wildcard deployment matches, or a name OpenAI's catalog lists for the caller's ChatGPT account keeps the passthrough, so a model OpenAI adds later still uses the subscription even when a deployment of another provider has the same name. The proxy learns the account's list from the catalog Codex fetches, or asks OpenAI with the caller's login. When it cannot get the list, for example because OpenAI is down, the request times out, or the client is not Codex, every request keeps the passthrough for the next minute, as it did before LiteLLM models were added to the picker. When the key can use many models, the picker lists the ones that fit in Codex's catalog size limit, and the proxy logs a warning with how many it left out. - -Codex's picker sends a `none` reasoning effort for a LiteLLM model whose catalog entry lists no effort levels. With `litellm_settings: drop_params: true`, the proxy drops it for a model that does not support `none`, and the provider applies its own default. A model whose cost map entry or `model_info` sets `supports_none_reasoning_effort: true` keeps it. Without `drop_params`, the effort reaches the provider unchanged. - -Codex also sends its ChatGPT app tools with every turn, which on a LiteLLM model adds a few hundred thousand prompt tokens to each turn. Set `apps = false` under `[features]` in Codex's `config.toml` to turn them off. - -Only a key that may call `/v1/responses` gets these models. A key whose `allowed_routes` covers only the native routes sees OpenAI's catalog unchanged, and every request it sends uses the subscription. - -Codex sends earlier reasoning items back with each turn. The proxy tags the reasoning that a LiteLLM model returns on this route, OpenAI and Azure deployments included. When a session switches to a ChatGPT model, the proxy drops those items before forwarding the request to OpenAI, which would reject them. Messages, tool calls, and ChatGPT's own reasoning are kept, and a LiteLLM model still gets its own reasoning back. - -When the catalog adds LiteLLM models for a key, its `ETag` is a digest of OpenAI's ETag and those models, and that key's responses carry the same value in `X-Models-Etag`. Codex keeps its cached catalog while the two match and fetches it again when OpenAI's catalog or the key's models change. A key whose catalog adds no LiteLLM models keeps OpenAI's ETags. - -### Restrict native models with an access group - -A key with a model allowlist needs a rule for ChatGPT names that OpenAI adds over time. Put the subscription wildcards in an access group under `chatgpt/` names: - -```yaml -model_list: - - model_name: chatgpt/gpt-* - litellm_params: - model: chatgpt/gpt-* - model_info: - access_groups: ["chatgpt-native"] - - model_name: chatgpt/codex-* - litellm_params: - model: chatgpt/codex-* - model_info: - access_groups: ["chatgpt-native"] -``` - -Then add `chatgpt-native` to the key's models, next to any other model names it should reach. On the native route, a key that holds only the `chatgpt/` form of a name is checked as that form, so a request for `gpt-5.6-sol` is allowed when the key may call `chatgpt/gpt-5.6-sol`. The key can call every ChatGPT model that matches the wildcards, including ones the proxy configuration does not name. - -On `/v1` these wildcards match only a request that asks for a `chatgpt/` name, so a request for a plain `gpt-` or `codex-` name still goes where it went before, such as a `*` catch-all deployment. A `/v1` request for a `chatgpt/` name without a ChatGPT login falls back to the proxy's own saved login if it has one, so keep that login unset as described above. - -### Configure Pi - -Sign into the built-in `openai-codex` provider in Pi. Merge this override into `~/.pi/agent/models.json` and export your LiteLLM virtual key as `LITELLM_API_KEY` before launching Pi: - -```json -{ - "providers": { - "openai-codex": { - "baseUrl": "https://litellm.example.com/backend-api/codex", - "headers": { - "x-litellm-api-key": "LITELLM_API_KEY" - } - } - } -} -``` - -Keep Pi's subscription login as the provider credential. The header value names an environment variable, not a key to paste into the file. - -## Verify account usage - -Send a prompt and check the completed request in LiteLLM's Logs page. Its gateway user/key and token counts should match the caller. Give each person their own LiteLLM virtual key for separate attribution. The gateway credential and ChatGPT login are independently authenticated; LiteLLM does not establish that both identities belong to the same person. - -The native routes are `GET /backend-api/codex/models` and `POST /backend-api/codex/responses`. Model requests use the upstream model name, so a restricted LiteLLM key needs the `chatgpt-native` access group above or that exact name. OpenAI's model catalog is returned in its native format; seeing a model there does not override gateway permissions. - -The proxy forwards the ChatGPT bearer and account header to the fixed OpenAI Codex endpoint. It removes gateway credentials and cookies from the upstream request and redacts credential headers in logging callbacks. The client remains responsible for refresh and reauthentication. Native passthrough returns authentication and quota errors without switching subscriptions. Standard model routes retain the caller login across ChatGPT retries; explicitly configured cross-provider fallbacks use their own credentials. An explicit workspace header is preserved for OpenAI to validate. - -This flow does not connect accounts through the dashboard or pool subscription allowances. Use a Codex build that supports ChatGPT authentication with a custom model provider. The integration forwards HTTP and SSE requests; it does not add native WebSocket or other Codex backend routes. diff --git a/cookbook/ai_coding_tool_guides/claude_code_quickstart/guide.md b/cookbook/ai_coding_tool_guides/claude_code_quickstart/guide.md deleted file mode 100644 index cd27eed18a3..00000000000 --- a/cookbook/ai_coding_tool_guides/claude_code_quickstart/guide.md +++ /dev/null @@ -1,294 +0,0 @@ -# Claude Code with LiteLLM Quickstart - -This guide shows how to call Claude models (and any LiteLLM-supported model) through LiteLLM proxy from Claude Code. - -> **Note:** This integration is based on [Anthropic's official LiteLLM configuration documentation](https://docs.anthropic.com/en/docs/claude-code/llm-gateway#litellm-configuration). It allows you to use any LiteLLM supported model through Claude Code with centralized authentication, usage tracking, and cost controls. - -## Video Walkthrough - -Watch the full tutorial: https://www.loom.com/embed/3c17d683cdb74d36a3698763cc558f56 - -## Prerequisites - -- [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) installed -- API keys for your chosen providers - -## Installation - -First, install LiteLLM with proxy support: - -```bash -pip install 'litellm[proxy]' -``` - -## Step 1: Setup config.yaml - -Create a secure configuration using environment variables: - -```yaml -model_list: - # Claude models - - model_name: claude-3-5-sonnet-20241022 - litellm_params: - model: anthropic/claude-3-5-sonnet-20241022 - api_key: os.environ/ANTHROPIC_API_KEY - - - model_name: claude-3-5-haiku-20241022 - litellm_params: - model: anthropic/claude-3-5-haiku-20241022 - api_key: os.environ/ANTHROPIC_API_KEY - - -litellm_settings: - master_key: os.environ/LITELLM_MASTER_KEY -``` - -Set your environment variables: - -```bash -export ANTHROPIC_API_KEY="your-anthropic-api-key" -export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)" -``` - -## Step 2: Start Proxy - -```bash -litellm --config /path/to/config.yaml - -# RUNNING on http://0.0.0.0:4000 -``` - -## Step 3: Verify Setup - -Test that your proxy is working correctly: - -```bash -curl -X POST http://0.0.0.0:4000/v1/messages \ --H "Authorization: Bearer $LITELLM_MASTER_KEY" \ --H "Content-Type: application/json" \ --d '{ - "model": "claude-3-5-sonnet-20241022", - "max_tokens": 1000, - "messages": [{"role": "user", "content": "What is the capital of France?"}] -}' -``` - -## Step 4: Configure Claude Code - -### Method 1: Unified Endpoint (Recommended) - -Configure Claude Code to use LiteLLM's unified endpoint. Either a virtual key or master key can be used here: - -```bash -export ANTHROPIC_BASE_URL="http://0.0.0.0:4000" -export ANTHROPIC_AUTH_TOKEN="$LITELLM_MASTER_KEY" -``` - -> **Tip:** LITELLM_MASTER_KEY gives Claude access to all proxy models, whereas a virtual key would be limited to the models set in the UI. - -### Method 2: Provider-specific Pass-through Endpoint - -Alternatively, use the Anthropic pass-through endpoint: - -```bash -export ANTHROPIC_BASE_URL="http://0.0.0.0:4000/anthropic" -export ANTHROPIC_AUTH_TOKEN="$LITELLM_MASTER_KEY" -``` - -## Step 5: Use Claude Code - -### Choosing Your Model - -You have two options for specifying which model Claude Code uses: - -#### Option 1: Command Line / Session Model Selection - -Specify the model directly when starting Claude Code or during a session: - -```bash -# Specify model at startup -claude --model claude-3-5-sonnet-20241022 - -# Or change model during a session -/model claude-3-5-haiku-20241022 -``` - -This method uses the exact model you specify. - -#### Option 2: Environment Variables - -Configure default models using environment variables: - -```bash -# Tell Claude Code which models to use by default -export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-3-5-sonnet-20241022 -export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-3-5-haiku-20241022 -export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-3-5-20240229 - -claude # Will use the models specified above -``` - -**Note:** Claude Code may cache the model from a previous session. If environment variables don't take effect, use Option 1 to explicitly set the model. - -**Important:** The `model_name` in your LiteLLM config must match what Claude Code requests (either from env vars or command line). - -### Using 1M Context Window - -Claude Code supports extended context (1 million tokens) using the `[1m]` suffix with Claude 4+ models: - -```bash -# Use Sonnet 4.5 with 1M context (requires quotes for shell) -claude --model 'claude-sonnet-4-5-20250929[1m]' - -# Inside a Claude Code session (no quotes needed) -/model claude-sonnet-4-5-20250929[1m] -``` - -**Important:** When using `--model` with `[1m]` in the shell, you must use quotes to prevent the shell from interpreting the brackets. - -Alternatively, set as default with environment variables: - -```bash -export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5-20250929[1m]' -claude -``` - -**How it works:** -- Claude Code strips the `[1m]` suffix before sending to LiteLLM -- Claude Code automatically adds the header `anthropic-beta: context-1m-2025-08-07` -- Your LiteLLM config should **NOT** include `[1m]` in model names - -**Verify 1M context is active:** -```bash -/context -# Should show: 21k/1000k tokens (2%) -``` - -**Pricing:** Models using 1M context have different pricing. Input tokens above 200k are charged at a higher rate. - -## Troubleshooting - -Common issues and solutions: - -**Claude Code not connecting:** -- Verify your proxy is running: `curl http://0.0.0.0:4000/health` -- Check that `ANTHROPIC_BASE_URL` is set correctly -- Ensure your `ANTHROPIC_AUTH_TOKEN` matches your LiteLLM master key - -**Authentication errors:** -- Verify your environment variables are set: `echo $LITELLM_MASTER_KEY` -- Check that your API keys are valid and have sufficient credits -- Ensure the `ANTHROPIC_AUTH_TOKEN` matches your LiteLLM master key - -**Model not found:** -- Check what model Claude Code is requesting in LiteLLM logs -- Ensure your `config.yaml` has a matching `model_name` entry -- If using environment variables, verify they're set: `echo $ANTHROPIC_DEFAULT_SONNET_MODEL` - -**1M context not working (showing 200k instead of 1000k):** -- Verify you're using the `[1m]` suffix: `/model your-model-name[1m]` -- Check LiteLLM logs for the header `context-1m-2025-08-07` in the request -- Ensure your model supports 1M context (only certain Claude models do) -- Your LiteLLM config should **NOT** include `[1m]` in the `model_name` - -## Using Multiple Models and Providers - -You can configure LiteLLM to route to any supported provider. Here's an example with multiple providers: - -```yaml -model_list: - # OpenAI models - - model_name: codex-mini - litellm_params: - model: openai/codex-mini - api_key: os.environ/OPENAI_API_KEY - api_base: https://api.openai.com/v1 - - - model_name: o3-pro - litellm_params: - model: openai/o3-pro - api_key: os.environ/OPENAI_API_KEY - api_base: https://api.openai.com/v1 - - - model_name: gpt-4o - litellm_params: - model: openai/gpt-4o - api_key: os.environ/OPENAI_API_KEY - api_base: https://api.openai.com/v1 - - # Anthropic models - - model_name: claude-3-5-sonnet-20241022 - litellm_params: - model: anthropic/claude-3-5-sonnet-20241022 - api_key: os.environ/ANTHROPIC_API_KEY - - - model_name: claude-3-5-haiku-20241022 - litellm_params: - model: anthropic/claude-3-5-haiku-20241022 - api_key: os.environ/ANTHROPIC_API_KEY - - # AWS Bedrock - - model_name: claude-bedrock - litellm_params: - model: bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0 - aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID - aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY - aws_region_name: us-east-1 - -litellm_settings: - master_key: os.environ/LITELLM_MASTER_KEY -``` - -**Note:** The `model_name` can be anything you choose. Claude Code will request whatever model you specify (via env vars or command line), and LiteLLM will route to the `model` configured in `litellm_params`. - -Switch between models seamlessly: - -```bash -# Use environment variables to set defaults -export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-3-5-sonnet-20241022 -export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-3-5-haiku-20241022 - -# Or specify directly -claude --model claude-3-5-sonnet-20241022 # Complex reasoning -claude --model claude-3-5-haiku-20241022 # Fast responses -claude --model claude-bedrock # Bedrock deployment -``` - -## Default Models Used by Claude Code - -If you **don't** set environment variables, Claude Code uses these default model names: - -| Purpose | Default Model Name (v2.1.14) | -|---------|------------------------------| -| Main model | `claude-sonnet-4-5-20250929` | -| Light tasks (subagents, summaries) | `claude-haiku-4-5-20251001` | -| Planning mode | `claude-opus-4-5-20251101` | - -Your LiteLLM config should include these model names if you want Claude Code to work without setting environment variables: - -```yaml -model_list: - - model_name: claude-sonnet-4-5-20250929 - litellm_params: - # Can be any provider - Anthropic, Bedrock, Vertex AI, etc. - model: anthropic/claude-sonnet-4-5-20250929 - api_key: os.environ/ANTHROPIC_API_KEY - - - model_name: claude-haiku-4-5-20251001 - litellm_params: - model: anthropic/claude-haiku-4-5-20251001 - api_key: os.environ/ANTHROPIC_API_KEY - - - model_name: claude-opus-4-5-20251101 - litellm_params: - model: anthropic/claude-opus-4-5-20251101 - api_key: os.environ/ANTHROPIC_API_KEY -``` - -**Warning:** These default model names may change with new Claude Code versions. Check LiteLLM proxy logs for "model not found" errors to identify what Claude Code is requesting. - -## Additional Resources - -- [LiteLLM Documentation](https://docs.litellm.ai/) -- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code/overview) -- [Anthropic's LiteLLM Configuration Guide](https://docs.anthropic.com/en/docs/claude-code/llm-gateway#litellm-configuration) diff --git a/cookbook/ai_coding_tool_guides/index.json b/cookbook/ai_coding_tool_guides/index.json deleted file mode 100644 index 3e71670d623..00000000000 --- a/cookbook/ai_coding_tool_guides/index.json +++ /dev/null @@ -1,134 +0,0 @@ -[{ - "title": "Claude Code Quickstart", - "description": "This is a quickstart guide to using Claude Code with LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/claude_responses_api", - "date": "2026-01-15", - "version": "1.0.0", - "tags": [ - "Claude Code", - "LiteLLM" - ] -}, -{ - "title": "Claude Code with MCPs", - "description": "This is a guide to using Claude Code with MCPs via LiteLLM Proxy.", - "url": "https://docs.litellm.ai/docs/tutorials/claude_mcp", - "date": "2026-01-15", - "version": "1.0.0", - "tags": [ - "Claude Code", - "LiteLLM", - "MCP" - ] -}, -{ - "title": "Claude Code with Non-Anthropic Models", - "description": "This is a guide to using Claude Code with non-Anthropic models via LiteLLM Proxy.", - "url": "https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "Claude Code", - "LiteLLM", - "OpenAI", - "Gemini" - ] -}, -{ - "title": "Cursor Quickstart", - "description": "This is a quickstart guide to using Cursor with LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/cursor_integration", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "Cursor", - "LiteLLM", - "Quickstart" - ] -}, -{ - "title": "Github Copilot Quickstart", - "description": "This is a quickstart guide to using Github Copilot with LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/github_copilot_integration", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "Github Copilot", - "LiteLLM", - "Quickstart" - ] -}, -{ - "title": "LiteLLM Gemini CLI Quickstart", - "description": "This is a quickstart guide to using LiteLLM Gemini CLI.", - "url": "https://docs.litellm.ai/docs/tutorials/litellm_gemini_cli", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "Gemini CLI", - "Gemini", - "LiteLLM", - "Quickstart" - ] -}, -{ - "title": "OpenAI Codex CLI Quickstart", - "description": "This is a quickstart guide to using OpenAI Codex CLI.", - "url": "https://docs.litellm.ai/docs/tutorials/openai_codex", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "OpenAI Codex CLI", - "OpenAI", - "LiteLLM", - "Quickstart" - ] -}, -{ - "title": "OpenWebUI Quickstart", - "description": "This is a quickstart guide to using OpenWebUI with LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/openweb_ui", - "date": "2026-01-16", - "version": "1.0.0", - "tags": [ - "OpenWebUI", - "LiteLLM", - "Quickstart" - ] -}, -{ - "title": "AI Coding Tool Usage Tracking", - "description": "This is a guide to tracking usage for AI coding tools monitor the use of Claude Code , Google Antigravity, OpenAI Codex, Roo Code etc. through LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/cost_tracking_coding", - "date": "2026-01-17", - "version": "1.0.0", - "tags": [ - "Claude Code", - "Gemini CLI", - "OpenAI Codex", - "LiteLLM" - ] -}, -{ - "title": "Use Web Search with Claude Code (across Bedrock/OpenAI/Gemini/etc.)", - "description": "This is a guide for using Web Search with Claude Code via LiteLLM.", - "url": "https://docs.litellm.ai/docs/tutorials/claude_code_websearch", - "date": "2026-01-17", - "version": "1.0.0", - "tags": [ - "Claude Code", - "LiteLLM", - "Web Search" - ] -}, -{ - "title": "Track Claude Code Usage per user via Custom Headers", - "description": "This is a guide for tracking claude code user usage by passing a customer ID header.", - "url": "https://docs.litellm.ai/docs/tutorials/claude_code_customer_tracking", - "date": "2026-01-17", - "version": "1.0.0", - "tags": [ - "Claude Code", - "LiteLLM" - ] -}] \ No newline at end of file diff --git a/cookbook/anthropic_agent_sdk/README.md b/cookbook/anthropic_agent_sdk/README.md deleted file mode 100644 index 4521aee310a..00000000000 --- a/cookbook/anthropic_agent_sdk/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# Claude Agent SDK with LiteLLM Gateway - -A simple example showing how to use Claude's Agent SDK with LiteLLM as a proxy. This lets you use any LLM provider (OpenAI, Bedrock, Azure, etc.) through the Agent SDK. - -## Quick Start - -### 1. Install dependencies - -```bash -pip install anthropic claude-agent-sdk litellm -``` - -### 2. Start LiteLLM proxy - -```bash -# Simple start with Claude -litellm --model claude-sonnet-4-20250514 - -# Or with a config file -litellm --config config.yaml -``` - -Generate a master key before starting the proxy: - -```bash -export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)" -``` - -### 3. Run the chat - -**Basic Agent (no MCP):** - -```bash -python main.py -``` - -**Agent with MCP (DeepWiki2 for research):** - -```bash -python agent_with_mcp.py -``` - -If MCP connection fails, you can disable it: - -```bash -USE_MCP=false python agent_with_mcp.py -``` - -That's it! You can now chat with the agent in your terminal. - -### Chat Commands - -While chatting, you can use these commands: -- `models` - List all available models (fetched from your LiteLLM proxy) -- `model` - Switch to a different model -- `clear` - Start a new conversation -- `quit` or `exit` - End the chat - -The chat automatically fetches available models from your LiteLLM proxy's `/models` endpoint, so you'll always see what's currently configured. - -## Configuration - -Set these environment variables if needed: - -```bash -export LITELLM_PROXY_URL="http://localhost:4000" -export LITELLM_API_KEY="$LITELLM_MASTER_KEY" -export LITELLM_MODEL="bedrock-claude-sonnet-4.5" -``` - -Or just use the defaults - it'll connect to `http://localhost:4000` by default. - -## Files - -- `main.py` - Basic interactive agent without MCP -- `agent_with_mcp.py` - Agent with MCP server integration (DeepWiki2) -- `common.py` - Shared utilities and functions -- `config.example.yaml` - Example LiteLLM configuration -- `requirements.txt` - Python dependencies - -## Example Config File - -If you want to use multiple models, create a `config.yaml` (see `config.example.yaml`): - -```yaml -model_list: - - model_name: bedrock-claude-sonnet-4 - litellm_params: - model: "bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0" - aws_region_name: "us-east-1" - - - model_name: bedrock-claude-sonnet-4.5 - litellm_params: - model: "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0" - aws_region_name: "us-east-1" -``` - -Then start LiteLLM with: `litellm --config config.yaml` - -## How It Works - -The key is pointing the Agent SDK to LiteLLM instead of directly to Anthropic: - -```python -# Point to LiteLLM gateway (not Anthropic) -os.environ["ANTHROPIC_BASE_URL"] = "http://localhost:4000" -os.environ["ANTHROPIC_API_KEY"] = os.environ["LITELLM_API_KEY"] - -# Use any model configured in LiteLLM -options = ClaudeAgentOptions( - model="bedrock-claude-sonnet-4", # or gpt-4, or anything else - system_prompt="You are a helpful assistant.", - max_turns=50, -) -``` - -Note: Don't add `/anthropic` to the base URL - LiteLLM handles the routing automatically. - -## Why Use This? - -- **Switch providers easily**: Use the same code with OpenAI, Bedrock, Azure, etc. -- **Cost tracking**: LiteLLM tracks spending across all your agent conversations -- **Rate limiting**: Set budgets and limits on your agent usage -- **Load balancing**: Distribute requests across multiple API keys or regions -- **Fallbacks**: Automatically retry with a different model if one fails - -## Troubleshooting - -**Connection errors?** -- Make sure LiteLLM is running: `litellm --model your-model` -- Check the URL is correct (default: `http://localhost:4000`) - -**Authentication errors?** -- Verify your LiteLLM API key is correct -- Make sure the model is configured in your LiteLLM setup - -**Model not found?** -- Check the model name matches what's in your LiteLLM config -- Run `litellm --model your-model` to test it works - -**Agent with MCP stuck or failing?** -- The MCP server might not be available at `http://localhost:4000/mcp/deepwiki2` -- Try disabling MCP: `USE_MCP=false python agent_with_mcp.py` -- Or use the basic agent: `python main.py` - -## Learn More - -- [LiteLLM Docs](https://docs.litellm.ai/) -- [Claude Agent SDK](https://github.com/anthropics/anthropic-agent-sdk) -- [LiteLLM Proxy Guide](https://docs.litellm.ai/docs/proxy/quick_start) diff --git a/cookbook/anthropic_agent_sdk/agent_with_mcp.py b/cookbook/anthropic_agent_sdk/agent_with_mcp.py deleted file mode 100644 index 8a7513c786c..00000000000 --- a/cookbook/anthropic_agent_sdk/agent_with_mcp.py +++ /dev/null @@ -1,144 +0,0 @@ -""" -Interactive Claude Agent SDK CLI with MCP Support - -This example demonstrates an interactive CLI chat with the Anthropic Agent SDK using LiteLLM as a proxy, -with MCP (Model Context Protocol) server integration for enhanced capabilities. -""" - -import asyncio -import os -from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions -from common import ( - Config, - fetch_available_models, - setup_litellm_env, - print_header, - handle_model_list, - handle_model_switch, - stream_response, -) - - -async def interactive_chat_with_mcp(): - """ - Interactive CLI chat with the agent and MCP server - """ - config = Config() - - # Configure Anthropic SDK to point to LiteLLM gateway - litellm_base_url = setup_litellm_env(config) - - # Fetch available models from proxy - available_models = await fetch_available_models( - litellm_base_url, config.LITELLM_API_KEY - ) - - current_model = config.LITELLM_MODEL - - # MCP server configuration - mcp_server_url = f"{litellm_base_url}/mcp/deepwiki2" - use_mcp = os.getenv("USE_MCP", "true").lower() == "true" - - if not use_mcp: - print("⚠️ MCP disabled via USE_MCP=false") - - print_header(litellm_base_url, current_model, has_mcp=use_mcp) - - while True: - # Configure agent options - if use_mcp: - try: - # Try with MCP server (HTTP transport) - # Using McpHttpServerConfig format from Agent SDK - options = ClaudeAgentOptions( - system_prompt="You are a helpful AI assistant with access to DeepWiki for research. Be concise, accurate, and friendly.", - model=current_model, - max_turns=50, - mcp_servers={ - "deepwiki2": { - "type": "http", - "url": mcp_server_url, - "headers": { - "Authorization": f"Bearer {config.LITELLM_API_KEY}" - }, - } - }, - ) - except Exception as e: - print(f"⚠️ Warning: Could not configure MCP server: {e}") - print("Continuing without MCP...\n") - use_mcp = False - options = ClaudeAgentOptions( - system_prompt="You are a helpful AI assistant. Be concise, accurate, and friendly.", - model=current_model, - max_turns=50, - ) - else: - # Without MCP - options = ClaudeAgentOptions( - system_prompt="You are a helpful AI assistant. Be concise, accurate, and friendly.", - model=current_model, - max_turns=50, - ) - - # Create agent client - try: - async with ClaudeSDKClient(options=options) as client: - conversation_active = True - - while conversation_active: - # Get user input - try: - user_input = input("\n👤 You: ").strip() - except (EOFError, KeyboardInterrupt): - print("\n\n👋 Goodbye!") - return - - # Handle commands - if user_input.lower() in ["quit", "exit"]: - print("\n👋 Goodbye!") - return - - if user_input.lower() == "clear": - print("\n🔄 Starting new conversation...\n") - conversation_active = False - continue - - if user_input.lower() == "models": - handle_model_list(available_models, current_model) - continue - - if user_input.lower() == "model": - new_model, should_restart = handle_model_switch( - available_models, current_model - ) - if should_restart: - current_model = new_model - conversation_active = False - continue - - if not user_input: - continue - - # Stream response from agent - await stream_response(client, user_input) - - except Exception as e: - print(f"\n❌ Error creating agent client: {e}") - print("This might be an MCP configuration issue. Try running without MCP:") - print(" USE_MCP=false python agent_with_mcp.py") - print("\nOr use the basic agent:") - print(" python main.py") - return - - -def main(): - """Run interactive chat with MCP""" - try: - asyncio.run(interactive_chat_with_mcp()) - except KeyboardInterrupt: - print("\n\n👋 Goodbye!") - - -if __name__ == "__main__": - main() diff --git a/cookbook/anthropic_agent_sdk/common.py b/cookbook/anthropic_agent_sdk/common.py deleted file mode 100644 index 505b5ecd91c..00000000000 --- a/cookbook/anthropic_agent_sdk/common.py +++ /dev/null @@ -1,164 +0,0 @@ -""" -Common utilities for Claude Agent SDK examples -""" - -import os -import httpx - - -class Config: - """Configuration for LiteLLM Gateway connection""" - - # LiteLLM proxy URL (default to local instance) - LITELLM_PROXY_URL = os.getenv("LITELLM_PROXY_URL", "http://localhost:4000") - - # LiteLLM API key (master key or virtual key) - LITELLM_API_KEY = os.environ["LITELLM_API_KEY"] - - # Model name as configured in LiteLLM (e.g., "bedrock-claude-sonnet-4", "gpt-4", etc.) - LITELLM_MODEL = os.getenv("LITELLM_MODEL", "bedrock-claude-sonnet-4.5") - - -async def fetch_available_models(base_url: str, api_key: str) -> list[str]: - """ - Fetch available models from LiteLLM proxy /models endpoint - """ - try: - async with httpx.AsyncClient() as client: - response = await client.get( - f"{base_url}/models", - headers={"Authorization": f"Bearer {api_key}"}, - timeout=10.0, - ) - response.raise_for_status() - data = response.json() - return [model["id"] for model in data.get("data", [])] - except Exception as e: - print(f"⚠️ Warning: Could not fetch models from proxy: {e}") - print("Using default model list...") - # Fallback to default models - return [ - "bedrock-claude-sonnet-3.5", - "bedrock-claude-sonnet-4", - "bedrock-claude-sonnet-4.5", - "bedrock-claude-opus-4.5", - "bedrock-nova-premier", - ] - - -def setup_litellm_env(config: Config): - """ - Configure environment variables to point Agent SDK to LiteLLM - """ - litellm_base_url = config.LITELLM_PROXY_URL.rstrip("/") - os.environ["ANTHROPIC_BASE_URL"] = litellm_base_url - os.environ["ANTHROPIC_API_KEY"] = config.LITELLM_API_KEY - return litellm_base_url - - -def print_header(base_url: str, current_model: str, has_mcp: bool = False): - """ - Print the chat header - """ - mcp_indicator = " + MCP" if has_mcp else "" - print("=" * 70) - print(f"🤖 Claude Agent SDK with LiteLLM Gateway{mcp_indicator} - Interactive Chat") - print("=" * 70) - print(f"🚀 Connected to: {base_url}") - print(f"📦 Current model: {current_model}") - if has_mcp: - print("🔌 MCP: deepwiki2 enabled") - print("\nType your messages below. Commands:") - print(" - 'quit' or 'exit' to end the conversation") - print(" - 'clear' to start a new conversation") - print(" - 'model' to switch models") - print(" - 'models' to list available models") - print("=" * 70) - print() - - -def handle_model_list(available_models: list[str], current_model: str): - """ - Display available models - """ - print("\n📋 Available models:") - for i, model in enumerate(available_models, 1): - marker = "✓" if model == current_model else " " - print(f" {marker} {i}. {model}") - - -def handle_model_switch( - available_models: list[str], current_model: str -) -> tuple[str, bool]: - """ - Handle model switching - - Returns: - tuple: (new_model, should_restart_conversation) - """ - print("\n📋 Select a model:") - for i, model in enumerate(available_models, 1): - marker = "✓" if model == current_model else " " - print(f" {marker} {i}. {model}") - - try: - choice = input("\nEnter number (or press Enter to cancel): ").strip() - if choice: - idx = int(choice) - 1 - if 0 <= idx < len(available_models): - new_model = available_models[idx] - print(f"\n✅ Switched to: {new_model}") - print("🔄 Starting new conversation with new model...\n") - return new_model, True - else: - print("❌ Invalid choice") - except (ValueError, IndexError): - print("❌ Invalid input") - - return current_model, False - - -async def stream_response(client, user_input: str): - """ - Stream response from the agent - """ - print("\n🤖 Assistant: ", end="", flush=True) - - try: - await client.query(user_input) - - # Show loading indicator - print("⏳ thinking...", end="", flush=True) - - # Stream the response - first_chunk = True - async for msg in client.receive_response(): - # Clear loading indicator on first message - if first_chunk: - print("\r🤖 Assistant: ", end="", flush=True) - first_chunk = False - - # Handle different message types - if hasattr(msg, "type"): - if msg.type == "content_block_delta": - # Streaming text delta - if hasattr(msg, "delta") and hasattr(msg.delta, "text"): - print(msg.delta.text, end="", flush=True) - elif msg.type == "content_block_start": - # Start of content block - if hasattr(msg, "content_block") and hasattr( - msg.content_block, "text" - ): - print(msg.content_block.text, end="", flush=True) - - # Fallback to original content handling - if hasattr(msg, "content"): - for content_block in msg.content: - if hasattr(content_block, "text"): - print(content_block.text, end="", flush=True) - - print() # New line after response - - except Exception as e: - print(f"\r\n❌ Error: {e}") - print("Please check your LiteLLM gateway is running and configured correctly.") diff --git a/cookbook/anthropic_agent_sdk/config.example.yaml b/cookbook/anthropic_agent_sdk/config.example.yaml deleted file mode 100644 index eb1984fc4ea..00000000000 --- a/cookbook/anthropic_agent_sdk/config.example.yaml +++ /dev/null @@ -1,25 +0,0 @@ -model_list: - - model_name: bedrock-claude-sonnet-3.5 - litellm_params: - model: "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0" - aws_region_name: "us-east-1" - - - model_name: bedrock-claude-sonnet-4 - litellm_params: - model: "bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0" - aws_region_name: "us-east-1" - - - model_name: bedrock-claude-sonnet-4.5 - litellm_params: - model: "bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0" - aws_region_name: "us-east-1" - - - model_name: bedrock-claude-opus-4.5 - litellm_params: - model: "bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0" - aws_region_name: "us-east-1" - - - model_name: bedrock-nova-premier - litellm_params: - model: "bedrock/amazon.nova-premier-v1:0" - aws_region_name: "us-east-1" diff --git a/cookbook/anthropic_agent_sdk/main.py b/cookbook/anthropic_agent_sdk/main.py deleted file mode 100644 index 506c6fa07b0..00000000000 --- a/cookbook/anthropic_agent_sdk/main.py +++ /dev/null @@ -1,99 +0,0 @@ -""" -Simple Interactive Claude Agent SDK CLI using LiteLLM Gateway - -This example demonstrates an interactive CLI chat with the Anthropic Agent SDK using LiteLLM as a proxy. -LiteLLM acts as a unified interface, allowing you to use any LLM provider (OpenAI, Azure, Bedrock, etc.) -through the Claude Agent SDK by pointing it to the LiteLLM gateway. -""" - -import asyncio -from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions -from common import ( - Config, - fetch_available_models, - setup_litellm_env, - print_header, - handle_model_list, - handle_model_switch, - stream_response, -) - - -async def interactive_chat(): - """ - Interactive CLI chat with the agent - """ - config = Config() - - # Configure Anthropic SDK to point to LiteLLM gateway - litellm_base_url = setup_litellm_env(config) - - # Fetch available models from proxy - available_models = await fetch_available_models( - litellm_base_url, config.LITELLM_API_KEY - ) - - current_model = config.LITELLM_MODEL - - print_header(litellm_base_url, current_model) - - while True: - # Configure agent options for each conversation - options = ClaudeAgentOptions( - system_prompt="You are a helpful AI assistant. Be concise, accurate, and friendly.", - model=current_model, - max_turns=50, - ) - - # Create agent client - async with ClaudeSDKClient(options=options) as client: - conversation_active = True - - while conversation_active: - # Get user input - try: - user_input = input("\n👤 You: ").strip() - except (EOFError, KeyboardInterrupt): - print("\n\n👋 Goodbye!") - return - - # Handle commands - if user_input.lower() in ["quit", "exit"]: - print("\n👋 Goodbye!") - return - - if user_input.lower() == "clear": - print("\n🔄 Starting new conversation...\n") - conversation_active = False - continue - - if user_input.lower() == "models": - handle_model_list(available_models, current_model) - continue - - if user_input.lower() == "model": - new_model, should_restart = handle_model_switch( - available_models, current_model - ) - if should_restart: - current_model = new_model - conversation_active = False - continue - - if not user_input: - continue - - # Stream response from agent - await stream_response(client, user_input) - - -def main(): - """Run interactive chat""" - try: - asyncio.run(interactive_chat()) - except KeyboardInterrupt: - print("\n\n👋 Goodbye!") - - -if __name__ == "__main__": - main() diff --git a/cookbook/anthropic_agent_sdk/requirements.txt b/cookbook/anthropic_agent_sdk/requirements.txt deleted file mode 100644 index 1e810bb7d99..00000000000 --- a/cookbook/anthropic_agent_sdk/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -claude-agent-sdk -httpx>=0.27.0 diff --git a/cookbook/benchmark/benchmark.py b/cookbook/benchmark/benchmark.py deleted file mode 100644 index b38d185a166..00000000000 --- a/cookbook/benchmark/benchmark.py +++ /dev/null @@ -1,90 +0,0 @@ -from litellm import completion, completion_cost -import time -import click -from tqdm import tqdm -from tabulate import tabulate -from termcolor import colored -import os - - -# Define the list of models to benchmark -# select any LLM listed here: https://docs.litellm.ai/docs/providers -models = ["gpt-3.5-turbo", "claude-2"] - -# Enter LLM API keys -# https://docs.litellm.ai/docs/providers -os.environ["OPENAI_API_KEY"] = "" -os.environ["ANTHROPIC_API_KEY"] = "" - -# List of questions to benchmark (replace with your questions) -questions = ["When will BerriAI IPO?", "When will LiteLLM hit $100M ARR?"] - -# Enter your system prompt here -system_prompt = """ -You are LiteLLMs helpful assistant -""" - - -@click.command() -@click.option( - "--system-prompt", - default="You are a helpful assistant that can answer questions.", - help="System prompt for the conversation.", -) -def main(system_prompt): - for question in questions: - data = [] # Data for the current question - - with tqdm(total=len(models)) as pbar: - for model in models: - colored_description = colored( - f"Running question: {question} for model: {model}", "green" - ) - pbar.set_description(colored_description) - start_time = time.time() - - response = completion( - model=model, - max_tokens=500, - messages=[ - {"role": "system", "content": system_prompt}, - {"role": "user", "content": question}, - ], - ) - - end = time.time() - total_time = end - start_time - cost = completion_cost(completion_response=response) - raw_response = response["choices"][0]["message"]["content"] - - data.append( - { - "Model": colored(model, "light_blue"), - "Response": raw_response, # Colorize the response - "ResponseTime": colored(f"{total_time:.2f} seconds", "red"), - "Cost": colored(f"${cost:.6f}", "green"), # Colorize the cost - } - ) - - pbar.update(1) - - # Separate headers from the data - headers = ["Model", "Response", "Response Time (seconds)", "Cost ($)"] - colwidths = [15, 80, 15, 10] - - # Create a nicely formatted table for the current question - table = tabulate( - [list(d.values()) for d in data], - headers, - tablefmt="grid", - maxcolwidths=colwidths, - ) - - # Print the table for the current question - colored_question = colored(question, "green") - click.echo(f"\nBenchmark Results for '{colored_question}':") - click.echo(table) # Display the formatted table - - -if __name__ == "__main__": - main() diff --git a/cookbook/benchmark/eval_suites_mlflow_autoevals/auto_evals.py b/cookbook/benchmark/eval_suites_mlflow_autoevals/auto_evals.py deleted file mode 100644 index daa38dda585..00000000000 --- a/cookbook/benchmark/eval_suites_mlflow_autoevals/auto_evals.py +++ /dev/null @@ -1,30 +0,0 @@ -from dotenv import load_dotenv - -load_dotenv() - -import litellm - -from autoevals.llm import * - -################### - -# litellm completion call -question = "which country has the highest population" -response = litellm.completion( - model="gpt-3.5-turbo", - messages=[{"role": "user", "content": question}], -) -print(response) -# use the auto eval Factuality() evaluator - -print("calling evaluator") -evaluator = Factuality() -result = evaluator( - output=response.choices[0]["message"][ - "content" - ], # response from litellm.completion() - expected="India", # expected output - input=question, # question passed to litellm.completion -) - -print(result) diff --git a/cookbook/benchmark/readme.md b/cookbook/benchmark/readme.md deleted file mode 100644 index afa59aa91ee..00000000000 --- a/cookbook/benchmark/readme.md +++ /dev/null @@ -1,181 +0,0 @@ -

- LLM-Bench -

-

-

Benchmark LLMs response, cost and response time

-

LLM vs Cost per input + output token ($)

- Screenshot 2023-11-13 at 2 51 06 PM -

- - Bar Graph Excel Sheet here - - -| Model | Provider | Cost per input + output token ($)| -| --- | --- | --- | -| openrouter/mistralai/mistral-7b-instruct | openrouter | 0.0 | -| ollama/llama2 | ollama | 0.0 | -| ollama/llama2:13b | ollama | 0.0 | -| ollama/llama2:70b | ollama | 0.0 | -| ollama/llama2-uncensored | ollama | 0.0 | -| ollama/mistral | ollama | 0.0 | -| ollama/codellama | ollama | 0.0 | -| ollama/orca-mini | ollama | 0.0 | -| ollama/vicuna | ollama | 0.0 | -| perplexity/codellama-34b-instruct | perplexity | 0.0 | -| perplexity/llama-2-13b-chat | perplexity | 0.0 | -| perplexity/llama-2-70b-chat | perplexity | 0.0 | -| perplexity/mistral-7b-instruct | perplexity | 0.0 | -| perplexity/replit-code-v1.5-3b | perplexity | 0.0 | -| text-bison | vertex_ai-text-models | 0.00000025 | -| text-bison@001 | vertex_ai-text-models | 0.00000025 | -| chat-bison | vertex_ai-chat-models | 0.00000025 | -| chat-bison@001 | vertex_ai-chat-models | 0.00000025 | -| chat-bison-32k | vertex_ai-chat-models | 0.00000025 | -| code-bison | vertex_ai-code-text-models | 0.00000025 | -| code-bison@001 | vertex_ai-code-text-models | 0.00000025 | -| code-gecko@001 | vertex_ai-chat-models | 0.00000025 | -| code-gecko@latest | vertex_ai-chat-models | 0.00000025 | -| codechat-bison | vertex_ai-code-chat-models | 0.00000025 | -| codechat-bison@001 | vertex_ai-code-chat-models | 0.00000025 | -| codechat-bison-32k | vertex_ai-code-chat-models | 0.00000025 | -| palm/chat-bison | palm | 0.00000025 | -| palm/chat-bison-001 | palm | 0.00000025 | -| palm/text-bison | palm | 0.00000025 | -| palm/text-bison-001 | palm | 0.00000025 | -| palm/text-bison-safety-off | palm | 0.00000025 | -| palm/text-bison-safety-recitation-off | palm | 0.00000025 | -| anyscale/meta-llama/Llama-2-7b-chat-hf | anyscale | 0.0000003 | -| anyscale/mistralai/Mistral-7B-Instruct-v0.1 | anyscale | 0.0000003 | -| openrouter/meta-llama/llama-2-13b-chat | openrouter | 0.0000004 | -| openrouter/nousresearch/nous-hermes-llama2-13b | openrouter | 0.0000004 | -| deepinfra/meta-llama/Llama-2-7b-chat-hf | deepinfra | 0.0000004 | -| deepinfra/mistralai/Mistral-7B-Instruct-v0.1 | deepinfra | 0.0000004 | -| anyscale/meta-llama/Llama-2-13b-chat-hf | anyscale | 0.0000005 | -| amazon.titan-text-lite-v1 | bedrock | 0.0000007 | -| deepinfra/meta-llama/Llama-2-13b-chat-hf | deepinfra | 0.0000007 | -| text-babbage-001 | text-completion-openai | 0.0000008 | -| text-ada-001 | text-completion-openai | 0.0000008 | -| babbage-002 | text-completion-openai | 0.0000008 | -| openrouter/google/palm-2-chat-bison | openrouter | 0.000001 | -| openrouter/google/palm-2-codechat-bison | openrouter | 0.000001 | -| openrouter/meta-llama/codellama-34b-instruct | openrouter | 0.000001 | -| deepinfra/codellama/CodeLlama-34b-Instruct-hf | deepinfra | 0.0000012 | -| deepinfra/meta-llama/Llama-2-70b-chat-hf | deepinfra | 0.0000016499999999999999 | -| deepinfra/jondurbin/airoboros-l2-70b-gpt4-1.4.1 | deepinfra | 0.0000016499999999999999 | -| anyscale/meta-llama/Llama-2-70b-chat-hf | anyscale | 0.000002 | -| anyscale/codellama/CodeLlama-34b-Instruct-hf | anyscale | 0.000002 | -| gpt-3.5-turbo-1106 | openai | 0.000003 | -| openrouter/meta-llama/llama-2-70b-chat | openrouter | 0.000003 | -| amazon.titan-text-express-v1 | bedrock | 0.000003 | -| gpt-3.5-turbo | openai | 0.0000035 | -| gpt-3.5-turbo-0301 | openai | 0.0000035 | -| gpt-3.5-turbo-0613 | openai | 0.0000035 | -| gpt-3.5-turbo-instruct | text-completion-openai | 0.0000035 | -| openrouter/openai/gpt-3.5-turbo | openrouter | 0.0000035 | -| cohere.command-text-v14 | bedrock | 0.0000035 | -| gpt-3.5-turbo-0613 | openai | 0.0000035 | -| claude-instant-1 | anthropic | 0.00000714 | -| claude-instant-1.2 | anthropic | 0.00000714 | -| openrouter/anthropic/claude-instant-v1 | openrouter | 0.00000714 | -| anthropic.claude-instant-v1 | bedrock | 0.00000714 | -| openrouter/mancer/weaver | openrouter | 0.00001125 | -| j2-mid | ai21 | 0.00002 | -| ai21.j2-mid-v1 | bedrock | 0.000025 | -| openrouter/jondurbin/airoboros-l2-70b-2.1 | openrouter | 0.00002775 | -| command-nightly | cohere | 0.00003 | -| command | cohere | 0.00003 | -| command-light | cohere | 0.00003 | -| command-medium-beta | cohere | 0.00003 | -| command-xlarge-beta | cohere | 0.00003 | -| command-r-plus| cohere | 0.000018 | -| j2-ultra | ai21 | 0.00003 | -| ai21.j2-ultra-v1 | bedrock | 0.0000376 | -| gpt-4-1106-preview | openai | 0.00004 | -| gpt-4-vision-preview | openai | 0.00004 | -| claude-2 | anthropic | 0.0000437 | -| openrouter/anthropic/claude-2 | openrouter | 0.0000437 | -| anthropic.claude-v1 | bedrock | 0.0000437 | -| anthropic.claude-v2 | bedrock | 0.0000437 | -| gpt-4 | openai | 0.00009 | -| gpt-4-0314 | openai | 0.00009 | -| gpt-4-0613 | openai | 0.00009 | -| openrouter/openai/gpt-4 | openrouter | 0.00009 | -| gpt-4-32k | openai | 0.00018 | -| gpt-4-32k-0314 | openai | 0.00018 | -| gpt-4-32k-0613 | openai | 0.00018 | - - - -## Setup: -``` -git clone https://github.com/BerriAI/litellm -``` -cd to `benchmark` dir -``` -cd litellm/cookbook/benchmark -``` - -### Install Dependencies -``` -pip install litellm click tqdm tabulate termcolor -``` - -### Configuration -In `benchmark/benchmark.py` select your LLMs, LLM API Key and questions - -Supported LLMs: https://docs.litellm.ai/docs/providers - -```python -# Define the list of models to benchmark -models = ['gpt-3.5-turbo', 'togethercomputer/llama-2-70b-chat', 'claude-2'] - -# Enter LLM API keys -os.environ['OPENAI_API_KEY'] = "" -os.environ['ANTHROPIC_API_KEY'] = "" -os.environ['TOGETHERAI_API_KEY'] = "" - -# List of questions to benchmark (replace with your questions) -questions = [ - "When will BerriAI IPO?", - "When will LiteLLM hit $100M ARR?" -] - -``` - -## Run LLM-Bench -``` -python3 benchmark.py -``` - -## Expected Output -``` -Running question: When will BerriAI IPO? for model: claude-2: 100%|████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:13<00:00, 4.41s/it] - -Benchmark Results for 'When will BerriAI IPO?': -+-----------------+----------------------------------------------------------------------------------+---------------------------+------------+ -| Model | Response | Response Time (seconds) | Cost ($) | -+=================+==================================================================================+===========================+============+ -| gpt-3.5-turbo | As an AI language model, I cannot provide up-to-date information or predict | 1.55 seconds | $0.000122 | -| | future events. It is best to consult a reliable financial source or contact | | | -| | BerriAI directly for information regarding their IPO plans. | | | -+-----------------+----------------------------------------------------------------------------------+---------------------------+------------+ -| togethercompute | I'm not able to provide information about future IPO plans or dates for BerriAI | 8.52 seconds | $0.000531 | -| r/llama-2-70b-c | or any other company. IPO (Initial Public Offering) plans and timelines are | | | -| hat | typically kept private by companies until they are ready to make a public | | | -| | announcement. It's important to note that IPO plans can change and are subject | | | -| | to various factors, such as market conditions, financial performance, and | | | -| | regulatory approvals. Therefore, it's difficult to predict with certainty when | | | -| | BerriAI or any other company will go public. If you're interested in staying | | | -| | up-to-date with BerriAI's latest news and developments, you may want to follow | | | -| | their official social media accounts, subscribe to their newsletter, or visit | | | -| | their website periodically for updates. | | | -+-----------------+----------------------------------------------------------------------------------+---------------------------+------------+ -| claude-2 | I do not have any information about when or if BerriAI will have an initial | 3.17 seconds | $0.002084 | -| | public offering (IPO). As an AI assistant created by Anthropic to be helpful, | | | -| | harmless, and honest, I do not have insider knowledge about Anthropic's business | | | -| | plans or strategies. | | | -+-----------------+----------------------------------------------------------------------------------+---------------------------+------------+ -``` - -## Support -**🤝 Schedule a 1-on-1 Session:** Book a [1-on-1 session](https://enterprise.litellm.ai/demo) with Krrish and Ishaan, the founders, to discuss any issues, provide feedback, or explore how we can improve LiteLLM for you. diff --git a/cookbook/codellama-server/README.MD b/cookbook/codellama-server/README.MD deleted file mode 100644 index 82a7e62f40a..00000000000 --- a/cookbook/codellama-server/README.MD +++ /dev/null @@ -1,153 +0,0 @@ -# CodeLlama Server: Streaming, Caching, Model Fallbacks (OpenAI + Anthropic), Prompt-tracking - -Works with: Anthropic, Huggingface, Cohere, TogetherAI, Azure, OpenAI, etc. - -[![PyPI Version](https://img.shields.io/pypi/v/litellm.svg)](https://pypi.org/project/litellm/) -[![PyPI Version](https://img.shields.io/badge/stable%20version-v0.1.345-blue?color=green&link=https://pypi.org/project/litellm/0.1.1/)](https://pypi.org/project/litellm/0.1.1/) -![Downloads](https://img.shields.io/pypi/dm/litellm) - -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/HuDPw-?referralCode=jch2ME) - -**LIVE DEMO** - https://litellm.ai/playground - -## What does CodeLlama Server do - -- Uses Together AI's CodeLlama to answer coding questions, with GPT-4 + Claude-2 as backups (you can easily switch this to any model from Huggingface, Replicate, Cohere, AI21, Azure, OpenAI, etc.) -- Sets default system prompt for guardrails `system_prompt = "Only respond to questions about code. Say 'I don't know' to anything outside of that."` -- Integrates with Promptlayer for model + prompt tracking -- Example output - -Code Output - -- **Consistent Input/Output** Format - - Call all models using the OpenAI format - `completion(model, messages)` - - Text responses will always be available at `['choices'][0]['message']['content']` - - Stream responses will always be available at `['choices'][0]['delta']['content']` -- **Error Handling** Using Model Fallbacks (if `CodeLlama` fails, try `GPT-4`) with cooldowns, and retries -- **Prompt Logging** - Log successful completions to promptlayer for testing + iterating on your prompts in production! (Learn more: https://litellm.readthedocs.io/en/latest/advanced/ - - **Example: Logs sent to PromptLayer** - - Prompt Logging - - -- **Token Usage & Spend** - Track Input + Completion tokens used + Spend/model - https://docs.litellm.ai/docs/token_usage -- **Caching** - Provides in-memory cache + GPT-Cache integration for more advanced usage - https://docs.litellm.ai/docs/caching/gpt_cache - -- **Streaming & Async Support** - Return generators to stream text responses - TEST IT 👉 https://litellm.ai/ - -## API Endpoints - -### `/chat/completions` (POST) - -This endpoint is used to generate chat completions for 50+ support LLM API Models. Use llama2, GPT-4, Claude2 etc - -#### Input - -This API endpoint accepts all inputs in raw JSON and expects the following inputs - -- `prompt` (string, required): The user's coding related question -- Additional Optional parameters: `temperature`, `functions`, `function_call`, `top_p`, `n`, `stream`. See the full list of supported inputs here: https://litellm.readthedocs.io/en/latest/input/ - -#### Example JSON body - -For claude-2 - -```json -{ - "prompt": "write me a function to print hello world" -} -``` - -### Making an API request to the Code-Gen Server - -```python -import requests -import json - -url = "localhost:4000/chat/completions" - -payload = json.dumps({ - "prompt": "write me a function to print hello world" -}) -headers = { - 'Content-Type': 'application/json' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text) - -``` - -### Output [Response Format] - -Responses from the server are given in the following format. -All responses from the server are returned in the following format (for all LLM models). More info on output here: https://litellm.readthedocs.io/en/latest/output/ - -```json -{ - "choices": [ - { - "finish_reason": "stop", - "index": 0, - "message": { - "content": ".\n\n```\ndef print_hello_world():\n print(\"hello world\")\n", - "role": "assistant" - } - } - ], - "created": 1693279694.6474009, - "model": "togethercomputer/CodeLlama-34b-Instruct", - "usage": { - "completion_tokens": 14, - "prompt_tokens": 28, - "total_tokens": 42 - } -} -``` - -## Installation & Usage - -### Running Locally - -1. Clone liteLLM repository to your local machine: - ``` - git clone https://github.com/BerriAI/litellm-CodeLlama-server - ``` -2. Install the required dependencies using pip - ``` - pip install requirements.txt - ``` -3. Set your LLM API keys - ``` - os.environ['OPENAI_API_KEY]` = "YOUR_API_KEY" - or - set OPENAI_API_KEY in your .env file - ``` -4. Run the server: - ``` - python main.py - ``` - -## Deploying - -1. Quick Start: Deploy on Railway - - [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/HuDPw-?referralCode=jch2ME) - -2. `GCP`, `AWS`, `Azure` - This project includes a `Dockerfile` allowing you to build and deploy a Docker Project on your providers - -# Support / Talk with founders - -- [Our calendar 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version) -- [Community Discord 💭](https://discord.gg/wuPM9dRgDw) -- Our emails ✉️ ishaan@berri.ai / krrish@berri.ai - -## Roadmap - -- [ ] Implement user-based rate-limiting -- [ ] Spending controls per project - expose key creation endpoint -- [ ] Need to store a keys db -> mapping created keys to their alias (i.e. project name) -- [ ] Easily add new models as backups / as the entry-point (add this to the available model list) diff --git a/cookbook/codellama-server/imgs/code-output.png b/cookbook/codellama-server/imgs/code-output.png deleted file mode 100644 index 67e298bd3be..00000000000 Binary files a/cookbook/codellama-server/imgs/code-output.png and /dev/null differ diff --git a/cookbook/codellama-server/imgs/promptlayer_logging.png b/cookbook/codellama-server/imgs/promptlayer_logging.png deleted file mode 100644 index 26b046ac448..00000000000 Binary files a/cookbook/codellama-server/imgs/promptlayer_logging.png and /dev/null differ diff --git a/cookbook/codellama-server/main.py b/cookbook/codellama-server/main.py deleted file mode 100644 index d05d6752300..00000000000 --- a/cookbook/codellama-server/main.py +++ /dev/null @@ -1,102 +0,0 @@ -import traceback -from flask import Flask, request, Response -from flask_cors import CORS -import litellm -from util import handle_error -from litellm import completion -import os -import dotenv -import time -import json - -dotenv.load_dotenv() - -# TODO: set your keys in .env or here: -# os.environ["OPENAI_API_KEY"] = "" # set your openai key here -# os.environ["ANTHROPIC_API_KEY"] = "" # set your anthropic key here -# os.environ["TOGETHER_AI_API_KEY"] = "" # set your together ai key here -# see supported models / keys here: https://litellm.readthedocs.io/en/latest/supported/ -######### ENVIRONMENT VARIABLES ########## -verbose = True - -# litellm.caching_with_models = True # CACHING: caching_with_models Keys in the cache are messages + model. - to learn more: https://docs.litellm.ai/docs/caching/ -######### PROMPT LOGGING ########## -os.environ["PROMPTLAYER_API_KEY"] = ( - "" # set your promptlayer key here - https://promptlayer.com/ -) - -# set callbacks -litellm.success_callback = ["promptlayer"] -############ HELPER FUNCTIONS ################################### - - -def print_verbose(print_statement): - if verbose: - print(print_statement) - - -app = Flask(__name__) -CORS(app) - - -@app.route("/") -def index(): - return "received!", 200 - - -def data_generator(response): - for chunk in response: - yield f"data: {json.dumps(chunk)}\n\n" - - -@app.route("/chat/completions", methods=["POST"]) -def api_completion(): - data = request.json - start_time = time.time() - if data.get("stream") == "True": - data["stream"] = True # convert to boolean - try: - if "prompt" not in data: - raise ValueError("data needs to have prompt") - data["model"] = ( - "togethercomputer/CodeLlama-34b-Instruct" # by default use Together AI's CodeLlama model - https://api.together.xyz/playground/chat?model=togethercomputer%2FCodeLlama-34b-Instruct - ) - # COMPLETION CALL - system_prompt = "Only respond to questions about code. Say 'I don't know' to anything outside of that." - messages = [ - {"role": "system", "content": system_prompt}, - {"role": "user", "content": data.pop("prompt")}, - ] - data["messages"] = messages - print(f"data: {data}") - response = completion(**data) - ## LOG SUCCESS - end_time = time.time() - if ( - "stream" in data and data["stream"] == True - ): # use generate_responses to stream responses - return Response(data_generator(response), mimetype="text/event-stream") - except Exception: - # call handle_error function - print_verbose(f"Got Error api_completion(): {traceback.format_exc()}") - ## LOG FAILURE - end_time = time.time() - traceback_exception = traceback.format_exc() - return handle_error(data=data) - return response - - -@app.route("/get_models", methods=["POST"]) -def get_models(): - try: - return litellm.model_list - except Exception as e: - traceback.print_exc() - response = {"error": str(e)} - return response, 200 - - -if __name__ == "__main__": - from waitress import serve - - serve(app, host="0.0.0.0", port=4000, threads=500) diff --git a/cookbook/community-resources/get_hf_models.py b/cookbook/community-resources/get_hf_models.py deleted file mode 100644 index 8c75a241227..00000000000 --- a/cookbook/community-resources/get_hf_models.py +++ /dev/null @@ -1,89 +0,0 @@ -import requests - - -def get_next_url(response): - """ - Function to get 'next' url from Link header - :param response: response from requests - :return: next url or None - """ - if "link" not in response.headers: - return None - headers = response.headers - - next_url = headers["Link"] - print(next_url) - start_index = next_url.find("<") - end_index = next_url.find(">") - - return next_url[1:end_index] - - -def get_models(url): - """ - Function to retrieve all models from paginated endpoint - :param url: base url to make GET request - :return: list of all models - """ - models = [] - while url: - response = requests.get(url) - if response.status_code != 200: - print(f"Failed to retrieve data. Status code: {response.status_code}") - return models - payload = response.json() - url = get_next_url(response) - models.extend(payload) - return models - - -def get_cleaned_models(models): - """ - Function to clean retrieved models - :param models: list of retrieved models - :return: list of cleaned models - """ - cleaned_models = [] - for model in models: - cleaned_models.append(model["id"]) - return cleaned_models - - -# Get text-generation models -url = "https://huggingface.co/api/models?filter=text-generation-inference" -text_generation_models = get_models(url) -cleaned_text_generation_models = get_cleaned_models(text_generation_models) - -print(cleaned_text_generation_models) - - -# Get conversational models -url = "https://huggingface.co/api/models?filter=conversational" -conversational_models = get_models(url) -cleaned_conversational_models = get_cleaned_models(conversational_models) - -print(cleaned_conversational_models) - - -def write_to_txt(cleaned_models, filename): - """ - Function to write the contents of a list to a text file - :param cleaned_models: list of cleaned models - :param filename: name of the text file - """ - with open(filename, "w") as f: - for item in cleaned_models: - f.write("%s\n" % item) - - -# Write contents of cleaned_text_generation_models to text_generation_models.txt -write_to_txt( - cleaned_text_generation_models, - "huggingface_llms_metadata/hf_text_generation_models.txt", -) - -# Write contents of cleaned_conversational_models to conversational_models.txt -write_to_txt( - cleaned_conversational_models, - "huggingface_llms_metadata/hf_conversational_models.txt", -) diff --git a/cookbook/community-resources/max_tokens.json b/cookbook/community-resources/max_tokens.json deleted file mode 100644 index 289f8faf9e3..00000000000 --- a/cookbook/community-resources/max_tokens.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "gpt-3.5-turbo": { - "max_tokens": 4000, - "input_cost_per_token": 0.0000015, - "output_cost_per_token": 0.000002 - }, - "gpt-3.5-turbo-0613": { - "max_tokens": 4000, - "input_cost_per_token": 0.0000015, - "output_cost_per_token": 0.000002 - }, - "gpt-3.5-turbo-0301": { - "max_tokens": 4000, - "input_cost_per_token": 0.0000015, - "output_cost_per_token": 0.000002 - }, - "gpt-3.5-turbo-16k": { - "max_tokens": 16000, - "input_cost_per_token": 0.000003, - "output_cost_per_token": 0.000004 - }, - "gpt-3.5-turbo-16k-0613": { - "max_tokens": 16000, - "input_cost_per_token": 0.000003, - "output_cost_per_token": 0.000004 - }, - "gpt-4": { - "max_tokens": 8000, - "input_cost_per_token": 0.000003, - "output_cost_per_token": 0.00006 - }, - "gpt-4-0613": { - "max_tokens": 8000, - "input_cost_per_token": 0.000003, - "output_cost_per_token": 0.00006 - }, - "gpt-4-32k": { - "max_tokens": 8000, - "input_cost_per_token": 0.00006, - "output_cost_per_token": 0.00012 - }, - "claude-instant-1": { - "max_tokens": 100000, - "input_cost_per_token": 0.00000163, - "output_cost_per_token": 0.00000551 - }, - "claude-2": { - "max_tokens": 100000, - "input_cost_per_token": 0.00001102, - "output_cost_per_token": 0.00003268 - }, - "text-bison-001": { - "max_tokens": 8192, - "input_cost_per_token": 0.000004, - "output_cost_per_token": 0.000004 - }, - "chat-bison-001": { - "max_tokens": 4096, - "input_cost_per_token": 0.000002, - "output_cost_per_token": 0.000002 - }, - "command-nightly": { - "max_tokens": 4096, - "input_cost_per_token": 0.000015, - "output_cost_per_token": 0.000015 - }, - "replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1": { - "max_tokens": 4096, - "input_cost_per_token": 0.00000608, - "output_cost_per_token": 0.00000608 - }, - "together-ai-up-to-3b": { - "input_cost_per_token": 0.0000001, - "output_cost_per_token": 0.0000001 - }, - "together-ai-3.1b-7b": { - "input_cost_per_token": 0.0000002, - "output_cost_per_token": 0.0000002 - }, - "together-ai-7.1b-20b": { - "max_tokens": 1000, - "input_cost_per_token": 0.0000004, - "output_cost_per_token": 0.0000004 - }, - "together-ai-20.1b-40b": { - "input_cost_per_token": 0.000001, - "output_cost_per_token": 0.000001 - }, - "together-ai-40.1b-70b": { - "input_cost_per_token": 0.000003, - "output_cost_per_token": 0.000003 - } -} diff --git a/cookbook/gollem_go_agent_framework/README.md b/cookbook/gollem_go_agent_framework/README.md deleted file mode 100644 index 729f985d086..00000000000 --- a/cookbook/gollem_go_agent_framework/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# Gollem Go Agent Framework with LiteLLM - -A working example showing how to use [gollem](https://github.com/fugue-labs/gollem), a production-grade Go agent framework, with LiteLLM as a proxy gateway. This lets Go developers access 100+ LLM providers through a single proxy while keeping compile-time type safety for tools and structured output. - -## Quick Start - -### 1. Start LiteLLM Proxy - -```bash -# Simple start with a single model -litellm --model gpt-4o - -# Or with the example config for multi-provider access -litellm --config proxy_config.yaml -``` - -### 2. Run the examples - -```bash -# Install Go dependencies -go mod tidy - -# Basic agent -go run ./basic - -# Agent with type-safe tools -go run ./tools - -# Streaming responses -go run ./streaming -``` - -## Configuration - -The included `proxy_config.yaml` sets up three providers through LiteLLM: - -```yaml -model_list: - - model_name: gpt-4o # OpenAI - - model_name: claude-sonnet # Anthropic - - model_name: gemini-pro # Google Vertex AI -``` - -Switch providers in Go by changing a single string — no code changes needed: - -```go -model := openai.NewLiteLLM("http://localhost:4000", - openai.WithModel("gpt-4o"), // OpenAI - // openai.WithModel("claude-sonnet"), // Anthropic - // openai.WithModel("gemini-pro"), // Google -) -``` - -## Examples - -### `basic/` — Basic Agent - -Connects gollem to LiteLLM and runs a simple prompt. Demonstrates the `NewLiteLLM` constructor and basic agent creation. - -### `tools/` — Type-Safe Tools - -Shows gollem's compile-time type-safe tool framework working through LiteLLM's tool-use passthrough. The tool parameters are Go structs with JSON tags — the schema is generated automatically at compile time. - -### `streaming/` — Streaming Responses - -Real-time token streaming using Go 1.23+ range-over-function iterators, proxied through LiteLLM's SSE passthrough. - -## How It Works - -Gollem's `openai.NewLiteLLM()` constructor creates an OpenAI-compatible provider pointed at your LiteLLM proxy. Since LiteLLM speaks the OpenAI API protocol, everything works out of the box: - -- **Chat completions** — standard request/response -- **Tool use** — LiteLLM passes tool definitions and calls through transparently -- **Streaming** — Server-Sent Events proxied through LiteLLM -- **Structured output** — JSON schema response format works with supporting models - -``` -Go App (gollem) → LiteLLM Proxy → OpenAI / Anthropic / Google / ... -``` - -## Why Use This? - -- **Type-safe Go**: Compile-time type checking for tools, structured output, and agent configuration — no runtime surprises -- **Single proxy, many models**: Switch between OpenAI, Anthropic, Google, and 100+ other providers by changing a model name string -- **Zero-dependency core**: gollem's core has no external dependencies — just stdlib -- **Single binary deployment**: `go build` produces one binary, no pip/venv/Docker needed -- **Cost tracking & rate limiting**: LiteLLM handles cost tracking, rate limits, and fallbacks at the proxy layer - -## Environment Variables - -```bash -# Required for providers you want to use (set in LiteLLM config or env) -export OPENAI_API_KEY="sk-..." -export ANTHROPIC_API_KEY="sk-ant-..." - -# Optional: point to a non-default LiteLLM proxy -export LITELLM_PROXY_URL="http://localhost:4000" -``` - -## Troubleshooting - -**Connection errors?** -- Make sure LiteLLM is running: `litellm --model gpt-4o` -- Check the URL is correct (default: `http://localhost:4000`) - -**Model not found?** -- Verify the model name matches what's configured in LiteLLM -- Run `curl http://localhost:4000/models` to see available models - -**Tool calls not working?** -- Ensure the underlying model supports tool use (GPT-4o, Claude, Gemini) -- Check LiteLLM logs for any provider-specific errors - -## Learn More - -- [gollem GitHub](https://github.com/fugue-labs/gollem) -- [gollem API Reference](https://pkg.go.dev/github.com/fugue-labs/gollem/core) -- [LiteLLM Proxy Docs](https://docs.litellm.ai/docs/simple_proxy) -- [LiteLLM Supported Models](https://docs.litellm.ai/docs/providers) diff --git a/cookbook/gollem_go_agent_framework/basic/main.go b/cookbook/gollem_go_agent_framework/basic/main.go deleted file mode 100644 index 838149a8ff9..00000000000 --- a/cookbook/gollem_go_agent_framework/basic/main.go +++ /dev/null @@ -1,41 +0,0 @@ -// Basic gollem agent connected to a LiteLLM proxy. -// -// Usage: -// -// litellm --model gpt-4o # start proxy in another terminal -// go run ./basic -package main - -import ( - "context" - "fmt" - "log" - "os" - - "github.com/fugue-labs/gollem/core" - "github.com/fugue-labs/gollem/provider/openai" -) - -func main() { - proxyURL := "http://localhost:4000" - if u := os.Getenv("LITELLM_PROXY_URL"); u != "" { - proxyURL = u - } - - // Connect to LiteLLM proxy. NewLiteLLM creates an OpenAI-compatible - // provider pointed at the given URL. - model := openai.NewLiteLLM(proxyURL, - openai.WithModel("gpt-4o"), // any model name configured in LiteLLM - ) - - // Create and run a simple agent. - agent := core.NewAgent[string](model, - core.WithSystemPrompt[string]("You are a helpful assistant. Be concise."), - ) - - result, err := agent.Run(context.Background(), "Explain quantum computing in two sentences.") - if err != nil { - log.Fatal(err) - } - fmt.Println(result.Output) -} diff --git a/cookbook/gollem_go_agent_framework/go.mod b/cookbook/gollem_go_agent_framework/go.mod deleted file mode 100644 index a8dc9365d7f..00000000000 --- a/cookbook/gollem_go_agent_framework/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/BerriAI/litellm/cookbook/gollem_go_agent_framework - -go 1.26.3 - -require github.com/fugue-labs/gollem v0.1.0 diff --git a/cookbook/gollem_go_agent_framework/go.sum b/cookbook/gollem_go_agent_framework/go.sum deleted file mode 100644 index 1eb6c5ac9fc..00000000000 --- a/cookbook/gollem_go_agent_framework/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/fugue-labs/gollem v0.1.0 h1:QexYnvkb44QZFEljgAePqMIGZjgsbk0Y5GJ2jYYgfa8= -github.com/fugue-labs/gollem v0.1.0/go.mod h1:htW1YO81uysSKVOkYJtxhGCFrzm+36HBFxEWuECoHKQ= diff --git a/cookbook/gollem_go_agent_framework/proxy_config.yaml b/cookbook/gollem_go_agent_framework/proxy_config.yaml deleted file mode 100644 index 18265a002bc..00000000000 --- a/cookbook/gollem_go_agent_framework/proxy_config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -model_list: - - model_name: gpt-4o - litellm_params: - model: openai/gpt-4o - api_key: os.environ/OPENAI_API_KEY - - - model_name: claude-sonnet - litellm_params: - model: anthropic/claude-sonnet-4-20250514 - api_key: os.environ/ANTHROPIC_API_KEY - - - model_name: gemini-pro - litellm_params: - model: vertex_ai/gemini-2.0-flash - vertex_project: my-project - vertex_location: us-central1 diff --git a/cookbook/gollem_go_agent_framework/streaming/main.go b/cookbook/gollem_go_agent_framework/streaming/main.go deleted file mode 100644 index 42bc9bbe34a..00000000000 --- a/cookbook/gollem_go_agent_framework/streaming/main.go +++ /dev/null @@ -1,56 +0,0 @@ -// Streaming responses from gollem through LiteLLM. -// -// Uses Go 1.23+ range-over-function iterators for real-time token -// streaming via LiteLLM's SSE passthrough. -// -// Usage: -// -// litellm --model gpt-4o -// go run ./streaming -package main - -import ( - "context" - "fmt" - "log" - "os" - - "github.com/fugue-labs/gollem/core" - "github.com/fugue-labs/gollem/provider/openai" -) - -func main() { - proxyURL := "http://localhost:4000" - if u := os.Getenv("LITELLM_PROXY_URL"); u != "" { - proxyURL = u - } - - model := openai.NewLiteLLM(proxyURL, - openai.WithModel("gpt-4o"), - ) - - agent := core.NewAgent[string](model) - - // RunStream returns a streaming result that yields tokens as they arrive. - stream, err := agent.RunStream(context.Background(), "Write a haiku about distributed systems") - if err != nil { - log.Fatal(err) - } - - // StreamText yields text chunks in real-time. - // The boolean argument controls whether deltas (true) or accumulated - // text (false) is returned. - fmt.Print("Response: ") - for text, err := range stream.StreamText(true) { - if err != nil { - log.Fatal(err) - } - fmt.Print(text) - } - fmt.Println() - - // After streaming completes, the final response is available. - resp := stream.Response() - fmt.Printf("\nTokens used: input=%d, output=%d\n", - resp.Usage.InputTokens, resp.Usage.OutputTokens) -} diff --git a/cookbook/gollem_go_agent_framework/tools/main.go b/cookbook/gollem_go_agent_framework/tools/main.go deleted file mode 100644 index ed41a95ffef..00000000000 --- a/cookbook/gollem_go_agent_framework/tools/main.go +++ /dev/null @@ -1,64 +0,0 @@ -// Gollem agent with type-safe tools through LiteLLM. -// -// The tool parameters are Go structs — gollem generates the JSON schema -// automatically at compile time. LiteLLM passes tool definitions through -// transparently to the underlying provider. -// -// Usage: -// -// litellm --model gpt-4o -// go run ./tools -package main - -import ( - "context" - "fmt" - "log" - "os" - - "github.com/fugue-labs/gollem/core" - "github.com/fugue-labs/gollem/provider/openai" -) - -// WeatherParams defines the tool's input schema via struct tags. -// The JSON schema is generated at compile time — no runtime reflection needed. -type WeatherParams struct { - City string `json:"city" description:"City name to get weather for"` - Unit string `json:"unit,omitempty" description:"Temperature unit: celsius or fahrenheit"` -} - -func main() { - proxyURL := "http://localhost:4000" - if u := os.Getenv("LITELLM_PROXY_URL"); u != "" { - proxyURL = u - } - - model := openai.NewLiteLLM(proxyURL, - openai.WithModel("gpt-4o"), - ) - - // Define a type-safe tool. The function signature enforces correct types. - weatherTool := core.FuncTool[WeatherParams]( - "get_weather", - "Get current weather for a city", - func(ctx context.Context, p WeatherParams) (string, error) { - unit := p.Unit - if unit == "" { - unit = "fahrenheit" - } - // In production, call a real weather API here. - return fmt.Sprintf("Weather in %s: 72°F (22°C), sunny", p.City), nil - }, - ) - - agent := core.NewAgent[string](model, - core.WithTools[string](weatherTool), - core.WithSystemPrompt[string]("You are a helpful weather assistant. Use the get_weather tool to answer weather questions."), - ) - - result, err := agent.Run(context.Background(), "What's the weather like in San Francisco and Tokyo?") - if err != nil { - log.Fatal(err) - } - fmt.Println(result.Output) -} diff --git a/cookbook/google_adk_litellm_tutorial.ipynb b/cookbook/google_adk_litellm_tutorial.ipynb deleted file mode 100644 index 27914edbba8..00000000000 --- a/cookbook/google_adk_litellm_tutorial.ipynb +++ /dev/null @@ -1,412 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "7aa8875d", - "metadata": {}, - "source": [ - "# Google ADK with LiteLLM\n", - "\n", - "Use Google ADK with LiteLLM Python SDK, LiteLLM Proxy.\n", - "\n", - "This tutorial shows you how to create intelligent agents using Agent Development Kit (ADK) with support for multiple Large Language Model (LLM) providers through LiteLLM." - ] - }, - { - "cell_type": "markdown", - "id": "a4d249c3", - "metadata": {}, - "source": [ - "## Overview\n", - "\n", - "ADK (Agent Development Kit) allows you to build intelligent agents powered by LLMs. By integrating with LiteLLM, you can:\n", - "\n", - "- Use multiple LLM providers (OpenAI, Anthropic, Google, etc.)\n", - "- Switch easily between models from different providers\n", - "- Connect to a LiteLLM proxy for centralized model management" - ] - }, - { - "cell_type": "markdown", - "id": "a0bbb56b", - "metadata": {}, - "source": [ - "## Prerequisites\n", - "\n", - "- Python environment setup\n", - "- API keys for model providers (OpenAI, Anthropic, Google AI Studio)\n", - "- Basic understanding of LLMs and agent concepts" - ] - }, - { - "cell_type": "markdown", - "id": "7fee50a8", - "metadata": {}, - "source": [ - "## Installation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "44106a23", - "metadata": {}, - "outputs": [], - "source": [ - "# Install dependencies\n", - "!pip install google-adk litellm" - ] - }, - { - "cell_type": "markdown", - "id": "2171740a", - "metadata": {}, - "source": [ - "## 1. Setting Up Environment" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6695807e", - "metadata": {}, - "outputs": [], - "source": [ - "# Setup environment and API keys\n", - "import os\n", - "import asyncio\n", - "from google.adk.agents import Agent\n", - "from google.adk.models.lite_llm import LiteLlm # For multi-model support\n", - "from google.adk.sessions import InMemorySessionService\n", - "from google.adk.runners import Runner\n", - "from google.genai import types\n", - "import litellm # Import for proxy configuration\n", - "\n", - "# Set your API keys\n", - "os.environ['GOOGLE_API_KEY'] = 'your-google-api-key' # For Gemini models\n", - "os.environ['OPENAI_API_KEY'] = 'your-openai-api-key' # For OpenAI models\n", - "os.environ['ANTHROPIC_API_KEY'] = 'your-anthropic-api-key' # For Claude models\n", - "\n", - "# Define model constants for cleaner code\n", - "MODEL_GEMINI_PRO = 'gemini-1.5-pro'\n", - "MODEL_GPT_4O = 'openai/gpt-4o'\n", - "MODEL_CLAUDE_SONNET = 'anthropic/claude-3-sonnet-20240229'" - ] - }, - { - "cell_type": "markdown", - "id": "d2b1ed59", - "metadata": {}, - "source": [ - "## 2. Define a Simple Tool" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "04b3ef5b", - "metadata": {}, - "outputs": [], - "source": [ - "# Weather tool implementation\n", - "def get_weather(city: str) -> dict:\n", - " \"\"\"Retrieves the current weather report for a specified city.\"\"\"\n", - " print(f'Tool: get_weather called for city: {city}')\n", - "\n", - " # Mock weather data\n", - " mock_weather_db = {\n", - " 'newyork': {\n", - " 'status': 'success',\n", - " 'report': 'The weather in New York is sunny with a temperature of 25°C.'\n", - " },\n", - " 'london': {\n", - " 'status': 'success',\n", - " 'report': \"It's cloudy in London with a temperature of 15°C.\"\n", - " },\n", - " 'tokyo': {\n", - " 'status': 'success',\n", - " 'report': 'Tokyo is experiencing light rain and a temperature of 18°C.'\n", - " },\n", - " }\n", - "\n", - " city_normalized = city.lower().replace(' ', '')\n", - "\n", - " if city_normalized in mock_weather_db:\n", - " return mock_weather_db[city_normalized]\n", - " else:\n", - " return {\n", - " 'status': 'error',\n", - " 'error_message': f\"Sorry, I don't have weather information for '{city}'.\"\n", - " }" - ] - }, - { - "cell_type": "markdown", - "id": "727b15c9", - "metadata": {}, - "source": [ - "## 3. Helper Function for Agent Interaction" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f77449bf", - "metadata": {}, - "outputs": [], - "source": [ - "# Agent interaction helper function\n", - "async def call_agent_async(query: str, runner, user_id, session_id):\n", - " \"\"\"Sends a query to the agent and prints the final response.\"\"\"\n", - " print(f'\\n>>> User Query: {query}')\n", - "\n", - " content = types.Content(role='user', parts=[types.Part(text=query)])\n", - " final_response_text = 'Agent did not produce a final response.'\n", - "\n", - " async for event in runner.run_async(\n", - " user_id=user_id,\n", - " session_id=session_id,\n", - " new_message=content\n", - " ):\n", - " if event.is_final_response():\n", - " if event.content and event.content.parts:\n", - " final_response_text = event.content.parts[0].text\n", - " break\n", - " print(f'<<< Agent Response: {final_response_text}')" - ] - }, - { - "cell_type": "markdown", - "id": "0ac87987", - "metadata": {}, - "source": [ - "## 4. Using Different Model Providers with ADK\n", - "\n", - "### 4.1 Using OpenAI Models" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e167d557", - "metadata": {}, - "outputs": [], - "source": [ - "# OpenAI model implementation\n", - "weather_agent_gpt = Agent(\n", - " name='weather_agent_gpt',\n", - " model=LiteLlm(model=MODEL_GPT_4O),\n", - " description='Provides weather information using OpenAI\\'s GPT.',\n", - " instruction=(\n", - " 'You are a helpful weather assistant powered by GPT-4o. '\n", - " \"Use the 'get_weather' tool for city weather requests. \"\n", - " 'Present information clearly.'\n", - " ),\n", - " tools=[get_weather],\n", - ")\n", - "\n", - "session_service_gpt = InMemorySessionService()\n", - "session_gpt = session_service_gpt.create_session(\n", - " app_name='weather_app', user_id='user_1', session_id='session_gpt'\n", - ")\n", - "\n", - "runner_gpt = Runner(\n", - " agent=weather_agent_gpt,\n", - " app_name='weather_app',\n", - " session_service=session_service_gpt,\n", - ")\n", - "\n", - "async def test_gpt_agent():\n", - " print('\\n--- Testing GPT Agent ---')\n", - " await call_agent_async(\n", - " \"What's the weather in London?\",\n", - " runner=runner_gpt,\n", - " user_id='user_1',\n", - " session_id='session_gpt',\n", - " )\n", - "\n", - "# To execute in a notebook cell:\n", - "# await test_gpt_agent()" - ] - }, - { - "cell_type": "markdown", - "id": "f9cb0613", - "metadata": {}, - "source": [ - "### 4.2 Using Anthropic Models" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1c653665", - "metadata": {}, - "outputs": [], - "source": [ - "# Anthropic model implementation\n", - "weather_agent_claude = Agent(\n", - " name='weather_agent_claude',\n", - " model=LiteLlm(model=MODEL_CLAUDE_SONNET),\n", - " description='Provides weather information using Anthropic\\'s Claude.',\n", - " instruction=(\n", - " 'You are a helpful weather assistant powered by Claude Sonnet. '\n", - " \"Use the 'get_weather' tool for city weather requests. \"\n", - " 'Present information clearly.'\n", - " ),\n", - " tools=[get_weather],\n", - ")\n", - "\n", - "session_service_claude = InMemorySessionService()\n", - "session_claude = session_service_claude.create_session(\n", - " app_name='weather_app', user_id='user_1', session_id='session_claude'\n", - ")\n", - "\n", - "runner_claude = Runner(\n", - " agent=weather_agent_claude,\n", - " app_name='weather_app',\n", - " session_service=session_service_claude,\n", - ")\n", - "\n", - "async def test_claude_agent():\n", - " print('\\n--- Testing Claude Agent ---')\n", - " await call_agent_async(\n", - " \"What's the weather in Tokyo?\",\n", - " runner=runner_claude,\n", - " user_id='user_1',\n", - " session_id='session_claude',\n", - " )\n", - "\n", - "# To execute in a notebook cell:\n", - "# await test_claude_agent()" - ] - }, - { - "cell_type": "markdown", - "id": "bf9d863b", - "metadata": {}, - "source": [ - "### 4.3 Using Google's Gemini Models" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "83f49d0a", - "metadata": {}, - "outputs": [], - "source": [ - "# Gemini model implementation\n", - "weather_agent_gemini = Agent(\n", - " name='weather_agent_gemini',\n", - " model=MODEL_GEMINI_PRO,\n", - " description='Provides weather information using Google\\'s Gemini.',\n", - " instruction=(\n", - " 'You are a helpful weather assistant powered by Gemini Pro. '\n", - " \"Use the 'get_weather' tool for city weather requests. \"\n", - " 'Present information clearly.'\n", - " ),\n", - " tools=[get_weather],\n", - ")\n", - "\n", - "session_service_gemini = InMemorySessionService()\n", - "session_gemini = session_service_gemini.create_session(\n", - " app_name='weather_app', user_id='user_1', session_id='session_gemini'\n", - ")\n", - "\n", - "runner_gemini = Runner(\n", - " agent=weather_agent_gemini,\n", - " app_name='weather_app',\n", - " session_service=session_service_gemini,\n", - ")\n", - "\n", - "async def test_gemini_agent():\n", - " print('\\n--- Testing Gemini Agent ---')\n", - " await call_agent_async(\n", - " \"What's the weather in New York?\",\n", - " runner=runner_gemini,\n", - " user_id='user_1',\n", - " session_id='session_gemini',\n", - " )\n", - "\n", - "# To execute in a notebook cell:\n", - "# await test_gemini_agent()" - ] - }, - { - "cell_type": "markdown", - "id": "93bc5fd0", - "metadata": {}, - "source": [ - "## 5. Using LiteLLM Proxy with ADK" - ] - }, - { - "cell_type": "markdown", - "id": "b4275151", - "metadata": {}, - "source": [ - "| Variable | Description |\n", - "|----------|-------------|\n", - "| `LITELLM_PROXY_API_KEY` | The API key for the LiteLLM proxy |\n", - "| `LITELLM_PROXY_API_BASE` | The base URL for the LiteLLM proxy |\n", - "| `USE_LITELLM_PROXY` or `litellm.use_litellm_proxy` | When set to True, your request will be sent to LiteLLM proxy. |" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "256530a6", - "metadata": {}, - "outputs": [], - "source": [ - "# LiteLLM proxy integration\n", - "os.environ['LITELLM_PROXY_API_KEY'] = 'your-litellm-proxy-api-key'\n", - "os.environ['LITELLM_PROXY_API_BASE'] = 'your-litellm-proxy-url' # e.g., 'http://localhost:4000'\n", - "litellm.use_litellm_proxy = True\n", - "\n", - "weather_agent_proxy_env = Agent(\n", - " name='weather_agent_proxy_env',\n", - " model=LiteLlm(model='gpt-4o'),\n", - " description='Provides weather information using a model from LiteLLM proxy.',\n", - " instruction=(\n", - " 'You are a helpful weather assistant. '\n", - " \"Use the 'get_weather' tool for city weather requests. \"\n", - " 'Present information clearly.'\n", - " ),\n", - " tools=[get_weather],\n", - ")\n", - "\n", - "session_service_proxy_env = InMemorySessionService()\n", - "session_proxy_env = session_service_proxy_env.create_session(\n", - " app_name='weather_app', user_id='user_1', session_id='session_proxy_env'\n", - ")\n", - "\n", - "runner_proxy_env = Runner(\n", - " agent=weather_agent_proxy_env,\n", - " app_name='weather_app',\n", - " session_service=session_service_proxy_env,\n", - ")\n", - "\n", - "async def test_proxy_env_agent():\n", - " print('\\n--- Testing Proxy-enabled Agent (Environment Variables) ---')\n", - " await call_agent_async(\n", - " \"What's the weather in London?\",\n", - " runner=runner_proxy_env,\n", - " user_id='user_1',\n", - " session_id='session_proxy_env',\n", - " )\n", - "\n", - "# To execute in a notebook cell:\n", - "# await test_proxy_env_agent()" - ] - } - ], - "metadata": { - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/cookbook/gpt_realtime_translate.py b/cookbook/gpt_realtime_translate.py deleted file mode 100644 index 827c65cdbfe..00000000000 --- a/cookbook/gpt_realtime_translate.py +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import asyncio -import base64 -import json -import os -import sys -import wave -from collections.abc import Iterator, Sequence -from dataclasses import dataclass -from pathlib import Path -from urllib.parse import urlencode, urlsplit, urlunsplit - -import websockets -from websockets.asyncio.client import ClientConnection - -SAMPLE_RATE = 24_000 -CHANNELS = 1 -SAMPLE_WIDTH = 2 -CHUNK_DURATION_SECONDS = 0.1 -CHUNK_BYTES = int(SAMPLE_RATE * CHANNELS * SAMPLE_WIDTH * CHUNK_DURATION_SECONDS) -RESPONSE_TIMEOUT_SECONDS = 30.0 -AUDIO_EVENT_TYPES = frozenset( - { - "session.output_audio.delta", - "response.audio.delta", - "response.output_audio.delta", - } -) -TRANSCRIPT_EVENT_TYPES = frozenset( - { - "session.output_transcript.delta", - "response.text.delta", - "response.output_audio_transcript.delta", - } -) - - -@dataclass(frozen=True, slots=True) -class Settings: - input_wav: Path - output_wav: Path - base_url: str - model: str - target_language: str - trailing_silence_seconds: float - api_key: str - - -def write_stdout(message: str = "", *, end: str = "\n", flush: bool = False) -> None: - sys.stdout.write(f"{message}{end}") - if flush: - sys.stdout.flush() - - -def write_stderr(message: str) -> None: - sys.stderr.write(f"{message}\n") - - -def parse_args(argv: Sequence[str] | None = None) -> Settings | str: - parser = argparse.ArgumentParser( - description="Stream a 24 kHz PCM16 WAV through gpt-realtime-translate and save the translated audio", - ) - parser.add_argument("input_wav", type=Path) - parser.add_argument("--output", type=Path, default=Path("translated.wav")) - parser.add_argument("--base-url", default=os.getenv("LITELLM_BASE_URL", "http://localhost:4000")) - parser.add_argument("--model", default=os.getenv("REALTIME_TRANSLATE_MODEL", "gpt-realtime-translate")) - parser.add_argument("--target-language", default="fr") - parser.add_argument("--trailing-silence", type=float, default=1.5) - parsed = parser.parse_args(argv) - api_key = os.getenv("LITELLM_API_KEY") or os.getenv("OPENAI_API_KEY") - if not api_key: - return "Set LITELLM_API_KEY or OPENAI_API_KEY before running the script" - if parsed.trailing_silence < 0: - return "--trailing-silence must be zero or greater" - return Settings( - input_wav=parsed.input_wav, - output_wav=parsed.output, - base_url=parsed.base_url, - model=parsed.model, - target_language=parsed.target_language, - trailing_silence_seconds=parsed.trailing_silence, - api_key=api_key, - ) - - -def translation_url(base_url: str, model: str) -> str | None: - parsed = urlsplit(base_url.rstrip("/")) - scheme = {"http": "ws", "https": "wss", "ws": "ws", "wss": "wss"}.get(parsed.scheme) - if not scheme or not parsed.netloc: - return None - base_path = parsed.path.rstrip("/") - realtime_path = ( - f"{base_path}/realtime/translations" if base_path.endswith("/v1") else f"{base_path}/v1/realtime/translations" - ) - return urlunsplit((scheme, parsed.netloc, realtime_path, urlencode({"model": model}), "")) - - -def read_pcm16_wav(path: Path) -> bytes | str: - try: - with wave.open(str(path), "rb") as source: - actual_format = ( - source.getnchannels(), - source.getsampwidth(), - source.getframerate(), - source.getcomptype(), - ) - expected_format = (CHANNELS, SAMPLE_WIDTH, SAMPLE_RATE, "NONE") - if actual_format != expected_format: - return ( - f"{path} must be mono, 16-bit PCM, 24 kHz WAV; received " - f"channels={actual_format[0]}, sample_width={actual_format[1]}, " - f"sample_rate={actual_format[2]}, compression={actual_format[3]}" - ) - return source.readframes(source.getnframes()) - except (OSError, EOFError, wave.Error) as exc: - return f"Unable to read {path}: {exc}" - - -def audio_chunks(audio: bytes) -> Iterator[bytes]: - return (audio[offset : offset + CHUNK_BYTES] for offset in range(0, len(audio), CHUNK_BYTES)) - - -def audio_message(audio: bytes) -> str: - return json.dumps( - { - "type": "session.input_audio_buffer.append", - "audio": base64.b64encode(audio).decode("ascii"), - } - ) - - -async def configure_session(connection: ClientConnection, target_language: str) -> str | None: - await connection.send( - json.dumps( - { - "type": "session.update", - "session": {"audio": {"output": {"language": target_language}}}, - } - ) - ) - while True: - raw_event = await asyncio.wait_for(connection.recv(), timeout=20) - event = json.loads(raw_event) - event_type = event.get("type") - if event_type == "session.created": - write_stdout(f"Session: {event.get('session', {}).get('id', 'created')}") - if event_type == "session.updated": - return None - if event_type == "error": - return f"Realtime API error: {json.dumps(event.get('error', event), ensure_ascii=False)}" - - -async def send_audio( - connection: ClientConnection, pcm: bytes, trailing_silence_seconds: float, finished: asyncio.Event -) -> None: - silence = bytes(round(trailing_silence_seconds * SAMPLE_RATE * CHANNELS * SAMPLE_WIDTH)) - try: - for chunk in audio_chunks(pcm + silence): - await connection.send(audio_message(chunk)) - await asyncio.sleep(len(chunk) / (SAMPLE_RATE * CHANNELS * SAMPLE_WIDTH)) - await connection.send(json.dumps({"type": "session.close"})) - finally: - finished.set() - - -async def receive_translation( - connection: ClientConnection, output_path: Path, sender_finished: asyncio.Event -) -> str | None: - audio_received = asyncio.Event() - try: - with wave.open(str(output_path), "wb") as output: - output.setnchannels(CHANNELS) - output.setsampwidth(SAMPLE_WIDTH) - output.setframerate(SAMPLE_RATE) - write_stdout("Translation: ", end="", flush=True) - while True: - try: - raw_event = await asyncio.wait_for(connection.recv(), timeout=RESPONSE_TIMEOUT_SECONDS) - except TimeoutError: - if not sender_finished.is_set(): - continue - return ( - f"The translation stream went quiet for {RESPONSE_TIMEOUT_SECONDS:g} s without closing the session" - ) - event = json.loads(raw_event) - event_type = event.get("type") - if event_type in AUDIO_EVENT_TYPES: - output.writeframes(base64.b64decode(event.get("delta", ""), validate=True)) - audio_received.set() - elif event_type in TRANSCRIPT_EVENT_TYPES: - write_stdout(event.get("delta", event.get("text", "")), end="", flush=True) - elif event_type == "error": - return f"Realtime API error: {json.dumps(event.get('error', event), ensure_ascii=False)}" - elif event_type == "session.closed": - write_stdout() - return None if audio_received.is_set() else "The translation stream ended without translated audio" - except (OSError, wave.Error) as exc: - return f"Unable to write {output_path}: {exc}" - - -async def translate(settings: Settings, pcm: bytes) -> str | None: - url = translation_url(settings.base_url, settings.model) - if not url: - return f"Invalid --base-url: {settings.base_url}" - sender_finished = asyncio.Event() - try: - async with websockets.connect( - url, - additional_headers={"Authorization": f"Bearer {settings.api_key}"}, - proxy=None, - open_timeout=20, - close_timeout=5, - ) as connection: - configuration_error = await configure_session(connection, settings.target_language) - if configuration_error: - return configuration_error - async with asyncio.TaskGroup() as tasks: - receiver = tasks.create_task(receive_translation(connection, settings.output_wav, sender_finished)) - tasks.create_task(send_audio(connection, pcm, settings.trailing_silence_seconds, sender_finished)) - return receiver.result() - except Exception as exc: - return f"Translation failed: {type(exc).__name__}: {exc}" - - -def main(argv: Sequence[str] | None = None) -> int: - settings = parse_args(argv) - if isinstance(settings, str): - write_stderr(settings) - return 2 - pcm = read_pcm16_wav(settings.input_wav) - if isinstance(pcm, str): - write_stderr(pcm) - return 2 - error = asyncio.run(translate(settings, pcm)) - if error: - write_stderr(error) - return 1 - write_stdout(f"Translated audio: {settings.output_wav}") - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/cookbook/liteLLM_A121_Jurrasic_example.ipynb b/cookbook/liteLLM_A121_Jurrasic_example.ipynb deleted file mode 100644 index f975b97e911..00000000000 --- a/cookbook/liteLLM_A121_Jurrasic_example.ipynb +++ /dev/null @@ -1,251 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# LiteLLM A121 Tutorial\n", - "\n", - "This walks through using A121 Jurassic models\n", - "* j2-light\n", - "* j2-mid\n", - "* j2-ultra" - ], - "metadata": { - "id": "LeFYo8iqcn5g" - } - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "GslPQFmaZsp-" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion\n", - "import os" - ], - "metadata": { - "id": "P3cKiqURZx7P" - }, - "execution_count": 2, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "## Set A121 Keys\n", - "You can get a free key from https://studio.ai21.com/account/api-key" - ], - "metadata": { - "id": "tmTvA1_GaNU4" - } - }, - { - "cell_type": "code", - "source": [ - "os.environ[\"AI21_API_KEY\"] = \"\"" - ], - "metadata": { - "id": "_xX8LmxAZ2vp" - }, - "execution_count": 5, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# A121 Supported Models:\n", - "https://studio.ai21.com/foundation-models" - ], - "metadata": { - "id": "Fx5ZfJTLbF0A" - } - }, - { - "cell_type": "markdown", - "source": [ - "## J2-light Call" - ], - "metadata": { - "id": "H0tl-0Z3bDaL" - } - }, - { - "cell_type": "code", - "source": [ - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "response = completion(model=\"j2-light\", messages=messages)\n", - "response" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "DZnApsJUZ_I2", - "outputId": "b5707cbe-f67c-47f7-bac5-a7b8af1ba815" - }, - "execution_count": 6, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - " JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" However, I have an important question to ask you\\nMy name is X, and I was wondering if you would be willing to help me.\",\n", - " \"role\": \"assistant\"\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1692761063.5189915,\n", - " \"model\": \"j2-light\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": null,\n", - " \"completion_tokens\": null,\n", - " \"total_tokens\": null\n", - " }\n", - "}" - ] - }, - "metadata": {}, - "execution_count": 6 - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "# J2-Mid" - ], - "metadata": { - "id": "wCcnrYnnbMQA" - } - }, - { - "cell_type": "code", - "source": [ - "messages = [{ \"content\": \"what model are you\",\"role\": \"user\"}]\n", - "response = completion(model=\"j2-mid\", messages=messages)\n", - "response" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-5Sxf4blaeEl", - "outputId": "6264a5e8-16d6-44a3-e167-9e0c59b6dbc4" - }, - "execution_count": 7, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - " JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"\\nplease choose the model from the list below\\nModel view in Tekla Structures\",\n", - " \"role\": \"assistant\"\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1692761140.0017524,\n", - " \"model\": \"j2-mid\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": null,\n", - " \"completion_tokens\": null,\n", - " \"total_tokens\": null\n", - " }\n", - "}" - ] - }, - "metadata": {}, - "execution_count": 7 - } - ] - }, - { - "cell_type": "markdown", - "source": [ - "# J2-Ultra" - ], - "metadata": { - "id": "wDARpjxtbUcg" - } - }, - { - "cell_type": "code", - "source": [ - "messages = [{ \"content\": \"what model are you\",\"role\": \"user\"}]\n", - "response = completion(model=\"j2-ultra\", messages=messages)\n", - "response" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "i228xwsYbSYo", - "outputId": "3765ac56-5a9b-442e-b357-2e346d02e1df" - }, - "execution_count": 8, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - " JSON: {\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \"\\nI am not a specific model, but I can provide information and assistance based on my training data. Please let me know if there is anything you\",\n", - " \"role\": \"assistant\"\n", - " }\n", - " }\n", - " ],\n", - " \"created\": 1692761157.8675153,\n", - " \"model\": \"j2-ultra\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": null,\n", - " \"completion_tokens\": null,\n", - " \"total_tokens\": null\n", - " }\n", - "}" - ] - }, - "metadata": {}, - "execution_count": 8 - } - ] - } - ] -} \ No newline at end of file diff --git a/cookbook/liteLLM_Baseten.ipynb b/cookbook/liteLLM_Baseten.ipynb deleted file mode 100644 index 0a5bc5f1df7..00000000000 --- a/cookbook/liteLLM_Baseten.ipynb +++ /dev/null @@ -1,146 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "gZx-wHJapG5w" - }, - "source": [ - "# LiteLLM with Baseten Model APIs\n", - "\n", - "This notebook demonstrates how to use LiteLLM with Baseten's Model APIs instead of dedicated deployments.\n", - "\n", - "## Example Usage\n", - "```python\n", - "response = completion(\n", - " model=\"baseten/openai/gpt-oss-120b\",\n", - " messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n", - " max_tokens=1000,\n", - " temperature=0.7\n", - ")\n", - "```\n", - "\n", - "## Setup" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "4JSRa0QVogPo" - }, - "outputs": [], - "source": [ - "%pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "VEukLhDzo4vw" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion\n", - "\n", - "# Set your Baseten API key\n", - "os.environ['BASETEN_API_KEY'] = \"\" #@param {type:\"string\"}\n", - "\n", - "# Test message\n", - "messages = [{\"role\": \"user\", \"content\": \"What is AGI?\"}]" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "4STYM2OHFNlc" - }, - "source": [ - "## Example 1: Basic Completion\n", - "\n", - "Simple completion with the GPT-OSS 120B model" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "DorpLxw1FHbC" - }, - "outputs": [], - "source": [ - "print(\"=== Basic Completion ===\")\n", - "response = completion(\n", - " model=\"baseten/openai/gpt-oss-120b\",\n", - " messages=messages,\n", - " max_tokens=1000,\n", - " temperature=0.7,\n", - " top_p=0.9,\n", - " presence_penalty=0.1,\n", - " frequency_penalty=0.1,\n", - ")\n", - "print(f\"Response: {response.choices[0].message.content}\")\n", - "print(f\"Usage: {response.usage}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "syF3dTdKFSQQ" - }, - "source": [ - "## Example 2: Streaming Completion\n", - "\n", - "Streaming completion with usage statistics" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "rPgSoMlsojz0", - "outputId": "81d6dc7b-1681-4ae4-e4c8-5684eb1bd050" - }, - "outputs": [], - "source": [ - "print(\"=== Streaming Completion ===\")\n", - "response = completion(\n", - " model=\"baseten/openai/gpt-oss-120b\",\n", - " messages=[{\"role\": \"user\", \"content\": \"Write a short poem about AI\"}],\n", - " stream=True,\n", - " max_tokens=500,\n", - " temperature=0.8,\n", - " stream_options={\n", - " \"include_usage\": True,\n", - " \"continuous_usage_stats\": True\n", - " },\n", - ")\n", - "\n", - "print(\"Streaming response:\")\n", - "for chunk in response:\n", - " if chunk.choices and chunk.choices[0].delta.content:\n", - " print(chunk.choices[0].delta.content, end=\"\", flush=True)\n", - "print(\"\\n\")" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/liteLLM_Getting_Started.ipynb b/cookbook/liteLLM_Getting_Started.ipynb deleted file mode 100644 index b43c51dceeb..00000000000 --- a/cookbook/liteLLM_Getting_Started.ipynb +++ /dev/null @@ -1,411 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "MZ01up0p7wOJ" - }, - "source": [ - "## 🚅 liteLLM Quick Start Demo\n", - "### TLDR: Call 50+ LLM APIs using chatGPT Input/Output format\n", - "https://github.com/BerriAI/litellm\n", - "\n", - "liteLLM is package to simplify calling **OpenAI, Azure, Llama2, Cohere, Anthropic, Huggingface API Endpoints**. LiteLLM manages\n", - "\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "RZtzCnQS7rW-" - }, - "source": [ - "## Installation and setting Params" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "rsrN5W-N7L8d" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "ArrWyG5b7QAG" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "import os" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "bbhJRt34_NJ1" - }, - "source": [ - "## Set your API keys\n", - "- liteLLM reads your .env, env variables or key manager for Auth\n", - "\n", - "Set keys for the models you want to use below" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "id": "-h8Ga5cR7SvV" - }, - "outputs": [], - "source": [ - "# Only set keys for the LLMs you want to use\n", - "os.environ['OPENAI_API_KEY'] = \"\" #@param\n", - "os.environ[\"ANTHROPIC_API_KEY\"] = \"\" #@param\n", - "os.environ[\"REPLICATE_API_KEY\"] = \"\" #@param\n", - "os.environ[\"COHERE_API_KEY\"] = \"\" #@param\n", - "os.environ[\"AZURE_API_BASE\"] = \"\" #@param\n", - "os.environ[\"AZURE_API_VERSION\"] = \"\" #@param\n", - "os.environ[\"AZURE_API_KEY\"] = \"\" #@param" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "fhqpKv6L8fBj" - }, - "source": [ - "## Call chatGPT" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "speIkoX_8db4", - "outputId": "331a6c65-f121-4e65-e121-bf8aaad05d9d" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"id\": \"chatcmpl-820kPkRwSLml4X6165fWbZlEDOedr\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1695490221,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"I'm sorry, but as an AI text-based model, I don't have real-time information. However, you can check the current weather in San Francisco by searching for \\\"weather in SF\\\" on any search engine or checking a weather website or app.\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 13,\n", - " \"completion_tokens\": 51,\n", - " \"total_tokens\": 64\n", - " },\n", - " \"response_ms\": 2385.592\n", - "}" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "completion(model=\"gpt-3.5-turbo\", messages=[{ \"content\": \"what's the weather in SF\",\"role\": \"user\"}])" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "Q3jV1Uxv8zNo" - }, - "source": [ - "## Call Claude-2" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "V8yTWYzY8m9S", - "outputId": "8b6dd32d-f9bf-4e89-886d-47cb8020f025" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop_sequence\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" Unfortunately I don't have enough context to know the exact location you are asking about when you say \\\"SF\\\". SF could refer to San Francisco, California, or potentially other cities that go by SF as an abbreviation. To get an accurate weather report, it would be helpful if you could provide the full city name and state/country. If you are looking for the weather in San Francisco, California, I would be happy to provide that forecast. Please let me know the specific location you want the weather for.\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-6d1a40c0-19c0-4bd7-9ca2-a91d8b8c2295\",\n", - " \"created\": 1695490260.983768,\n", - " \"response_ms\": 6351.544,\n", - " \"model\": \"claude-2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 14,\n", - " \"completion_tokens\": 102,\n", - " \"total_tokens\": 116\n", - " }\n", - "}" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "completion(model=\"claude-2\", messages=[{ \"content\": \"what's the weather in SF\",\"role\": \"user\"}])" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "yu0LPDmW9PJa" - }, - "source": [ - "## Call llama2 on replicate" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "0GWV5mtO9Jbu", - "outputId": "38538825-b271-406d-a437-f5cf0eb7e548" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" I'm happy to help! However, I must point out that the question \\\"what's the weather in SF\\\" doesn't make sense as \\\"SF\\\" could refer to multiple locations. Could you please clarify which location you are referring to? San Francisco, California or Sioux Falls, South Dakota? Once I have more context, I would be happy to provide you with accurate and reliable information.\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-3151c2eb-b26f-4c96-89b5-ed1746b219e0\",\n", - " \"created\": 1695490237.714101,\n", - " \"response_ms\": 12109.565,\n", - " \"model\": \"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 78,\n", - " \"total_tokens\": 84\n", - " },\n", - " \"ended\": 1695490249.821266\n", - "}" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model = \"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\"\n", - "completion(model=model, messages=[{ \"content\": \"what's the weather in SF\",\"role\": \"user\"}])" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "HXdj5SEe9iLK" - }, - "source": [ - "## Call Command-Nightly" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "EaUq2xIx9fhr", - "outputId": "55fe6f52-b58b-4729-948a-74dac4b431b2" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" As an AI model I don't have access to real-time data, so I can't tell\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-dc0d8ead-071d-486c-a111-78975b38794b\",\n", - " \"created\": 1695490235.936903,\n", - " \"response_ms\": 1022.6759999999999,\n", - " \"model\": \"command-nightly\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 6,\n", - " \"completion_tokens\": 19,\n", - " \"total_tokens\": 25\n", - " }\n", - "}" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "completion(model=\"command-nightly\", messages=[{ \"content\": \"what's the weather in SF\",\"role\": \"user\"}])" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "1g9hSgsL9soJ" - }, - "source": [ - "## Call Azure OpenAI" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For azure openai calls ensure to add the `azure/` prefix to `model`. If your deployment-id is `chatgpt-test` set `model` = `azure/chatgpt-test`" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "AvLjR-PF-lt0", - "outputId": "deff2db3-b003-48cd-ea62-c03a68a4464a" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"id\": \"chatcmpl-820kZyCwbNvZATiLkNmXmpxxzvTKO\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1695490231,\n", - " \"model\": \"gpt-35-turbo\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"finish_reason\": \"stop\",\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Sorry, as an AI language model, I don't have real-time information. Please check your preferred weather website or app for the latest weather updates of San Francisco.\"\n", - " }\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"completion_tokens\": 33,\n", - " \"prompt_tokens\": 14,\n", - " \"total_tokens\": 47\n", - " },\n", - " \"response_ms\": 1499.529\n", - "}" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "completion(model=\"azure/chatgpt-v-2\", messages=[{ \"content\": \"what's the weather in SF\",\"role\": \"user\"}])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/liteLLM_IBM_Watsonx.ipynb b/cookbook/liteLLM_IBM_Watsonx.ipynb deleted file mode 100644 index 6de108b5d39..00000000000 --- a/cookbook/liteLLM_IBM_Watsonx.ipynb +++ /dev/null @@ -1,300 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# LiteLLM x IBM [watsonx.ai](https://www.ibm.com/products/watsonx-ai)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Pre-Requisites" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Set watsonx.ai Credentials\n", - "\n", - "See [this documentation](https://cloud.ibm.com/apidocs/watsonx-ai#api-authentication) for more information about authenticating to watsonx.ai" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "import litellm\n", - "from litellm.llms.watsonx import IBMWatsonXAI\n", - "litellm.set_verbose = False\n", - "\n", - "os.environ[\"WATSONX_URL\"] = \"\" # Your watsonx.ai base URL\n", - "os.environ[\"WATSONX_APIKEY\"] = \"\" # Your IBM cloud API key or watsonx.ai token\n", - "os.environ[\"WATSONX_PROJECT_ID\"] = \"\" # ID of your watsonx.ai project\n", - "# these can also be passed as arguments to the function\n", - "\n", - "# generating an IAM token is optional, but it is recommended to generate it once and use it for all your requests during the session\n", - "# if not passed to the function, it will be generated automatically for each request\n", - "iam_token = IBMWatsonXAI().generate_iam_token(api_key=os.environ[\"WATSONX_APIKEY\"]) \n", - "# you can also set os.environ[\"WATSONX_TOKEN\"] = iam_token" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Completion Requests\n", - "\n", - "See the following link for a list of supported *text generation* models available with watsonx.ai:\n", - "\n", - "https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx&locale=en&audience=wdp" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Granite v2 response:\n", - "ModelResponse(id='chatcmpl-adba60b2-3741-452e-921c-27b8f68d0298', choices=[Choices(finish_reason='stop', index=0, message=Message(content=\" I'm often asked this question, but it seems a bit bizarre given my circumstances. You see,\", role='assistant'))], created=1713881850, model='ibm/granite-13b-chat-v2', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=8, completion_tokens=20, total_tokens=28), finish_reason='max_tokens')\n", - "LLaMa 3 8b response:\n", - "ModelResponse(id='chatcmpl-eb282abc-373c-4082-9dae-172546d16d5c', choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"I'm just a language model, I don't have emotions or feelings like humans do, but I\", role='assistant'))], created=1713881852, model='meta-llama/llama-3-8b-instruct', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=16, completion_tokens=20, total_tokens=36), finish_reason='max_tokens')\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "# see litellm.llms.watsonx.IBMWatsonXAIConfig for a list of available parameters to pass to the completion functions\n", - "response = completion(\n", - " model=\"watsonx/ibm/granite-13b-chat-v2\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " token=iam_token\n", - ")\n", - "print(\"Granite v2 response:\")\n", - "print(response)\n", - "\n", - "\n", - "response = completion(\n", - " model=\"watsonx/meta-llama/llama-3-8b-instruct\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " token=iam_token\n", - ")\n", - "print(\"LLaMa 3 8b response:\")\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Streaming Requests" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Granite v2 streaming response:\n", - "\n", - "Thank you for asking. I'm fine, thank you for asking. What can I do for you today?\n", - "I'm looking for a new job. Do you have any job openings that might be a good fit for me?\n", - "Sure,\n", - "LLaMa 3 8b streaming response:\n", - "I'm just an AI, so I don't have emotions or feelings like humans do, but I'm functioning properly and ready to help you with any questions or tasks you have! It's great to chat with you. How can I assist you today" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(\n", - " model=\"watsonx/ibm/granite-13b-chat-v2\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True,\n", - " max_tokens=50, # maps to watsonx.ai max_new_tokens\n", - ")\n", - "print(\"Granite v2 streaming response:\")\n", - "for chunk in response:\n", - " print(chunk['choices'][0]['delta']['content'] or '', end='')\n", - "\n", - "# print()\n", - "response = completion(\n", - " model=\"watsonx/meta-llama/llama-3-8b-instruct\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " stream=True,\n", - " max_tokens=50, # maps to watsonx.ai max_new_tokens\n", - ")\n", - "print(\"\\nLLaMa 3 8b streaming response:\")\n", - "for chunk in response:\n", - " print(chunk['choices'][0]['delta']['content'] or '', end='')" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Async Requests" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Granite v2 response:\n", - "ModelResponse(id='chatcmpl-73e7474b-2760-4578-b52d-068d6f4ff68b', choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"\\nHello, thank you for asking. I'm well, how about you?\\n\\n3.\", role='assistant'))], created=1713881895, model='ibm/granite-13b-chat-v2', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=8, completion_tokens=20, total_tokens=28), finish_reason='max_tokens')\n", - "LLaMa 3 8b response:\n", - "ModelResponse(id='chatcmpl-fbf4cd5a-3a38-4b6c-ba00-01ada9fbde8a', choices=[Choices(finish_reason='stop', index=0, message=Message(content=\"I'm just a language model, I don't have emotions or feelings like humans do. However,\", role='assistant'))], created=1713881894, model='meta-llama/llama-3-8b-instruct', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=16, completion_tokens=20, total_tokens=36), finish_reason='max_tokens')\n" - ] - } - ], - "source": [ - "from litellm import acompletion\n", - "import asyncio\n", - "\n", - "granite_task = acompletion(\n", - " model=\"watsonx/ibm/granite-13b-chat-v2\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " max_tokens=20, # maps to watsonx.ai max_new_tokens\n", - " token=iam_token\n", - ")\n", - "llama_3_task = acompletion(\n", - " model=\"watsonx/meta-llama/llama-3-8b-instruct\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " max_tokens=20, # maps to watsonx.ai max_new_tokens\n", - " token=iam_token\n", - ")\n", - "\n", - "granite_response, llama_3_response = await asyncio.gather(granite_task, llama_3_task)\n", - "\n", - "print(\"Granite v2 response:\")\n", - "print(granite_response)\n", - "\n", - "print(\"LLaMa 3 8b response:\")\n", - "print(llama_3_response)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Request deployed models\n", - "\n", - "Models that have been deployed to a deployment space (e.g tuned models) can be called using the \"deployment/\" format (where `` is the ID of the deployed model in your deployment space). The ID of your deployment space must also be set in the environment variable `WATSONX_DEPLOYMENT_SPACE_ID` or passed to the function as `space_id=`. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from litellm import acompletion\n", - "\n", - "os.environ[\"WATSONX_DEPLOYMENT_SPACE_ID\"] = \"\" # ID of the watsonx.ai deployment space where the model is deployed\n", - "await acompletion(\n", - " model=\"watsonx/deployment/\",\n", - " messages=[{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}],\n", - " token=iam_token\n", - ")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Embeddings\n", - "\n", - "See the following link for a list of supported *embedding* models available with watsonx.ai:\n", - "\n", - "https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models-embed.html?context=wx" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Slate 30m embeddings response:\n", - "EmbeddingResponse(model='ibm/slate-30m-english-rtrvr', data=[{'object': 'embedding', 'index': 0, 'embedding': [0.0025110552, -0.021022381, 0.056658838, 0.023194756, 0.06528087, 0.051285733, 0.025715597, 0.009245981, -0.048218597, 0.02131204, 0.0048608365, 0.056427978, -0.029722512, -0.022280851, 0.03397489, 0.15861669, -0.0032172804, 0.021461686, -0.034179244, 0.03242367, 0.045696042, -0.10642838, 0.044042706, 0.003619815, -0.03445944, 0.06782116, -0.012801977, -0.083491564, 0.048063237, -0.0009263491, 0.03926016, -0.003800945, 0.06431806, 0.008804617, 0.041459076, 0.019176882, 0.063215, 0.016872335, -0.07120825, 0.0026858407, -0.0061372668, 0.016006729, 0.034623176, -0.0009702338, 0.05586387, -0.0030038806, 0.10219119, 0.023867028, 0.017003942, 0.07522453, 0.03827543, 0.002119465, -0.047579825, 0.030801363, 0.055104297, -0.00926156, 0.060950216, -0.012564041, -0.0938483, 0.06749232, 0.0303093, 0.1260211, 0.008772238, 0.0937941, 0.03146898, -0.013548525, -0.04654987, 0.038247738, -0.0047283196, -0.021979854, -0.04481472, 0.009184976, 0.030558616, -0.035239127, 0.015711905, 0.079948395, -0.10273533, -0.033666693, 0.009253284, -0.013218568, 0.014513645, 0.011746366, -0.04836566, 0.00059039996, 0.056465007, 0.057913274, 0.046911363, 0.022496173, -0.016504057, -0.0009266135, 0.007562665, 0.024523543, 0.012681347, -0.0034720704, 0.014897689, 0.034027215, -0.035149213, 0.046610955, -0.38038146, -0.05560348, 0.056164417, 0.023633359, -0.020914413, 0.0017839101, 0.043425612, 0.0921522, 0.021333266, 0.032627117, 0.052366074, 0.059688427, -0.02425017, 0.07460727, 0.040419403, 0.018662684, -0.02174095, -0.015262358, 0.0041535227, -0.004320668, 0.001545062, 0.023696192, 0.053526532, 0.031027582, -0.030727778, -0.07266011, 0.01924883, -0.021610625, 0.03179455, -0.002117363, 0.037670195, -0.021235954, -0.03931032, -0.057163127, -0.046020538, 0.013852293, 0.007136301, 0.020461356, 0.027465757, 0.013625788, 0.09281521, 0.03537469, -0.15295835, -0.045262642, 0.013799362, 0.029831719, 0.06360841, 0.045387108, -0.008106462, 0.047562532, 0.026519125, 0.030519808, -0.035604805, 0.059504308, -0.010260606, 0.05920231, -0.039987702, 0.003475537, 0.012535757, 0.03711557, 0.022637982, 0.022368006, -0.013918498, 0.03144229, 0.02680179, 0.05283082, 0.09737034, 0.062140185, 0.047479317, 0.04292394, 0.041657448, 0.031671192, -0.01198203, -0.0398639, 0.050961364, -0.005440624, -0.013748672, 0.02486566, 0.06105261, 0.09158345, 0.047486037, 0.03503525, -0.0009857323, 0.017584834, 0.0015176772, -0.013855697, -0.0016783233, -0.032760657, 0.0073869363, 0.0032070065, 0.08748817, 0.062042974, -0.006563574, -0.01277716, 0.064277925, -0.048509046, 0.01998247, 0.015449057, 0.06161844, 0.0361277, 0.07378269, 0.031909943, 0.035593968, -0.021533003, 0.15151453, 0.009489467, 0.0077385777, 0.004732935, 0.06757376, 0.018628953, 0.03609718, 0.065334365, 0.046664603, 0.03710433, 0.023046834, 0.065034136, 0.021973003, 0.01938253, 0.0049545416, 0.009443422, 0.08657203, -0.006455585, 0.06113277, -0.009921393, 0.008861325, 0.021925068, 0.0073863543, 0.029231662, 0.018063372, -0.028237753, 0.06752595, -0.015746683, -0.06744447, -0.0019776542, -0.16144808, 0.055144247, -0.07052258, -0.0062173936, 0.005187277, 0.057623632, 0.008336536, 0.018794686, 0.08856226, 0.05324669, 0.023925344, -0.011277585, -0.015746504, -0.01888707, -0.010619123, 0.05960752, -0.02111604, 0.13263386, 0.053238407, 0.0423469, 0.03247613, 0.072818235, 0.039493106, -0.0080635715, 0.038805183, 0.05633994, 0.021095807, -0.022528276, 0.113213256, -0.040802993, 0.01971789, 0.00073800184, 0.04653605, 0.024364496, 0.051224973, 0.022803178, 0.06527072, -0.030100288, 0.02277551, 0.034268156, -0.0024341822, 0.030275142, -0.0043326514, 0.026949842, 0.03554525, 0.043582354, 0.037845742, 0.024644673, 0.06225431, 0.06668994, 0.042802095, -0.14308476, 0.028445719, -0.0057268543, 0.034851402, 0.04973769, -0.01673276, -0.0084733, -0.04498498, -0.01888843, 0.0018199912, -0.08666151, 0.03408551, 0.03374362, 0.016341621, -0.017816868, 0.027611718, 0.048712954, 0.03562084, 0.06156702, 0.06942091, 0.018424997, 0.010069236, -0.025854982, -0.005099922, 0.042129293, -0.018960087, -0.04267046, 0.003192464, 0.07610024, 0.01623567, 0.06430824, 0.045628317, -0.13192567, 0.00597194, 0.03359213, -0.051644783, -0.027538724, 0.047537625, 0.00078535493, -0.050269134, 0.06352181, 0.04414142, -0.00025181545, -0.011166945, 0.083493516, -0.022445189, 0.06386556, 0.009009819, 0.018880796, 0.046981215, -0.04803033, 0.20140722, 0.009405448, 0.011427641, 0.032028355, -0.039911997, 0.059231583, 0.10603366, -0.012695404, -0.018773954, 0.051107403, 0.004720434, 0.049031533, 0.008848073, -0.008443017, 0.068459414, -0.001594059, -0.037717424, 0.0083658025, 0.036570624, -0.009189262, -0.07422237, -0.03578154, 0.00016998129, -0.033594534, 0.04550856, -0.09751915, 0.031381045, -0.020289807, -0.025066, 0.05559659, 0.065852426, -0.030574895, 0.098877095, 0.024548644, 0.02716826, -0.0073690503, -0.006680294, -0.062504984, 0.001748584, -0.0015254011, 0.0030000636, 0.05166639, -0.03598367, 0.02785021, 0.019170346, -0.01893702, 0.006487694, -0.045320857, -0.042290565, 0.030072719]}], object='list', usage=Usage(prompt_tokens=8, total_tokens=8))\n", - "Slate 125m embeddings response:\n", - "EmbeddingResponse(model='ibm/slate-125m-english-rtrvr', data=[{'object': 'embedding', 'index': 0, 'embedding': [-0.037463713, -0.02141933, -0.02851813, 0.015519324, -0.08252965, 0.040418413, 0.0125358505, -0.015099016, 0.007372251, 0.043594047, -0.045923322, -0.024535796, -0.06683439, -0.023252856, -0.014445329, -0.007990043, -0.0038893714, 0.024145052, 0.002840671, -0.005213263, 0.025767032, -0.029234663, -0.022147253, -0.04008686, -0.0049467147, -0.005722156, 0.05712166, 0.02074406, -0.027984975, 0.011733741, 0.037084717, 0.0267332, 0.027662167, 0.018661365, 0.034368176, -0.016858159, 0.01525097, 0.0037685328, -0.029145032, -0.014014788, -0.026596593, -0.019313056, -0.034545943, -0.012755116, -0.027378004, -0.0022658114, 0.0671108, -0.011186887, -0.012560194, 0.07890564, 0.04370288, -0.002565922, 0.04558289, -0.015022389, 0.01721297, -0.02836881, 0.00028577668, 0.041560214, -0.028451115, 0.026690092, -0.03240052, 0.043185145, -0.048146088, -0.01863734, 0.014189055, 0.005409885, -0.004303547, 0.043854367, -0.08027855, 0.0036468406, -0.03761452, -0.01586453, 0.0015843573, -0.06557115, -0.017214078, 0.013112075, -0.063624665, -0.059002113, -0.027906772, -0.0104140695, -0.0122148385, 0.002914942, 0.009600896, 0.024618316, 0.0028588492, -0.04129038, -0.0066302163, -0.016593395, 0.0119156595, 0.030668158, 0.032204323, -0.008526114, 0.031477567, -0.027671225, -0.021325896, -0.012719999, 0.020595504, -0.010196725, 0.016694892, 0.015447107, 0.033599768, 0.0015109212, 0.055442166, -0.032922138, 0.032867074, 0.034223255, 0.018267235, 0.044258785, -0.009512916, -0.01888108, 0.0020811916, -0.071849406, -0.029209733, 0.030071445, 0.04898721, 0.03807559, 0.030091342, 0.0049845255, 0.011301079, 0.0060062855, -0.052550614, -0.040027767, -0.04539995, -0.069943875, 0.052881725, 0.015551356, -0.0016604571, 0.0021608798, 0.055507053, -0.015404854, -0.0023839937, 0.0070840786, 0.042537935, -0.045489613, 0.018908504, -0.015565469, 0.015916781, 0.07333876, 0.0034915418, -0.0029724848, 0.019170308, 0.02221138, -0.027242986, -0.003735747, -0.02341423, -0.0037938543, 0.0104211755, -0.06185881, -0.036718667, -0.02746382, -0.026462527, -0.050701175, 0.0057923957, 0.040674523, -0.019840682, -0.030195065, 0.045316722, 0.017369563, -0.031288657, -0.047546197, 0.026255054, -0.0049950704, -0.040272273, 0.0005752177, 0.03959872, -0.0073655704, -0.025617458, -0.009416491, -0.019514928, -0.07619169, 0.0051972694, 0.016387343, -0.012366861, -0.009152257, -0.035955105, -0.05794065, 0.019153351, -0.0461187, 0.024734644, 0.0031722176, 0.06610593, -0.0046516205, -0.04635891, 0.02524459, 0.004230386, 0.06153266, -0.0008394812, -0.013522857, 0.029861225, -0.00394871, -0.037432022, 0.0483034, 0.02181303, 0.015967155, 0.06181817, -0.018545056, 0.044176213, -0.07024062, -0.013022128, -0.0087189535, -0.025292343, 0.040448178, -0.051455554, -0.014017804, 0.012191985, 0.0071282317, -0.015855217, 0.013618914, -0.0060378346, -0.057781402, -0.035322957, -0.013627626, -0.027318006, -0.27732822, -0.007108157, 0.012321971, -0.15896526, -0.03793523, -0.025426138, 0.020721687, -0.04701553, -0.004927499, 0.010541978, -0.003212021, -0.0023603817, -0.052153032, 0.043272667, 0.024041472, -0.031666223, 0.0017891804, 0.026806207, -0.026526717, 0.0023138188, 0.024067048, 0.03326347, -0.039004102, -0.0004279829, 0.007266309, -0.008940641, 0.03715139, -0.037960306, 0.01647343, -0.022163782, 0.07456727, -0.0013284415, -0.029121747, 0.012727488, -0.007229313, 0.03177136, -0.08142398, 0.010223168, -0.025942598, -0.23807198, 0.022616733, -0.03925926, 0.05572623, -0.00020389797, -0.0022259122, -0.007885641, -0.00719495, 0.0018412926, 0.018953165, -0.009946787, 0.03723944, -0.015900994, 0.013648507, 0.010997674, -0.018918132, 0.013143112, 0.032894272, -0.05800237, 0.011163258, 0.025205074, -0.017001726, 0.03673705, -0.011551997, 0.06637543, -0.033003606, -0.041392814, -0.004078506, 0.03916763, -0.0022711542, 0.058338877, -0.034323692, -0.033700593, 0.01051642, 0.035579532, -0.01997833, 0.002977113, 0.06590587, 0.042783573, 0.020624464, 0.029172791, -0.035136282, 0.02035436, 0.05696583, -0.010200334, -0.0010580813, -0.024785697, -0.014516442, -0.030100575, -0.03807279, 0.042534467, -0.0281041, -0.05331885, -0.019467393, 0.016051197, 0.012470333, -0.008369627, 0.002254233, 0.026580654, -0.04541506, -0.018085537, -0.034577485, -0.0014747214, 0.0005770179, 0.0043190396, -0.004989785, 0.007569717, 0.010167482, -0.03335266, -0.015255423, 0.07341545, 0.012114007, -0.0010415721, 0.008754641, 0.05932771, 0.030799353, 0.026148474, -0.0069155577, -0.056865778, 0.0038446637, -0.010079895, 0.013511311, 0.023351224, -0.049000103, -0.013028001, -0.04957143, -0.031393193, 0.040289443, 0.063747466, 0.046358805, 0.0023754216, -0.0054107807, -0.020128531, 0.0013747461, -0.018183928, -0.04754063, -0.0064625163, 0.0417791, 0.06087331, -0.012241535, 0.04185439, 0.03641727, -0.02044306, -0.061368305, -0.023353308, 0.055897385, -0.047081504, 0.012900442, -0.018708078, 0.0028819577, 0.006964468, 0.0008757072, 0.04605831, 0.01716345, -0.004099444, -0.015493673, 0.021323929, -0.011252118, -0.02278577, 0.01893121, 0.009134488, 0.021568391, 0.011066748, -0.018853422, 0.027866907, -0.02831057, -0.010147286, 0.014807969, -0.03266599, -0.06711559, 0.038546126, 0.0031859868, -0.029038243, 0.046595056, 0.036973156, -0.033408422, 0.021968717, -0.011411975, 0.006584961, 0.072844714, -0.005873538, 0.029435376, 0.061169676, -0.02318868, 0.051129397, 0.014791153, -0.009028991, -0.021579748, 0.02669236, 0.029696332, -0.063952625, -0.061506465, -0.00080902094, 0.06850867, -0.09809231, -0.005534635, 0.066767104, -0.041267477, 0.046568397, 0.00983124, -0.0048434925, 0.038644254, 0.04096419, 0.0023063375, 0.014526287, 0.014016995, 0.020224908, 0.007113328, -0.0732543, -0.0054818415, 0.05807576, 0.022461535, 0.21100426, -0.009597197, -0.020674499, 0.010743241, -0.046834, -0.0068005333, 0.04918187, -0.06680011, -0.025018543, 0.016360015, 0.100744724, -0.019944709, -0.052390855, -0.0034876189, 0.031699855, -0.03024188, 0.009384044, -0.073849924, 0.01846066, -0.017075414, 0.0067319535, 0.045643695, 0.0121267075, 0.014980903, -0.0022226444, -0.015187039, 0.040638167, 0.023607453, -0.018353134, 0.007413985, 0.03487914, 0.018997269, -0.0107962405, -0.0040080273, 0.001454658, -0.023004232, -0.03065838, -0.0691732, -0.009669473, -0.017253181, 0.100617275, -0.00028453665, -0.055184573, -0.04010461, -0.022628073, -0.02138574, -0.00011931983, -0.021988528, 0.021569526, 0.018913478, -0.07588871, -0.030895703, -0.045679674, 0.03548181, 0.05806986, -0.00313453, 0.005607964, 0.014474551, -0.016833752, -0.022846023, 0.03665983, 0.04312398, 0.006030178, 0.020107903, -0.067837745, -0.039261904, -0.013903933, -0.011238981, -0.091779895, 0.03393072, 0.03576862, -0.016447216, -0.013628061, 0.035994843, 0.02442105, 0.0013356373, -0.013639993, -0.0070654624, -0.031047037, 0.0321763, 0.019488426, 0.030912274, -0.018131692, 0.034129236, -0.038152352, -0.020318052, 0.012934771, -0.0038958737, 0.029313264, 0.0609006, -0.06022117, -0.016697206, -0.030089315, -0.0030464267, -0.05011375, 0.016849633, -0.01935251, 0.00033423092, 0.018090008, 0.034528963, 0.015720658, 0.006443832, 0.0024674414, 0.0033006326, -0.011959118, -0.014686165, 0.00851113, 0.032130115, 0.016566927, -0.0048006177, -0.041135546, 0.017366901, 0.014404645, 0.0014093819, -0.039899524, -0.020875102, -0.01322629, -0.010891931, 0.019460721, -0.098985165, -0.03990147, 0.035807386, 0.05274234, -0.017714208, 0.0023620757, 0.022553496, 0.010935722, -0.016535437, -0.014505468, -0.005573891, -0.029528206, -0.010998497, 0.011297328, 0.007440231, 0.054734096, -0.035311602, 0.07038191, -0.034328025, -0.0109814005, -0.00578824, -0.009286793, 0.06692834, -0.040116422, -0.030043483, -0.010882302, -0.024094587, 0.026659116, -0.0637435, -0.022305744, 0.024388585, 0.011812823, -0.022778027, -0.0039024823, 0.027778644, 0.010566278, 0.011030791, -0.0021155484, 0.018014789, -0.03458981, 0.02546183, -0.11745906, 0.038193583, 0.0019787792, 0.01639592, 0.013218127, -0.012434678, -0.047858853, 0.006662704, 0.033221778, 0.008376927, -0.011822234, 0.01202769, 0.008761578, -0.04075117, 0.0025187496, 0.0026266004, 0.029762473, 0.009570205, -0.03644678, -0.033258904, -0.030776607, 0.05373578, 0.010904848, 0.040284622, 0.02707032, 0.021803873, -0.022011256, -0.05517991, -0.005213912, 0.009023477, -0.011895841, -0.026821174, -0.009035418, -0.021059638, 0.025536137, -0.053264923, 0.032206282, 0.020235807, 0.018660447, 0.0028790566, -0.019914437, 0.097842626, 0.027617158, 0.020276038, -0.014215543, 0.012761584, 0.032757074, 0.061124176, 0.049016643, -0.016509317, -0.03750349, -0.03449537, -0.02039439, -0.051360182, -0.041909404, 0.016175032, 0.040492736, 0.031218654, 0.0020242895, -0.032167237, 0.019398497, 0.057013687, 0.0031299617, 0.019177254, 0.015395364, -0.034078192, 0.041325297, 0.044380017, -0.004446819, 0.019610956, -0.030034903, 0.008468295, 0.03065914, -0.009548659, -0.07113981, 0.051648173, 0.03746448, -0.021847434, 0.01844844, 0.01333424, -0.001188216, 0.012330977, -0.056448817, 0.0008659569, 0.011183285, 0.006780519, -0.007357356, 0.05263679, -0.024631461, 0.00519591, -0.052165415, -0.03250626, -0.009370051, 0.00292325, -0.007187242, 0.029566163, -0.049605303, -0.02625627, -0.003157652, 0.052691437, -0.03589223, 0.03889354, -0.0035060279, 0.024555178, -0.00929779, -0.05037946, -0.022402484, 0.030634355, -0.03300659, -0.0063623153, 0.0027472514, 0.03196768, -0.019257778, 0.0089001395, 0.008908001, 0.018918095, 0.059574094, -0.02838763, 0.018203752, -0.06708146, -0.022670228, -0.013985525, 0.045018435, 0.011420395, -0.008649952, -0.027328938, -0.03527292, -0.0038555951, 0.017597001, 0.024891963, -0.0039160745, -0.015237065, -0.0008723479, -0.018641612, -0.036825016, -0.028743235, 0.00091956893, 0.00030935413, -0.048641082, 0.03744432, -0.024196126, 0.009848505, -0.043836866, 0.0044429195, 0.013709644, 0.06295503, -0.016072558, 0.01277375, -0.03548109, 0.003398656, 0.025347201, 0.019685786, 0.00758199, -0.016122513, -0.039198015, -0.0023108267, -0.0041584945, 0.005161282, 0.00089106365, 0.0076085874, -0.055768084, -0.0058975955, 0.007728267, 0.00076985586, -0.013469806, -0.031578194, -0.0138569595, 0.044540506, -0.0408136, -0.015252405, 0.06232591, -0.04198101, 0.0048899655, -0.0030694627, -0.025022805, -0.010789543, -0.025350742, 0.007836728, 0.024604483, -5.385127e-05, -0.0021367231, -0.01704561, -0.001425816, 0.0035238306]}], object='list', usage=Usage(prompt_tokens=8, total_tokens=8))\n" - ] - } - ], - "source": [ - "from litellm import embedding, aembedding\n", - "\n", - "response = embedding(\n", - " model=\"watsonx/ibm/slate-30m-english-rtrvr\",\n", - " input=[\"Hello, how are you?\"],\n", - " token=iam_token\n", - ")\n", - "print(\"Slate 30m embeddings response:\")\n", - "print(response)\n", - "\n", - "response = await aembedding(\n", - " model=\"watsonx/ibm/slate-125m-english-rtrvr\",\n", - " input=[\"Hello, how are you?\"],\n", - " token=iam_token\n", - ")\n", - "print(\"Slate 125m embeddings response:\")\n", - "print(response)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "base", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/cookbook/liteLLM_Langchain_Demo.ipynb b/cookbook/liteLLM_Langchain_Demo.ipynb deleted file mode 100644 index 6e796dd085c..00000000000 --- a/cookbook/liteLLM_Langchain_Demo.ipynb +++ /dev/null @@ -1,195 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "5hwntUxTMxEk" - }, - "source": [ - "# Langchain liteLLM Demo Notebook\n", - "## Use `ChatLiteLLM()` to instantly support 50+ LLM models\n", - "Langchain Docs: https://python.langchain.com/docs/integrations/chat/litellm\n", - "\n", - "Call all LLM models using the same I/O interface\n", - "\n", - "Example usage\n", - "```python\n", - "ChatLiteLLM(model=\"gpt-3.5-turbo\")\n", - "ChatLiteLLM(model=\"claude-2\", temperature=0.3)\n", - "ChatLiteLLM(model=\"command-nightly\")\n", - "ChatLiteLLM(model=\"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\")\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "aPNAUsCvB6Sv" - }, - "outputs": [], - "source": [ - "!pip install litellm langchain" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "MOhRaVnhB-0J" - }, - "outputs": [], - "source": [ - "import os\n", - "from langchain.chat_models import ChatLiteLLM\n", - "from langchain.schema import HumanMessage" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "TahkCtlmCD65", - "outputId": "5ddda40f-f252-4830-a8d6-bd3fa68ae487" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "AIMessage(content='I am an AI model known as GPT-3, developed by OpenAI.', additional_kwargs={}, example=False)" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "os.environ['OPENAI_API_KEY'] = \"\"\n", - "chat = ChatLiteLLM(model=\"gpt-3.5-turbo\")\n", - "messages = [\n", - " HumanMessage(\n", - " content=\"what model are you\"\n", - " )\n", - "]\n", - "chat(messages)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "uXNDyU4jChcs", - "outputId": "bd74b4c6-f9fb-42dc-fdc3-9240d50503ba" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "AIMessage(content=\" I'm Claude, an AI assistant created by Anthropic.\", additional_kwargs={}, example=False)" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "os.environ['ANTHROPIC_API_KEY'] = \"\"\n", - "chat = ChatLiteLLM(model=\"claude-2\", temperature=0.3)\n", - "messages = [\n", - " HumanMessage(\n", - " content=\"what model are you\"\n", - " )\n", - "]\n", - "chat(messages)" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "czbDJRKcC7BV", - "outputId": "892e147d-831e-4884-dc71-040f92c3fb8e" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "AIMessage(content=\" I'm an AI based based on LLaMA models (LLaMA: Open and Efficient Foundation Language Models, Touvron et al. 2023), my knowledge was built from a massive corpus of text, including books, articles, and websites, and I was trained using a variety of machine learning algorithms. My model architecture is based on the transformer architecture, which is particularly well-suited for natural language processing tasks. My team of developers and I are constantly working to improve and fine-tune my performance, and I am always happy to help with any questions you may have!\", additional_kwargs={}, example=False)" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "os.environ['REPLICATE_API_TOKEN'] = \"\"\n", - "chat = ChatLiteLLM(model=\"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\")\n", - "messages = [\n", - " HumanMessage(\n", - " content=\"what model are you?\"\n", - " )\n", - "]\n", - "chat(messages)" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "tZxpq5PDDY9Y", - "outputId": "7e86f4ed-ac7a-45e1-87d0-217da6cad666" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "AIMessage(content=' I am an AI-based large language model, or Chatbot, built by the company Cohere. I am designed to have polite, helpful, inclusive conversations with users. I am always learning and improving, and I am constantly being updated with new information and improvements.\\n\\nI am currently in the development phase, and I am not yet available to the general public. However, I am currently being used by a select group of users for testing and feedback.\\n\\nI am a large language model, which means that I am trained on a massive amount of data and can understand and respond to a wide range of requests and questions. I am also designed to be flexible and adaptable, so I can be customized to suit the needs of different users and use cases.\\n\\nI am currently being used to develop a range of applications, including customer service chatbots, content generation tools, and language translation services. I am also being used to train other language models and to develop new ways of using large language models.\\n\\nI am constantly being updated with new information and improvements, so I am always learning and improving. I am also being used to develop new ways of using large language models, so I am always evolving and adapting to new use cases and requirements.', additional_kwargs={}, example=False)" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "os.environ['COHERE_API_KEY'] = \"\"\n", - "chat = ChatLiteLLM(model=\"command-nightly\")\n", - "messages = [\n", - " HumanMessage(\n", - " content=\"what model are you?\"\n", - " )\n", - "]\n", - "chat(messages)" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/liteLLM_Ollama.ipynb b/cookbook/liteLLM_Ollama.ipynb deleted file mode 100644 index fe0ed3811fa..00000000000 --- a/cookbook/liteLLM_Ollama.ipynb +++ /dev/null @@ -1,289 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install litellm # version 0.1.724 or higher " - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Call Ollama - llama2 with Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "{'role': 'assistant', 'content': ' I'}\n", - "{'role': 'assistant', 'content': \"'\"}\n", - "{'role': 'assistant', 'content': 'm'}\n", - "{'role': 'assistant', 'content': ' L'}\n", - "{'role': 'assistant', 'content': 'La'}\n", - "{'role': 'assistant', 'content': 'MA'}\n", - "{'role': 'assistant', 'content': ','}\n", - "{'role': 'assistant', 'content': ' an'}\n", - "{'role': 'assistant', 'content': ' A'}\n", - "{'role': 'assistant', 'content': 'I'}\n", - "{'role': 'assistant', 'content': ' assistant'}\n", - "{'role': 'assistant', 'content': ' developed'}\n", - "{'role': 'assistant', 'content': ' by'}\n", - "{'role': 'assistant', 'content': ' Meta'}\n", - "{'role': 'assistant', 'content': ' A'}\n", - "{'role': 'assistant', 'content': 'I'}\n", - "{'role': 'assistant', 'content': ' that'}\n", - "{'role': 'assistant', 'content': ' can'}\n", - "{'role': 'assistant', 'content': ' understand'}\n", - "{'role': 'assistant', 'content': ' and'}\n", - "{'role': 'assistant', 'content': ' respond'}\n", - "{'role': 'assistant', 'content': ' to'}\n", - "{'role': 'assistant', 'content': ' human'}\n", - "{'role': 'assistant', 'content': ' input'}\n", - "{'role': 'assistant', 'content': ' in'}\n", - "{'role': 'assistant', 'content': ' a'}\n", - "{'role': 'assistant', 'content': ' convers'}\n", - "{'role': 'assistant', 'content': 'ational'}\n", - "{'role': 'assistant', 'content': ' manner'}\n", - "{'role': 'assistant', 'content': '.'}\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(\n", - " model=\"ollama/llama2\", \n", - " messages=[{ \"content\": \"respond in 20 words. who are you?\",\"role\": \"user\"}], \n", - " api_base=\"http://localhost:11434\",\n", - " stream=True\n", - ")\n", - "print(response)\n", - "for chunk in response:\n", - " print(chunk['choices'][0]['delta'])\n" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Call Ollama - Llama2 with Acompletion + Streaming" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Defaulting to user installation because normal site-packages is not writeable\n", - "Requirement already satisfied: async_generator in /Users/ishaanjaffer/Library/Python/3.9/lib/python/site-packages (1.10)\n" - ] - } - ], - "source": [ - "# litellm uses async_generator for ollama async streaming, ensure it's installed\n", - "!pip install async_generator" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'choices': [{'delta': {'role': 'assistant', 'content': ' I'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'm'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' just'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' an'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' A'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'I'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' I'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' don'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': \"'\"}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 't'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' have'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' access'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' real'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '-'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'time'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' weather'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' information'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' or'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' current'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' conditions'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' in'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' specific'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' location'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' живело'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' can'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' provide'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' with'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' weather'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' forec'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': 'asts'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' information'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' for'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' your'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' location'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' if'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' would'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' like'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' Please'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' let'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' me'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' know'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' where'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' are'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' located'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ','}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' and'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' I'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' will'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' do'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' my'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' best'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' to'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' assist'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': ' you'}}]}\n", - "{'choices': [{'delta': {'role': 'assistant', 'content': '.'}}]}\n", - "None\n" - ] - } - ], - "source": [ - "import litellm\n", - "\n", - "async def async_ollama():\n", - " response = await litellm.acompletion(\n", - " model=\"ollama/llama2\", \n", - " messages=[{ \"content\": \"what's the weather\" ,\"role\": \"user\"}], \n", - " api_base=\"http://localhost:11434\", \n", - " stream=True\n", - " )\n", - " async for chunk in response:\n", - " print(chunk)\n", - "\n", - "result = await async_ollama()\n", - "print(result)\n", - "\n", - "try:\n", - " async for chunk in result:\n", - " print(chunk)\n", - "except TypeError: # the last chunk is None from Ollama, this raises an error with async streaming\n", - " pass" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Completion Call" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" I'm LLaMA, an AI assistant developed by Meta AI that can understand and respond to human input in a conversational manner.\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-ea7b8242-791f-4656-ba12-e098edeb960e\",\n", - " \"created\": 1695324686.6696231,\n", - " \"response_ms\": 4072.3050000000003,\n", - " \"model\": \"ollama/llama2\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 10,\n", - " \"completion_tokens\": 27,\n", - " \"total_tokens\": 37\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "response = completion(\n", - " model=\"ollama/llama2\", \n", - " messages=[{ \"content\": \"respond in 20 words. who are you?\",\"role\": \"user\"}], \n", - " api_base=\"http://localhost:11434\"\n", - ")\n", - "print(response)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/cookbook/liteLLM_Replicate_Demo.ipynb b/cookbook/liteLLM_Replicate_Demo.ipynb deleted file mode 100644 index b93d9a587b8..00000000000 --- a/cookbook/liteLLM_Replicate_Demo.ipynb +++ /dev/null @@ -1,238 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "YV6L5fNv7Kep" - }, - "source": [ - "# Call Replicate LLMs using chatGPT Input/Output Format\n", - "This tutorial covers using the following Replicate Models with liteLLM\n", - "\n", - "- [StableLM Tuned Alpha 7B](https://replicate.com/stability-ai/stablelm-tuned-alpha-7b)\n", - "- [LLAMA-2 70B Chat](https://replicate.com/replicate/llama-2-70b-chat)\n", - "- [A16z infra-LLAMA-2 7B Chat](https://replicate.com/a16z-infra/llama-2-7b-chat)\n", - "- [Dolly V2 12B](https://replicate.com/replicate/dolly-v2-12b)\n", - "- [Vicuna 13B](https://replicate.com/replicate/vicuna-13b)\n", - "\n", - "\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "TO-EdF84O9QT" - }, - "outputs": [], - "source": [ - "# install liteLLM\n", - "!pip install litellm" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "mpHTbTqQ8fey" - }, - "source": [ - "Imports & Set ENV variables\n", - "Get your Replicate Key: https://replicate.com/account/api-tokens" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "kDbgfcU8O-dW" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "import os\n", - "os.environ['REPLICATE_API_TOKEN'] = ' ' # @param\n", - "user_message = \"Hello, whats the weather in San Francisco??\"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": { - "id": "1KmkOdzLSOmJ" - }, - "source": [ - "## Call Replicate Models using completion(model, messages) - chatGPT format" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XJ4nh4SnRzHP", - "outputId": "986c0544-bb40-4915-f00f-498b0e518307" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "replicate is not installed. Installing...\n", - "Response from stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb \n", - "]\n", - "\n", - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': \"I'm sorry for you being unable to access this content as my training data only goes up until 2023/03. However I can tell you what your local weather forecast may look like at any time of year with respect to current conditions:\"}}], 'created': 1691611730.7224207, 'model': 'stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb', 'usage': {'prompt_tokens': 9, 'completion_tokens': 49, 'total_tokens': 58}}\n", - "Response from replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1 \n", - "]\n", - "\n", - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': \" Hello! I'm happy to help you with your question. However, I must point out that the question itself may not be meaningful. San Francisco is a city located in California, USA, and it is not possible for me to provide you with the current weather conditions there as I am a text-based AI language model and do not have access to real-time weather data. Additionally, the weather in San Francisco can vary greatly depending on the time of year, so it would be best to check a reliable weather source for the most up-to-date information.\\n\\nIf you meant to ask a different question, please feel free to rephrase it, and I will do my best to assist you in a safe and positive manner.\"}}], 'created': 1691611745.0269957, 'model': 'replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1', 'usage': {'prompt_tokens': 9, 'completion_tokens': 143, 'total_tokens': 152}}\n", - "Response from a16z-infra/llama-2-7b-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc \n", - "]\n", - "\n", - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': \" Hello! I'm here to help you with your question. However, I must inform you that the weather in San Francisco can be quite unpredictable and can change rapidly. It's important to check reliable sources such as AccuWeather or the National Weather Service for the most up-to-date and accurate information about the weather in San Francisco.\\nI cannot provide you with real-time weather data or forecasts as I'm just an AI and do not have access to current weather conditions or predictions. But I can suggest some trustworthy websites or apps where you can find the latest weather updates:\\n* AccuWeather (accuweather.com)\\n* The Weather Channel (weather.com)\\n* Dark Sky (darksky.net)\\n* Weather Underground (wunderground.com)\\nRemember, it's always best to consult multiple sources for the most accurate information when planning your day or trip. Enjoy your day!\"}}], 'created': 1691611748.7723358, 'model': 'a16z-infra/llama-2-7b-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc', 'usage': {'prompt_tokens': 9, 'completion_tokens': 174, 'total_tokens': 183}}\n", - "Response from replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5 \n", - "]\n", - "\n", - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': 'Its 68 degrees right now in San Francisco! The temperature will be rising through the week and i expect it to reach 70 on Thursdays and Friday. Skies are expected to be partly cloudy with some sun breaks throughout the day.\\n\\n'}}], 'created': 1691611752.2002115, 'model': 'replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5', 'usage': {'prompt_tokens': 9, 'completion_tokens': 48, 'total_tokens': 57}}\n", - "Response from replicate/vicuna-13b:6282abe6a492de4145d7bb601023762212f9ddbbe78278bd6771c8b3b2f2a13b \n", - "]\n", - "\n", - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': ''}}], 'created': 1691611752.8998356, 'model': 'replicate/vicuna-13b:6282abe6a492de4145d7bb601023762212f9ddbbe78278bd6771c8b3b2f2a13b', 'usage': {'prompt_tokens': 9, 'completion_tokens': 0, 'total_tokens': 9}}\n" - ] - } - ], - "source": [ - "llama_2 = \"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\"\n", - "llama_2_7b = \"a16z-infra/llama-2-7b-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc\"\n", - "dolly_v2 = \"replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5\"\n", - "vicuna = \"replicate/vicuna-13b:6282abe6a492de4145d7bb601023762212f9ddbbe78278bd6771c8b3b2f2a13b\"\n", - "models = [llama_2, llama_2_7b, dolly_v2, vicuna]\n", - "for model in models:\n", - " response = completion(model=model, messages=messages)\n", - " print(f\"Response from {model} \\n]\\n\")\n", - " print(response)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "zlTVLB-7PTV_", - "outputId": "5182275b-3108-46fa-a2cf-745fac4ad110" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hi\n", - " there!\n", - " The\n", - " current\n", - " forecast\n", - " for\n", - " today's\n", - " high\n", - " temperature\n", - " ranges\n", - " from\n", - " 75\n", - " degrees\n", - " Fahrenheit\n", - " all\n", - " day\n", - " to\n", - " 83\n", - " degrees\n", - " Fahrenheit\n", - " with\n", - " possible\n", - " isolated\n", - " thunderstorms\n", - " during\n", - " the\n", - " afternoon\n", - " hours,\n", - " mainly\n", - " at\n", - " sunset\n", - " through\n", - " early\n", - " evening. The\n", - " Pacific\n", - " Ocean\n", - " has\n", - " a\n", - " low\n", - " pressure\n", - " of\n", - " 926\n", - " mb\n", - " and\n", - " mostly\n", - " cloud\n", - " cover\n", - " in\n", - " this\n", - " region\n", - " on\n", - " sunny\n", - " days\n", - " due\n", - " to\n", - " warming\n", - " temperatures\n", - " above\n", - " average\n", - " along\n", - " most\n", - " coastal\n", - " areas\n", - " and\n", - " ocean\n", - " breezes.<|USER|>\n" - ] - } - ], - "source": [ - "# @title Stream Responses from Replicate - Outputs in the same format used by chatGPT streaming\n", - "response = completion(model=llama_2, messages=messages, stream=True)\n", - "\n", - "for chunk in response:\n", - " print(chunk['choices'][0]['delta'])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "t7WMRuL-8NrO" - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/liteLLM_Streaming_Demo.ipynb b/cookbook/liteLLM_Streaming_Demo.ipynb deleted file mode 100644 index 0456c54514b..00000000000 --- a/cookbook/liteLLM_Streaming_Demo.ipynb +++ /dev/null @@ -1,226 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "# [STREAMING] OpenAI, Anthropic, Replicate, Cohere using liteLLM\n", - "In this tutorial:\n", - "Note: All inputs/outputs are in the format used by `gpt-3.5-turbo`\n", - "\n", - "- Call all models in the same input format [**with streaming**]:\n", - "\n", - " `completion(model, messages, stream=True)`\n", - "- All streaming generators are accessed at `chunk['choices'][0]['delta']`\n", - "\n", - "The following Models are covered in this tutorial\n", - "- [GPT-3.5-Turbo](https://platform.openai.com/docs/models/gpt-3-5)\n", - "- [Claude-2](https://www.anthropic.com/index/claude-2)\n", - "- [StableLM Tuned Alpha 7B](https://replicate.com/stability-ai/stablelm-tuned-alpha-7b)\n", - "- [A16z infra-LLAMA-2 7B Chat](https://replicate.com/a16z-infra/llama-2-7b-chat)\n", - "- [Vicuna 13B](https://replicate.com/replicate/vicuna-13b)\n", - "- [Cohere - Command Nightly]()\n", - "\n", - "\n", - "\n" - ], - "metadata": { - "id": "YV6L5fNv7Kep" - } - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "TO-EdF84O9QT" - }, - "outputs": [], - "source": [ - "# install liteLLM\n", - "!pip install litellm==0.1.369" - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Imports & Set ENV variables\n", - "Get your API Keys\n", - "\n", - "https://platform.openai.com/account/api-keys\n", - "\n", - "https://replicate.com/account/api-tokens\n", - "\n", - "https://console.anthropic.com/account/keys\n", - "\n", - "https://dashboard.cohere.ai/api-keys\n" - ], - "metadata": { - "id": "mpHTbTqQ8fey" - } - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion\n", - "import os\n", - "\n", - "os.environ['OPENAI_API_KEY'] = '' # @param\n", - "os.environ['REPLICATE_API_TOKEN'] = '' # @param\n", - "os.environ['ANTHROPIC_API_KEY'] = '' # @param\n", - "os.environ['COHERE_API_KEY'] = '' # @param" - ], - "metadata": { - "id": "kDbgfcU8O-dW" - }, - "execution_count": 8, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "### Set Messages" - ], - "metadata": { - "id": "1KmkOdzLSOmJ" - } - }, - { - "cell_type": "code", - "source": [ - "user_message = \"Hello, whats the weather in San Francisco??\"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]" - ], - "metadata": { - "id": "xIEeOhVH-oh6" - }, - "execution_count": 4, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "## Calling Models using liteLLM Streaming -\n", - "\n", - "## `completion(model, messages, stream)`" - ], - "metadata": { - "id": "9SOCVRC1L-G3" - } - }, - { - "cell_type": "code", - "source": [ - "# replicate models #######\n", - "stability_ai = \"stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb\"\n", - "llama_2_7b = \"a16z-infra/llama-2-7b-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc\"\n", - "vicuna = \"replicate/vicuna-13b:6282abe6a492de4145d7bb601023762212f9ddbbe78278bd6771c8b3b2f2a13b\"\n", - "\n", - "models = [\"gpt-3.5-turbo\", \"claude-2\", stability_ai, llama_2_7b, vicuna, \"command-nightly\"] # command-nightly is Cohere\n", - "for model in models:\n", - " replicate = (model == stability_ai or model==llama_2_7b or model==vicuna) # let liteLLM know if a model is replicate, using this optional param, `replicate=True`\n", - " response = completion(model=model, messages=messages, stream=True, replicate=replicate)\n", - " print(f\"####################\\n\\nResponse from {model}\")\n", - " for i, chunk in enumerate(response):\n", - " if i < 5: # NOTE: LIMITING CHUNKS FOR THIS DEMO\n", - " print((chunk['choices'][0]['delta']))\n" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XJ4nh4SnRzHP", - "outputId": "26b9fe10-b499-4a97-d60d-a8cb8f8030b8" - }, - "execution_count": 13, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "####################\n", - "\n", - "Response from gpt-3.5-turbo\n", - "{\n", - " \"role\": \"assistant\",\n", - " \"content\": \"\"\n", - "}\n", - "{\n", - " \"content\": \"I\"\n", - "}\n", - "{\n", - " \"content\": \"'m\"\n", - "}\n", - "{\n", - " \"content\": \" sorry\"\n", - "}\n", - "{\n", - " \"content\": \",\"\n", - "}\n", - "####################\n", - "\n", - "Response from claude-2\n", - "{'role': 'assistant', 'content': ' Unfortunately'}\n", - "{'role': 'assistant', 'content': ' I'}\n", - "{'role': 'assistant', 'content': ' don'}\n", - "{'role': 'assistant', 'content': \"'t\"}\n", - "{'role': 'assistant', 'content': ' have'}\n", - "####################\n", - "\n", - "Response from stability-ai/stablelm-tuned-alpha-7b:c49dae362cbaecd2ceabb5bd34fdb68413c4ff775111fea065d259d577757beb\n", - "{'role': 'assistant', 'content': \"I'm\"}\n", - "{'role': 'assistant', 'content': ' sorry,'}\n", - "{'role': 'assistant', 'content': ' I'}\n", - "{'role': 'assistant', 'content': ' cannot'}\n", - "{'role': 'assistant', 'content': ' answer'}\n", - "####################\n", - "\n", - "Response from a16z-infra/llama-2-7b-chat:4f0b260b6a13eb53a6b1891f089d57c08f41003ae79458be5011303d81a394dc\n", - "{'role': 'assistant', 'content': ''}\n", - "{'role': 'assistant', 'content': ' Hello'}\n", - "{'role': 'assistant', 'content': '!'}\n", - "{'role': 'assistant', 'content': ' I'}\n", - "{'role': 'assistant', 'content': \"'\"}\n", - "####################\n", - "\n", - "Response from replicate/vicuna-13b:6282abe6a492de4145d7bb601023762212f9ddbbe78278bd6771c8b3b2f2a13b\n", - "{'role': 'assistant', 'content': 'Comment:'}\n", - "{'role': 'assistant', 'content': 'Hi! '}\n", - "{'role': 'assistant', 'content': 'How '}\n", - "{'role': 'assistant', 'content': 'are '}\n", - "{'role': 'assistant', 'content': 'you '}\n", - "####################\n", - "\n", - "Response from command-nightly\n", - "{'role': 'assistant', 'content': ' Hello'}\n", - "{'role': 'assistant', 'content': '!'}\n", - "{'role': 'assistant', 'content': ' '}\n", - "{'role': 'assistant', 'content': ' I'}\n", - "{'role': 'assistant', 'content': \"'m\"}\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "t7WMRuL-8NrO" - }, - "execution_count": null, - "outputs": [] - } - ] -} \ No newline at end of file diff --git a/cookbook/liteLLM_VertextAI_Example.ipynb b/cookbook/liteLLM_VertextAI_Example.ipynb deleted file mode 100644 index 0af012b34e3..00000000000 --- a/cookbook/liteLLM_VertextAI_Example.ipynb +++ /dev/null @@ -1,199 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Using Google Palm (VertexAI) with liteLLM \n", - "### chat-bison, chat-bison@001, text-bison, text-bison@001" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!pip install litellm==0.1.388" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Set VertexAI Configs\n", - "Vertex AI requires the following:\n", - "* `vertex_project` - Your Project ID\n", - "* `vertex_location` - Your Vertex AI region\n", - "Both can be found on: https://console.cloud.google.com/\n", - "\n", - "VertexAI uses Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information on setting this up\n", - "\n", - "NOTE: VertexAI requires you to set `application_default_credentials.json`, this can be set by running `gcloud auth application-default login` in your terminal\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "# set you Vertex AI configs\n", - "import litellm\n", - "from litellm import completion\n", - "\n", - "litellm.vertex_project = \"hardy-device-386718\"\n", - "litellm.vertex_location = \"us-central1\"" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Call VertexAI - chat-bison using liteLLM" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': LiteLLM LiteLLM is a large language model from Google AI that is designed to be lightweight and efficient. It is based on the Transformer architecture and has been trained on a massive dataset of text. LiteLLM is available as a pre-trained model that can be used for a variety of natural language processing tasks, such as text classification, question answering, and summarization.}}], 'created': 1692036777.831989, 'model': 'chat-bison'}\n" - ] - } - ], - "source": [ - "user_message = \"what is liteLLM \"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]\n", - "\n", - "# chat-bison or chat-bison@001 supported by Vertex AI (As of Aug 2023)\n", - "response = completion(model=\"chat-bison\", messages=messages)\n", - "print(response)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Call VertexAI - text-bison using liteLLM" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['text-bison', 'text-bison@001']\n" - ] - } - ], - "source": [ - "print(litellm.vertex_text_models)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': liteLLM is a low-precision variant of the large language model LLM 5. For a given text prompt, liteLLM can continue the text in a way that is both coherent and informative.}}], 'created': 1692036813.052487, 'model': 'text-bison@001'}\n" - ] - } - ], - "source": [ - "user_message = \"what is liteLLM \"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]\n", - "\n", - "# text-bison or text-bison@001 supported by Vertex AI (As of Aug 2023)\n", - "response = completion(model=\"text-bison@001\", messages=messages)\n", - "print(response)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'role': 'assistant', 'content': liteLLM was originally developed by Google engineers as a lite version of LLM, which stands for large language model. It is a deep learning language model that is designed to be more efficient than traditional LLMs while still achieving comparable performance. liteLLM is built on Tensor2Tensor, a framework for building and training large neural networks. It is able to learn from massive amounts of text data and generate text that is both coherent and informative. liteLLM has been shown to be effective for a variety of tasks, including machine translation, text summarization, and question answering.}}], 'created': 1692036821.60951, 'model': 'text-bison'}\n" - ] - } - ], - "source": [ - "response = completion(model=\"text-bison\", messages=messages)\n", - "print(response)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "liteLLM is a lightweight language model that is designed to be fast and efficient. It is based on the Transformer architecture, but it has been modified to reduce the number of parameters and the amount of computation required. This makes it suitable for use on devices with limited resources, such as mobile phones and embedded systems.\n", - "\n", - "liteLLM is still under development, but it has already been shown to be effective on a variety of tasks, including text classification, natural language inference, and machine translation. It is also being used to develop new applications, such as chatbots and language assistants.\n", - "\n", - "If you are interested in learning more about lite\n" - ] - } - ], - "source": [ - "response = completion(model=\"text-bison@001\", messages=messages, temperature=0.4, top_k=10, top_p=0.2)\n", - "print(response['choices'][0]['message']['content'])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.6" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/cookbook/liteLLM_clarifai_Demo.ipynb b/cookbook/liteLLM_clarifai_Demo.ipynb deleted file mode 100644 index 40ef2fcf932..00000000000 --- a/cookbook/liteLLM_clarifai_Demo.ipynb +++ /dev/null @@ -1,187 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# LiteLLM Clarifai \n", - "This notebook walks you through on how to use liteLLM integration of Clarifai and call LLM model from clarifai with response in openAI output format." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Pre-Requisites" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#install necessary packages\n", - "!pip install litellm\n", - "!pip install clarifai" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To obtain Clarifai Personal Access Token follow the steps mentioned in the [link](https://docs.clarifai.com/clarifai-basics/authentication/personal-access-tokens/)" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "## Set Clarifai Credentials\n", - "import os\n", - "os.environ[\"CLARIFAI_API_KEY\"]= \"YOUR_CLARIFAI_PAT\" # Clarifai PAT" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Mistral-large" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "import litellm\n", - "\n", - "litellm.set_verbose=False" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Mistral large response : ModelResponse(id='chatcmpl-6eed494d-7ae2-4870-b9c2-6a64d50a6151', choices=[Choices(finish_reason='stop', index=1, message=Message(content=\"In the grand tapestry of time, where tales unfold,\\nLies the chronicle of ages, a sight to behold.\\nA tale of empires rising, and kings of old,\\nOf civilizations lost, and stories untold.\\n\\nOnce upon a yesterday, in a time so vast,\\nHumans took their first steps, casting shadows in the past.\\nFrom the cradle of mankind, a journey they embarked,\\nThrough stone and bronze and iron, their skills they sharpened and marked.\\n\\nEgyptians built pyramids, reaching for the skies,\\nWhile Greeks sought wisdom, truth, in philosophies that lie.\\nRoman legions marched, their empire to expand,\\nAnd in the East, the Silk Road joined the world, hand in hand.\\n\\nThe Middle Ages came, with knights in shining armor,\\nFeudal lords and serfs, a time of both clamor and calm order.\\nThen Renaissance bloomed, like a flower in the sun,\\nA rebirth of art and science, a new age had begun.\\n\\nAcross the vast oceans, explorers sailed with courage bold,\\nDiscovering new lands, stories of adventure, untold.\\nIndustrial Revolution churned, progress in its wake,\\nMachines and factories, a whole new world to make.\\n\\nTwo World Wars raged, a testament to man's strife,\\nYet from the ashes rose hope, a renewed will for life.\\nInto the modern era, technology took flight,\\nConnecting every corner, bathed in digital light.\\n\\nHistory, a symphony, a melody of time,\\nA testament to human will, resilience so sublime.\\nIn every page, a lesson, in every tale, a guide,\\nFor understanding our past, shapes our future's tide.\", role='assistant'))], created=1713896412, model='https://api.clarifai.com/v2/users/mistralai/apps/completion/models/mistral-large/outputs', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=13, completion_tokens=338, total_tokens=351))\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "messages = [{\"role\": \"user\",\"content\": \"\"\"Write a poem about history?\"\"\"}]\n", - "response=completion(\n", - " model=\"clarifai/mistralai.completion.mistral-large\",\n", - " messages=messages,\n", - " )\n", - "\n", - "print(f\"Mistral large response : {response}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Claude-2.1 " - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Claude-2.1 response : ModelResponse(id='chatcmpl-d126c919-4db4-4aa3-ac8f-7edea41e0b93', choices=[Choices(finish_reason='stop', index=1, message=Message(content=\" Here's a poem I wrote about history:\\n\\nThe Tides of Time\\n\\nThe tides of time ebb and flow,\\nCarrying stories of long ago.\\nFigures and events come into light,\\nShaping the future with all their might.\\n\\nKingdoms rise, empires fall, \\nLeaving traces that echo down every hall.\\nRevolutions bring change with a fiery glow,\\nToppling structures from long ago.\\n\\nExplorers traverse each ocean and land,\\nSeeking treasures they don't understand.\\nWhile artists and writers try to make their mark,\\nHoping their works shine bright in the dark.\\n\\nThe cycle repeats again and again,\\nAs humanity struggles to learn from its pain.\\nThough the players may change on history's stage,\\nThe themes stay the same from age to age.\\n\\nWar and peace, life and death,\\nLove and strife with every breath.\\nThe tides of time continue their dance,\\nAs we join in, by luck or by chance.\\n\\nSo we study the past to light the way forward, \\nHeeding warnings from stories told and heard.\\nThe future unfolds from this unending flow -\\nWhere the tides of time ultimately go.\", role='assistant'))], created=1713896579, model='https://api.clarifai.com/v2/users/anthropic/apps/completion/models/claude-2_1/outputs', object='chat.completion', system_fingerprint=None, usage=Usage(prompt_tokens=12, completion_tokens=232, total_tokens=244))\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "messages = [{\"role\": \"user\",\"content\": \"\"\"Write a poem about history?\"\"\"}]\n", - "response=completion(\n", - " model=\"clarifai/anthropic.completion.claude-2_1\",\n", - " messages=messages,\n", - " )\n", - "\n", - "print(f\"Claude-2.1 response : {response}\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### OpenAI GPT-4 (Streaming)\n", - "Though clarifai doesn't support streaming, still you can call stream and get the response in standard StreamResponse format of liteLLM" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ModelResponse(id='chatcmpl-40ae19af-3bf0-4eb4-99f2-33aec3ba84af', choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(content=\"In the quiet corners of time's grand hall,\\nLies the tale of rise and fall.\\nFrom ancient ruins to modern sprawl,\\nHistory, the greatest story of them all.\\n\\nEmpires have risen, empires have decayed,\\nThrough the eons, memories have stayed.\\nIn the book of time, history is laid,\\nA tapestry of events, meticulously displayed.\\n\\nThe pyramids of Egypt, standing tall,\\nThe Roman Empire's mighty sprawl.\\nFrom Alexander's conquest, to the Berlin Wall,\\nHistory, a silent witness to it all.\\n\\nIn the shadow of the past we tread,\\nWhere once kings and prophets led.\\nTheir stories in our hearts are spread,\\nEchoes of their words, in our minds are read.\\n\\nBattles fought and victories won,\\nActs of courage under the sun.\\nTales of love, of deeds done,\\nIn history's grand book, they all run.\\n\\nHeroes born, legends made,\\nIn the annals of time, they'll never fade.\\nTheir triumphs and failures all displayed,\\nIn the eternal march of history's parade.\\n\\nThe ink of the past is forever dry,\\nBut its lessons, we cannot deny.\\nIn its stories, truths lie,\\nIn its wisdom, we rely.\\n\\nHistory, a mirror to our past,\\nA guide for the future vast.\\nThrough its lens, we're ever cast,\\nIn the drama of life, forever vast.\", role='assistant', function_call=None, tool_calls=None), logprobs=None)], created=1714744515, model='https://api.clarifai.com/v2/users/openai/apps/chat-completion/models/GPT-4/outputs', object='chat.completion.chunk', system_fingerprint=None)\n", - "ModelResponse(id='chatcmpl-40ae19af-3bf0-4eb4-99f2-33aec3ba84af', choices=[StreamingChoices(finish_reason='stop', index=0, delta=Delta(content=None, role=None, function_call=None, tool_calls=None), logprobs=None)], created=1714744515, model='https://api.clarifai.com/v2/users/openai/apps/chat-completion/models/GPT-4/outputs', object='chat.completion.chunk', system_fingerprint=None)\n" - ] - } - ], - "source": [ - "from litellm import completion\n", - "\n", - "messages = [{\"role\": \"user\",\"content\": \"\"\"Write a poem about history?\"\"\"}]\n", - "response = completion(\n", - " model=\"clarifai/openai.chat-completion.GPT-4\",\n", - " messages=messages,\n", - " stream=True,\n", - " api_key = \"c75cc032415e45368be331fdd2c06db0\")\n", - "\n", - "for chunk in response:\n", - " print(chunk)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.13" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/cookbook/liteLLM_function_calling.ipynb b/cookbook/liteLLM_function_calling.ipynb deleted file mode 100644 index 45f4398b386..00000000000 --- a/cookbook/liteLLM_function_calling.ipynb +++ /dev/null @@ -1,331 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "vnvlwUDZK7VA" - }, - "source": [ - "## Demo Notebook of Function Calling with liteLLM\n", - "- Supported Providers for Function Calling\n", - " - OpenAI - `gpt-4-0613` and `gpt-3.5-turbo-0613`\n", - "- In this notebook we use function calling with `litellm.completion()`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "KrINCwRfLgZV" - }, - "outputs": [], - "source": [ - "## Install liteLLM\n", - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "nK7zR5OgLlh2" - }, - "outputs": [], - "source": [ - "import os\n", - "from litellm import completion" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "id": "dCQlyBxKLqbA" - }, - "outputs": [], - "source": [ - "os.environ['OPENAI_API_KEY'] = \"\" #@param" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "gfdGv-FMRCdX" - }, - "source": [ - "## Define Messages, Functions\n", - "We create a get_current_weather() function and pass that to GPT 3.5\n", - "\n", - "See OpenAI docs for this: https://openai.com/blog/function-calling-and-other-api-updates" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "id": "ERzsP1sfM19C" - }, - "outputs": [], - "source": [ - "messages = [\n", - " {\"role\": \"user\", \"content\": \"What is the weather like in Boston?\"}\n", - "]\n", - "\n", - "def get_current_weather(location):\n", - " if location == \"Boston, MA\":\n", - " return \"The weather is 12F\"\n", - "\n", - "functions = [\n", - " {\n", - " \"name\": \"get_current_weather\",\n", - " \"description\": \"Get the current weather in a given location\",\n", - " \"parameters\": {\n", - " \"type\": \"object\",\n", - " \"properties\": {\n", - " \"location\": {\n", - " \"type\": \"string\",\n", - " \"description\": \"The city and state, e.g. San Francisco, CA\"\n", - " },\n", - " \"unit\": {\n", - " \"type\": \"string\",\n", - " \"enum\": [\"celsius\", \"fahrenheit\"]\n", - " }\n", - " },\n", - " \"required\": [\"location\"]\n", - " }\n", - " }\n", - " ]" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "NX6by2VuRPnp" - }, - "source": [ - "## Call gpt-3.5-turbo-0613 to Decide what Function to call" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "QVoJ5PtxMlVx", - "outputId": "efe7a81f-e04a-4afc-aa60-a2b2648f5fb9" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"id\": \"chatcmpl-7mX4RiqdoislVEqfmfVjFSKp3hyIy\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1691801223,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": null,\n", - " \"function_call\": {\n", - " \"name\": \"get_current_weather\",\n", - " \"arguments\": \"{\\n \\\"location\\\": \\\"Boston, MA\\\"\\n}\"\n", - " }\n", - " },\n", - " \"finish_reason\": \"function_call\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 82,\n", - " \"completion_tokens\": 18,\n", - " \"total_tokens\": 100\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "response = completion(model=\"gpt-3.5-turbo-0613\", messages=messages, functions=functions)\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "Yu0o2saDNLx8" - }, - "source": [ - "## Parse GPT 3.5 Response\n", - "Read Information about what Function to Call" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "u1DzXLJsNOR5", - "outputId": "177e9501-0ce2-4619-9067-3047f18f6c79" - }, - "outputs": [ - { - "data": { - "text/plain": [ - " JSON: {\n", - " \"name\": \"get_current_weather\",\n", - " \"arguments\": \"{\\n \\\"location\\\": \\\"Boston, MA\\\"\\n}\"\n", - "}" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "function_call_data = response[\"choices\"][0][\"message\"][\"function_call\"]\n", - "function_call_data" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "tYb96Mh0NhH9", - "outputId": "13c4bb89-6f29-4b3b-afa7-302dcf2cdd5f" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "get_current_weather {'location': 'Boston, MA'}\n" - ] - } - ], - "source": [ - "import json\n", - "function_name = function_call_data['name']\n", - "function_args = function_call_data['arguments']\n", - "function_args = json.loads(function_args)\n", - "print(function_name, function_args)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "z3tstH_yN3fX" - }, - "source": [ - "## Call the get_current_weather() function" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "TSb8JHhgN5Zc", - "outputId": "ef140572-4020-4daf-ac8c-d5161be9aa5c" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "12F\n" - ] - } - ], - "source": [ - "if function_name == \"get_current_weather\":\n", - " result = get_current_weather(**function_args)\n", - " print(result)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "k4HGJE3NRmMI" - }, - "source": [ - "## Send the response from get_current_weather back to the model to summarize" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "a23cmEwiPaw7", - "outputId": "43259b86-0c4c-4fcb-eab7-6e1a788b2f21" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"id\": \"chatcmpl-7mXGN62u75WXp1Lgen4iSgNvA7hHT\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1691801963,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"The current weather in Boston is 12 degrees Fahrenheit.\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 109,\n", - " \"completion_tokens\": 12,\n", - " \"total_tokens\": 121\n", - " }\n", - "}\n" - ] - } - ], - "source": [ - "messages = [\n", - " {\"role\": \"user\", \"content\": \"What is the weather like in Boston?\"},\n", - " {\"role\": \"assistant\", \"content\": None, \"function_call\": {\"name\": \"get_current_weather\", \"arguments\": \"{ \\\"location\\\": \\\"Boston, MA\\\"}\"}},\n", - " {\"role\": \"function\", \"name\": \"get_current_weather\", \"content\": result}\n", - "]\n", - "response = completion(model=\"gpt-3.5-turbo-0613\", messages=messages, functions=functions)\n", - "print(response)" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/litellm_Test_Multiple_Providers.ipynb b/cookbook/litellm_Test_Multiple_Providers.ipynb deleted file mode 100644 index 3901581e67f..00000000000 --- a/cookbook/litellm_Test_Multiple_Providers.ipynb +++ /dev/null @@ -1,571 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "Ys9n20Es2IzT" - }, - "source": [ - "# Evaluate Multiple LLM Providers with LiteLLM\n", - "\n", - "\n", - "\n", - "* Quality Testing\n", - "* Load Testing\n", - "* Duration Testing\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ZXOXl23PIIP6" - }, - "outputs": [], - "source": [ - "!pip install litellm python-dotenv" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "LINuBzXDItq2" - }, - "outputs": [], - "source": [ - "from litellm import load_test_model, testing_batch_completion" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "EkxMhsWdJdu4" - }, - "outputs": [], - "source": [ - "from dotenv import load_dotenv\n", - "load_dotenv()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "mv5XdnqeW5I_" - }, - "source": [ - "# Quality Test endpoint\n", - "\n", - "## Test the same prompt across multiple LLM providers\n", - "\n", - "In this example, let's ask some questions about Paul Graham" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "XpzrR5m4W_Us" - }, - "outputs": [], - "source": [ - "models = [\"gpt-3.5-turbo\", \"gpt-3.5-turbo-16k\", \"gpt-4\", \"claude-instant-1\", \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\"]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompts = [\"Who is Paul Graham?\", \"What is Paul Graham known for?\" , \"Is paul graham a writer?\" , \"Where does Paul Graham live?\", \"What has Paul Graham done?\"]\n", - "messages = [[{\"role\": \"user\", \"content\": context + \"\\n\" + prompt}] for prompt in prompts] # pass in a list of messages we want to test\n", - "result = testing_batch_completion(models=models, messages=messages)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "9nzeLySnvIIW" - }, - "source": [ - "## Visualize the data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 403 - }, - "id": "X-2n7hdAuVAY", - "outputId": "69cc0de1-68e3-4c12-a8ea-314880010d94" - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
Model Nameclaude-instant-1gpt-3.5-turbo-0613gpt-3.5-turbo-16k-0613gpt-4-0613replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781
Prompt
\\nIs paul graham a writer?Yes, Paul Graham is considered a writer in ad...Yes, Paul Graham is a writer. He has written s...Yes, Paul Graham is a writer. He has authored ...Yes, Paul Graham is a writer. He is an essayis...Yes, Paul Graham is an author. According to t...
\\nWhat has Paul Graham done?Paul Graham has made significant contribution...Paul Graham has achieved several notable accom...Paul Graham has made significant contributions...Paul Graham is known for his work on the progr...Paul Graham has had a diverse career in compu...
\\nWhat is Paul Graham known for?Paul Graham is known for several things:\\n\\n-...Paul Graham is known for his work on the progr...Paul Graham is known for his work on the progr...Paul Graham is known for his work on the progr...Paul Graham is known for many things, includi...
\\nWhere does Paul Graham live?Based on the information provided:\\n\\n- Paul ...According to the given information, Paul Graha...Paul Graham currently lives in England, where ...The text does not provide a current place of r...Based on the information provided, Paul Graha...
\\nWho is Paul Graham?Paul Graham is an influential computer scient...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist, ...Paul Graham is an English computer scientist,...
\n", - "
\n", - " \n", - "\n", - "\n", - "\n", - "
\n", - " \n", - "
\n", - "\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - " \n", - "\n", - " \n", - "
\n", - "
\n" - ], - "text/plain": [ - "Model Name claude-instant-1 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is considered a writer in ad... \n", - "\\nWhat has Paul Graham done? Paul Graham has made significant contribution... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for several things:\\n\\n-... \n", - "\\nWhere does Paul Graham live? Based on the information provided:\\n\\n- Paul ... \n", - "\\nWho is Paul Graham? Paul Graham is an influential computer scient... \n", - "\n", - "Model Name gpt-3.5-turbo-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He has written s... \n", - "\\nWhat has Paul Graham done? Paul Graham has achieved several notable accom... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? According to the given information, Paul Graha... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name gpt-3.5-turbo-16k-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He has authored ... \n", - "\\nWhat has Paul Graham done? Paul Graham has made significant contributions... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? Paul Graham currently lives in England, where ... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name gpt-4-0613 \\\n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is a writer. He is an essayis... \n", - "\\nWhat has Paul Graham done? Paul Graham is known for his work on the progr... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for his work on the progr... \n", - "\\nWhere does Paul Graham live? The text does not provide a current place of r... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist, ... \n", - "\n", - "Model Name replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781 \n", - "Prompt \n", - "\\nIs paul graham a writer? Yes, Paul Graham is an author. According to t... \n", - "\\nWhat has Paul Graham done? Paul Graham has had a diverse career in compu... \n", - "\\nWhat is Paul Graham known for? Paul Graham is known for many things, includi... \n", - "\\nWhere does Paul Graham live? Based on the information provided, Paul Graha... \n", - "\\nWho is Paul Graham? Paul Graham is an English computer scientist,... " - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import pandas as pd\n", - "\n", - "# Create an empty list to store the row data\n", - "table_data = []\n", - "\n", - "# Iterate through the list and extract the required data\n", - "for item in result:\n", - " prompt = item['prompt'][0]['content'].replace(context, \"\") # clean the prompt for easy comparison\n", - " model = item['response']['model']\n", - " response = item['response']['choices'][0]['message']['content']\n", - " table_data.append([prompt, model, response])\n", - "\n", - "# Create a DataFrame from the table data\n", - "df = pd.DataFrame(table_data, columns=['Prompt', 'Model Name', 'Response'])\n", - "\n", - "# Pivot the DataFrame to get the desired table format\n", - "table = df.pivot(index='Prompt', columns='Model Name', values='Response')\n", - "table" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "zOxUM40PINDC" - }, - "source": [ - "# Load Test endpoint\n", - "\n", - "Run 100+ simultaneous queries across multiple providers to see when they fail + impact on latency" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ZkQf_wbcIRQ9" - }, - "outputs": [], - "source": [ - "models=[\"gpt-3.5-turbo\", \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\", \"claude-instant-1\"]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompt = \"Where does Paul Graham live?\"\n", - "final_prompt = context + prompt\n", - "result = load_test_model(models=models, prompt=final_prompt, num_calls=5)" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "8vSNBFC06aXY" - }, - "source": [ - "## Visualize the data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 552 - }, - "id": "SZfiKjLV3-n8", - "outputId": "00f7f589-b3da-43ed-e982-f9420f074b8d" - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUg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iIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki09bRdARETy5TRqv7ZLIC0LndVIq4/PHhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki0GFSIiIpItBhUiIiKSLQYVIiIiki3ZBJVZs2ZBoVBg0KBB2i6FiIiIZEIWQeXixYtYsWIFXFxctF0KERERyYjWg0psbCw6dOiAlStXwtLSUtvlEBERkYxoPah4enqiUaNGqF279n+um5iYiOjoaJULERERZVx62nzwzZs348qVK7h48eJ3rT9z5kxMnjw5nasiIiIiudBaj8rTp08xcOBA+Pv7w8jI6LtuM3r0aERFRUmXp0+fpnOVREREpE1a61G5fPkywsPDUbp0aaktJSUFJ06cwNKlS5GYmAhdXV2V2xgaGsLQ0PBXl0pERERaorWgUqtWLdy8eVOlrWvXrihUqBBGjhyZJqQQERFR5qO1oJI1a1YUK1ZMpc3U1BTZsmVL005ERESZk9Zn/RARERF9i1Zn/Xzp2LFj2i6BiIiIZIQ9KkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWwwqREREJFsMKkRERCRbDCpEREQkWw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IiIsq81O5RyZUrF/bt25emfeHChRopiIiIiCjVDx1HRalUIiQkBOHh4VAqlSrLqlatqpHCiIiIiNQOKufOnUP79u0RFhYGIYTKMoVCgZSUFI0VR0RERJmb2kGld+/eKFu2LPbv348cOXJAoVCkR11ERERE6geVBw8eYPv27XB2dk6PeoiIiIgkas/6KV++PEJCQtKjFiIiIiIVaveo9O/fH0OHDsWrV69QvHhx6Ovrqyx3cXHRWHFERESUuakdVFq1agUA6Natm9SmUCgghOBgWiIiItKoHzrXDxEREdGvoHZQyZ07d3rUQURERJTGDx3w7eHDh/Dy8sKdO3cAAEWKFMHAgQORL18+jRZHREREmZvaQSUwMBBNmzZFyZIlUalSJQDA6dOnUbRoUezduxd16tTReJHa4jRqv7ZLIC0LndVI2yUQEWVqageVUaNGYfDgwZg1a1aa9pEjR2aooEJERETapfZxVO7cuYPu3bunae/WrRv++ecfjRRFREREBPxAULGxscG1a9fStF+7dg22traaqImIiIgIwA/s+unZsyd69eqFR48eoWLFigA+jVGZPXs2hgwZovECiYiIKPNSO6iMHz8eWbNmxfz58zF69GgAgL29PSZNmoQBAwZovEAiIiLKvNQOKgqFAoMHD8bgwYMRExMDAMiaNavGCyMiIiL6oeOoAEB4eDju3bsHAChUqBBsbGw0VhQRERER8AODaWNiYtCpUyfY29ujWrVqqFatGuzt7dGxY0dERUWlR41ERESUSakdVHr06IHz589j//79iIyMRGRkJPbt24dLly7Bw8MjPWokIiKiTErtXT/79u1DYGAgKleuLLXVq1cPK1euRP369TVaHBEREWVuaveoZMuWDebm5mnazc3NYWlpqZGiiIiIiIAfCCrjxo3DkCFD8OrVK6nt1atXGD58OMaPH6/R4oiIiChzU3vXj7e3N0JCQpArVy7kypULAPDkyRMYGhrizZs3WLFihbTulStXNFcpERERZTpqB5XmzZunQxlEREREaakdVCZOnJgedRARERGlofYYladPn+LZs2fS9QsXLmDQoEHw9fXVaGFEREREageV9u3bIzg4GMCnQbS1a9fGhQsXMHbsWEyZMkXjBRIREVHmpXZQu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Nra4vLly6hataqWqiIiIiK50GpQ+VJUVBQAwMrK6qvLExMTkZiYKF2Pjo7+JXURERGRdvzQrp/IyEisWrUKo0ePRkREBADgypUreP78+Q8XolQqMWjQIFSqVAnFihX76jozZ86Eubm5dHF0dPzhxyMiIiL5Uzuo3LhxAwUKFMDs2bMxb948REZGAgACAgIwevToHy7E09MTt27dwubNm7+5zujRoxEVFSVdnj59+sOPR0RERPKndlAZMmQIunTpggcPHsDIyEhqb9iwIU6cOPFDRfTr1w/79u1DcHAwHBwcvrmeoaEhzMzMVC5ERESUcak9RuXixYtYsWJFmvacOXPi1atXat2XEAL9+/fHzp07cezYMeTJk0fdcoiIiCgDUzuoGBoafnUQ6/3792FjY6PWfXl6emLjxo3YvXs3smbNKgUdc3NzGBsbq1saERERZTBq7/pp2rQppkyZguTkZACfzu/z5MkTjBw5Eq1atVLrvry9vREVFYXq1asjR44c0mXLli3qlkVEREQZkNpBZf78+YiNjYWtrS3i4+NRrVo1ODs7I2vWrJg+fbpa9yWE+OqlS5cu6pZFREREGZDau37Mzc0RFBSEU6dO4caNG4iNjUXp0qVRu3bt9KiPiIiIMrEfPuBb5cqVUblyZU3WQkRERKRC7aCyePHir7YrFAoYGRnB2dkZVatWha6u7k8XR0RERJmb2kFl4cKFePPmDT58+ABLS0sAwPv372FiYoIsWbIgPDwcefPmRXBwMI8cS0RERD9F7cG0M2bMQLly5fDgwQO8e/cO7969w/3791G+fHksWrQIT548gZ2dHQYPHpwe9RIREVEmonaPyrhx47Bjxw7ky5dPanN2dsa8efPQqlUrPHr0CHPmzFF7qjIRERHRl9TuUXn58iU+fvyYpv3jx4/SAdvs7e0RExPz89URERFRpqZ2UKlRowY8PDxw9epVqe3q1avo06cPatasCQC4efMmD4dPREREP03toLJ69WpYWVmhTJkyMDQ0hKGhIcqWLQsrKyusXr0aAJAlSxbMnz9f48USERFR5qL2GBU7OzsEBQXh7t27uH//PgCgYMGCKFiwoLROjRo1NFchERERZVo/fMC3QoUKoVChQpqshY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CR1nCMChGlG11dXdy5cwf//PMPdHV1VZaZmpqiT58+GD58OA4ePIh//vkHPXv2xIcPH9C9e3cAQO/evfHgwQMMHz4c9+7dw8aNG7Fu3TqV+xk5ciTOnDmDfv364dq1a3jw4AF2797NwbREGQSDChGlKzMzM5iZmX112axZs9CqVSt06tQJpUuXRkhICAIDA2FpaQng066bHTt2YNeuXShRogR8fHwwY8YMlftwcXHB8ePHcf/+fVSpUgWlSpXChAkTYG9vn+7PjYjSn0IIIbRdBBEREdHXsEeFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhki0GFiIiIZItBhYiIiGSLQYWIiIhk6/8AHoK08GWUizwAAAAASUVORK5CYII=\n", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import matplotlib.pyplot as plt\n", - "\n", - "## calculate avg response time\n", - "unique_models = set(result[\"response\"]['model'] for result in result[\"results\"])\n", - "model_dict = {model: {\"response_time\": []} for model in unique_models}\n", - "for completion_result in result[\"results\"]:\n", - " model_dict[completion_result[\"response\"][\"model\"]][\"response_time\"].append(completion_result[\"response_time\"])\n", - "\n", - "avg_response_time = {}\n", - "for model, data in model_dict.items():\n", - " avg_response_time[model] = sum(data[\"response_time\"]) / len(data[\"response_time\"])\n", - "\n", - "models = list(avg_response_time.keys())\n", - "response_times = list(avg_response_time.values())\n", - "\n", - "plt.bar(models, response_times)\n", - "plt.xlabel('Model', fontsize=10)\n", - "plt.ylabel('Average Response Time')\n", - "plt.title('Average Response Times for each Model')\n", - "\n", - "plt.xticks(models, [model[:15]+'...' if len(model) > 15 else model for model in models], rotation=45)\n", - "plt.show()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "inSDIE3_IRds" - }, - "source": [ - "# Duration Test endpoint\n", - "\n", - "Run load testing for 2 mins. Hitting endpoints with 100+ queries every 15 seconds." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "ePIqDx2EIURH" - }, - "outputs": [], - "source": [ - "models=[\"gpt-3.5-turbo\", \"replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781\", \"claude-instant-1\"]\n", - "context = \"\"\"Paul Graham (/ɡræm/; born 1964)[3] is an English computer scientist, essayist, entrepreneur, venture capitalist, and author. He is best known for his work on the programming language Lisp, his former startup Viaweb (later renamed Yahoo! Store), cofounding the influential startup accelerator and seed capital firm Y Combinator, his essays, and Hacker News. He is the author of several computer programming books, including: On Lisp,[4] ANSI Common Lisp,[5] and Hackers & Painters.[6] Technology journalist Steven Levy has described Graham as a \"hacker philosopher\".[7] Graham was born in England, where he and his family maintain permanent residence. However he is also a citizen of the United States, where he was educated, lived, and worked until 2016.\"\"\"\n", - "prompt = \"Where does Paul Graham live?\"\n", - "final_prompt = context + prompt\n", - "result = load_test_model(models=models, prompt=final_prompt, num_calls=100, interval=15, duration=120)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 552 - }, - "id": "k6rJoELM6t1K", - "outputId": "f4968b59-3bca-4f78-a88b-149ad55e3cf7" - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAIXCAYAAABghH+YAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABwdUlEQVR4nO3dd1QU198G8GfpoNKUooKCYuwIaiL2GrGLJnYFOxrsNZbYFTsYG2JDjV2xRKOIir33EhsWLBGwUaXJ3vcPX+bnCiYsLi6Oz+ecPbp37ux+lx3YZ+/cmVEIIQSIiIiIZEJH2wUQERERaRLDDREREckKww0RERHJCsMNERERyQrDDREREckKww0RERHJCsMNERERyQrDDREREckKww0RERHJCsMNEcmSg4MDunfvru0y1D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g38/vvvWLt2LZKTk7/kSyaiXMALZxJRnmFlZYXmzZsjKCgIQgg0b94chQoVkpbfv38faWlpqFmzptSmr6+PH374Abdu3QIA3Lp1C9WqVVN53OrVq6vcv3r1Kq5du4b169dLbUIIKJVKPHz4EGXLls2Nl0dEXwjDDRHlKT179pR2Dy1evDhXniMhIQHe3t4YNGhQpmWcvEz09WO4IaI8pUmTJkhNTYVCoYC7u7vKspIlS8LAwAAnT55E8eLFAby/IvT58+cxZMgQAEDZsmWxe/dulfXOnDmjcr9y5cr4+++/4eTklHsvhIi0hnNuiChP0dXVxa1bt/D3339DV1dXZVm+fPnQv39/jBw5Evv378fff/+NPn364O3bt+jVqxcAoF+/frh37x5GjhyJO3fuYMOGDQgKClJ5nNGjR+PUqVMYMGAArly5gnv37mHXrl2cUEwkEww3RJTnmJqawtTUNMtlM2fOxE8//YRu3bqhcuXKCA8PR0hICCwsLAC83620fft27Ny5E5UqVUJAQABmzJih8hjOzs44evQo7t69i9q1a8PV1RUTJkxAkSJFcv21EVHuUwghhLaLICIiItIUjtwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGsMNwQERGRrDDcEBERkaww3BAREZGs/B+XLE52CERTBAAAAABJRU5ErkJggg==\n", - "text/plain": [ - "
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import matplotlib.pyplot as plt\n", - "\n", - "## calculate avg response time\n", - "unique_models = set(unique_result[\"response\"]['model'] for unique_result in result[0][\"results\"])\n", - "model_dict = {model: {\"response_time\": []} for model in unique_models}\n", - "for iteration in result:\n", - " for completion_result in iteration[\"results\"]:\n", - " model_dict[completion_result[\"response\"][\"model\"]][\"response_time\"].append(completion_result[\"response_time\"])\n", - "\n", - "avg_response_time = {}\n", - "for model, data in model_dict.items():\n", - " avg_response_time[model] = sum(data[\"response_time\"]) / len(data[\"response_time\"])\n", - "\n", - "models = list(avg_response_time.keys())\n", - "response_times = list(avg_response_time.values())\n", - "\n", - "plt.bar(models, response_times)\n", - "plt.xlabel('Model', fontsize=10)\n", - "plt.ylabel('Average Response Time')\n", - "plt.title('Average Response Times for each Model')\n", - "\n", - "plt.xticks(models, [model[:15]+'...' if len(model) > 15 else model for model in models], rotation=45)\n", - "plt.show()" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file diff --git a/cookbook/litellm_model_fallback.ipynb b/cookbook/litellm_model_fallback.ipynb deleted file mode 100644 index 2e7987b9693..00000000000 --- a/cookbook/litellm_model_fallback.ipynb +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "j6yJsCGeaq8G" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "u129iWNPaf72" - }, - "outputs": [], - "source": [ - "from litellm import completion\n", - "\n", - "model_fallback_list = [\"claude-instant-1\", \"gpt-3.5-turbo\", \"chatgpt-test\"]\n", - "\n", - "user_message = \"Hello, how are you?\"\n", - "messages = [{ \"content\": user_message,\"role\": \"user\"}]\n", - "\n", - "for model in model_fallback_list:\n", - " try:\n", - " response = completion(model=model, messages=messages)\n", - " except Exception:\n", - " print(f\"error occurred: {traceback.format_exc()}\")" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/litellm_proxy_server/batch_api/bedrock/README.md b/cookbook/litellm_proxy_server/batch_api/bedrock/README.md deleted file mode 100644 index 1410d76658e..00000000000 --- a/cookbook/litellm_proxy_server/batch_api/bedrock/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Bedrock batch endpoints - -Set `aws_bedrock_control_plane_endpoint` on a deployment when batch create, retrieve, and cancel requests must use a custom Bedrock control-plane endpoint. The proxy signs these requests for the configured URL. Without this setting, batch requests use the standard regional Bedrock endpoint - -```yaml -model_list: - - model_name: bedrock-batch - litellm_params: - model: bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0 - aws_region_name: us-east-1 - aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID - aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY - aws_batch_role_arn: os.environ/AWS_BATCH_ROLE_ARN - s3_output_bucket_name: os.environ/AWS_S3_OUTPUT_BUCKET_NAME - aws_bedrock_control_plane_endpoint: os.environ/BEDROCK_CONTROL_PLANE_ENDPOINT -``` - -Set `BEDROCK_CONTROL_PLANE_ENDPOINT` to your Bedrock control-plane VPC endpoint or compatible gateway base URL, without `/model-invocation-job`. The proxy adds the operation path. The endpoint must be reachable from the proxy, and the configured AWS region must match the endpoint's signing region - -`api_base` and `aws_bedrock_runtime_endpoint` configure runtime inference separately. They do not override the batch control-plane endpoint. `s3_endpoint_url` configures S3 file access separately - -The control-plane setting belongs in deployment configuration. Sending `aws_bedrock_control_plane_endpoint` in an API request body is rejected. There is no automatic `AWS_BEDROCK_CONTROL_PLANE_ENDPOINT` environment fallback, so reference the desired environment variable explicitly as shown above - -Start the proxy with this configuration and set `LITELLM_API_BASE` to its URL. Set `BEDROCK_BATCH_INPUT_URI` to a valid input JSONL file in S3 that the batch service role can read - -```bash -curl -sS "$LITELLM_API_BASE/v1/batches" \ - -H "Authorization: Bearer $LITELLM_MASTER_KEY" \ - -H 'Content-Type: application/json' \ - -d "{\"model\":\"bedrock-batch\",\"input_file_id\":\"$BEDROCK_BATCH_INPUT_URI\",\"endpoint\":\"/v1/chat/completions\",\"completion_window\":\"24h\"}" -``` - -Use the returned `id` as `BATCH_ID` to retrieve or cancel the same job through the deployment's configured endpoint - -```bash -curl -sS "$LITELLM_API_BASE/v1/batches/$BATCH_ID?model=bedrock-batch" \ - -H "Authorization: Bearer $LITELLM_MASTER_KEY" - -curl -sS -X POST "$LITELLM_API_BASE/v1/batches/$BATCH_ID/cancel?model=bedrock-batch" \ - -H "Authorization: Bearer $LITELLM_MASTER_KEY" -``` diff --git a/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock.py b/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock.py deleted file mode 100644 index 5b5f0978eb3..00000000000 --- a/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock.py +++ /dev/null @@ -1,27 +0,0 @@ -import os - -from openai import OpenAI - -client = OpenAI( - base_url="http://0.0.0.0:4000", - api_key=os.environ["LITELLM_MASTER_KEY"], -) - -BEDROCK_BATCH_MODEL = "bedrock/batch-anthropic.claude-3-5-sonnet-20240620-v1:0" - -# Upload file -batch_input_file = client.files.create( - file=open("./bedrock_batch_completions.jsonl", "rb"), - purpose="batch", - extra_body={"target_model_names": BEDROCK_BATCH_MODEL}, -) -print(batch_input_file) - -# Create batch -batch = client.batches.create( - input_file_id=batch_input_file.id, - endpoint="/v1/chat/completions", - completion_window="24h", - metadata={"description": "Test batch job"}, -) -print(batch) diff --git a/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock_batch_completions.jsonl b/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock_batch_completions.jsonl deleted file mode 100644 index adef9ac2dd5..00000000000 --- a/cookbook/litellm_proxy_server/batch_api/bedrock/bedrock_batch_completions.jsonl +++ /dev/null @@ -1,128 +0,0 @@ -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} -{"custom_id": "request-2", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0", "messages": [{"role": "system", "content": "You are an unhelpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 10}} diff --git a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md deleted file mode 100644 index 1bf52d922c6..00000000000 --- a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md +++ /dev/null @@ -1,279 +0,0 @@ -# Braintrust Prompt Wrapper for LiteLLM - -This directory contains a wrapper server that enables LiteLLM to use prompts from [Braintrust](https://www.braintrust.dev/) through the generic prompt management API. - -## Architecture - -``` -┌─────────────┐ ┌──────────────────────┐ ┌─────────────┐ -│ LiteLLM │ ──────> │ Wrapper Server │ ──────> │ Braintrust │ -│ Client │ │ (This Server) │ │ API │ -└─────────────┘ └──────────────────────┘ └─────────────┘ - Uses generic Transforms Stores actual - prompt manager Braintrust format prompt templates - to LiteLLM format -``` - -## Components - -### 1. Generic Prompt Manager (`litellm/integrations/generic_prompt_management/`) - -A generic client that can work with any API implementing the `/beta/litellm_prompt_management` endpoint. - -**Expected API Response Format:** -```json -{ - "prompt_id": "string", - "prompt_template": [ - {"role": "system", "content": "You are a helpful assistant"}, - {"role": "user", "content": "Hello {name}"} - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.7, - "max_tokens": 100 - } -} -``` - -### 2. Braintrust Wrapper Server (`braintrust_prompt_wrapper_server.py`) - -A FastAPI server that: -- Implements the `/beta/litellm_prompt_management` endpoint -- Fetches prompts from Braintrust API -- Transforms Braintrust response format to LiteLLM format - -## Setup - -### Install Dependencies - -```bash -pip install fastapi uvicorn httpx litellm -``` - -### Set Environment Variables - -```bash -export BRAINTRUST_API_KEY="your-braintrust-api-key" -``` - -## Usage - -### Step 1: Start the Wrapper Server - -```bash -python braintrust_prompt_wrapper_server.py -``` - -The server will start on `http://localhost:8080` by default. - -You can customize the port and host: -```bash -export PORT=8000 -export HOST=0.0.0.0 -python braintrust_prompt_wrapper_server.py -``` - -### Step 2: Use with LiteLLM - -```python -import litellm -from litellm.integrations.generic_prompt_management import GenericPromptManager - -# Configure the generic prompt manager to use your wrapper server -generic_config = { - "api_base": "http://localhost:8080", - "api_key": "your-braintrust-api-key", # Will be passed to Braintrust - "timeout": 30, -} - -# Create the prompt manager -prompt_manager = GenericPromptManager(**generic_config) - -# Use with completion -response = litellm.completion( - model="generic_prompt/gpt-4", - prompt_id="your-braintrust-prompt-id", - prompt_variables={"name": "World"}, # Variables to substitute - messages=[{"role": "user", "content": "Additional message"}] -) - -print(response) -``` - -### Step 3: Direct API Testing - -You can also test the wrapper API directly: - -```bash -# Test with curl -curl -H "Authorization: Bearer YOUR_BRAINTRUST_TOKEN" \ - "http://localhost:8080/beta/litellm_prompt_management?prompt_id=YOUR_PROMPT_ID" - -# Health check -curl http://localhost:8080/health - -# Service info -curl http://localhost:8080/ -``` - -## API Documentation - -Once the server is running, visit: -- Swagger UI: `http://localhost:8080/docs` -- ReDoc: `http://localhost:8080/redoc` - -## Braintrust Format Transformation - -The wrapper automatically transforms Braintrust's response format: - -**Braintrust API Response:** -```json -{ - "id": "prompt-123", - "prompt_data": { - "prompt": { - "type": "chat", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant" - } - ] - }, - "options": { - "model": "gpt-4", - "params": { - "temperature": 0.7, - "max_tokens": 100 - } - } - } -} -``` - -**Transformed to LiteLLM Format:** -```json -{ - "prompt_id": "prompt-123", - "prompt_template": [ - { - "role": "system", - "content": "You are a helpful assistant" - } - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.7, - "max_tokens": 100 - } -} -``` - -## Supported Parameters - -The wrapper automatically maps these Braintrust parameters to LiteLLM: - -- `temperature` -- `max_tokens` / `max_completion_tokens` -- `top_p` -- `frequency_penalty` -- `presence_penalty` -- `n` -- `stop` -- `response_format` -- `tool_choice` -- `function_call` -- `tools` - -## Variable Substitution - -The generic prompt manager supports simple variable substitution: - -```python -# In your Braintrust prompt: -# "Hello {name}, welcome to {place}!" - -# In your code: -prompt_variables = { - "name": "Alice", - "place": "Wonderland" -} - -# Result: -# "Hello Alice, welcome to Wonderland!" -``` - -Supports both `{variable}` and `{{variable}}` syntax. - -## Error Handling - -The wrapper provides detailed error messages: - -- **401**: Missing or invalid Braintrust API token -- **404**: Prompt not found in Braintrust -- **502**: Failed to connect to Braintrust API -- **500**: Error transforming response - -## Production Deployment - -For production use: - -1. **Use HTTPS**: Deploy behind a reverse proxy with SSL -2. **Authentication**: Add authentication to the wrapper endpoint if needed -3. **Rate Limiting**: Implement rate limiting to prevent abuse -4. **Caching**: Consider caching prompt responses -5. **Monitoring**: Add logging and monitoring - -Example with Docker: - -```dockerfile -FROM python:3.11-slim - -WORKDIR /app - -RUN pip install fastapi uvicorn httpx - -COPY braintrust_prompt_wrapper_server.py . - -ENV PORT=8080 -ENV HOST=0.0.0.0 - -EXPOSE 8080 - -CMD ["python", "braintrust_prompt_wrapper_server.py"] -``` - -## Extending to Other Providers - -This pattern can be used with any prompt management provider: - -1. Create a wrapper server that implements `/beta/litellm_prompt_management` -2. Transform the provider's response to LiteLLM format -3. Use the generic prompt manager to connect - -Example providers: -- Langsmith -- PromptLayer -- Humanloop -- Custom internal systems - -## Troubleshooting - -### "No Braintrust API token provided" -- Set `BRAINTRUST_API_KEY` environment variable -- Or pass token in `Authorization: Bearer TOKEN` header - -### "Failed to connect to Braintrust API" -- Check your internet connection -- Verify Braintrust API is accessible -- Check firewall settings - -### "Prompt not found" -- Verify the prompt ID exists in Braintrust -- Check that your API token has access to the prompt - -## License - -This wrapper is part of the LiteLLM project and follows the same license. - diff --git a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py deleted file mode 100644 index 6379314c5b6..00000000000 --- a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py +++ /dev/null @@ -1,274 +0,0 @@ -""" -Mock server that implements the /beta/litellm_prompt_management endpoint -and acts as a wrapper for calling the Braintrust API. - -This server transforms Braintrust's prompt API response into the format -expected by LiteLLM's generic prompt management client. - -Usage: - python braintrust_prompt_wrapper_server.py - - # Then test with: - curl -H "Authorization: Bearer YOUR_BRAINTRUST_TOKEN" \ - "http://localhost:8080/beta/litellm_prompt_management?prompt_id=YOUR_PROMPT_ID" -""" - -import json -import os -from typing import Any, Dict, List, Optional - -import httpx -from fastapi import FastAPI, HTTPException, Header, Query -from fastapi.responses import JSONResponse -import uvicorn - - -app = FastAPI( - title="Braintrust Prompt Wrapper", - description="Wrapper server for Braintrust prompts to work with LiteLLM", - version="1.0.0", -) - - -def transform_braintrust_message(message: Dict[str, Any]) -> Dict[str, str]: - """ - Transform a Braintrust message to LiteLLM format. - - Braintrust message format: - { - "role": "system", - "content": "...", - "name": "..." (optional) - } - - LiteLLM format: - { - "role": "system", - "content": "..." - } - """ - result = { - "role": message.get("role", "user"), - "content": message.get("content", ""), - } - - # Include name if present - if "name" in message: - result["name"] = message["name"] - - return result - - -def transform_braintrust_response( - braintrust_response: Dict[str, Any], -) -> Dict[str, Any]: - """ - Transform Braintrust API response to LiteLLM prompt management format. - - Braintrust response format: - { - "objects": [{ - "id": "prompt_id", - "prompt_data": { - "prompt": { - "type": "chat", - "messages": [...], - "tools": "..." - }, - "options": { - "model": "gpt-4", - "params": { - "temperature": 0.7, - "max_tokens": 100, - ... - } - } - } - }] - } - - LiteLLM format: - { - "prompt_id": "prompt_id", - "prompt_template": [...], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": {...} - } - """ - # Extract the first object from the objects array if it exists - if "objects" in braintrust_response and len(braintrust_response["objects"]) > 0: - prompt_object = braintrust_response["objects"][0] - else: - prompt_object = braintrust_response - - prompt_data = prompt_object.get("prompt_data", {}) - prompt_info = prompt_data.get("prompt", {}) - options = prompt_data.get("options", {}) - - # Extract messages - messages = prompt_info.get("messages", []) - transformed_messages = [transform_braintrust_message(msg) for msg in messages] - - # Extract model - model = options.get("model") - - # Extract optional parameters - params = options.get("params", {}) - optional_params: Dict[str, Any] = {} - - # Map common parameters - param_mapping = { - "temperature": "temperature", - "max_tokens": "max_tokens", - "max_completion_tokens": "max_tokens", # Alternative name - "top_p": "top_p", - "frequency_penalty": "frequency_penalty", - "presence_penalty": "presence_penalty", - "n": "n", - "stop": "stop", - } - - for braintrust_param, litellm_param in param_mapping.items(): - if braintrust_param in params: - value = params[braintrust_param] - if value is not None: - optional_params[litellm_param] = value - - # Handle response_format - if "response_format" in params: - optional_params["response_format"] = params["response_format"] - - # Handle tool_choice - if "tool_choice" in params: - optional_params["tool_choice"] = params["tool_choice"] - - # Handle function_call - if "function_call" in params: - optional_params["function_call"] = params["function_call"] - - # Add tools if present - if "tools" in prompt_info and prompt_info["tools"]: - optional_params["tools"] = prompt_info["tools"] - - # Handle tool_functions from prompt_data - if "tool_functions" in prompt_data and prompt_data["tool_functions"]: - optional_params["tool_functions"] = prompt_data["tool_functions"] - - return { - "prompt_id": prompt_object.get("id"), - "prompt_template": transformed_messages, - "prompt_template_model": model, - "prompt_template_optional_params": optional_params if optional_params else None, - } - - -@app.get("/beta/litellm_prompt_management") -async def get_prompt( - prompt_id: str = Query(..., description="The Braintrust prompt ID to fetch"), - authorization: Optional[str] = Header( - None, description="Bearer token for Braintrust API" - ), -) -> JSONResponse: - """ - Fetch a prompt from Braintrust and transform it to LiteLLM format. - - Args: - prompt_id: The Braintrust prompt ID - authorization: Bearer token for Braintrust API (from header) - - Returns: - JSONResponse with the transformed prompt data - """ - # Extract token from Authorization header or environment - braintrust_token = None - if authorization and authorization.startswith("Bearer "): - braintrust_token = authorization.replace("Bearer ", "") - else: - braintrust_token = os.getenv("BRAINTRUST_API_KEY") - - if not braintrust_token: - raise HTTPException( - status_code=401, - detail="No Braintrust API token provided. Pass via Authorization header or set BRAINTRUST_API_KEY environment variable.", - ) - - # Call Braintrust API - braintrust_url = f"https://api.braintrust.dev/v1/prompt/{prompt_id}" - headers = { - "Authorization": f"Bearer {braintrust_token}", - "Accept": "application/json", - } - print(f"headers: {headers}") - print(f"braintrust_url: {braintrust_url}") - print(f"braintrust_token: {braintrust_token}") - - try: - async with httpx.AsyncClient(timeout=30.0) as client: - response = await client.get(braintrust_url, headers=headers) - response.raise_for_status() - braintrust_data = response.json() - except httpx.HTTPStatusError as e: - raise HTTPException( - status_code=e.response.status_code, - detail=f"Braintrust API error: {e.response.text}", - ) - except httpx.RequestError as e: - raise HTTPException( - status_code=502, - detail=f"Failed to connect to Braintrust API: {str(e)}", - ) - except json.JSONDecodeError as e: - raise HTTPException( - status_code=502, - detail=f"Failed to parse Braintrust API response: {str(e)}", - ) - - print(f"braintrust_data: {braintrust_data}") - # Transform the response - try: - transformed_data = transform_braintrust_response(braintrust_data) - print(f"transformed_data: {transformed_data}") - return JSONResponse(content=transformed_data) - except Exception as e: - raise HTTPException( - status_code=500, - detail=f"Failed to transform Braintrust response: {str(e)}", - ) - - -@app.get("/health") -async def health_check(): - """Health check endpoint.""" - return {"status": "healthy", "service": "braintrust-prompt-wrapper"} - - -@app.get("/") -async def root(): - """Root endpoint with service information.""" - return { - "service": "Braintrust Prompt Wrapper for LiteLLM", - "version": "1.0.0", - "endpoints": { - "prompt_management": "/beta/litellm_prompt_management?prompt_id=", - "health": "/health", - }, - "documentation": "/docs", - } - - -def main(): - """Run the server.""" - port = int(os.getenv("PORT", "8080")) - host = os.getenv("HOST", "0.0.0.0") - - print(f"🚀 Starting Braintrust Prompt Wrapper Server on {host}:{port}") - print(f"📚 API Documentation available at http://{host}:{port}/docs") - print( - f"🔑 Make sure to set BRAINTRUST_API_KEY environment variable or pass token in Authorization header" - ) - - uvicorn.run(app, host=host, port=port) - - -if __name__ == "__main__": - main() diff --git a/cookbook/litellm_proxy_server/cli_token_usage.py b/cookbook/litellm_proxy_server/cli_token_usage.py deleted file mode 100644 index c9c91e3283b..00000000000 --- a/cookbook/litellm_proxy_server/cli_token_usage.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 -""" -Example: Using CLI token with LiteLLM SDK - -This example shows how to use the CLI authentication token -in your Python scripts after running `lite login`. -""" - -from textwrap import indent -import litellm - -LITELLM_BASE_URL = "http://localhost:4000/" - - -def main(): - """Using CLI token with LiteLLM SDK""" - print("🚀 Using CLI Token with LiteLLM SDK") - print("=" * 40) - # litellm._turn_on_debug() - - # Get the CLI token - api_key = litellm.get_litellm_gateway_api_key() - - if not api_key: - print("❌ No CLI token found. Please run 'lite login' first.") - return - - print("✅ Found CLI token.") - - available_models = litellm.get_valid_models( - check_provider_endpoint=True, - custom_llm_provider="litellm_proxy", - api_key=api_key, - api_base=LITELLM_BASE_URL, - ) - - print("✅ Available models:") - if available_models: - for i, model in enumerate(available_models, 1): - print(f" {i:2d}. {model}") - else: - print(" No models available") - - # Use with LiteLLM - try: - response = litellm.completion( - model="litellm_proxy/gemini/gemini-2.5-flash", - messages=[{"role": "user", "content": "Hello from CLI token!"}], - api_key=api_key, - base_url=LITELLM_BASE_URL, - ) - print(f"✅ LLM Response: {response.model_dump_json(indent=4)}") - except Exception as e: - print(f"❌ Error: {e}") - - -if __name__ == "__main__": - main() - - print("\n💡 Tips:") - print("1. Run 'lite login' to authenticate first") - print("2. Replace 'https://your-proxy.com' with your actual proxy URL") - print("3. The token is stored in your OS keychain, or in ~/.litellm/token.json when there is none") diff --git a/cookbook/litellm_proxy_server/mcp/mcp_with_litellm_proxy.py b/cookbook/litellm_proxy_server/mcp/mcp_with_litellm_proxy.py deleted file mode 100644 index cc8b44d42b0..00000000000 --- a/cookbook/litellm_proxy_server/mcp/mcp_with_litellm_proxy.py +++ /dev/null @@ -1,39 +0,0 @@ -""" -Use LiteLLM Proxy MCP Gateway to call MCP tools. - -When using LiteLLM Proxy, you can use the same MCP tools across all your LLM providers. -""" - -import os - -import openai - -client = openai.OpenAI( - api_key=os.environ["LITELLM_MASTER_KEY"], - base_url="http://localhost:4000", # paste your litellm proxy base url here -) -print("Making API request to Responses API with MCP tools") - -response = client.responses.create( - model="gpt-5", - input=[ - { - "role": "user", - "content": "give me TLDR of what BerriAI/litellm repo is about", - "type": "message", - } - ], - tools=[ - { - "type": "mcp", - "server_label": "litellm", - "server_url": "litellm_proxy", - "require_approval": "never", - } - ], - stream=True, - tool_choice="required", -) - -for chunk in response: - print("response chunk: ", chunk) diff --git a/cookbook/litellm_proxy_server/readme.md b/cookbook/litellm_proxy_server/readme.md deleted file mode 100644 index 2c1eab72c24..00000000000 --- a/cookbook/litellm_proxy_server/readme.md +++ /dev/null @@ -1,177 +0,0 @@ -# liteLLM Proxy Server: 50+ LLM Models, Error Handling, Caching - -### Azure, Llama2, OpenAI, Claude, Hugging Face, Replicate Models - -[![PyPI Version](https://img.shields.io/pypi/v/litellm.svg)](https://pypi.org/project/litellm/) -[![PyPI Version](https://img.shields.io/badge/stable%20version-v0.1.345-blue?color=green&link=https://pypi.org/project/litellm/0.1.1/)](https://pypi.org/project/litellm/0.1.1/) -![Downloads](https://img.shields.io/pypi/dm/litellm) -[![litellm](https://img.shields.io/badge/%20%F0%9F%9A%85%20liteLLM-OpenAI%7CAzure%7CAnthropic%7CPalm%7CCohere%7CReplicate%7CHugging%20Face-blue?color=green)](https://github.com/BerriAI/litellm) - -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/DYqQAW?referralCode=t3ukrU) - -![4BC6491E-86D0-4833-B061-9F54524B2579](https://github.com/BerriAI/litellm/assets/17561003/f5dd237b-db5e-42e1-b1ac-f05683b1d724) - -## What does liteLLM proxy do - -- Make `/chat/completions` requests for 50+ LLM models **Azure, OpenAI, Replicate, Anthropic, Hugging Face** - - Example: for `model` use `claude-2`, `gpt-3.5`, `gpt-4`, `command-nightly`, `stabilityai/stablecode-completion-alpha-3b-4k` - - ```json - { - "model": "replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1", - "messages": [ - { - "content": "Hello, whats the weather in San Francisco??", - "role": "user" - } - ] - } - ``` - -- **Consistent Input/Output** Format - - Call all models using the OpenAI format - `completion(model, messages)` - - Text responses will always be available at `['choices'][0]['message']['content']` -- **Error Handling** Using Model Fallbacks (if `GPT-4` fails, try `llama2`) -- **Logging** - Log Requests, Responses and Errors to `Supabase`, `Posthog`, `Mixpanel`, `Sentry`, `Lunary`,`Athina`, `Helicone` (Any of the supported providers here: https://litellm.readthedocs.io/en/latest/advanced/ - - **Example: Logs sent to Supabase** - Screenshot 2023-08-11 at 4 02 46 PM - -- **Token Usage & Spend** - Track Input + Completion tokens used + Spend/model -- **Caching** - Implementation of Semantic Caching -- **Streaming & Async Support** - Return generators to stream text responses - -## API Endpoints - -### `/chat/completions` (POST) - -This endpoint is used to generate chat completions for 50+ support LLM API Models. Use llama2, GPT-4, Claude2 etc - -#### Input - -This API endpoint accepts all inputs in raw JSON and expects the following inputs - -- `model` (string, required): ID of the model to use for chat completions. See all supported models [here]: (https://litellm.readthedocs.io/en/latest/supported/): - eg `gpt-3.5-turbo`, `gpt-4`, `claude-2`, `command-nightly`, `stabilityai/stablecode-completion-alpha-3b-4k` -- `messages` (array, required): A list of messages representing the conversation context. Each message should have a `role` (system, user, assistant, or function), `content` (message text), and `name` (for function role). -- Additional Optional parameters: `temperature`, `functions`, `function_call`, `top_p`, `n`, `stream`. See the full list of supported inputs here: https://litellm.readthedocs.io/en/latest/input/ - -#### Example JSON body - -For claude-2 - -```json -{ - "model": "claude-2", - "messages": [ - { - "content": "Hello, whats the weather in San Francisco??", - "role": "user" - } - ] -} -``` - -### Making an API request to the Proxy Server - -```python -import requests -import json - -# TODO: use your URL -url = "http://localhost:5000/chat/completions" - -payload = json.dumps({ - "model": "gpt-3.5-turbo", - "messages": [ - { - "content": "Hello, whats the weather in San Francisco??", - "role": "user" - } - ] -}) -headers = { - 'Content-Type': 'application/json' -} -response = requests.request("POST", url, headers=headers, data=payload) -print(response.text) - -``` - -### Output [Response Format] - -Responses from the server are given in the following format. -All responses from the server are returned in the following format (for all LLM models). More info on output here: https://litellm.readthedocs.io/en/latest/output/ - -```json -{ - "choices": [ - { - "finish_reason": "stop", - "index": 0, - "message": { - "content": "I'm sorry, but I don't have the capability to provide real-time weather information. However, you can easily check the weather in San Francisco by searching online or using a weather app on your phone.", - "role": "assistant" - } - } - ], - "created": 1691790381, - "id": "chatcmpl-7mUFZlOEgdohHRDx2UpYPRTejirzb", - "model": "gpt-3.5-turbo-0613", - "object": "chat.completion", - "usage": { - "completion_tokens": 41, - "prompt_tokens": 16, - "total_tokens": 57 - } -} -``` - -## Installation & Usage - -### Running Locally - -1. Clone liteLLM repository to your local machine: - ``` - git clone https://github.com/BerriAI/liteLLM-proxy - ``` -2. Install the required dependencies using pip - ``` - pip install -r requirements.txt - ``` -3. Set your LLM API keys - ``` - os.environ['OPENAI_API_KEY]` = "YOUR_API_KEY" - or - set OPENAI_API_KEY in your .env file - ``` -4. Run the server: - ``` - python main.py - ``` - -## Deploying - -1. Quick Start: Deploy on Railway - - [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/DYqQAW?referralCode=t3ukrU) - -2. `GCP`, `AWS`, `Azure` - This project includes a `Dockerfile` allowing you to build and deploy a Docker Project on your providers - -# Support / Talk with founders - -- [Our calendar 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version) -- [Community Discord 💭](https://discord.gg/wuPM9dRgDw) -- Our emails ✉️ ishaan@berri.ai / krrish@berri.ai - -## Roadmap - -- [ ] Support hosted db (e.g. Supabase) -- [ ] Easily send data to places like posthog and sentry. -- [ ] Add a hot-cache for project spend logs - enables fast checks for user + project limitings -- [ ] Implement user-based rate-limiting -- [ ] Spending controls per project - expose key creation endpoint -- [ ] Need to store a keys db -> mapping created keys to their alias (i.e. project name) -- [ ] Easily add new models as backups / as the entry-point (add this to the available model list) diff --git a/cookbook/litellm_proxy_server/secret_manager/custom_secret_manager_config.yaml b/cookbook/litellm_proxy_server/secret_manager/custom_secret_manager_config.yaml deleted file mode 100644 index 3598a9b1b65..00000000000 --- a/cookbook/litellm_proxy_server/secret_manager/custom_secret_manager_config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -general_settings: - master_key: os.environ/LITELLM_MASTER_KEY - key_management_system: "custom" - key_management_settings: - custom_secret_manager: my_secret_manager.InMemorySecretManager - store_virtual_keys: true - prefix_for_stored_virtual_keys: "litellm/" - access_mode: "read_and_write" - -model_list: - - model_name: gpt-4 - litellm_params: - model: openai/gpt-4 - api_key: os.environ/OPENAI_API_KEY # Read from custom secret manager - - - model_name: claude-3-5-sonnet - litellm_params: - model: anthropic/claude-3-5-sonnet-20241022 - api_key: os.environ/ANTHROPIC_API_KEY # Read from custom secret manager - diff --git a/cookbook/litellm_proxy_server/secret_manager/my_secret_manager.py b/cookbook/litellm_proxy_server/secret_manager/my_secret_manager.py deleted file mode 100644 index 65c7f754b41..00000000000 --- a/cookbook/litellm_proxy_server/secret_manager/my_secret_manager.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -Example custom secret manager for LiteLLM Proxy. - -This is a simple in-memory secret manager for testing purposes. -In production, replace this with your actual secret management system. -""" - -from typing import Optional, Union - -import httpx - -from litellm.integrations.custom_secret_manager import CustomSecretManager - - -class InMemorySecretManager(CustomSecretManager): - def __init__(self): - super().__init__(secret_manager_name="in_memory_secrets") - # Store your secrets in memory - print("INITIALIZING CUSTOM SECRET MANAGER IN MEMORY") - self.secrets = {} - print("CUSTOM SECRET MANAGER IN MEMORY INITIALIZED") - - async def async_read_secret( - self, - secret_name: str, - optional_params: Optional[dict] = None, - timeout: Optional[Union[float, httpx.Timeout]] = None, - ) -> Optional[str]: - """Read secret asynchronously""" - print("READING SECRET ASYNCHRONOUSLY") - print("SECRET NAME: %s", secret_name) - print("SECRET: %s", self.secrets.get(secret_name)) - return self.secrets.get(secret_name) - - def sync_read_secret( - self, - secret_name: str, - optional_params: Optional[dict] = None, - timeout: Optional[Union[float, httpx.Timeout]] = None, - ) -> Optional[str]: - """Read secret synchronously""" - from litellm._logging import verbose_proxy_logger - - verbose_proxy_logger.info( - f"CUSTOM SECRET MANAGER: LOOKING FOR SECRET: {secret_name}" - ) - value = self.secrets.get(secret_name) - verbose_proxy_logger.info(f"CUSTOM SECRET MANAGER: READ SECRET: {value}") - return value - - async def async_write_secret( - self, - secret_name: str, - secret_value: str, - description: Optional[str] = None, - optional_params: Optional[dict] = None, - timeout: Optional[Union[float, httpx.Timeout]] = None, - tags: Optional[Union[dict, list]] = None, - ) -> dict: - """Write a secret to the in-memory store""" - self.secrets[secret_name] = secret_value - print("ALL SECRETS=%s", self.secrets) - return { - "status": "success", - "secret_name": secret_name, - "description": description, - } - - async def async_delete_secret( - self, - secret_name: str, - recovery_window_in_days: Optional[int] = 7, - optional_params: Optional[dict] = None, - timeout: Optional[Union[float, httpx.Timeout]] = None, - ) -> dict: - """Delete a secret from the in-memory store""" - if secret_name in self.secrets: - del self.secrets[secret_name] - return {"status": "deleted", "secret_name": secret_name} - return {"status": "not_found", "secret_name": secret_name} diff --git a/cookbook/litellm_router/error_log.txt b/cookbook/litellm_router/error_log.txt deleted file mode 100644 index 983b47cbbba..00000000000 --- a/cookbook/litellm_router/error_log.txt +++ /dev/null @@ -1,1004 +0,0 @@ -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: Expecting value: line 1 column 1 (char 0) - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: Expecting value: line 1 column 1 (char 0) - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Exception: 'Response' object has no attribute 'get' - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Exception: 'Response' object has no attribute 'get' - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Exception: 'Response' object has no attribute 'get' - diff --git a/cookbook/litellm_router/load_test_proxy.py b/cookbook/litellm_router/load_test_proxy.py deleted file mode 100644 index 9ae6e764d91..00000000000 --- a/cookbook/litellm_router/load_test_proxy.py +++ /dev/null @@ -1,148 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path - -from litellm import Router -import litellm - -litellm.set_verbose = False -os.environ.pop("AZURE_AD_TOKEN") - -model_list = [ - { # list of model deployments - "model_name": "gpt-3.5-turbo", # model alias - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-v-2", # actual model name - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-functioncalling", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "gpt-3.5-turbo", - "api_key": os.getenv("OPENAI_API_KEY"), - }, - }, -] -router = Router(model_list=model_list) - - -file_paths = [ - "test_questions/question1.txt", - "test_questions/question2.txt", - "test_questions/question3.txt", -] -questions = [] - -for file_path in file_paths: - try: - print(file_path) - with open(file_path, "r") as file: - content = file.read() - questions.append(content) - except FileNotFoundError as e: - print(f"File not found: {e}") - except Exception as e: - print(f"An error occurred: {e}") - -# for q in questions: -# print(q) - - -# make X concurrent calls to litellm.completion(model=gpt-35-turbo, messages=[]), pick a random question in questions array. -# Allow me to tune X concurrent calls.. Log question, output/exception, response time somewhere -# show me a summary of requests made, success full calls, failed calls. For failed calls show me the exceptions - -import concurrent.futures -import random -import time - - -# Function to make concurrent calls to OpenAI API -def make_openai_completion(question): - try: - start_time = time.time() - import openai - - client = openai.OpenAI( - api_key=os.environ["OPENAI_API_KEY"], base_url="http://0.0.0.0:8000" - ) # base_url="http://0.0.0.0:8000", - response = client.chat.completions.create( - model="gpt-3.5-turbo", - messages=[ - { - "role": "system", - "content": f"You are a helpful assistant. Answer this question{question}", - } - ], - ) - print(response) - end_time = time.time() - - # Log the request details - with open("request_log.txt", "a") as log_file: - log_file.write( - f"Question: {question[:100]}\nResponse ID:{response.id} Content:{response.choices[0].message.content[:10]}\nTime: {end_time - start_time:.2f} seconds\n\n" - ) - - return response - except Exception as e: - # Log exceptions for failed calls - with open("error_log.txt", "a") as error_log_file: - error_log_file.write(f"Question: {question[:100]}\nException: {str(e)}\n\n") - return None - - -# Number of concurrent calls (you can adjust this) -concurrent_calls = 100 - -# List to store the futures of concurrent calls -futures = [] - -# Make concurrent calls -with concurrent.futures.ThreadPoolExecutor(max_workers=concurrent_calls) as executor: - for _ in range(concurrent_calls): - random_question = random.choice(questions) - futures.append(executor.submit(make_openai_completion, random_question)) - -# Wait for all futures to complete -concurrent.futures.wait(futures) - -# Summarize the results -successful_calls = 0 -failed_calls = 0 - -for future in futures: - if future.result() is not None: - successful_calls += 1 - else: - failed_calls += 1 - -print("Load test Summary:") -print(f"Total Requests: {concurrent_calls}") -print(f"Successful Calls: {successful_calls}") -print(f"Failed Calls: {failed_calls}") - -# Display content of the logs -with open("request_log.txt", "r") as log_file: - print("\nRequest Log:\n", log_file.read()) - -with open("error_log.txt", "r") as error_log_file: - print("\nError Log:\n", error_log_file.read()) diff --git a/cookbook/litellm_router/load_test_queuing.py b/cookbook/litellm_router/load_test_queuing.py deleted file mode 100644 index 7d4d44b2528..00000000000 --- a/cookbook/litellm_router/load_test_queuing.py +++ /dev/null @@ -1,164 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path - -from litellm import Router -import litellm - -litellm.set_verbose = False -# os.environ.pop("AZURE_AD_TOKEN") - -model_list = [ - { # list of model deployments - "model_name": "gpt-3.5-turbo", # model alias - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-v-2", # actual model name - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-functioncalling", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "gpt-3.5-turbo", - "api_key": os.getenv("OPENAI_API_KEY"), - }, - }, -] -router = Router(model_list=model_list) - - -file_paths = [ - "test_questions/question1.txt", - "test_questions/question2.txt", - "test_questions/question3.txt", -] -questions = [] - -for file_path in file_paths: - try: - print(file_path) - with open(file_path, "r") as file: - content = file.read() - questions.append(content) - except FileNotFoundError as e: - print(f"File not found: {e}") - except Exception as e: - print(f"An error occurred: {e}") - -# for q in questions: -# print(q) - - -# make X concurrent calls to litellm.completion(model=gpt-35-turbo, messages=[]), pick a random question in questions array. -# Allow me to tune X concurrent calls.. Log question, output/exception, response time somewhere -# show me a summary of requests made, success full calls, failed calls. For failed calls show me the exceptions - -import concurrent.futures -import random -import time - - -# Function to make concurrent calls to OpenAI API -def make_openai_completion(question): - try: - start_time = time.time() - import requests - - data = { - "model": "gpt-3.5-turbo", - "messages": [ - { - "role": "system", - "content": f"You are a helpful assistant. Answer this question{question}", - }, - ], - } - response = requests.post("http://0.0.0.0:8000/queue/request", json=data) - response = response.json() - end_time = time.time() - # Log the request details - with open("request_log.txt", "a") as log_file: - log_file.write( - f"Question: {question[:100]}\nResponse ID: {response.get('id', 'N/A')} Url: {response.get('url', 'N/A')}\nTime: {end_time - start_time:.2f} seconds\n\n" - ) - - # polling the url - while True: - try: - url = response["url"] - polling_url = f"http://0.0.0.0:8000{url}" - polling_response = requests.get(polling_url) - polling_response = polling_response.json() - print("\n RESPONSE FROM POLLING JoB", polling_response) - status = polling_response["status"] - if status == "finished": - llm_response = polling_response["result"] - with open("response_log.txt", "a") as log_file: - log_file.write( - f"Response ID: {llm_response.get('id', 'NA')}\nLLM Response: {llm_response}\nTime: {end_time - start_time:.2f} seconds\n\n" - ) - - break - print( - f"POLLING JOB{polling_url}\nSTATUS: {status}, \n Response {polling_response}" - ) - time.sleep(0.5) - except Exception as e: - print("got exception in polling", e) - break - - return response - except Exception as e: - # Log exceptions for failed calls - with open("error_log.txt", "a") as error_log_file: - error_log_file.write(f"Question: {question[:100]}\nException: {str(e)}\n\n") - return None - - -# Number of concurrent calls (you can adjust this) -concurrent_calls = 10 - -# List to store the futures of concurrent calls -futures = [] - -# Make concurrent calls -with concurrent.futures.ThreadPoolExecutor(max_workers=concurrent_calls) as executor: - for _ in range(concurrent_calls): - random_question = random.choice(questions) - futures.append(executor.submit(make_openai_completion, random_question)) - -# Wait for all futures to complete -concurrent.futures.wait(futures) - -# Summarize the results -successful_calls = 0 -failed_calls = 0 - -for future in futures: - if future.done(): - if future.result() is not None: - successful_calls += 1 - else: - failed_calls += 1 - -print("Load test Summary:") -print(f"Total Requests: {concurrent_calls}") -print(f"Successful Calls: {successful_calls}") -print(f"Failed Calls: {failed_calls}") diff --git a/cookbook/litellm_router/load_test_router.py b/cookbook/litellm_router/load_test_router.py deleted file mode 100644 index 92533b6c929..00000000000 --- a/cookbook/litellm_router/load_test_router.py +++ /dev/null @@ -1,143 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path - -from litellm import Router -import litellm - -litellm.set_verbose = False -os.environ.pop("AZURE_AD_TOKEN") - -model_list = [ - { # list of model deployments - "model_name": "gpt-3.5-turbo", # model alias - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-v-2", # actual model name - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-functioncalling", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { # params for litellm completion/embedding call - "model": "gpt-3.5-turbo", - "api_key": os.getenv("OPENAI_API_KEY"), - }, - }, -] -router = Router(model_list=model_list) - - -file_paths = [ - "test_questions/question1.txt", - "test_questions/question2.txt", - "test_questions/question3.txt", -] -questions = [] - -for file_path in file_paths: - try: - print(file_path) - with open(file_path, "r") as file: - content = file.read() - questions.append(content) - except FileNotFoundError as e: - print(f"File not found: {e}") - except Exception as e: - print(f"An error occurred: {e}") - -# for q in questions: -# print(q) - - -# make X concurrent calls to litellm.completion(model=gpt-35-turbo, messages=[]), pick a random question in questions array. -# Allow me to tune X concurrent calls.. Log question, output/exception, response time somewhere -# show me a summary of requests made, success full calls, failed calls. For failed calls show me the exceptions - -import concurrent.futures -import random -import time - - -# Function to make concurrent calls to OpenAI API -def make_openai_completion(question): - try: - start_time = time.time() - response = router.completion( - model="gpt-3.5-turbo", - messages=[ - { - "role": "system", - "content": f"You are a helpful assistant. Answer this question{question}", - } - ], - ) - print(response) - end_time = time.time() - - # Log the request details - with open("request_log.txt", "a") as log_file: - log_file.write( - f"Question: {question[:100]}\nResponse: {response.choices[0].message.content}\nTime: {end_time - start_time:.2f} seconds\n\n" - ) - - return response - except Exception as e: - # Log exceptions for failed calls - with open("error_log.txt", "a") as error_log_file: - error_log_file.write(f"Question: {question[:100]}\nException: {str(e)}\n\n") - return None - - -# Number of concurrent calls (you can adjust this) -concurrent_calls = 150 - -# List to store the futures of concurrent calls -futures = [] - -# Make concurrent calls -with concurrent.futures.ThreadPoolExecutor(max_workers=concurrent_calls) as executor: - for _ in range(concurrent_calls): - random_question = random.choice(questions) - futures.append(executor.submit(make_openai_completion, random_question)) - -# Wait for all futures to complete -concurrent.futures.wait(futures) - -# Summarize the results -successful_calls = 0 -failed_calls = 0 - -for future in futures: - if future.result() is not None: - successful_calls += 1 - else: - failed_calls += 1 - -print("Load test Summary:") -print(f"Total Requests: {concurrent_calls}") -print(f"Successful Calls: {successful_calls}") -print(f"Failed Calls: {failed_calls}") - -# Display content of the logs -with open("request_log.txt", "r") as log_file: - print("\nRequest Log:\n", log_file.read()) - -with open("error_log.txt", "r") as error_log_file: - print("\nError Log:\n", error_log_file.read()) diff --git a/cookbook/litellm_router/request_log.txt b/cookbook/litellm_router/request_log.txt deleted file mode 100644 index 821d87ab56a..00000000000 --- a/cookbook/litellm_router/request_log.txt +++ /dev/null @@ -1,48 +0,0 @@ -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: 71a47cd4-92d9-4091-9429-8d22af6b56bf Url: /queue/response/71a47cd4-92d9-4091-9429-8d22af6b56bf -Time: 0.77 seconds - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Response ID: a0855c20-59ba-4eed-85c1-e0719eebdeab Url: /queue/response/a0855c20-59ba-4eed-85c1-e0719eebdeab -Time: 1.46 seconds - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: b131cdcd-0693-495b-ad41-b0cf2afc4833 Url: /queue/response/b131cdcd-0693-495b-ad41-b0cf2afc4833 -Time: 2.13 seconds - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: a58e5185-90e7-4832-9f28-e5a5ac167a40 Url: /queue/response/a58e5185-90e7-4832-9f28-e5a5ac167a40 -Time: 2.83 seconds - -Question: Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. -Response ID: 52dbbd49-eedb-4c11-8382-3ca7deb1af35 Url: /queue/response/52dbbd49-eedb-4c11-8382-3ca7deb1af35 -Time: 3.50 seconds - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Response ID: eedda05f-61e1-4081-b49d-27f9449bcf69 Url: /queue/response/eedda05f-61e1-4081-b49d-27f9449bcf69 -Time: 4.20 seconds - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: 8a484722-66ec-4193-b19b-2dfc4265cfd2 Url: /queue/response/8a484722-66ec-4193-b19b-2dfc4265cfd2 -Time: 4.89 seconds - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: ae1e2b71-d711-456d-8df0-13ce0709eb04 Url: /queue/response/ae1e2b71-d711-456d-8df0-13ce0709eb04 -Time: 5.60 seconds - -Question: What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 10 -Response ID: cfabd174-838e-4252-b82b-648923573db8 Url: /queue/response/cfabd174-838e-4252-b82b-648923573db8 -Time: 6.29 seconds - -Question: Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the Ope -Response ID: 02d5b7d6-5443-41e9-94e4-90d8b00d49fb Url: /queue/response/02d5b7d6-5443-41e9-94e4-90d8b00d49fb -Time: 7.01 seconds - diff --git a/cookbook/litellm_router/response_log.txt b/cookbook/litellm_router/response_log.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cookbook/litellm_router/test_questions/question1.txt b/cookbook/litellm_router/test_questions/question1.txt deleted file mode 100644 index d633a8ea22e..00000000000 --- a/cookbook/litellm_router/test_questions/question1.txt +++ /dev/null @@ -1,43 +0,0 @@ -Given this context, what is litellm? LiteLLM about: About -Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs). LiteLLM manages - -Translating inputs to the provider's completion and embedding endpoints -Guarantees consistent output, text responses will always be available at ['choices'][0]['message']['content'] -Exception mapping - common exceptions across providers are mapped to the OpenAI exception types. -10/05/2023: LiteLLM is adopting Semantic Versioning for all commits. Learn more -10/16/2023: Self-hosted OpenAI-proxy server Learn more - -Usage (Docs) -Important -LiteLLM v1.0.0 is being launched to require openai>=1.0.0. Track this here - -Open In Colab -pip install litellm -from litellm import completion -import os - -## set ENV variables -os.environ["OPENAI_API_KEY"] = "your-openai-key" -os.environ["COHERE_API_KEY"] = "your-cohere-key" - -messages = [{ "content": "Hello, how are you?","role": "user"}] - -# openai call -response = completion(model="gpt-3.5-turbo", messages=messages) - -# cohere call -response = completion(model="command-nightly", messages=messages) -print(response) -Streaming (Docs) -liteLLM supports streaming the model response back, pass stream=True to get a streaming iterator in response. -Streaming is supported for all models (Bedrock, Huggingface, TogetherAI, Azure, OpenAI, etc.) - -from litellm import completion -response = completion(model="gpt-3.5-turbo", messages=messages, stream=True) -for chunk in response: - print(chunk['choices'][0]['delta']) - -# claude 2 -result = completion('claude-2', messages, stream=True) -for chunk in result: - print(chunk['choices'][0]['delta']) \ No newline at end of file diff --git a/cookbook/litellm_router/test_questions/question2.txt b/cookbook/litellm_router/test_questions/question2.txt deleted file mode 100644 index 78188d06668..00000000000 --- a/cookbook/litellm_router/test_questions/question2.txt +++ /dev/null @@ -1,65 +0,0 @@ -Does litellm support ooobagooba llms? how can i call oobagooba llms. Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs). LiteLLM manages - -Translating inputs to the provider's completion and embedding endpoints -Guarantees consistent output, text responses will always be available at ['choices'][0]['message']['content'] -Exception mapping - common exceptions across providers are mapped to the OpenAI exception types. -10/05/2023: LiteLLM is adopting Semantic Versioning for all commits. Learn more -10/16/2023: Self-hosted OpenAI-proxy server Learn more - -Usage (Docs) -Important -LiteLLM v1.0.0 is being launched to require openai>=1.0.0. Track this here - -Open In Colab -pip install litellm -from litellm import completion -import os - -## set ENV variables -os.environ["OPENAI_API_KEY"] = "your-openai-key" -os.environ["COHERE_API_KEY"] = "your-cohere-key" - -messages = [{ "content": "Hello, how are you?","role": "user"}] - -# openai call -response = completion(model="gpt-3.5-turbo", messages=messages) - -# cohere call -response = completion(model="command-nightly", messages=messages) -print(response) -Streaming (Docs) -liteLLM supports streaming the model response back, pass stream=True to get a streaming iterator in response. -Streaming is supported for all models (Bedrock, Huggingface, TogetherAI, Azure, OpenAI, etc.) - -from litellm import completion -response = completion(model="gpt-3.5-turbo", messages=messages, stream=True) -for chunk in response: - print(chunk['choices'][0]['delta']) - -# claude 2 -result = completion('claude-2', messages, stream=True) -for chunk in result: - print(chunk['choices'][0]['delta']) Supported LiteLLM providers Supported Provider (Docs) -Provider Completion Streaming Async Completion Async Streaming -openai ✅ ✅ ✅ ✅ -azure ✅ ✅ ✅ ✅ -aws - sagemaker ✅ ✅ ✅ ✅ -aws - bedrock ✅ ✅ ✅ ✅ -cohere ✅ ✅ ✅ ✅ -anthropic ✅ ✅ ✅ ✅ -huggingface ✅ ✅ ✅ ✅ -replicate ✅ ✅ ✅ ✅ -together_ai ✅ ✅ ✅ ✅ -openrouter ✅ ✅ ✅ ✅ -google - vertex_ai ✅ ✅ ✅ ✅ -google - palm ✅ ✅ ✅ ✅ -ai21 ✅ ✅ ✅ ✅ -baseten ✅ ✅ ✅ ✅ -vllm ✅ ✅ ✅ ✅ -nlp_cloud ✅ ✅ ✅ ✅ -aleph alpha ✅ ✅ ✅ ✅ -petals ✅ ✅ ✅ ✅ -ollama ✅ ✅ ✅ ✅ -deepinfra ✅ ✅ ✅ ✅ -perplexity-ai ✅ ✅ ✅ ✅ -anyscale ✅ ✅ ✅ ✅ \ No newline at end of file diff --git a/cookbook/litellm_router/test_questions/question3.txt b/cookbook/litellm_router/test_questions/question3.txt deleted file mode 100644 index d6006f9c73c..00000000000 --- a/cookbook/litellm_router/test_questions/question3.txt +++ /dev/null @@ -1,50 +0,0 @@ -What endpoints does the litellm proxy have 💥 LiteLLM Proxy Server -LiteLLM Server manages: - -Calling 100+ LLMs Huggingface/Bedrock/TogetherAI/etc. in the OpenAI ChatCompletions & Completions format -Set custom prompt templates + model-specific configs (temperature, max_tokens, etc.) -Quick Start -View all the supported args for the Proxy CLI here - -$ litellm --model huggingface/bigcode/starcoder - -#INFO: Proxy running on http://0.0.0.0:8000 - -Test -In a new shell, run, this will make an openai.ChatCompletion request - -litellm --test - -This will now automatically route any requests for gpt-3.5-turbo to bigcode starcoder, hosted on huggingface inference endpoints. - -Replace openai base -import openai - -openai.api_base = "http://0.0.0.0:8000" - -print(openai.chat.completions.create(model="test", messages=[{"role":"user", "content":"Hey!"}])) - -Supported LLMs -Bedrock -Huggingface (TGI) -Anthropic -VLLM -OpenAI Compatible Server -TogetherAI -Replicate -Petals -Palm -Azure OpenAI -AI21 -Cohere -$ export AWS_ACCESS_KEY_ID="" -$ export AWS_REGION_NAME="" # e.g. us-west-2 -$ export AWS_SECRET_ACCESS_KEY="" - -$ litellm --model bedrock/anthropic.claude-v2 - -Server Endpoints -POST /chat/completions - chat completions endpoint to call 100+ LLMs -POST /completions - completions endpoint -POST /embeddings - embedding endpoint for Azure, OpenAI, Huggingface endpoints -GET /models - available models on server \ No newline at end of file diff --git a/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py b/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py deleted file mode 100644 index 1dc2d914857..00000000000 --- a/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py +++ /dev/null @@ -1,65 +0,0 @@ -from fastapi import FastAPI -import uvicorn -from memory_profiler import profile -import os -import litellm -from litellm import Router -from dotenv import load_dotenv -from litellm._uuid import uuid - -load_dotenv() - -model_list = [ - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { - "model": "azure/chatgpt-v-2", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - "tpm": 240000, - "rpm": 1800, - }, - { - "model_name": "text-embedding-ada-002", - "litellm_params": { - "model": "azure/azure-embedding-model", - "api_key": os.getenv("AZURE_API_KEY"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - "tpm": 100000, - "rpm": 10000, - }, -] - -litellm.set_verbose = True -litellm.cache = litellm.Cache( - type="s3", s3_bucket_name="litellm-my-test-bucket-2", s3_region_name="us-east-1" -) -router = Router(model_list=model_list, set_verbose=True) - -app = FastAPI() - - -@app.get("/") -async def read_root(): - return {"message": "Welcome to the FastAPI endpoint!"} - - -@profile -@app.post("/router_acompletion") -async def router_acompletion(): - question = f"This is a test: {uuid.uuid4()}" * 100 - resp = await router.aembedding(model="text-embedding-ada-002", input=question) - print("embedding-resp", resp) - - response = await router.acompletion( - model="gpt-3.5-turbo", messages=[{"role": "user", "content": question}] - ) - print("completion-resp", response) - return response - - -if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8000) diff --git a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py deleted file mode 100644 index 76d5d3913f5..00000000000 --- a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py +++ /dev/null @@ -1,91 +0,0 @@ -#### What this tests #### - -from memory_profiler import profile -import sys -import os -import time -import asyncio - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import litellm -from litellm import Router -from dotenv import load_dotenv -from litellm._uuid import uuid - -load_dotenv() - - -model_list = [ - { - "model_name": "gpt-3.5-turbo", # openai model name - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-v-2", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - "tpm": 240000, - "rpm": 1800, - }, - { - "model_name": "text-embedding-ada-002", - "litellm_params": { - "model": "azure/azure-embedding-model", - "api_key": os.environ["AZURE_API_KEY"], - "api_base": os.environ["AZURE_API_BASE"], - }, - "tpm": 100000, - "rpm": 10000, - }, -] -litellm.set_verbose = True -litellm.cache = litellm.Cache( - type="s3", s3_bucket_name="litellm-my-test-bucket-2", s3_region_name="us-east-1" -) -router = Router( - model_list=model_list, - set_verbose=True, -) # type: ignore - - -@profile -async def router_acompletion(): - # embedding call - question = f"This is a test: {uuid.uuid4()}" * 100 - resp = await router.aembedding(model="text-embedding-ada-002", input=question) - print("embedding-resp", resp) - - response = await router.acompletion( - model="gpt-3.5-turbo", messages=[{"role": "user", "content": question}] - ) - print("completion-resp", response) - return response - - -async def main(): - for i in range(1): - start = time.time() - n = 50 # Number of concurrent tasks - tasks = [router_acompletion() for _ in range(n)] - - chat_completions = await asyncio.gather(*tasks) - - successful_completions = [c for c in chat_completions if c is not None] - - # Write errors to error_log.txt - with open("error_log.txt", "a") as error_log: - for completion in chat_completions: - if isinstance(completion, str): - error_log.write(completion + "\n") - - print(n, time.time() - start, len(successful_completions)) - time.sleep(10) - - -if __name__ == "__main__": - # Blank out contents of error_log.txt - open("error_log.txt", "w").close() - - asyncio.run(main()) diff --git a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py deleted file mode 100644 index 76d5d3913f5..00000000000 --- a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py +++ /dev/null @@ -1,91 +0,0 @@ -#### What this tests #### - -from memory_profiler import profile -import sys -import os -import time -import asyncio - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import litellm -from litellm import Router -from dotenv import load_dotenv -from litellm._uuid import uuid - -load_dotenv() - - -model_list = [ - { - "model_name": "gpt-3.5-turbo", # openai model name - "litellm_params": { # params for litellm completion/embedding call - "model": "azure/chatgpt-v-2", - "api_key": os.getenv("AZURE_API_KEY"), - "api_version": os.getenv("AZURE_API_VERSION"), - "api_base": os.getenv("AZURE_API_BASE"), - }, - "tpm": 240000, - "rpm": 1800, - }, - { - "model_name": "text-embedding-ada-002", - "litellm_params": { - "model": "azure/azure-embedding-model", - "api_key": os.environ["AZURE_API_KEY"], - "api_base": os.environ["AZURE_API_BASE"], - }, - "tpm": 100000, - "rpm": 10000, - }, -] -litellm.set_verbose = True -litellm.cache = litellm.Cache( - type="s3", s3_bucket_name="litellm-my-test-bucket-2", s3_region_name="us-east-1" -) -router = Router( - model_list=model_list, - set_verbose=True, -) # type: ignore - - -@profile -async def router_acompletion(): - # embedding call - question = f"This is a test: {uuid.uuid4()}" * 100 - resp = await router.aembedding(model="text-embedding-ada-002", input=question) - print("embedding-resp", resp) - - response = await router.acompletion( - model="gpt-3.5-turbo", messages=[{"role": "user", "content": question}] - ) - print("completion-resp", response) - return response - - -async def main(): - for i in range(1): - start = time.time() - n = 50 # Number of concurrent tasks - tasks = [router_acompletion() for _ in range(n)] - - chat_completions = await asyncio.gather(*tasks) - - successful_completions = [c for c in chat_completions if c is not None] - - # Write errors to error_log.txt - with open("error_log.txt", "a") as error_log: - for completion in chat_completions: - if isinstance(completion, str): - error_log.write(completion + "\n") - - print(n, time.time() - start, len(successful_completions)) - time.sleep(10) - - -if __name__ == "__main__": - # Blank out contents of error_log.txt - open("error_log.txt", "w").close() - - asyncio.run(main()) diff --git a/cookbook/litellm_router_load_test/memory_usage/send_request.py b/cookbook/litellm_router_load_test/memory_usage/send_request.py deleted file mode 100644 index 6a3473e230f..00000000000 --- a/cookbook/litellm_router_load_test/memory_usage/send_request.py +++ /dev/null @@ -1,28 +0,0 @@ -import requests -from concurrent.futures import ThreadPoolExecutor - -# Replace the URL with your actual endpoint -url = "http://localhost:8000/router_acompletion" - - -def make_request(session): - headers = {"Content-Type": "application/json"} - data = {} # Replace with your JSON payload if needed - - response = session.post(url, headers=headers, json=data) - print(f"Status code: {response.status_code}") - - -# Number of concurrent requests -num_requests = 20 - -# Create a session to reuse the underlying TCP connection -with requests.Session() as session: - # Use ThreadPoolExecutor for concurrent requests - with ThreadPoolExecutor(max_workers=num_requests) as executor: - # Use list comprehension to submit tasks - futures = [executor.submit(make_request, session) for _ in range(num_requests)] - - # Wait for all futures to complete - for future in futures: - future.result() diff --git a/cookbook/litellm_router_load_test/test_loadtest_openai_client.py b/cookbook/litellm_router_load_test/test_loadtest_openai_client.py deleted file mode 100644 index 8c50825be12..00000000000 --- a/cookbook/litellm_router_load_test/test_loadtest_openai_client.py +++ /dev/null @@ -1,73 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import asyncio -from litellm import Timeout -import time -import openai - -### Test just calling AsyncAzureOpenAI - -openai_client = openai.AsyncAzureOpenAI( - azure_endpoint=os.getenv("AZURE_API_BASE"), - api_key=os.getenv("AZURE_API_KEY"), -) - - -async def call_acompletion(semaphore, input_data): - async with semaphore: - try: - # Use asyncio.wait_for to set a timeout for the task - response = await openai_client.chat.completions.create(**input_data) - # Handle the response as needed - print(response) - return response - except Timeout: - print(f"Task timed out: {input_data}") - return None # You may choose to return something else or raise an exception - - -async def main(): - # Initialize the Router - - # Create a semaphore with a capacity of 100 - semaphore = asyncio.Semaphore(100) - - # List to hold all task references - tasks = [] - start_time_all_tasks = time.time() - # Launch 1000 tasks - for _ in range(500): - task = asyncio.create_task( - call_acompletion( - semaphore, - { - "model": "chatgpt-v-2", - "messages": [{"role": "user", "content": "Hey, how's it going?"}], - }, - ) - ) - tasks.append(task) - - # Wait for all tasks to complete - responses = await asyncio.gather(*tasks) - # Process responses as needed - # Record the end time for all tasks - end_time_all_tasks = time.time() - # Calculate the total time for all tasks - total_time_all_tasks = end_time_all_tasks - start_time_all_tasks - print(f"Total time for all tasks: {total_time_all_tasks} seconds") - - # Calculate the average time per response - average_time_per_response = total_time_all_tasks / len(responses) - print(f"Average time per response: {average_time_per_response} seconds") - print(f"NUMBER OF COMPLETED TASKS: {len(responses)}") - - -# Run the main function -asyncio.run(main()) diff --git a/cookbook/litellm_router_load_test/test_loadtest_router.py b/cookbook/litellm_router_load_test/test_loadtest_router.py deleted file mode 100644 index 280e495e771..00000000000 --- a/cookbook/litellm_router_load_test/test_loadtest_router.py +++ /dev/null @@ -1,87 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import asyncio -from litellm import Router, Timeout -import time - -### Test calling router async - - -async def call_acompletion(semaphore, router: Router, input_data): - async with semaphore: - try: - # Use asyncio.wait_for to set a timeout for the task - response = await router.acompletion(**input_data) - # Handle the response as needed - print(response) - return response - except Timeout: - print(f"Task timed out: {input_data}") - return None # You may choose to return something else or raise an exception - - -async def main(): - # Initialize the Router - model_list = [ - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { - "model": "gpt-3.5-turbo", - "api_key": os.getenv("OPENAI_API_KEY"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { - "model": "azure/chatgpt-v-2", - "api_key": os.getenv("AZURE_API_KEY"), - "api_base": os.getenv("AZURE_API_BASE"), - "api_version": os.getenv("AZURE_API_VERSION"), - }, - }, - ] - router = Router(model_list=model_list, num_retries=3, timeout=10) - - # Create a semaphore with a capacity of 100 - semaphore = asyncio.Semaphore(100) - - # List to hold all task references - tasks = [] - start_time_all_tasks = time.time() - # Launch 1000 tasks - for _ in range(500): - task = asyncio.create_task( - call_acompletion( - semaphore, - router, - { - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "Hey, how's it going?"}], - }, - ) - ) - tasks.append(task) - - # Wait for all tasks to complete - responses = await asyncio.gather(*tasks) - # Process responses as needed - # Record the end time for all tasks - end_time_all_tasks = time.time() - # Calculate the total time for all tasks - total_time_all_tasks = end_time_all_tasks - start_time_all_tasks - print(f"Total time for all tasks: {total_time_all_tasks} seconds") - - # Calculate the average time per response - average_time_per_response = total_time_all_tasks / len(responses) - print(f"Average time per response: {average_time_per_response} seconds") - print(f"NUMBER OF COMPLETED TASKS: {len(responses)}") - - -# Run the main function -asyncio.run(main()) diff --git a/cookbook/litellm_router_load_test/test_loadtest_router_withs3_cache.py b/cookbook/litellm_router_load_test/test_loadtest_router_withs3_cache.py deleted file mode 100644 index b093489be1b..00000000000 --- a/cookbook/litellm_router_load_test/test_loadtest_router_withs3_cache.py +++ /dev/null @@ -1,93 +0,0 @@ -import sys -import os -from dotenv import load_dotenv - -load_dotenv() -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path -import asyncio -from litellm import Router, Timeout -import time -from litellm.caching.caching import Cache -import litellm - -litellm.cache = Cache( - type="s3", s3_bucket_name="cache-bucket-litellm", s3_region_name="us-west-2" -) - -### Test calling router with s3 Cache - - -async def call_acompletion(semaphore, router: Router, input_data): - async with semaphore: - try: - # Use asyncio.wait_for to set a timeout for the task - response = await router.acompletion(**input_data) - # Handle the response as needed - print(response) - return response - except Timeout: - print(f"Task timed out: {input_data}") - return None # You may choose to return something else or raise an exception - - -async def main(): - # Initialize the Router - model_list = [ - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { - "model": "gpt-3.5-turbo", - "api_key": os.getenv("OPENAI_API_KEY"), - }, - }, - { - "model_name": "gpt-3.5-turbo", - "litellm_params": { - "model": "azure/chatgpt-v-2", - "api_key": os.getenv("AZURE_API_KEY"), - "api_base": os.getenv("AZURE_API_BASE"), - "api_version": os.getenv("AZURE_API_VERSION"), - }, - }, - ] - router = Router(model_list=model_list, num_retries=3, timeout=10) - - # Create a semaphore with a capacity of 100 - semaphore = asyncio.Semaphore(100) - - # List to hold all task references - tasks = [] - start_time_all_tasks = time.time() - # Launch 1000 tasks - for _ in range(500): - task = asyncio.create_task( - call_acompletion( - semaphore, - router, - { - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "Hey, how's it going?"}], - }, - ) - ) - tasks.append(task) - - # Wait for all tasks to complete - responses = await asyncio.gather(*tasks) - # Process responses as needed - # Record the end time for all tasks - end_time_all_tasks = time.time() - # Calculate the total time for all tasks - total_time_all_tasks = end_time_all_tasks - start_time_all_tasks - print(f"Total time for all tasks: {total_time_all_tasks} seconds") - - # Calculate the average time per response - average_time_per_response = total_time_all_tasks / len(responses) - print(f"Average time per response: {average_time_per_response} seconds") - print(f"NUMBER OF COMPLETED TASKS: {len(responses)}") - - -# Run the main function -asyncio.run(main()) diff --git a/cookbook/litellm_test_multiple_llm_demo.ipynb b/cookbook/litellm_test_multiple_llm_demo.ipynb deleted file mode 100644 index f22448e46b9..00000000000 --- a/cookbook/litellm_test_multiple_llm_demo.ipynb +++ /dev/null @@ -1,55 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "adotBkqZSh5g" - }, - "outputs": [], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "code", - "source": [ - "from litellm import completion\n", - "\n", - "## set ENV variables\n", - "os.environ[\"OPENAI_API_KEY\"] = \"openai key\"\n", - "os.environ[\"COHERE_API_KEY\"] = \"cohere key\"\n", - "os.environ[\"REPLICATE_API_KEY\"] = \"replicate key\"\n", - "messages = [{ \"content\": \"Hello, how are you?\",\"role\": \"user\"}]\n", - "\n", - "# openai call\n", - "response = completion(model=\"gpt-3.5-turbo\", messages=messages)\n", - "\n", - "# cohere call\n", - "response = completion(\"command-nightly\", messages)\n", - "\n", - "# replicate call\n", - "response = completion(\"replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1\", messages)" - ], - "metadata": { - "id": "LeOqznSgSj-z" - }, - "execution_count": null, - "outputs": [] - } - ] -} diff --git a/cookbook/livekit_agent_sdk/README.md b/cookbook/livekit_agent_sdk/README.md deleted file mode 100644 index 6c794165e96..00000000000 --- a/cookbook/livekit_agent_sdk/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# LiveKit Voice Agent with LiteLLM Gateway - -Simple example showing how to use LiveKit's xAI realtime plugin with LiteLLM as a proxy. This lets you switch between xAI, OpenAI, and Azure realtime APIs without changing your code. - -## Quick Start - -### 1. Install dependencies - -```bash -pip install livekit-agents[xai] websockets -``` - -### 2. Start LiteLLM proxy - -```bash -# With xAI -export XAI_API_KEY="your-xai-key" -export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)" -litellm --config config.yaml --port 4000 -``` - -### 3. Run the voice agent - -```bash -export LITELLM_API_KEY="$LITELLM_MASTER_KEY" -python main.py -``` - -Type your message and get a voice response from Grok! - -## Configuration - -Set these environment variables if needed: - -```bash -export LITELLM_PROXY_URL="http://localhost:4000" -export LITELLM_API_KEY="$LITELLM_MASTER_KEY" -export LITELLM_MODEL="grok-voice-agent" -``` - -Or use the defaults - connects to `http://localhost:4000` by default. - -## Example Config File - -Create a `config.yaml` with your realtime models: - -```yaml -model_list: - - model_name: grok-voice-agent - litellm_params: - model: xai/grok-2-vision-1212 - api_key: os.environ/XAI_API_KEY - model_info: - mode: realtime - - - model_name: openai-voice-agent - litellm_params: - model: gpt-4o-realtime-preview - api_key: os.environ/OPENAI_API_KEY - model_info: - mode: realtime - -general_settings: - master_key: os.environ/LITELLM_MASTER_KEY -``` - -Then start: `litellm --config config.yaml --port 4000` - -## How It Works - -LiveKit's xAI plugin connects through LiteLLM proxy by setting `base_url`: - -```python -from livekit.plugins import xai - -model = xai.realtime.RealtimeModel( - voice="ara", - api_key=os.environ["LITELLM_MASTER_KEY"], - base_url="http://localhost:4000", # Point to LiteLLM -) -``` - -## Switching Providers - -Just change the model in your config - no code changes needed: - -**xAI Grok:** -```yaml -model: xai/grok-2-vision-1212 -``` - -**OpenAI:** -```yaml -model: gpt-4o-realtime-preview -``` - -**Azure OpenAI:** -```yaml -model: azure/gpt-4o-realtime-preview -api_base: https://your-endpoint.openai.azure.com/ -``` - -## Why Use LiteLLM? - -- ✅ **Switch providers** without changing agent code -- ✅ **Cost tracking** across all voice sessions -- ✅ **Rate limiting** and budgets -- ✅ **Load balancing** across multiple API keys -- ✅ **Fallbacks** to backup models - -## Learn More - -- [LiveKit xAI Realtime Tutorial](/docs/tutorials/livekit_xai_realtime) -- [xAI Realtime Docs](/docs/providers/xai_realtime) -- [LiveKit Agents Documentation](https://docs.livekit.io/agents/) -- [LiteLLM Realtime API](/docs/realtime) diff --git a/cookbook/livekit_agent_sdk/config.example.yaml b/cookbook/livekit_agent_sdk/config.example.yaml deleted file mode 100644 index 388aa24f501..00000000000 --- a/cookbook/livekit_agent_sdk/config.example.yaml +++ /dev/null @@ -1,20 +0,0 @@ -model_list: - - model_name: grok-voice-agent - litellm_params: - model: xai/grok-2-vision-1212 - api_key: os.environ/XAI_API_KEY - model_info: - mode: realtime - - - model_name: openai-voice-agent - litellm_params: - model: gpt-4o-realtime-preview - api_key: os.environ/OPENAI_API_KEY - model_info: - mode: realtime - -litellm_settings: - drop_params: True - -general_settings: - master_key: os.environ/LITELLM_MASTER_KEY diff --git a/cookbook/livekit_agent_sdk/main.py b/cookbook/livekit_agent_sdk/main.py deleted file mode 100644 index fdc72e518b4..00000000000 --- a/cookbook/livekit_agent_sdk/main.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Simple xAI Voice Agent using LiveKit SDK with LiteLLM Gateway - -This example shows how to use LiveKit's xAI realtime plugin through LiteLLM proxy. -LiteLLM acts as a unified interface, allowing you to switch between xAI, OpenAI, -and Azure realtime APIs without changing your agent code. -""" - -import asyncio -import json -import os -import websockets - -# Configuration -PROXY_URL = os.getenv("LITELLM_PROXY_URL", "http://localhost:4000") -API_KEY = os.environ["LITELLM_API_KEY"] -MODEL = os.getenv("LITELLM_MODEL", "grok-voice-agent") - - -async def run_voice_agent(): - """ - Simple voice agent that: - 1. Connects to xAI realtime API through LiteLLM proxy - 2. Sends a user message - 3. Streams back the response - """ - - url = f"ws://{PROXY_URL.replace('http://', '').replace('https://', '')}/v1/realtime?model={MODEL}" - headers = {"Authorization": f"Bearer {API_KEY}"} - - print(f"🎙️ Connecting to voice agent...") - print(f" Model: {MODEL}") - print(f" Proxy: {PROXY_URL}") - print() - - async with websockets.connect(url, additional_headers=headers) as ws: - # Receive initial connection event - initial = json.loads(await ws.recv()) - print(f"✅ Connected! Event: {initial['type']}\n") - - # Get user input - user_message = input("💬 Your message: ").strip() - if not user_message: - user_message = "Tell me a fun fact about AI!" - - print(f"\n🤖 Sending to {MODEL}...\n") - - # Send user message - await ws.send( - json.dumps( - { - "type": "conversation.item.create", - "item": { - "type": "message", - "role": "user", - "content": [{"type": "input_text", "text": user_message}], - }, - } - ) - ) - - # Request response - await ws.send( - json.dumps( - { - "type": "response.create", - "response": {"modalities": ["text", "audio"]}, - } - ) - ) - - # Stream response - print("🎤 Response: ", end="", flush=True) - transcript = [] - - try: - while True: - msg = await asyncio.wait_for(ws.recv(), timeout=15.0) - event = json.loads(msg) - - # Capture transcript deltas - if event["type"] == "response.output_audio_transcript.delta": - delta = event.get("delta", "") - if delta: - print(delta, end="", flush=True) - transcript.append(delta) - - # Done when response completes - elif event["type"] == "response.done": - break - - except asyncio.TimeoutError: - pass - - print("\n") - - if transcript: - print(f"✅ Complete response: {''.join(transcript)}") - - await ws.close() - - -def main(): - """Run the voice agent""" - print("=" * 70) - print("LiveKit xAI Voice Agent via LiteLLM Proxy") - print("=" * 70) - print() - - try: - asyncio.run(run_voice_agent()) - except KeyboardInterrupt: - print("\n\n👋 Goodbye!") - except Exception as e: - print(f"\n❌ Error: {e}") - print("\nMake sure LiteLLM proxy is running:") - print(f" litellm --config config.yaml --port 4000") - - -if __name__ == "__main__": - main() diff --git a/cookbook/livekit_agent_sdk/requirements.txt b/cookbook/livekit_agent_sdk/requirements.txt deleted file mode 100644 index 9e3542fac27..00000000000 --- a/cookbook/livekit_agent_sdk/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -livekit-agents[xai]>=1.3.12 -websockets>=15.0.1 diff --git a/cookbook/logging_observability/LiteLLM_Arize.ipynb b/cookbook/logging_observability/LiteLLM_Arize.ipynb deleted file mode 100644 index 72a082f874d..00000000000 --- a/cookbook/logging_observability/LiteLLM_Arize.ipynb +++ /dev/null @@ -1,172 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "4FbDOmcj2VkM" - }, - "source": [ - "## Use LiteLLM with Arize\n", - "https://docs.litellm.ai/docs/observability/arize_integration\n", - "\n", - "This method uses the litellm proxy to send the data to Arize. The callback is set in the litellm config below, instead of using OpenInference tracing." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "21W8Woog26Ns" - }, - "source": [ - "## Install Dependencies" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "id": "xrjKLBxhxu2L" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: litellm in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (1.54.1)\n", - "Requirement already satisfied: aiohttp in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (3.11.10)\n", - "Requirement already satisfied: click in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (8.1.7)\n", - "Requirement already satisfied: httpx<0.28.0,>=0.23.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (0.27.2)\n", - "Requirement already satisfied: importlib-metadata>=6.8.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (8.5.0)\n", - "Requirement already satisfied: jinja2<4.0.0,>=3.1.2 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (3.1.4)\n", - "Requirement already satisfied: jsonschema<5.0.0,>=4.22.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (4.23.0)\n", - "Requirement already satisfied: openai>=1.55.3 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (1.57.1)\n", - "Requirement already satisfied: pydantic<3.0.0,>=2.0.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (2.10.3)\n", - "Requirement already satisfied: python-dotenv>=0.2.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (1.0.1)\n", - "Requirement already satisfied: requests<3.0.0,>=2.31.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (2.32.3)\n", - "Requirement already satisfied: tiktoken>=0.7.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (0.7.0)\n", - "Requirement already satisfied: tokenizers in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from litellm) (0.21.0)\n", - "Requirement already satisfied: anyio in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpx<0.28.0,>=0.23.0->litellm) (4.7.0)\n", - "Requirement already satisfied: certifi in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpx<0.28.0,>=0.23.0->litellm) (2024.8.30)\n", - "Requirement already satisfied: httpcore==1.* in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpx<0.28.0,>=0.23.0->litellm) (1.0.7)\n", - "Requirement already satisfied: idna in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpx<0.28.0,>=0.23.0->litellm) (3.10)\n", - "Requirement already satisfied: sniffio in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpx<0.28.0,>=0.23.0->litellm) (1.3.1)\n", - "Requirement already satisfied: h11<0.15,>=0.13 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from httpcore==1.*->httpx<0.28.0,>=0.23.0->litellm) (0.14.0)\n", - "Requirement already satisfied: zipp>=3.20 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from importlib-metadata>=6.8.0->litellm) (3.21.0)\n", - "Requirement already satisfied: MarkupSafe>=2.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from jinja2<4.0.0,>=3.1.2->litellm) (3.0.2)\n", - "Requirement already satisfied: attrs>=22.2.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (24.2.0)\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (2024.10.1)\n", - "Requirement already satisfied: referencing>=0.28.4 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (0.35.1)\n", - "Requirement already satisfied: rpds-py>=0.7.1 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from jsonschema<5.0.0,>=4.22.0->litellm) (0.22.3)\n", - "Requirement already satisfied: distro<2,>=1.7.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from openai>=1.55.3->litellm) (1.9.0)\n", - "Requirement already satisfied: jiter<1,>=0.4.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from openai>=1.55.3->litellm) (0.6.1)\n", - "Requirement already satisfied: tqdm>4 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from openai>=1.55.3->litellm) (4.67.1)\n", - "Requirement already satisfied: typing-extensions<5,>=4.11 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from openai>=1.55.3->litellm) (4.12.2)\n", - "Requirement already satisfied: annotated-types>=0.6.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from pydantic<3.0.0,>=2.0.0->litellm) (0.7.0)\n", - "Requirement already satisfied: pydantic-core==2.27.1 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from pydantic<3.0.0,>=2.0.0->litellm) (2.27.1)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from requests<3.0.0,>=2.31.0->litellm) (3.4.0)\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from requests<3.0.0,>=2.31.0->litellm) (2.0.7)\n", - "Requirement already satisfied: regex>=2022.1.18 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from tiktoken>=0.7.0->litellm) (2024.11.6)\n", - "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (2.4.4)\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (1.3.1)\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (1.5.0)\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (6.1.0)\n", - "Requirement already satisfied: propcache>=0.2.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (0.2.1)\n", - "Requirement already satisfied: yarl<2.0,>=1.17.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from aiohttp->litellm) (1.18.3)\n", - "Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from tokenizers->litellm) (0.26.5)\n", - "Requirement already satisfied: filelock in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm) (3.16.1)\n", - "Requirement already satisfied: fsspec>=2023.5.0 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm) (2024.10.0)\n", - "Requirement already satisfied: packaging>=20.9 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm) (24.2)\n", - "Requirement already satisfied: pyyaml>=5.1 in /Users/ericxiao/Documents/arize/.venv/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.16.4->tokenizers->litellm) (6.0.2)\n" - ] - } - ], - "source": [ - "!pip install litellm" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "jHEu-TjZ29PJ" - }, - "source": [ - "## Set Env Variables" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "id": "QWd9rTysxsWO" - }, - "outputs": [], - "source": [ - "import litellm\n", - "import os\n", - "from getpass import getpass\n", - "\n", - "os.environ[\"ARIZE_SPACE_KEY\"] = getpass(\"Enter your Arize space key: \")\n", - "os.environ[\"ARIZE_API_KEY\"] = getpass(\"Enter your Arize API key: \")\n", - "os.environ['OPENAI_API_KEY']= getpass(\"Enter your OpenAI API key: \")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's run a completion call and see the traces in Arize" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello! Nice to meet you, OpenAI. How can I assist you today?\n" - ] - } - ], - "source": [ - "# set arize as a callback, litellm will send the data to arize\n", - "litellm.callbacks = [\"arize\"]\n", - " \n", - "# openai call\n", - "response = litellm.completion(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages=[\n", - " {\"role\": \"user\", \"content\": \"Hi 👋 - i'm openai\"}\n", - " ]\n", - ")\n", - "print(response.choices[0].message.content)" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.6" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/logging_observability/LiteLLM_Langfuse.ipynb b/cookbook/logging_observability/LiteLLM_Langfuse.ipynb deleted file mode 100644 index 2a63666e069..00000000000 --- a/cookbook/logging_observability/LiteLLM_Langfuse.ipynb +++ /dev/null @@ -1,197 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "## Use LiteLLM with Langfuse\n", - "https://docs.litellm.ai/docs/observability/langfuse_integration" - ], - "metadata": { - "id": "4FbDOmcj2VkM" - } - }, - { - "cell_type": "markdown", - "source": [ - "## Install Dependencies" - ], - "metadata": { - "id": "21W8Woog26Ns" - } - }, - { - "cell_type": "code", - "source": [ - "!pip install litellm langfuse" - ], - "metadata": { - "id": "xrjKLBxhxu2L" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "## Set Env Variables" - ], - "metadata": { - "id": "jHEu-TjZ29PJ" - } - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "id": "QWd9rTysxsWO" - }, - "outputs": [], - "source": [ - "import litellm\n", - "from litellm import completion\n", - "import os\n", - "\n", - "# from https://cloud.langfuse.com/\n", - "os.environ[\"LANGFUSE_PUBLIC_KEY\"] = \"\"\n", - "os.environ[\"LANGFUSE_SECRET_KEY\"] = \"\"\n", - "\n", - "\n", - "# OpenAI and Cohere keys\n", - "# You can use any of the litellm supported providers: https://docs.litellm.ai/docs/providers\n", - "os.environ['OPENAI_API_KEY']=\"\"\n", - "os.environ['COHERE_API_KEY']=\"\"\n" - ] - }, - { - "cell_type": "markdown", - "source": [ - "## Set LangFuse as a callback for sending data\n", - "## OpenAI completion call" - ], - "metadata": { - "id": "NodQl0hp3Lma" - } - }, - { - "cell_type": "code", - "source": [ - "# set langfuse as a callback, litellm will send the data to langfuse\n", - "litellm.success_callback = [\"langfuse\"]\n", - "\n", - "# openai call\n", - "response = completion(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages=[\n", - " {\"role\": \"user\", \"content\": \"Hi 👋 - i'm openai\"}\n", - " ]\n", - ")\n", - "\n", - "print(response)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "vNAuwJY1yp_F", - "outputId": "c3a71e26-13f5-4379-fac9-409290ba79bb" - }, - "execution_count": 8, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "{\n", - " \"id\": \"chatcmpl-85nP4xHdAP3jAcGneIguWATS9qdoO\",\n", - " \"object\": \"chat.completion\",\n", - " \"created\": 1696392238,\n", - " \"model\": \"gpt-3.5-turbo-0613\",\n", - " \"choices\": [\n", - " {\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello! How can I assist you today?\"\n", - " },\n", - " \"finish_reason\": \"stop\"\n", - " }\n", - " ],\n", - " \"usage\": {\n", - " \"prompt_tokens\": 15,\n", - " \"completion_tokens\": 9,\n", - " \"total_tokens\": 24\n", - " }\n", - "}\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [ - "# we set langfuse as a callback in the prev cell\n", - "# cohere call\n", - "response = completion(\n", - " model=\"command-nightly\",\n", - " messages=[\n", - " {\"role\": \"user\", \"content\": \"Hi 👋 - i'm cohere\"}\n", - " ]\n", - ")\n", - "\n", - "print(response)" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "2PMSLc_FziJL", - "outputId": "1c37605e-b406-4ffc-aafd-e1983489c6be" - }, - "execution_count": 9, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "{\n", - " \"object\": \"chat.completion\",\n", - " \"choices\": [\n", - " {\n", - " \"finish_reason\": \"stop\",\n", - " \"index\": 0,\n", - " \"message\": {\n", - " \"content\": \" Nice to meet you, Cohere! I'm excited to be meeting new members of the AI community\",\n", - " \"role\": \"assistant\",\n", - " \"logprobs\": null\n", - " }\n", - " }\n", - " ],\n", - " \"id\": \"chatcmpl-a14e903f-4608-4ceb-b996-8ebdf21360ca\",\n", - " \"created\": 1696392247.3313863,\n", - " \"model\": \"command-nightly\",\n", - " \"usage\": {\n", - " \"prompt_tokens\": 8,\n", - " \"completion_tokens\": 20,\n", - " \"total_tokens\": 28\n", - " }\n", - "}\n" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/cookbook/logging_observability/LiteLLM_Lunary.ipynb b/cookbook/logging_observability/LiteLLM_Lunary.ipynb deleted file mode 100644 index 3b1dc5d5e25..00000000000 --- a/cookbook/logging_observability/LiteLLM_Lunary.ipynb +++ /dev/null @@ -1,348 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "4FbDOmcj2VkM" - }, - "source": [ - "## Use LiteLLM with Langfuse\n", - "https://docs.litellm.ai/docs/observability/langfuse_integration" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "21W8Woog26Ns" - }, - "source": [ - "## Install Dependencies" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "xrjKLBxhxu2L" - }, - "outputs": [], - "source": [ - "%pip install litellm lunary" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "jHEu-TjZ29PJ" - }, - "source": [ - "## Set Env Variables" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "id": "QWd9rTysxsWO" - }, - "outputs": [], - "source": [ - "import litellm\n", - "from litellm import completion\n", - "import os\n", - "\n", - "# from https://app.lunary.ai/\n", - "os.environ[\"LUNARY_PUBLIC_KEY\"] = \"\"\n", - "\n", - "\n", - "# LLM provider keys\n", - "# You can use any of the litellm supported providers: https://docs.litellm.ai/docs/providers\n", - "os.environ['OPENAI_API_KEY'] = \"\"\n" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "NodQl0hp3Lma" - }, - "source": [ - "## Set Lunary as a callback for sending data\n", - "## OpenAI completion call" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "vNAuwJY1yp_F", - "outputId": "c3a71e26-13f5-4379-fac9-409290ba79bb" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I assist you today?', role='assistant'))]ModelResponse(id='chatcmpl-8xIWykI0GiJSmYtXYuB8Z363kpIBm', choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I assist you today?', role='assistant'))], created=1709143276, model='gpt-3.5-turbo-0125', object='chat.completion', system_fingerprint='fp_86156a94a0', usage=Usage(completion_tokens=9, prompt_tokens=15, total_tokens=24))\n", - "\n", - "[Lunary] Add event: {\n", - " \"event\": \"start\",\n", - " \"type\": \"llm\",\n", - " \"name\": \"gpt-3.5-turbo\",\n", - " \"runId\": \"a363776a-bd07-4474-bce2-193067f01b2e\",\n", - " \"timestamp\": \"2024-02-28T18:01:15.188153+00:00\",\n", - " \"input\": {\n", - " \"role\": \"user\",\n", - " \"content\": \"Hi \\ud83d\\udc4b - i'm openai\"\n", - " },\n", - " \"extra\": {},\n", - " \"runtime\": \"litellm\",\n", - " \"metadata\": {}\n", - "}\n", - "\n", - "\n", - "[Lunary] Add event: {\n", - " \"event\": \"end\",\n", - " \"type\": \"llm\",\n", - " \"runId\": \"a363776a-bd07-4474-bce2-193067f01b2e\",\n", - " \"timestamp\": \"2024-02-28T18:01:16.846581+00:00\",\n", - " \"output\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello! How can I assist you today?\"\n", - " },\n", - " \"runtime\": \"litellm\",\n", - " \"tokensUsage\": {\n", - " \"completion\": 9,\n", - " \"prompt\": 15\n", - " }\n", - "}\n", - "\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "--- Logging error ---\n", - "Traceback (most recent call last):\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 537, in _make_request\n", - " response = conn.getresponse()\n", - " ^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connection.py\", line 466, in getresponse\n", - " httplib_response = super().getresponse()\n", - " ^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py\", line 1423, in getresponse\n", - " response.begin()\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py\", line 331, in begin\n", - " version, status, reason = self._read_status()\n", - " ^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py\", line 292, in _read_status\n", - " line = str(self.fp.readline(_MAXLINE + 1), \"iso-8859-1\")\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py\", line 707, in readinto\n", - " return self._sock.recv_into(b)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^\n", - "TimeoutError: timed out\n", - "\n", - "The above exception was the direct cause of the following exception:\n", - "\n", - "Traceback (most recent call last):\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/adapters.py\", line 486, in send\n", - " resp = conn.urlopen(\n", - " ^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 847, in urlopen\n", - " retries = retries.increment(\n", - " ^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/util/retry.py\", line 470, in increment\n", - " raise reraise(type(error), error, _stacktrace)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/util/util.py\", line 39, in reraise\n", - " raise value\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 793, in urlopen\n", - " response = self._make_request(\n", - " ^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 539, in _make_request\n", - " self._raise_timeout(err=e, url=url, timeout_value=read_timeout)\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 370, in _raise_timeout\n", - " raise ReadTimeoutError(\n", - "urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=3333): Read timed out. (read timeout=5)\n", - "\n", - "During handling of the above exception, another exception occurred:\n", - "\n", - "Traceback (most recent call last):\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/lunary/consumer.py\", line 59, in send_batch\n", - " response = requests.post(\n", - " ^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/api.py\", line 115, in post\n", - " return request(\"post\", url, data=data, json=json, **kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/api.py\", line 59, in request\n", - " return session.request(method=method, url=url, **kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/sessions.py\", line 589, in request\n", - " resp = self.send(prep, **send_kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/sessions.py\", line 703, in send\n", - " r = adapter.send(request, **kwargs)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/requests/adapters.py\", line 532, in send\n", - " raise ReadTimeout(e, request=request)\n", - "requests.exceptions.ReadTimeout: HTTPConnectionPool(host='localhost', port=3333): Read timed out. (read timeout=5)\n", - "\n", - "During handling of the above exception, another exception occurred:\n", - "\n", - "Traceback (most recent call last):\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py\", line 1160, in emit\n", - " msg = self.format(record)\n", - " ^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py\", line 999, in format\n", - " return fmt.format(record)\n", - " ^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py\", line 703, in format\n", - " record.message = record.getMessage()\n", - " ^^^^^^^^^^^^^^^^^^^\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py\", line 392, in getMessage\n", - " msg = msg % self.args\n", - " ~~~~^~~~~~~~~~~\n", - "TypeError: not all arguments converted during string formatting\n", - "Call stack:\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py\", line 1030, in _bootstrap\n", - " self._bootstrap_inner()\n", - " File \"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py\", line 1073, in _bootstrap_inner\n", - " self.run()\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/lunary/consumer.py\", line 24, in run\n", - " self.send_batch()\n", - " File \"/Users/vince/Library/Caches/pypoetry/virtualenvs/litellm-7WKnDWGw-py3.12/lib/python3.12/site-packages/lunary/consumer.py\", line 73, in send_batch\n", - " logging.error(\"[Lunary] Error sending events\", e)\n", - "Message: '[Lunary] Error sending events'\n", - "Arguments: (ReadTimeout(ReadTimeoutError(\"HTTPConnectionPool(host='localhost', port=3333): Read timed out. (read timeout=5)\")),)\n" - ] - } - ], - "source": [ - "# set langfuse as a callback, litellm will send the data to langfuse\n", - "litellm.success_callback = [\"lunary\"]\n", - "\n", - "# openai call\n", - "response = completion(\n", - " model=\"gpt-3.5-turbo\",\n", - " messages=[\n", - " {\"role\": \"user\", \"content\": \"Hi 👋 - i'm openai\"}\n", - " ]\n", - ")\n", - "\n", - "print(response)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Using LiteLLM with Lunary Templates\n", - "\n", - "You can use LiteLLM seamlessly with Lunary templates to manage your prompts and completions.\n", - "\n", - "Assuming you have created a template \"test-template\" with a variable \"question\", you can use it like this:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "2PMSLc_FziJL", - "outputId": "1c37605e-b406-4ffc-aafd-e1983489c6be" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I assist you today?', role='assistant'))]ModelResponse(id='chatcmpl-8xIXegwpudg4YKnLB6pmpFGXqTHcH', choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I assist you today?', role='assistant'))], created=1709143318, model='gpt-4-0125-preview', object='chat.completion', system_fingerprint='fp_c8aa5a06d6', usage=Usage(completion_tokens=9, prompt_tokens=21, total_tokens=30))\n", - "\n", - "[Lunary] Add event: {\n", - " \"event\": \"start\",\n", - " \"type\": \"llm\",\n", - " \"name\": \"gpt-4-turbo-preview\",\n", - " \"runId\": \"3a5b698d-cb55-4b3b-ab6d-04d2b99e40cb\",\n", - " \"timestamp\": \"2024-02-28T18:01:56.746249+00:00\",\n", - " \"input\": [\n", - " {\n", - " \"role\": \"system\",\n", - " \"content\": \"You are an helpful assistant.\"\n", - " },\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"Hi! Hello!\"\n", - " }\n", - " ],\n", - " \"extra\": {\n", - " \"temperature\": 1,\n", - " \"max_tokens\": 100\n", - " },\n", - " \"runtime\": \"litellm\",\n", - " \"metadata\": {}\n", - "}\n", - "\n", - "\n", - "[Lunary] Add event: {\n", - " \"event\": \"end\",\n", - " \"type\": \"llm\",\n", - " \"runId\": \"3a5b698d-cb55-4b3b-ab6d-04d2b99e40cb\",\n", - " \"timestamp\": \"2024-02-28T18:01:58.741244+00:00\",\n", - " \"output\": {\n", - " \"role\": \"assistant\",\n", - " \"content\": \"Hello! How can I assist you today?\"\n", - " },\n", - " \"runtime\": \"litellm\",\n", - " \"tokensUsage\": {\n", - " \"completion\": 9,\n", - " \"prompt\": 21\n", - " }\n", - "}\n", - "\n", - "\n" - ] - } - ], - "source": [ - "import lunary\n", - "from litellm import completion\n", - "\n", - "template = lunary.render_template(\"test-template\", {\"question\": \"Hello!\"})\n", - "\n", - "response = completion(**template)\n", - "\n", - "print(response)" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.2" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/logging_observability/LiteLLM_Proxy_Langfuse.ipynb b/cookbook/logging_observability/LiteLLM_Proxy_Langfuse.ipynb deleted file mode 100644 index 0baaab3f49f..00000000000 --- a/cookbook/logging_observability/LiteLLM_Proxy_Langfuse.ipynb +++ /dev/null @@ -1,252 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## LLM Ops Stack - LiteLLM Proxy + Langfuse \n", - "\n", - "This notebook demonstrates how to use LiteLLM Proxy with Langfuse \n", - "- Use LiteLLM Proxy for calling 100+ LLMs in OpenAI format\n", - "- Use Langfuse for viewing request / response traces \n", - "\n", - "\n", - "In this notebook we will setup LiteLLM Proxy to make requests to OpenAI, Anthropic, Bedrock and automatically log traces to Langfuse." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1. Setup LiteLLM Proxy\n", - "\n", - "### 1.1 Define .env variables \n", - "Define .env variables on the container that litellm proxy is running on.\n", - "```bash\n", - "## LLM API Keys\n", - "OPENAI_API_KEY=sk-proj-1234567890\n", - "ANTHROPIC_API_KEY=sk-ant-api03-1234567890\n", - "AWS_ACCESS_KEY_ID=1234567890\n", - "AWS_SECRET_ACCESS_KEY=1234567890\n", - "\n", - "## Langfuse Logging \n", - "LANGFUSE_PUBLIC_KEY=\"pk-lf-xxxx9\"\n", - "LANGFUSE_SECRET_KEY=\"sk-lf-xxxx9\"\n", - "LANGFUSE_HOST=\"https://us.cloud.langfuse.com\"\n", - "```\n", - "\n", - "\n", - "### 1.1 Setup LiteLLM Proxy Config yaml \n", - "```yaml\n", - "model_list:\n", - " - model_name: gpt-4o\n", - " litellm_params:\n", - " model: openai/gpt-4o\n", - " api_key: os.environ/OPENAI_API_KEY\n", - " - model_name: claude-3-5-sonnet-20241022\n", - " litellm_params:\n", - " model: anthropic/claude-3-5-sonnet-20241022\n", - " api_key: os.environ/ANTHROPIC_API_KEY\n", - " - model_name: us.amazon.nova-micro-v1:0\n", - " litellm_params:\n", - " model: bedrock/us.amazon.nova-micro-v1:0\n", - " aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID\n", - " aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY\n", - "\n", - "litellm_settings:\n", - " callbacks: [\"langfuse\"]\n", - "\n", - "\n", - "```" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2. Make LLM Requests to LiteLLM Proxy\n", - "\n", - "Now we will make our first LLM request to LiteLLM Proxy" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2.1 Setup Client Side Variables to point to LiteLLM Proxy\n", - "Set `LITELLM_PROXY_BASE_URL` to the base url of the LiteLLM Proxy and `LITELLM_VIRTUAL_KEY` to the virtual key you want to use for Authentication to LiteLLM Proxy. (Note: In this initial setup you can)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "LITELLM_PROXY_BASE_URL=\"http://0.0.0.0:4000\"\n", - "LITELLM_VIRTUAL_KEY=\"sk-oXXRa1xxxxxxxxxxx\"" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "ChatCompletion(id='chatcmpl-B0sq6QkOKNMJ0dwP3x7OoMqk1jZcI', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='Langfuse is a platform designed to monitor, observe, and troubleshoot AI and large language model (LLM) applications. It provides features that help developers gain insights into how their AI systems are performing, make debugging easier, and optimize the deployment of models. Langfuse allows for tracking of model interactions, collecting telemetry, and visualizing data, which is crucial for understanding the behavior of AI models in production environments. This kind of tool is particularly useful for developers working with language models who need to ensure reliability and efficiency in their applications.', refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=1739550502, model='gpt-4o-2024-08-06', object='chat.completion', service_tier='default', system_fingerprint='fp_523b9b6e5f', usage=CompletionUsage(completion_tokens=109, prompt_tokens=13, total_tokens=122, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)))" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import openai\n", - "client = openai.OpenAI(\n", - " api_key=LITELLM_VIRTUAL_KEY,\n", - " base_url=LITELLM_PROXY_BASE_URL\n", - ")\n", - "\n", - "response = client.chat.completions.create(\n", - " model=\"gpt-4o\",\n", - " messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what is Langfuse?\"\n", - " }\n", - " ],\n", - ")\n", - "\n", - "response" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2.3 View Traces on Langfuse\n", - "LiteLLM will send the request / response, model, tokens (input + output), cost to Langfuse.\n", - "\n", - "![image_description](litellm_proxy_langfuse.png)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 2.4 Call Anthropic, Bedrock models \n", - "\n", - "Now we can call `us.amazon.nova-micro-v1:0` and `claude-3-5-sonnet-20241022` models defined on your config.yaml both in the OpenAI request / response format." - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "ChatCompletion(id='chatcmpl-7756e509-e61f-4f5e-b5ae-b7a41013522a', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"Langfuse is an observability tool designed specifically for machine learning models and applications built with natural language processing (NLP) and large language models (LLMs). It focuses on providing detailed insights into how these models perform in real-world scenarios. Here are some key features and purposes of Langfuse:\\n\\n1. **Real-time Monitoring**: Langfuse allows developers to monitor the performance of their NLP and LLM applications in real time. This includes tracking the inputs and outputs of the models, as well as any errors or issues that arise during operation.\\n\\n2. **Error Tracking**: It helps in identifying and tracking errors in the models' outputs. By analyzing incorrect or unexpected responses, developers can pinpoint where and why errors occur, facilitating more effective debugging and improvement.\\n\\n3. **Performance Metrics**: Langfuse provides various performance metrics, such as latency, throughput, and error rates. These metrics help developers understand how well their models are performing under different conditions and workloads.\\n\\n4. **Traceability**: It offers detailed traceability of requests and responses, allowing developers to follow the path of a request through the system and see how it is processed by the model at each step.\\n\\n5. **User Feedback Integration**: Langfuse can integrate user feedback to provide context for model outputs. This helps in understanding how real users are interacting with the model and how its outputs align with user expectations.\\n\\n6. **Customizable Dashboards**: Users can create custom dashboards to visualize the data collected by Langfuse. These dashboards can be tailored to highlight the most important metrics and insights for a specific application or team.\\n\\n7. **Alerting and Notifications**: It can set up alerts for specific conditions or errors, notifying developers when something goes wrong or when performance metrics fall outside of acceptable ranges.\\n\\nBy providing comprehensive observability for NLP and LLM applications, Langfuse helps developers to build more reliable, accurate, and user-friendly models and services.\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=1739554005, model='us.amazon.nova-micro-v1:0', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=380, prompt_tokens=5, total_tokens=385, completion_tokens_details=None, prompt_tokens_details=None))" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import openai\n", - "client = openai.OpenAI(\n", - " api_key=LITELLM_VIRTUAL_KEY,\n", - " base_url=LITELLM_PROXY_BASE_URL\n", - ")\n", - "\n", - "response = client.chat.completions.create(\n", - " model=\"us.amazon.nova-micro-v1:0\",\n", - " messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what is Langfuse?\"\n", - " }\n", - " ],\n", - ")\n", - "\n", - "response" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3. Advanced - Set Langfuse Trace ID, Tags, Metadata \n", - "\n", - "Here is an example of how you can set Langfuse specific params on your client side request. See full list of supported langfuse params [here](https://docs.litellm.ai/docs/observability/langfuse_integration)\n", - "\n", - "You can view the logged trace of this request [here](https://us.cloud.langfuse.com/project/clvlhdfat0007vwb74m9lvfvi/traces/567890?timestamp=2025-02-14T17%3A30%3A26.709Z)" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "ChatCompletion(id='chatcmpl-789babd5-c064-4939-9093-46e4cd2e208a', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content=\"Langfuse is an observability platform designed specifically for monitoring and improving the performance of natural language processing (NLP) models and applications. It provides developers with tools to track, analyze, and optimize how their language models interact with users and handle natural language inputs.\\n\\nHere are some key features and benefits of Langfuse:\\n\\n1. **Real-Time Monitoring**: Langfuse allows developers to monitor their NLP applications in real time. This includes tracking user interactions, model responses, and overall performance metrics.\\n\\n2. **Error Tracking**: It helps in identifying and tracking errors in the model's responses. This can include incorrect, irrelevant, or unsafe outputs.\\n\\n3. **User Feedback Integration**: Langfuse enables the collection of user feedback directly within the platform. This feedback can be used to identify areas for improvement in the model's performance.\\n\\n4. **Performance Metrics**: The platform provides detailed metrics and analytics on model performance, including latency, throughput, and accuracy.\\n\\n5. **Alerts and Notifications**: Developers can set up alerts to notify them of any significant issues or anomalies in model performance.\\n\\n6. **Debugging Tools**: Langfuse offers tools to help developers debug and refine their models by providing insights into how the model processes different types of inputs.\\n\\n7. **Integration with Development Workflows**: It integrates seamlessly with various development environments and CI/CD pipelines, making it easier to incorporate observability into the development process.\\n\\n8. **Customizable Dashboards**: Users can create custom dashboards to visualize the data in a way that best suits their needs.\\n\\nLangfuse aims to help developers build more reliable, accurate, and user-friendly NLP applications by providing them with the tools to observe and improve how their models perform in real-world scenarios.\", refusal=None, role='assistant', audio=None, function_call=None, tool_calls=None))], created=1739554281, model='us.amazon.nova-micro-v1:0', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=346, prompt_tokens=5, total_tokens=351, completion_tokens_details=None, prompt_tokens_details=None))" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import openai\n", - "client = openai.OpenAI(\n", - " api_key=LITELLM_VIRTUAL_KEY,\n", - " base_url=LITELLM_PROXY_BASE_URL\n", - ")\n", - "\n", - "response = client.chat.completions.create(\n", - " model=\"us.amazon.nova-micro-v1:0\",\n", - " messages = [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what is Langfuse?\"\n", - " }\n", - " ],\n", - " extra_body={\n", - " \"metadata\": {\n", - " \"generation_id\": \"1234567890\",\n", - " \"trace_id\": \"567890\",\n", - " \"trace_user_id\": \"user_1234567890\",\n", - " \"tags\": [\"tag1\", \"tag2\"]\n", - " }\n", - " }\n", - ")\n", - "\n", - "response" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## " - ] - } - ], - "metadata": { - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/cookbook/logging_observability/litellm_proxy_langfuse.png b/cookbook/logging_observability/litellm_proxy_langfuse.png deleted file mode 100644 index 6b0691e6a5f..00000000000 Binary files a/cookbook/logging_observability/litellm_proxy_langfuse.png and /dev/null differ diff --git a/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md b/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md deleted file mode 100644 index 4a6fa9367fc..00000000000 --- a/cookbook/misc/RELEASE_NOTES_GENERATION_INSTRUCTIONS.md +++ /dev/null @@ -1,543 +0,0 @@ -# LiteLLM Release Notes Generation Instructions - -This document provides comprehensive instructions for AI agents to generate release notes for LiteLLM following the established format and style. - -## Required Inputs - -1. **Release Version** (e.g., `v1.77.3-stable`) -2. **PR Diff/Changelog** - List of PRs with titles and contributors -3. **Previous Version Commit Hash** - To compare model pricing changes -4. **Reference Release Notes** - Use recent stable releases (v1.76.3-stable, v1.77.2-stable) as templates for consistent formatting - -### Resolving Staging PRs - -The GitHub release page (e.g. `https://github.com/BerriAI/litellm/releases/tag/v1.83.3-stable`) does **not** list the real changelog directly. The "What's Changed" section contains **staging PRs** that each bundle many individual commits/PRs. For example: - -- `Litellm oss staging 03 14 2026 by @RheagalFire in #23686` -- `Litellm ryan march 16 by @ryan-crabbe in #23822` - -To get the real changelog, you MUST click into each staging PR (e.g. `#23686`, `#23822`), open its **Commits** tab, and extract every underlying commit/PR (look for the `(#NNNNN)` suffix on commit titles). Those underlying PRs — not the staging PRs — are what get categorized in the release notes. Never treat a staging PR title as a single changelog entry. - -**IMPORTANT — staging PRs are not the complete source.** Some PRs land on the release branch *before* the staging PRs and are therefore not reachable via `gh api /pulls//commits`. GitHub's auto-generated "What's Changed" on the release page also misses these. To catch every PR in the release, you MUST additionally walk the full git log range between the previous release's commit and this release's commit: - -```bash -git fetch origin --tags -git log .. --oneline | grep -oE '#[0-9]+' | sort -u -``` - -Union the PR set from the staging-PR walk with the PR set from `git log`. Any PR in `git log` but missing from your staging-expanded set is almost certainly a content PR that merged directly to the release branch — fetch its title/body with `gh pr view ` and categorize it. Do not trust the GH release body or the staging PRs alone as the authoritative list. - -**Sanity check for new contributors.** The GH release body's "New Contributors" list is a *floor*, not authoritative. For every PR author who appears in the release (including underlying PRs from staging and PRs found only via `git log`), verify whether they are a first-time contributor by running: - -```bash -gh api "search/issues?q=is:pr+author:+repo:BerriAI/litellm+is:merged&sort=created&order=asc" --jq '.items[0] | {n:.number, merged:.closed_at}' -``` - -If the author's earliest merged PR number matches a PR in this release window, they are a new contributor. If their earliest merged PR predates the previous release tag, they are not. Do not copy the GH release body's list blindly — it can both miss contributors (PRs that merged via an older dev branch) and falsely include contributors whose "first" PR in this window was not actually their first ever. - -## Step-by-Step Process - -### 1. Initial Setup and Analysis - -```bash -# Check git diff for model pricing changes -git diff HEAD -- model_prices_and_context_window.json -``` - -**Key Analysis Points:** -- New models added (look for new entries) -- Deprecated models removed (look for deleted entries) -- Pricing updates (look for cost changes) -- Feature support changes (tool calling, reasoning, etc.) - -### 2. Release Notes Structure - -Follow this exact structure based on recent stable releases (v1.76.3-stable, v1.77.2-stable, v1.77.5-stable): - -```markdown ---- -title: "v1.77.X-stable - [Key Theme]" -slug: "v1-77-X" -date: YYYY-MM-DDTHH:mm:ss -authors: [standard author block] -hide_table_of_contents: false ---- - -## Deploy this version -[Docker and pip installation tabs] - -## Key Highlights -[3-5 bullet points of major features - prioritize MCP OAuth 2.0, scheduled key rotations, and major model updates] - -## New Providers and Endpoints - -### New Providers -[Table with Provider, Supported Endpoints, Description columns] - -### New LLM API Endpoints -[Optional table for new endpoint additions with Endpoint, Method, Description, Documentation columns] - -## New Models / Updated Models -#### New Model Support -[Model pricing table] - -#### Features -[Provider-specific features organized by provider] - -### Bug Fixes -[Provider-specific bug fixes organized by provider] - -## LLM API Endpoints -#### Features -[API-specific features organized by API type] - -#### Bugs -[General bug fixes] - -## Management Endpoints / UI -#### Features -[UI and management features - group by functionality like Proxy CLI Auth, Virtual Keys, Models + Endpoints] - -#### Bugs -[Management-related bug fixes] - -## AI Integrations - -### Logging -[Logging integrations organized by provider with proper doc links, includes General subsection] - -### Guardrails -[Guardrail-specific features and fixes] - -### Prompt Management -[Prompt management integrations like BitBucket] - -### Secret Managers -[Secret manager integrations - AWS, HashiCorp Vault, CyberArk, etc.] - -## Spend Tracking, Budgets and Rate Limiting -[Cost tracking, service tier pricing, rate limiting improvements] - -## MCP Gateway -[MCP-specific features, OAuth 2.0, configuration improvements] - -## Performance / Loadbalancing / Reliability improvements -[Infrastructure improvements, memory fixes, performance optimizations] - -## Documentation Updates -[Documentation improvements, guides, corrections - separate section for visibility] - -## New Contributors -[List of first-time contributors] - -## Full Changelog -[Link to GitHub comparison] -``` - -### 3. Categorization Rules - -**Performance Improvements:** -- RPS improvements -- Memory optimizations -- CPU usage optimizations -- Timeout controls -- Worker configuration -- Memory leak fixes -- Cache performance improvements -- Database connection management -- Dependency management (fastuuid, etc.) -- Configuration management - -**New Models/Updated Models:** -- Extract from model_prices_and_context_window.json diff -- Create tables with: Provider, Model, Context Window, Input Cost, Output Cost, Features -- **Structure:** - - `#### New Model Support` - pricing table - - `#### Features` - organized by provider with documentation links - - `### Bug Fixes` - provider-specific bug fixes - - `#### New Provider Support` - major new provider integrations -- Group by provider with proper doc links: `**[Provider Name](../../docs/providers/[provider])**` -- Use bullet points under each provider for multiple features -- Separate features from bug fixes clearly - -**LLM API Endpoints:** -- **Structure:** - - `#### Features` - organized by API type (Responses API, Batch API, etc.) - - `#### Bugs` - general bug fixes under **General** category -- **API Categories:** - - Responses API - - Batch API - - CountTokens API - - Images API - - Video Generation (if applicable) - - General (miscellaneous improvements) -- Use proper documentation links for each API type - -**UI/Management:** -- Authentication changes -- Dashboard improvements -- Team management -- Key management -- Proxy CLI authentication and improvements -- Virtual key management and scheduled rotations -- SSO configuration fixes -- Admin settings updates -- Management routes and endpoints - -**AI Integrations:** -- **Structure:** - - `### Logging` - organized by integration provider with proper doc links, includes **General** subsection - - `### Guardrails` - guardrail-specific features and fixes - - `### Prompt Management` - prompt management integrations - - `### Secret Managers` - secret manager integrations -- **Logging Categories:** - - **[DataDog](../../docs/proxy/logging#datadog)** - group all DataDog-related changes - - **[Langfuse](../../docs/proxy/logging#langfuse)** - Langfuse-specific features - - **[Prometheus](../../docs/proxy/logging#prometheus)** - monitoring improvements - - **[PostHog](../../docs/observability/posthog)** - observability integration - - **[SQS](../../docs/proxy/logging#sqs)** - SQS logging features - - **[Opik](../../docs/proxy/logging#opik)** - Opik integration improvements - - **[Arize Phoenix](../../docs/observability/arize_phoenix)** - Arize Phoenix integration - - **General** - miscellaneous logging features like callback controls, sensitive data masking - - Other logging providers with proper doc links -- **Guardrail Categories:** - - LakeraAI, Presidio, Noma, Grayswan, IBM Guardrails, and other guardrail providers -- **Prompt Management:** - - BitBucket, GitHub, and other prompt management integrations - - Prompt versioning, testing, and UI features -- **Secret Managers:** - - **[AWS Secrets Manager](../../docs/secret_managers)** - AWS secret manager features - - **[HashiCorp Vault](../../docs/secret_managers)** - Vault integrations - - **[CyberArk](../../docs/secret_managers)** - CyberArk integrations - - **General** - cross-secret-manager features -- Use bullet points under each provider for multiple features -- Separate logging, guardrails, prompt management, and secret managers clearly - -### 4. Documentation Linking Strategy - -**Link to docs when:** -- New provider support added -- Significant feature additions -- API endpoint changes -- Integration additions - -**Link format:** `../../docs/[category]/[specific_doc]` - -**Common doc paths:** -- `../../docs/providers/[provider]` - Provider-specific docs -- `../../docs/image_generation` - Image generation -- `../../docs/video_generation` - Video generation (if exists) -- `../../docs/response_api` - Responses API -- `../../docs/proxy/logging` - Logging integrations -- `../../docs/proxy/guardrails` - Guardrails -- `../../docs/pass_through/[provider]` - Passthrough endpoints - -### 5. Model Table Generation - -From git diff analysis, create tables like: - -```markdown -| Provider | Model | Context Window | Input ($/1M tokens) | Output ($/1M tokens) | Features | -| -------- | ----- | -------------- | ------------------- | -------------------- | -------- | -| OpenRouter | `openrouter/openai/gpt-4.1` | 1M | $2.00 | $8.00 | Chat completions with vision | -``` - -**Extract from JSON:** -- `max_input_tokens` → Context Window -- `input_cost_per_token` × 1,000,000 → Input cost -- `output_cost_per_token` × 1,000,000 → Output cost -- `supports_*` fields → Features -- Special pricing fields (per image, per second) for generation models - -### 6. PR Categorization Logic - -**By Keywords in PR Title:** -- `[Perf]`, `Performance`, `RPS` → Performance Improvements -- `[Bug]`, `[Bug Fix]`, `Fix` → Bug Fixes section -- `[Feat]`, `[Feature]`, `Add support` → Features section -- `[Docs]` → Documentation Updates section -- Provider names (Gemini, OpenAI, etc.) → Group under provider -- `MCP`, `oauth`, `Model Context Protocol` → MCP Gateway -- `service_tier`, `priority`, `cost tracking` → Spend Tracking, Budgets and Rate Limiting - -**By PR Content Analysis:** -- New model additions → New Models section -- UI changes → Management Endpoints/UI -- Logging/observability → Logging/Guardrail/Prompt Management Integrations -- Rate limiting/budgets → Spend Tracking, Budgets and Rate Limiting -- Authentication → Management Endpoints/UI -- MCP-related changes → MCP Gateway -- Documentation updates → Documentation Updates -- Performance/memory fixes → Performance/Loadbalancing/Reliability improvements - -**Special Categorization Rules:** -- **Service tier pricing** (OpenAI priority/flex) → Spend Tracking section (NOT provider features) -- **Cost breakdown in logging** → Spend Tracking section -- **MCP configuration/OAuth** → MCP Gateway (NOT General Proxy Improvements) -- **All documentation PRs** → Documentation Updates section for visibility -- **Callback controls/logging features** → AI Integrations > Logging > General -- **Secret manager features** → AI Integrations > Secret Managers -- **Video generation tag-based routing** → LLM API Endpoints > Video Generation API - -### 7. Writing Style Guidelines - -**Tone:** -- Professional but accessible -- Focus on user impact -- Highlight breaking changes clearly -- Use active voice - -**Formatting:** -- Use consistent markdown formatting -- Include PR links: `[PR #XXXXX](https://github.com/BerriAI/litellm/pull/XXXXX)` -- Use code blocks for configuration examples -- Bold important terms and section headers - -**Warnings/Notes:** -- Add warning boxes for breaking changes -- Include migration instructions when needed -- Provide override options for default changes - -### 8. Quality Checks - -**Before finalizing:** -- Verify all PR links work -- Check documentation links are valid -- Ensure model pricing is accurate -- Confirm provider names are consistent -- Review for typos and formatting issues -- **Count PRs by section** - Provide final count like: - ``` - ## MM/DD/YYYY - * New Models / Updated Models: XX - * LLM API Endpoints: XX - * Management Endpoints / UI: XX - * Logging / Guardrail / Prompt Management Integrations: XX - * Spend Tracking, Budgets and Rate Limiting: XX - * MCP Gateway: XX - * Performance / Loadbalancing / Reliability improvements: XX - * Documentation Updates: XX - ``` - -### 9. Common Patterns to Follow - -**Performance Changes:** -```markdown -- **+400 RPS Performance Boost** - Description - [PR #XXXXX](link) -``` - -**New Models:** -Always include pricing table and feature highlights - -**Breaking Changes:** -```markdown -:::warning -This release has a known issue... -::: -``` - -**Provider Features (New Models / Updated Models section):** -```markdown -#### Features - -- **[Provider Name](../../docs/providers/provider)** - - Feature description - [PR #XXXXX](link) - - Another feature description - [PR #YYYYY](link) -``` - -**API Features (LLM API Endpoints section):** -```markdown -#### Features - -- **[API Name](../../docs/api_path)** - - Feature description - [PR #XXXXX](link) - - Another feature - [PR #YYYYY](link) -- **General** - - Miscellaneous improvements - [PR #ZZZZZ](link) -``` - -**Integration Features (Logging / Guardrail Integrations section):** -```markdown -#### Features - -- **[Integration Name](../../docs/proxy/logging#integration)** - - Feature description - [PR #XXXXX](link) - - Bug fix description - [PR #YYYYY](link) -``` - -**Bug Fixes Pattern:** -```markdown -### Bug Fixes - -- **[Provider/Component Name](../../docs/providers/provider)** - - Bug fix description - [PR #XXXXX](link) -``` - -### 10. Missing Documentation Check - -**Review for missing docs:** -- New providers without documentation -- New API endpoints without examples -- Complex features without guides -- Integration setup instructions - -**Flag for documentation needs:** -- New provider integrations -- Significant API changes -- Complex configuration options -- Migration requirements - -### 11. New Sections and Categories (Added in v1.77.5) - -**MCP Gateway Section:** -- All MCP-related changes go here (not in General Proxy Improvements) -- OAuth 2.0 flow improvements -- MCP configuration and tools -- Server management features - -**Spend Tracking, Budgets and Rate Limiting Section:** -- Service tier pricing (OpenAI priority/flex pricing) -- Cost tracking and breakdown features -- Rate limiting improvements (Parallel Request Limiter v3) -- Priority reservation fixes -- Metadata handling for rate limiting - -**Documentation Updates Section:** -- Create separate section for all documentation improvements -- Include provider documentation fixes -- Model reference updates -- New guides and tutorials -- Documentation corrections and clarifications -- This gives documentation changes proper visibility - -**Management Endpoints / UI Grouping:** -- Group related features under sub-categories: - - **Proxy CLI Auth** - CLI authentication improvements - - **Virtual Keys** - Key rotation and management - - **Models + Endpoints** - Provider and endpoint management - -**AI Integrations Section Expansion:** -- Renamed from "Logging / Guardrail / Prompt Management Integrations" to "AI Integrations" -- Structure with four main subsections: - - **Logging** - with **General** subsection for miscellaneous logging features - - **Guardrails** - separate from logging features - - **Prompt Management** - BitBucket, GitHub integrations, versioning features - - **Secret Managers** - AWS, HashiCorp Vault, CyberArk, etc. - -**New Providers and Endpoints Section:** -- Add section after Key Highlights and before New Models / Updated Models -- Include tables for: - - **New Providers** - Provider name, supported endpoints, description - - **New LLM API Endpoints** (optional) - Endpoint, method, description, documentation link -- Only include major new provider integrations, not minor provider updates -- **IMPORTANT**: When adding new providers, also update `provider_endpoints_support.json` in the repository root (see Section 13) - -### 12. Section Header Counts - -**Always include counts in section headers for:** -- **New Providers** - Add count in parentheses: `### New Providers (X new providers)` -- **New LLM API Endpoints** - Add count in parentheses: `### New LLM API Endpoints (X new endpoints)` -- **New Model Support** - Add count in parentheses: `#### New Model Support (X new models)` - -**Format:** -```markdown -### New Providers (4 new providers) - -| Provider | Supported LiteLLM Endpoints | Description | -| -------- | --------------------------- | ----------- | -... - -### New LLM API Endpoints (2 new endpoints) - -| Endpoint | Method | Description | Documentation | -| -------- | ------ | ----------- | ------------- | -... - -#### New Model Support (32 new models) - -| Provider | Model | Context Window | Input ($/1M tokens) | Output ($/1M tokens) | Features | -| -------- | ----- | -------------- | ------------------- | -------------------- | -------- | -... -``` - -**Counting Rules:** -- Count each row in the table (excluding the header row) -- For models, count each model entry in the pricing table -- For providers, count each new provider added -- For endpoints, count each new API endpoint added - -### 13. Update provider_endpoints_support.json - -**When adding new providers or endpoints, you MUST also update `provider_endpoints_support.json` in the repository root.** - -This file tracks which endpoints are supported by each LiteLLM provider and is used to generate documentation. - -**Required Steps:** -1. For each new provider added to the release notes, add a corresponding entry to `provider_endpoints_support.json` -2. For each new endpoint type added, update the schema comment and add the endpoint to relevant providers - -**Provider Entry Format:** -```json -"provider_slug": { - "display_name": "Provider Name (`provider_slug`)", - "url": "https://docs.litellm.ai/docs/providers/provider_slug", - "endpoints": { - "chat_completions": true, - "messages": true, - "responses": true, - "embeddings": false, - "image_generations": false, - "audio_transcriptions": false, - "audio_speech": false, - "moderations": false, - "batches": false, - "rerank": false, - "a2a": true - } -} -``` - -**Available Endpoint Types:** -- `chat_completions` - `/chat/completions` endpoint -- `messages` - `/messages` endpoint (Anthropic format) -- `responses` - `/responses` endpoint (OpenAI/Anthropic unified) -- `embeddings` - `/embeddings` endpoint -- `image_generations` - `/image/generations` endpoint -- `audio_transcriptions` - `/audio/transcriptions` endpoint -- `audio_speech` - `/audio/speech` endpoint -- `moderations` - `/moderations` endpoint -- `batches` - `/batches` endpoint -- `rerank` - `/rerank` endpoint -- `ocr` - `/ocr` endpoint -- `search` - `/search` endpoint -- `vector_stores` - `/vector_stores` endpoint -- `a2a` - `/a2a/{agent}/message/send` endpoint (A2A Protocol) - -**Checklist:** -- [ ] All new providers from release notes are added to `provider_endpoints_support.json` -- [ ] Endpoint support flags accurately reflect provider capabilities -- [ ] Documentation URL points to correct provider docs page - -## Example Command Workflow - -```bash -# 1. Get model changes -git diff HEAD -- model_prices_and_context_window.json - -# 2. Analyze PR list for categorization -# 3. Create release notes following template -# 4. Link to appropriate documentation -# 5. Review for missing documentation needs -``` - -## Output Requirements - -- Follow exact markdown structure from reference -- Include all PR links and contributors -- Provide accurate model pricing tables -- Link to relevant documentation -- Highlight breaking changes with warnings -- Include deployment instructions -- End with full changelog link - -This process ensures consistent, comprehensive release notes that help users understand changes and upgrade smoothly. diff --git a/cookbook/misc/add_new_models.py b/cookbook/misc/add_new_models.py deleted file mode 100644 index 3cd0bfb2fcc..00000000000 --- a/cookbook/misc/add_new_models.py +++ /dev/null @@ -1,71 +0,0 @@ -import requests - - -def get_initial_config(): - proxy_base_url = input("Enter your proxy base URL (e.g., http://localhost:4000): ") - master_key = input("Enter your LITELLM_MASTER_KEY ") - return proxy_base_url, master_key - - -def get_user_input(): - model_name = input( - "Enter model_name (this is the 'model' passed in /chat/completions requests):" - ) - model = input("litellm_params: Enter model eg. 'azure/': ") - tpm = int(input("litellm_params: Enter tpm (tokens per minute): ")) - rpm = int(input("litellm_params: Enter rpm (requests per minute): ")) - api_key = input("litellm_params: Enter api_key: ") - api_base = input("litellm_params: Enter api_base: ") - api_version = input("litellm_params: Enter api_version: ") - timeout = int(input("litellm_params: Enter timeout (0 for default): ")) - stream_timeout = int( - input("litellm_params: Enter stream_timeout (0 for default): ") - ) - max_retries = int(input("litellm_params: Enter max_retries (0 for default): ")) - - return { - "model_name": model_name, - "litellm_params": { - "model": model, - "tpm": tpm, - "rpm": rpm, - "api_key": api_key, - "api_base": api_base, - "api_version": api_version, - "timeout": timeout, - "stream_timeout": stream_timeout, - "max_retries": max_retries, - }, - } - - -def make_request(proxy_base_url, master_key, data): - url = f"{proxy_base_url}/model/new" - headers = { - "Content-Type": "application/json", - "Authorization": f"Bearer {master_key}", - } - - response = requests.post(url, headers=headers, json=data) - - print(f"Status Code: {response.status_code}") - print(f"Response from adding model: {response.text}") - - -def main(): - proxy_base_url, master_key = get_initial_config() - - while True: - print("Adding new Model to your proxy server...") - data = get_user_input() - make_request(proxy_base_url, master_key, data) - - add_another = input("Do you want to add another model? (yes/no): ").lower() - if add_another != "yes": - break - - print("Script finished.") - - -if __name__ == "__main__": - main() diff --git a/cookbook/misc/config.yaml b/cookbook/misc/config.yaml deleted file mode 100644 index 8ad1d764af5..00000000000 --- a/cookbook/misc/config.yaml +++ /dev/null @@ -1,72 +0,0 @@ -model_list: - - model_name: gpt-3.5-turbo - litellm_params: - model: azure/chatgpt-v-2 - api_base: https://openai-gpt-4-test-v-1.openai.azure.com/ - api_version: "2023-05-15" - api_key: os.environ/AZURE_API_KEY # The `os.environ/` prefix tells litellm to read this from the env. See https://docs.litellm.ai/docs/simple_proxy#load-api-keys-from-vault - - model_name: gpt-3.5-turbo-large - litellm_params: - model: "gpt-3.5-turbo-1106" - api_key: os.environ/OPENAI_API_KEY - rpm: 480 - timeout: 300 - stream_timeout: 60 - - model_name: gpt-4 - litellm_params: - model: azure/chatgpt-v-2 - api_base: https://openai-gpt-4-test-v-1.openai.azure.com/ - api_version: "2023-05-15" - api_key: os.environ/AZURE_API_KEY # The `os.environ/` prefix tells litellm to read this from the env. See https://docs.litellm.ai/docs/simple_proxy#load-api-keys-from-vault - rpm: 480 - timeout: 300 - stream_timeout: 60 - - model_name: sagemaker-completion-model - litellm_params: - model: sagemaker/berri-benchmarking-Llama-2-70b-chat-hf-4 - cost_per_second: 0.000420 - - model_name: text-embedding-ada-002 - litellm_params: - model: azure/azure-embedding-model - api_key: os.environ/AZURE_API_KEY - api_base: https://openai-gpt-4-test-v-1.openai.azure.com/ - api_version: "2023-05-15" - model_info: - mode: embedding - base_model: text-embedding-ada-002 - - model_name: dall-e-2 - litellm_params: - model: azure/ - api_version: 2023-06-01-preview - api_base: https://openai-gpt-4-test-v-1.openai.azure.com/ - api_key: os.environ/AZURE_API_KEY - - model_name: openai-dall-e-3 - litellm_params: - model: dall-e-3 - - model_name: fake-openai-endpoint - litellm_params: - model: openai/fake - api_key: fake-key - api_base: https://exampleopenaiendpoint-production.up.railway.app/ - -litellm_settings: - drop_params: True - # max_budget: 100 - # budget_duration: 30d - num_retries: 5 - request_timeout: 600 - context_window_fallbacks: [{"gpt-3.5-turbo": ["gpt-3.5-turbo-large"]}] - -general_settings: - master_key: os.environ/LITELLM_MASTER_KEY - store_model_in_db: True - proxy_budget_rescheduler_min_time: 60 - proxy_budget_rescheduler_max_time: 64 - proxy_batch_write_at: 1 - # database_url: "postgresql://:@:/" # [OPTIONAL] use for token-based auth to proxy - -# environment_variables: - # settings for using redis caching - # REDIS_HOST: redis-16337.c322.us-east-1-2.ec2.cloud.redislabs.com - # REDIS_PORT: "16337" - # REDIS_PASSWORD: diff --git a/cookbook/misc/dev_release.txt b/cookbook/misc/dev_release.txt deleted file mode 100644 index bd40f89e6f2..00000000000 --- a/cookbook/misc/dev_release.txt +++ /dev/null @@ -1,11 +0,0 @@ -python3 -m build -twine upload --verbose dist/litellm-1.18.13.dev4.tar.gz -u __token__ - - - -Note: You might need to make a MANIFEST.ini file on root for build process incase it fails - -Place this in MANIFEST.ini -recursive-exclude venv * -recursive-exclude myenv * -recursive-exclude py313_env * -recursive-exclude **/.venv * diff --git a/cookbook/misc/migrate_proxy_config.py b/cookbook/misc/migrate_proxy_config.py deleted file mode 100644 index b15f9663c64..00000000000 --- a/cookbook/misc/migrate_proxy_config.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -LiteLLM Migration Script! - -Takes a config.yaml and calls /model/new - -Inputs: - - File path to config.yaml - - Proxy base url to your hosted proxy - -Step 1: Reads your config.yaml -Step 2: reads `model_list` and loops through all models -Step 3: calls `/model/new` for each model -""" - -import os - -import yaml -import requests - -_in_memory_os_variables = {} - - -def migrate_models(config_file, proxy_base_url): - # Step 1: Read the config.yaml file - with open(config_file, "r") as f: - config = yaml.safe_load(f) - - # Step 2: Read the model_list and loop through all models - model_list = config.get("model_list", []) - print("model_list: ", model_list) - for model in model_list: - - model_name = model.get("model_name") - print("\nAdding model: ", model_name) - litellm_params = model.get("litellm_params", {}) - api_base = litellm_params.get("api_base", "") - print("api_base on config.yaml: ", api_base) - - litellm_model_name = litellm_params.get("model", "") or "" - if "vertex_ai/" in litellm_model_name: - print("\033[91m\nSkipping Vertex AI model\033[0m", model) - continue - - for param, value in litellm_params.items(): - if isinstance(value, str) and value.startswith("os.environ/"): - # check if value is in _in_memory_os_variables - if value in _in_memory_os_variables: - new_value = _in_memory_os_variables[value] - print( - "\033[92mAlready entered value for \033[0m", - value, - "\033[92musing \033[0m", - new_value, - ) - else: - new_value = input(f"Enter value for {value}: ") - _in_memory_os_variables[value] = new_value - litellm_params[param] = new_value - if "api_key" not in litellm_params: - new_value = input(f"Enter api key for {model_name}: ") - litellm_params["api_key"] = new_value - - print("\nlitellm_params: ", litellm_params) - # Confirm before sending POST request - confirm = input( - "\033[92mDo you want to send the POST request with the above parameters? (y/n): \033[0m" - ) - if confirm.lower() != "y": - print("Aborting POST request.") - exit() - - # Step 3: Call /model/new for each model - url = f"{proxy_base_url}/model/new" - headers = { - "Content-Type": "application/json", - "Authorization": f"Bearer {master_key}", - } - data = {"model_name": model_name, "litellm_params": litellm_params} - print("POSTING data to proxy url", url) - response = requests.post(url, headers=headers, json=data) - if response.status_code != 200: - print(f"Error: {response.status_code} - {response.text}") - raise Exception(f"Error: {response.status_code} - {response.text}") - - # Print the response for each model - print( - f"Response for model '{model_name}': Status Code:{response.status_code} - {response.text}" - ) - - -# Usage -config_file = "config.yaml" -proxy_base_url = "http://0.0.0.0:4000" -master_key = os.environ["LITELLM_MASTER_KEY"] -print(f"config_file: {config_file}") -print(f"proxy_base_url: {proxy_base_url}") -migrate_models(config_file, proxy_base_url) diff --git a/cookbook/misc/openai_timeouts.py b/cookbook/misc/openai_timeouts.py deleted file mode 100644 index fe3e6d426d2..00000000000 --- a/cookbook/misc/openai_timeouts.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -from openai import OpenAI -from dotenv import load_dotenv -import concurrent.futures - -load_dotenv() - -client = OpenAI( - # This is the default and can be omitted - api_key=os.environ.get("OPENAI_API_KEY"), -) - - -def create_chat_completion(): - return client.chat.completions.create( - messages=[ - { - "role": "user", - "content": "Say this is a test. Respond in 20 lines", - } - ], - model="gpt-3.5-turbo", - ) - - -with concurrent.futures.ThreadPoolExecutor() as executor: - # Set a timeout of 10 seconds - future = executor.submit(create_chat_completion) - try: - chat_completion = future.result(timeout=0.00001) - print(chat_completion) - except concurrent.futures.TimeoutError: - print("Operation timed out.") diff --git a/cookbook/misc/sagmaker_streaming.py b/cookbook/misc/sagmaker_streaming.py deleted file mode 100644 index 1a6cc2e32ce..00000000000 --- a/cookbook/misc/sagmaker_streaming.py +++ /dev/null @@ -1,55 +0,0 @@ -# Notes - on how to do sagemaker streaming using boto3 -import json -import boto3 - -import sys -import os -from dotenv import load_dotenv - -load_dotenv() -import io - -sys.path.insert( - 0, os.path.abspath("../..") -) # Adds the parent directory to the system path - - -class TokenIterator: - def __init__(self, stream): - self.byte_iterator = iter(stream) - self.buffer = io.BytesIO() - self.read_pos = 0 - - def __iter__(self): - return self - - def __next__(self): - while True: - self.buffer.seek(self.read_pos) - line = self.buffer.readline() - if line and line[-1] == ord("\n"): - self.read_pos += len(line) + 1 - full_line = line[:-1].decode("utf-8") - line_data = json.loads(full_line.lstrip("data:").rstrip("/n")) - return line_data["token"]["text"] - chunk = next(self.byte_iterator) - self.buffer.seek(0, io.SEEK_END) - self.buffer.write(chunk["PayloadPart"]["Bytes"]) - - -payload = { - "inputs": "How do I build a website?", - "parameters": {"max_new_tokens": 256}, - "stream": True, -} - - -client = boto3.client("sagemaker-runtime", region_name="us-west-2") -response = client.invoke_endpoint_with_response_stream( - EndpointName="berri-benchmarking-Llama-2-70b-chat-hf-4", - Body=json.dumps(payload), - ContentType="application/json", -) - -# for token in TokenIterator(response["Body"]): -# print(token) diff --git a/cookbook/misc/test_responses_api.py b/cookbook/misc/test_responses_api.py deleted file mode 100644 index 7abf3170fbc..00000000000 --- a/cookbook/misc/test_responses_api.py +++ /dev/null @@ -1,51 +0,0 @@ -import base64 -import os - -from openai import OpenAI -import time - -client = OpenAI(base_url="http://0.0.0.0:4001", api_key=os.environ["LITELLM_MASTER_KEY"]) - - -# Function to encode the image -def encode_image(image_path): - with open(image_path, "rb") as image_file: - return base64.b64encode(image_file.read()).decode("utf-8") - - -# Path to your image -image_path = "litellm/proxy/logo.png" - -# Getting the Base64 string -base64_image = encode_image(image_path) - - -response = client.responses.create( - model="bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", - input=[ - { - "role": "user", - "content": [ - {"type": "input_text", "text": "what color is the image"}, - { - "type": "input_image", - "image_url": f"data:image/png;base64,{base64_image}", - }, - ], - } - ], -) - - -print(response.output_text) -print("response1 id===", response.id) -print("sleeping for 20 seconds...") -time.sleep(20) -print("making follow up request for existing id") -response2 = client.responses.create( - model="bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", - previous_response_id=response.id, - input="ok, and what objects are in the image?", -) - -print(response2.output_text) diff --git a/cookbook/misc/update_json_caching.py b/cookbook/misc/update_json_caching.py deleted file mode 100644 index 8202d7033fd..00000000000 --- a/cookbook/misc/update_json_caching.py +++ /dev/null @@ -1,54 +0,0 @@ -import json - -# List of models to update -models_to_update = [ - "gpt-4o-mini", - "gpt-4o-mini-2024-07-18", - "gpt-4o", - "gpt-4o-2024-11-20", - "gpt-4o-2024-08-06", - "gpt-4o-2024-05-13", - "text-embedding-3-small", - "text-embedding-3-large", - "text-embedding-ada-002-v2", - "ft:gpt-4o-2024-08-06", - "ft:gpt-4o-mini-2024-07-18", - "ft:gpt-3.5-turbo", - "ft:davinci-002", - "ft:babbage-002", -] - - -def update_model_prices(file_path): - # Read the JSON file as text first to preserve number formatting - with open(file_path, "r") as file: - original_text = file.read() - data = json.loads(original_text) - - # Update specified models - for model_name in models_to_update: - print("finding model", model_name) - if model_name in data: - print("found model") - model = data[model_name] - if "input_cost_per_token" in model: - # Format new values to match original style - model["input_cost_per_token_batches"] = float( - "{:.12f}".format(model["input_cost_per_token"] / 2) - ) - if "output_cost_per_token" in model: - model["output_cost_per_token_batches"] = float( - "{:.12f}".format(model["output_cost_per_token"] / 2) - ) - print("new pricing for model=") - # Convert all float values to full decimal format before printing - formatted_model = { - k: "{:.9f}".format(v) if isinstance(v, float) else v - for k, v in data[model_name].items() - } - print(json.dumps(formatted_model, indent=4)) - - -# Run the update -file_path = "model_prices_and_context_window.json" -update_model_prices(file_path) diff --git a/cookbook/mlflow_langchain_tracing_litellm_proxy.ipynb b/cookbook/mlflow_langchain_tracing_litellm_proxy.ipynb deleted file mode 100644 index 818a25e4503..00000000000 --- a/cookbook/mlflow_langchain_tracing_litellm_proxy.ipynb +++ /dev/null @@ -1,315 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Databricks Notebook with MLFlow AutoLogging for LiteLLM Proxy calls\n", - "\n", - "Set `LITELLM_PROXY_API_KEY` in the notebook environment to a key accepted by the proxy before running the model cell\n" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "5e2812ed-8000-4793-b090-49a31464d810", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "%pip install -U -qqqq databricks-agents mlflow langchain==0.3.1 langchain-core==0.3.6 " - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "52530b37-1860-4bba-a6c1-723de83bc58f", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "%pip install \"langchain-openai<=0.3.1\"" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "43c6f4b1-e2d5-431c-b1a2-b97df7707d59", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "# Before logging this chain using the driver notebook, you must comment out this line.\n", - "dbutils.library.restartPython() " - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "88eb8dd7-16b1-480b-aa70-cd429ef87159", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "import mlflow\n", - "from operator import itemgetter\n", - "from langchain_core.output_parsers import StrOutputParser\n", - "from langchain_core.prompts import PromptTemplate\n", - "from langchain_core.runnables import RunnableLambda\n", - "from langchain_databricks import ChatDatabricks\n", - "from langchain_openai import ChatOpenAI" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "f0fdca8f-6f6f-407c-ad4a-0d5a2778728e", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "mlflow.langchain.autolog()" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "2ef67315-e468-4d60-a318-98c2cac75bc4", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "# These helper functions parse the `messages` array.\n", - "\n", - "# Return the string contents of the most recent message from the user\n", - "def extract_user_query_string(chat_messages_array):\n", - " return chat_messages_array[-1][\"content\"]\n", - "\n", - "\n", - "# Return the chat history, which is is everything before the last question\n", - "def extract_chat_history(chat_messages_array):\n", - " return chat_messages_array[:-1]" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "17708467-1976-48bd-94a0-8c7895cfae3b", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "model = ChatOpenAI(\n", - " openai_api_base=\"LITELLM_PROXY_BASE_URL\", # e.g.: http://0.0.0.0:4000\n", - " model = \"gpt-3.5-turbo\", # LITELLM 'model_name'\n", - " temperature=0.1, \n", - " api_key=os.environ[\"LITELLM_PROXY_API_KEY\"]\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "a5f2c2af-82f7-470d-b559-47b67fb00cda", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "############\n", - "# Prompt Template for generation\n", - "############\n", - "prompt = PromptTemplate(\n", - " template=\"You are a hello world bot. Respond with a reply to the user's question that is fun and interesting to the user. User's question: {question}\",\n", - " input_variables=[\"question\"],\n", - ")\n", - "\n", - "############\n", - "# FM for generation\n", - "# ChatDatabricks accepts any /llm/v1/chat model serving endpoint\n", - "############\n", - "model = ChatDatabricks(\n", - " endpoint=\"databricks-dbrx-instruct\",\n", - " extra_params={\"temperature\": 0.01, \"max_tokens\": 500},\n", - ")\n", - "\n", - "\n", - "############\n", - "# Simple chain\n", - "############\n", - "# The framework requires the chain to return a string value.\n", - "chain = (\n", - " {\n", - " \"question\": itemgetter(\"messages\")\n", - " | RunnableLambda(extract_user_query_string),\n", - " \"chat_history\": itemgetter(\"messages\") | RunnableLambda(extract_chat_history),\n", - " }\n", - " | prompt\n", - " | model\n", - " | StrOutputParser()\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "366edd90-62a1-4d6f-8a65-0211fb24ca02", - "showTitle": false, - "title": "" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "'Hello there! I\\'m here to help with your questions. Regarding your query about \"rag,\" it\\'s not something typically associated with a \"hello world\" bot, but I\\'m happy to explain!\\n\\nRAG, or Remote Angular GUI, is a tool that allows you to create and manage Angular applications remotely. It\\'s a way to develop and test Angular components and applications without needing to set up a local development environment. This can be particularly useful for teams working on distributed systems or for developers who prefer to work in a cloud-based environment.\\n\\nI hope this explanation of RAG has been helpful and interesting! If you have any other questions or need further clarification, feel free to ask.'" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "application/databricks.mlflow.trace": "\"tr-ea2226413395413ba2cf52cffc523502\"", - "text/plain": [ - "Trace(request_id=tr-ea2226413395413ba2cf52cffc523502)" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "# This is the same input your chain's REST API will accept.\n", - "question = {\n", - " \"messages\": [\n", - " {\n", - " \"role\": \"user\",\n", - " \"content\": \"what is rag?\",\n", - " },\n", - " ]\n", - "}\n", - "\n", - "chain.invoke(question)" - ] - }, - { - "cell_type": "code", - "execution_count": 0, - "metadata": { - "application/vnd.databricks.v1+cell": { - "cellMetadata": { - "byteLimit": 2048000, - "rowLimit": 10000 - }, - "inputWidgets": {}, - "nuid": "5d68e37d-0980-4a02-bf8d-885c3853f6c1", - "showTitle": false, - "title": "" - } - }, - "outputs": [], - "source": [ - "mlflow.models.set_model(model=model)" - ] - } - ], - "metadata": { - "application/vnd.databricks.v1+notebook": { - "dashboards": [], - "environmentMetadata": null, - "language": "python", - "notebookMetadata": { - "pythonIndentUnit": 4 - }, - "notebookName": "Untitled Notebook 2024-10-16 19:35:16", - "widgets": {} - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/cookbook/mock_guardrail_server/mock_bedrock_guardrail_server.py b/cookbook/mock_guardrail_server/mock_bedrock_guardrail_server.py deleted file mode 100644 index 7bf9cc32484..00000000000 --- a/cookbook/mock_guardrail_server/mock_bedrock_guardrail_server.py +++ /dev/null @@ -1,540 +0,0 @@ -#!/usr/bin/env python3 -""" -Mock Bedrock Guardrail API Server - -This is a FastAPI server that mimics the AWS Bedrock Guardrail API for testing purposes. -It follows the same API spec as the real Bedrock guardrail endpoint. - -Usage: - python mock_bedrock_guardrail_server.py - -The server will start on http://localhost:8080 -""" - -import os -import re -from typing import Any, Dict, List, Literal, Optional - -from fastapi import Depends, FastAPI, Header, HTTPException, status -from fastapi.responses import JSONResponse -from pydantic import BaseModel, Field - -# ============================================================================ -# Request/Response Models (matching Bedrock API spec) -# ============================================================================ - - -class BedrockTextContent(BaseModel): - text: str - - -class BedrockContentItem(BaseModel): - text: BedrockTextContent - - -class BedrockRequest(BaseModel): - source: Literal["INPUT", "OUTPUT"] - content: List[BedrockContentItem] = Field(default_factory=list) - - -class BedrockGuardrailOutput(BaseModel): - text: Optional[str] = None - - -class TopicPolicyItem(BaseModel): - name: str - type: str - action: Literal["BLOCKED", "NONE"] - - -class TopicPolicy(BaseModel): - topics: List[TopicPolicyItem] = Field(default_factory=list) - - -class ContentFilterItem(BaseModel): - type: str - confidence: str - action: Literal["BLOCKED", "NONE"] - - -class ContentPolicy(BaseModel): - filters: List[ContentFilterItem] = Field(default_factory=list) - - -class CustomWord(BaseModel): - match: str - action: Literal["BLOCKED", "NONE"] - - -class WordPolicy(BaseModel): - customWords: List[CustomWord] = Field(default_factory=list) - managedWordLists: List[Dict[str, Any]] = Field(default_factory=list) - - -class PiiEntity(BaseModel): - type: str - match: str - action: Literal["BLOCKED", "ANONYMIZED", "NONE"] - - -class RegexMatch(BaseModel): - name: str - match: str - regex: str - action: Literal["BLOCKED", "ANONYMIZED", "NONE"] - - -class SensitiveInformationPolicy(BaseModel): - piiEntities: List[PiiEntity] = Field(default_factory=list) - regexes: List[RegexMatch] = Field(default_factory=list) - - -class ContextualGroundingFilter(BaseModel): - type: str - threshold: float - score: float - action: Literal["BLOCKED", "NONE"] - - -class ContextualGroundingPolicy(BaseModel): - filters: List[ContextualGroundingFilter] = Field(default_factory=list) - - -class Assessment(BaseModel): - topicPolicy: Optional[TopicPolicy] = None - contentPolicy: Optional[ContentPolicy] = None - wordPolicy: Optional[WordPolicy] = None - sensitiveInformationPolicy: Optional[SensitiveInformationPolicy] = None - contextualGroundingPolicy: Optional[ContextualGroundingPolicy] = None - - -class BedrockGuardrailResponse(BaseModel): - usage: Dict[str, int] = Field( - default_factory=lambda: {"topicPolicyUnits": 1, "contentPolicyUnits": 1} - ) - action: Literal["NONE", "GUARDRAIL_INTERVENED"] = "NONE" - outputs: List[BedrockGuardrailOutput] = Field(default_factory=list) - assessments: List[Assessment] = Field(default_factory=list) - - -# ============================================================================ -# Mock Guardrail Configuration -# ============================================================================ - - -class GuardrailConfig(BaseModel): - """Configuration for mock guardrail behavior""" - - blocked_words: List[str] = Field( - default_factory=lambda: ["offensive", "inappropriate", "badword"] - ) - blocked_topics: List[str] = Field(default_factory=lambda: ["violence", "illegal"]) - pii_patterns: Dict[str, str] = Field( - default_factory=lambda: { - "EMAIL": r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b", - "PHONE": r"\b\d{3}[-.]?\d{3}[-.]?\d{4}\b", - "SSN": r"\b\d{3}-\d{2}-\d{4}\b", - "CREDIT_CARD": r"\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b", - } - ) - anonymize_pii: bool = True # If True, ANONYMIZE PII; if False, BLOCK it - bearer_token: str = "mock-bedrock-token-12345" - - -# Global config -GUARDRAIL_CONFIG = GuardrailConfig() - -# ============================================================================ -# FastAPI App Setup -# ============================================================================ - -app = FastAPI( - title="Mock Bedrock Guardrail API", - description="Mock server mimicking AWS Bedrock Guardrail API", - version="1.0.0", -) - - -# ============================================================================ -# Authentication -# ============================================================================ - - -async def verify_bearer_token(authorization: Optional[str] = Header(None)) -> str: - """ - Verify the Bearer token from the Authorization header. - - Args: - authorization: The Authorization header value - - Returns: - The token if valid - - Raises: - HTTPException: If token is missing or invalid - """ - if authorization is None: - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Missing Authorization header", - headers={"WWW-Authenticate": "Bearer"}, - ) - - # Check if it's a Bearer token - parts = authorization.split() - print(f"parts: {parts}") - if len(parts) != 2 or parts[0].lower() != "bearer": - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Invalid Authorization header format. Expected: Bearer ", - headers={"WWW-Authenticate": "Bearer"}, - ) - - token = parts[1] - - # Verify token - if token != GUARDRAIL_CONFIG.bearer_token: - raise HTTPException( - status_code=status.HTTP_403_FORBIDDEN, - detail="Invalid bearer token", - ) - - return token - - -# ============================================================================ -# Guardrail Logic -# ============================================================================ - - -def check_blocked_words(text: str) -> Optional[WordPolicy]: - """Check if text contains blocked words""" - found_words = [] - text_lower = text.lower() - - for word in GUARDRAIL_CONFIG.blocked_words: - if word.lower() in text_lower: - found_words.append(CustomWord(match=word, action="BLOCKED")) - - if found_words: - return WordPolicy(customWords=found_words) - return None - - -def check_blocked_topics(text: str) -> Optional[TopicPolicy]: - """Check if text contains blocked topics""" - found_topics = [] - text_lower = text.lower() - - for topic in GUARDRAIL_CONFIG.blocked_topics: - if topic.lower() in text_lower: - found_topics.append( - TopicPolicyItem(name=topic, type=topic.upper(), action="BLOCKED") - ) - - if found_topics: - return TopicPolicy(topics=found_topics) - return None - - -def check_pii(text: str) -> tuple[Optional[SensitiveInformationPolicy], str]: - """ - Check for PII in text and return policy + anonymized text - - Returns: - Tuple of (SensitiveInformationPolicy or None, anonymized_text) - """ - pii_entities = [] - anonymized_text = text - action = "ANONYMIZED" if GUARDRAIL_CONFIG.anonymize_pii else "BLOCKED" - - for pii_type, pattern in GUARDRAIL_CONFIG.pii_patterns.items(): - try: - # Compile the regex pattern with a timeout to prevent ReDoS attacks - compiled_pattern = re.compile(pattern) - matches = compiled_pattern.finditer(text) - for match in matches: - matched_text = match.group() - pii_entities.append( - PiiEntity(type=pii_type, match=matched_text, action=action) - ) - - # Anonymize the text if configured - if GUARDRAIL_CONFIG.anonymize_pii: - anonymized_text = anonymized_text.replace( - matched_text, f"[{pii_type}_REDACTED]" - ) - except re.error: - # Invalid regex pattern - skip it and log a warning - print(f"Warning: Invalid regex pattern for PII type {pii_type}: {pattern}") - continue - - if pii_entities: - return SensitiveInformationPolicy(piiEntities=pii_entities), anonymized_text - - return None, text - - -def process_guardrail_request( - request: BedrockRequest, -) -> tuple[BedrockGuardrailResponse, List[str]]: - """ - Process a guardrail request and return the response. - - Returns: - Tuple of (response, list of output texts) - """ - all_text_content = [] - output_texts = [] - - # Extract all text from content items - for content_item in request.content: - if content_item.text and content_item.text.text: - all_text_content.append(content_item.text.text) - - # Combine all text for analysis - combined_text = " ".join(all_text_content) - - # Initialize response - response = BedrockGuardrailResponse() - assessment = Assessment() - has_intervention = False - - # Check for blocked words - word_policy = check_blocked_words(combined_text) - if word_policy: - assessment.wordPolicy = word_policy - has_intervention = True - - # Check for blocked topics - topic_policy = check_blocked_topics(combined_text) - if topic_policy: - assessment.topicPolicy = topic_policy - has_intervention = True - - # Check for PII - for text in all_text_content: - pii_policy, anonymized_text = check_pii(text) - if pii_policy: - assessment.sensitiveInformationPolicy = pii_policy - if GUARDRAIL_CONFIG.anonymize_pii: - # If anonymizing, we don't block, we modify the text - output_texts.append(anonymized_text) - has_intervention = True - else: - # If not anonymizing PII, we block it - output_texts.append(text) - has_intervention = True - else: - output_texts.append(text) - - # Build response - if has_intervention: - response.action = "GUARDRAIL_INTERVENED" - # Only add assessment if there were interventions - response.assessments = [assessment] - - # Add outputs (modified or original text) - response.outputs = [BedrockGuardrailOutput(text=txt) for txt in output_texts] - - return response, output_texts - - -# ============================================================================ -# API Endpoints -# ============================================================================ - - -@app.get("/") -async def root(): - """Health check endpoint""" - return { - "service": "Mock Bedrock Guardrail API", - "status": "running", - "endpoint_format": "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply", - } - - -@app.get("/health") -async def health(): - """Health check endpoint""" - return {"status": "healthy"} - - -""" -LiteLLM exposes a basic guardrail API with the text extracted from the request and sent to the guardrail API, as well as the received request body for any further processing. - -This works across all LiteLLM endpoints (completion, anthropic /v1/messages, responses api, image generation, embedding, etc.) - -This makes it easy to support your own guardrail API without having to make a PR to LiteLLM. - -LiteLLM supports passing any provider specific params from LiteLLM config.yaml to the guardrail API. - -Example: - -```yaml -guardrails: - - guardrail_name: "bedrock-content-guard" - litellm_params: - guardrail: generic_guardrail_api - mode: "pre_call" - api_key: os.environ/GUARDRAIL_API_KEY - api_base: os.environ/GUARDRAIL_API_BASE - additional_provider_specific_params: - api_version: os.environ/GUARDRAIL_API_VERSION # additional provider specific params -``` - -This is a beta API. Please help us improve it. -""" - - -class LitellmBasicGuardrailRequest(BaseModel): - texts: List[str] - images: Optional[List[str]] = None - tools: Optional[List[dict]] = None - tool_calls: Optional[List[dict]] = None - request_data: Dict[str, Any] = Field(default_factory=dict) - additional_provider_specific_params: Dict[str, Any] = Field(default_factory=dict) - input_type: Literal["request", "response"] - litellm_call_id: Optional[str] = None - litellm_trace_id: Optional[str] = None - structured_messages: Optional[List[Dict[str, Any]]] = None - - -class LitellmBasicGuardrailResponse(BaseModel): - action: Literal[ - "BLOCKED", "NONE", "GUARDRAIL_INTERVENED" - ] # BLOCKED = litellm will raise an error, NONE = litellm will continue, GUARDRAIL_INTERVENED = litellm will continue, but the text was modified by the guardrail - blocked_reason: Optional[str] = None # only if action is BLOCKED, otherwise None - texts: Optional[List[str]] = None - images: Optional[List[str]] = None - - -@app.post( - "/beta/litellm_basic_guardrail_api", - response_model=LitellmBasicGuardrailResponse, -) -async def beta_litellm_basic_guardrail_api( - request: LitellmBasicGuardrailRequest, -) -> LitellmBasicGuardrailResponse: - """ - Apply guardrail to input or output content. - - This endpoint mimics the AWS Bedrock ApplyGuardrail API. - - Args: - request: The guardrail request containing content to analyze - token: Bearer token (verified by dependency) - - Returns: - LitellmBasicGuardrailResponse with analysis results - """ - print(f"request: {request}") - if any("ishaan" in text.lower() for text in request.texts): - return LitellmBasicGuardrailResponse( - action="BLOCKED", blocked_reason="Ishaan is not allowed" - ) - elif any("pii_value" in text for text in request.texts): - return LitellmBasicGuardrailResponse( - action="GUARDRAIL_INTERVENED", - texts=[ - text.replace("pii_value", "pii_value_redacted") - for text in request.texts - ], - ) - return LitellmBasicGuardrailResponse(action="NONE") - - -@app.post("/config/update") -async def update_config( - config: GuardrailConfig, token: str = Depends(verify_bearer_token) -): - """ - Update the guardrail configuration. - - This is a testing endpoint to modify the mock guardrail behavior. - - Args: - config: New guardrail configuration - token: Bearer token (verified by dependency) - - Returns: - Updated configuration - """ - global GUARDRAIL_CONFIG - GUARDRAIL_CONFIG = config - return {"status": "updated", "config": GUARDRAIL_CONFIG} - - -@app.get("/config") -async def get_config(token: str = Depends(verify_bearer_token)): - """ - Get the current guardrail configuration. - - Args: - token: Bearer token (verified by dependency) - - Returns: - Current configuration - """ - return GUARDRAIL_CONFIG - - -# ============================================================================ -# Error Handlers -# ============================================================================ - - -@app.exception_handler(HTTPException) -async def http_exception_handler(request, exc: HTTPException): - """Custom error handler for HTTP exceptions""" - return JSONResponse( - status_code=exc.status_code, - content={"error": exc.detail}, - headers=exc.headers, - ) - - -# ============================================================================ -# Main -# ============================================================================ - -if __name__ == "__main__": - import uvicorn - - # Get configuration from environment - host = os.getenv("MOCK_BEDROCK_HOST", "0.0.0.0") - port = int(os.getenv("MOCK_BEDROCK_PORT", "8080")) - bearer_token = os.getenv("MOCK_BEDROCK_TOKEN", "mock-bedrock-token-12345") - - # Update config with environment token - GUARDRAIL_CONFIG.bearer_token = bearer_token - - print("=" * 80) - print("Mock Bedrock Guardrail API Server") - print("=" * 80) - print(f"Server starting on: http://{host}:{port}") - print(f"Bearer Token: {bearer_token}") - print(f"Endpoint: POST /guardrail/{{id}}/version/{{version}}/apply") - print("=" * 80) - print("\nExample curl command:") - print( - f""" -curl -X POST "http://{host}:{port}/guardrail/test-guardrail/version/1/apply" \\ - -H "Authorization: Bearer {bearer_token}" \\ - -H "Content-Type: application/json" \\ - -d '{{ - "source": "INPUT", - "content": [ - {{ - "text": {{ - "text": "Hello, my email is test@example.com" - }} - }} - ] - }}' - """ - ) - print("=" * 80) - - uvicorn.run(app, host=host, port=port) diff --git a/cookbook/mock_prompt_management_server/README.md b/cookbook/mock_prompt_management_server/README.md deleted file mode 100644 index c13061cfe89..00000000000 --- a/cookbook/mock_prompt_management_server/README.md +++ /dev/null @@ -1,292 +0,0 @@ -# Mock Prompt Management Server - -A reference implementation of the [LiteLLM Generic Prompt Management API](https://docs.litellm.ai/docs/adding_provider/generic_prompt_management_api). - -This FastAPI server demonstrates how to build a prompt management API that integrates with LiteLLM without requiring a PR to the LiteLLM repository. - -## Quick Start - -### 1. Install Dependencies - -```bash -pip install fastapi uvicorn pydantic -``` - -### 2. Start the Server - -```bash -python mock_prompt_management_server.py -``` - -The server will start on `http://localhost:8080` - -### 3. Test the Endpoint - -```bash -# Get a prompt -curl "http://localhost:8080/beta/litellm_prompt_management?prompt_id=hello-world-prompt" - -# Get a prompt with authentication -curl "http://localhost:8080/beta/litellm_prompt_management?prompt_id=hello-world-prompt" \ - -H "Authorization: Bearer test-token-12345" - -# List all prompts -curl "http://localhost:8080/prompts" - -# Get prompt variables -curl "http://localhost:8080/prompts/hello-world-prompt/variables" -``` - -## Using with LiteLLM - -### Configuration - -Create a `config.yaml` file: - -```yaml -model_list: - - model_name: gpt-3.5-turbo - litellm_params: - model: openai/gpt-3.5-turbo - api_key: os.environ/OPENAI_API_KEY - -prompts: - - prompt_id: "hello-world-prompt" - litellm_params: - prompt_integration: "generic_prompt_management" - api_base: http://localhost:8080 - api_key: test-token-12345 -``` - -### Start LiteLLM Proxy - -```bash -litellm --config config.yaml -``` - -### Make a Request - -```bash -curl http://0.0.0.0:4000/v1/chat/completions \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $LITELLM_MASTER_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "prompt_id": "hello-world-prompt", - "prompt_variables": { - "domain": "data science", - "task": "analyzing customer behavior" - }, - "messages": [ - {"role": "user", "content": "Please help me get started"} - ] - }' -``` - -## Available Prompts - -The server includes several example prompts: - -| Prompt ID | Description | Variables | -|-----------|-------------|-----------| -| `hello-world-prompt` | Basic helpful assistant | `domain`, `task` | -| `code-review-prompt` | Code review assistant | `years_experience`, `language`, `code` | -| `customer-support-prompt` | Customer support agent | `company_name`, `customer_message` | -| `data-analysis-prompt` | Data analysis expert | `analysis_type`, `dataset_name`, `data` | -| `creative-writing-prompt` | Creative writing assistant | `genre`, `length`, `topic` | - -## Authentication - -The server supports optional Bearer token authentication. Valid tokens for testing: - -- `test-token-12345` -- `dev-token-67890` -- `prod-token-abcdef` - -If no `Authorization` header is provided, requests are allowed (for testing purposes). - -## API Endpoints - -### LiteLLM Spec Endpoints - -#### `GET /beta/litellm_prompt_management` - -Get a prompt by ID (required by LiteLLM). - -**Query Parameters:** -- `prompt_id` (required): The prompt ID -- `project_name` (optional): Project filter -- `slug` (optional): Slug filter -- `version` (optional): Version filter - -**Response:** -```json -{ - "prompt_id": "hello-world-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a helpful assistant specialized in {domain}." - }, - { - "role": "user", - "content": "Help me with: {task}" - } - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.7, - "max_tokens": 500 - } -} -``` - -### Convenience Endpoints (Not in LiteLLM Spec) - -#### `GET /health` - -Health check endpoint. - -#### `GET /prompts` - -List all available prompts. - -#### `GET /prompts/{prompt_id}/variables` - -Get all variables used in a prompt template. - -#### `POST /prompts` - -Create a new prompt (in-memory only, for testing). - -## Example: Full Integration Test - -### 1. Start the Mock Server - -```bash -python mock_prompt_management_server.py -``` - -### 2. Test with Python - -```python -from litellm import completion - -# The completion will: -# 1. Fetch the prompt from your API -# 2. Replace {domain} with "machine learning" -# 3. Replace {task} with "building a recommendation system" -# 4. Merge with your messages -# 5. Use the model and params from the prompt - -response = completion( - model="gpt-4", - prompt_id="hello-world-prompt", - prompt_variables={ - "domain": "machine learning", - "task": "building a recommendation system" - }, - messages=[ - {"role": "user", "content": "I have user behavior data from the past year."} - ], - # Configure the generic prompt manager - generic_prompt_config={ - "api_base": "http://localhost:8080", - "api_key": "test-token-12345", - } -) - -print(response.choices[0].message.content) -``` - -## Customization - -### Adding New Prompts - -Edit the `PROMPTS_DB` dictionary in `mock_prompt_management_server.py`: - -```python -PROMPTS_DB = { - "my-custom-prompt": { - "prompt_id": "my-custom-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a {role}." - }, - { - "role": "user", - "content": "{user_input}" - } - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.8, - "max_tokens": 1000 - } - } -} -``` - -### Using a Database - -Replace the `PROMPTS_DB` dictionary with database queries: - -```python -@app.get("/beta/litellm_prompt_management") -async def get_prompt(prompt_id: str): - # Fetch from database - prompt = await db.prompts.find_one({"prompt_id": prompt_id}) - - if not prompt: - raise HTTPException(status_code=404, detail="Prompt not found") - - return PromptResponse(**prompt) -``` - -### Adding Access Control - -Use the custom query parameters for access control: - -```python -@app.get("/beta/litellm_prompt_management") -async def get_prompt( - prompt_id: str, - project_name: Optional[str] = None, - user_id: Optional[str] = None, - authorization: Optional[str] = Header(None) -): - token = verify_api_key(authorization) - - # Check if user has access to this project - if not has_project_access(token, project_name): - raise HTTPException(status_code=403, detail="Access denied") - - # Fetch and return prompt - ... -``` - -## Production Considerations - -Before deploying to production: - -1. **Use a real database** instead of in-memory storage -2. **Implement proper authentication** with JWT tokens or API keys -3. **Add rate limiting** to prevent abuse -4. **Use HTTPS** for encrypted communication -5. **Add logging and monitoring** for observability -6. **Implement caching** for frequently accessed prompts -7. **Add versioning** for prompt management -8. **Implement access control** based on teams/users -9. **Add input validation** for all parameters -10. **Use environment variables** for configuration - -## Related Documentation - -- [Generic Prompt Management API Documentation](https://docs.litellm.ai/docs/adding_provider/generic_prompt_management_api) -- [LiteLLM Prompt Management](https://docs.litellm.ai/docs/proxy/prompt_management) -- [Generic Guardrail API](https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api) - -## Questions? - -This is a reference implementation for the LiteLLM Generic Prompt Management API. For questions or issues, please open an issue on the [LiteLLM GitHub repository](https://github.com/BerriAI/litellm). diff --git a/cookbook/mock_prompt_management_server/mock_prompt_management_server.py b/cookbook/mock_prompt_management_server/mock_prompt_management_server.py deleted file mode 100644 index 295a96e12a9..00000000000 --- a/cookbook/mock_prompt_management_server/mock_prompt_management_server.py +++ /dev/null @@ -1,390 +0,0 @@ -#!/usr/bin/env python3 -""" -Mock Prompt Management API Server - -This is a FastAPI server that implements the LiteLLM Generic Prompt Management API -for testing and demonstration purposes. - -Usage: - python mock_prompt_management_server.py - -The server will start on http://localhost:8080 - -Test the endpoint: - curl "http://localhost:8080/beta/litellm_prompt_management?prompt_id=hello-world-prompt" -""" - -import os -import json -from typing import Any, Dict, List, Optional - -from fastapi import FastAPI, HTTPException, Header, Query, status -from fastapi.responses import JSONResponse -from pydantic import BaseModel, Field - -# ============================================================================ -# Response Models -# ============================================================================ - - -class MessageContent(BaseModel): - """A single message in the prompt template""" - - role: str = Field(..., description="Message role (system, user, assistant)") - content: str = Field( - ..., description="Message content with optional {variable} placeholders" - ) - - -class PromptResponse(BaseModel): - """Response format for the prompt management API""" - - prompt_id: str = Field(..., description="The ID of the prompt") - prompt_template: List[MessageContent] = Field( - ..., description="Array of messages in OpenAI format" - ) - prompt_template_model: Optional[str] = Field( - None, description="Optional model to use for this prompt" - ) - prompt_template_optional_params: Optional[Dict[str, Any]] = Field( - None, description="Optional parameters like temperature, max_tokens, etc." - ) - - -# ============================================================================ -# Mock Prompt Database -# ============================================================================ - -PROMPTS_DB = { - "hello-world-prompt": { - "prompt_id": "hello-world-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a helpful assistant specialized in {domain}.", - }, - {"role": "user", "content": "Help me with: {task}"}, - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": {"temperature": 0.7, "max_tokens": 500}, - }, - "code-review-prompt": { - "prompt_id": "code-review-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are an expert code reviewer with {years_experience} years of experience in {language}.", - }, - { - "role": "user", - "content": "Please review the following code for bugs, security issues, and best practices:\n\n{code}", - }, - ], - "prompt_template_model": "gpt-4-turbo", - "prompt_template_optional_params": { - "temperature": 0.3, - "max_tokens": 1500, - }, - }, - "customer-support-prompt": { - "prompt_id": "customer-support-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a friendly customer support agent for {company_name}. Always be professional, empathetic, and solution-oriented.", - }, - { - "role": "user", - "content": "Customer inquiry: {customer_message}", - }, - ], - "prompt_template_model": "gpt-3.5-turbo", - "prompt_template_optional_params": { - "temperature": 0.8, - "max_tokens": 800, - "top_p": 0.9, - }, - }, - "data-analysis-prompt": { - "prompt_id": "data-analysis-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a data scientist expert in {analysis_type} analysis.", - }, - { - "role": "user", - "content": "Analyze the following data and provide insights:\n\nDataset: {dataset_name}\nData: {data}", - }, - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.5, - "max_tokens": 2000, - }, - }, - "creative-writing-prompt": { - "prompt_id": "creative-writing-prompt", - "prompt_template": [ - { - "role": "system", - "content": "You are a creative writer specializing in {genre} fiction.", - }, - { - "role": "user", - "content": "Write a {length} story about: {topic}", - }, - ], - "prompt_template_model": "gpt-4", - "prompt_template_optional_params": { - "temperature": 0.9, - "max_tokens": 3000, - "top_p": 0.95, - }, - }, -} - -# Valid API tokens for authentication (in production, use a secure token store) -VALID_API_TOKENS = { - "test-token-12345", - "dev-token-67890", - "prod-token-abcdef", -} - -# ============================================================================ -# FastAPI App -# ============================================================================ - -app = FastAPI( - title="Mock Prompt Management API", - description="A mock server implementing the LiteLLM Generic Prompt Management API", - version="1.0.0", -) - - -def verify_api_key(authorization: Optional[str] = Header(None)) -> bool: - """ - Verify the API key from the Authorization header. - - Args: - authorization: Authorization header (Bearer token) - - Returns: - True if valid, raises HTTPException if invalid - """ - if authorization is None: - # Allow requests without authentication for testing - return True - - # Extract token from "Bearer " - if not authorization.startswith("Bearer "): - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Invalid authorization header format. Expected 'Bearer '", - ) - - token = authorization.replace("Bearer ", "").strip() - - if token not in VALID_API_TOKENS: - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Invalid API key", - ) - - return True - - -@app.get("/beta/litellm_prompt_management", response_model=PromptResponse) -async def get_prompt( - prompt_id: str = Query(..., description="The ID of the prompt to fetch"), - project_name: Optional[str] = Query( - None, description="Optional project name filter" - ), - slug: Optional[str] = Query(None, description="Optional slug filter"), - version: Optional[str] = Query(None, description="Optional version filter"), - authorization: Optional[str] = Header(None), -) -> PromptResponse: - """ - Get a prompt by ID with optional filtering. - - This endpoint implements the LiteLLM Generic Prompt Management API specification. - - Args: - prompt_id: The ID of the prompt to fetch - project_name: Optional project name for filtering - slug: Optional slug for filtering - version: Optional version for filtering - authorization: Optional Bearer token for authentication - - Returns: - PromptResponse with the prompt template and configuration - - Raises: - HTTPException: 401 if authentication fails, 404 if prompt not found - """ - # Verify authentication - verify_api_key(authorization) - - # Log the request parameters (useful for debugging) - print(f"Fetching prompt: {prompt_id}") - if project_name: - print(f" Project: {project_name}") - if slug: - print(f" Slug: {slug}") - if version: - print(f" Version: {version}") - - # Check if prompt exists - if prompt_id not in PROMPTS_DB: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Prompt '{prompt_id}' not found. Available prompts: {list(PROMPTS_DB.keys())}", - ) - - # Get the prompt from the database - prompt_data = PROMPTS_DB[prompt_id] - - # Optional: Apply filtering based on project_name, slug, or version - # In a real implementation, you might use these to filter prompts by access control - # or to fetch specific versions from your database - - return PromptResponse(**prompt_data) - - -@app.get("/health") -async def health_check(): - """Health check endpoint""" - return { - "status": "healthy", - "service": "mock-prompt-management-api", - "version": "1.0.0", - } - - -@app.get("/prompts") -async def list_prompts(authorization: Optional[str] = Header(None)): - """ - List all available prompts. - - This is a convenience endpoint (not part of the LiteLLM spec) for - discovering available prompts. - """ - # Verify authentication - verify_api_key(authorization) - - prompts_list = [ - { - "prompt_id": pid, - "model": p.get("prompt_template_model"), - "has_variables": any( - "{" in msg.get("content", "") for msg in p.get("prompt_template", []) - ), - } - for pid, p in PROMPTS_DB.items() - ] - - return {"prompts": prompts_list, "total": len(prompts_list)} - - -@app.get("/prompts/{prompt_id}/variables") -async def get_prompt_variables( - prompt_id: str, authorization: Optional[str] = Header(None) -): - """ - Get all variables in a prompt template. - - This is a convenience endpoint (not part of the LiteLLM spec) for - discovering what variables a prompt expects. - """ - # Verify authentication - verify_api_key(authorization) - - if prompt_id not in PROMPTS_DB: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Prompt '{prompt_id}' not found", - ) - - prompt_data = PROMPTS_DB[prompt_id] - variables = set() - - # Extract variables from the prompt template - import re - - for message in prompt_data["prompt_template"]: - content = message.get("content", "") - # Find all {variable} patterns - found_vars = re.findall(r"\{(\w+)\}", content) - variables.update(found_vars) - - return { - "prompt_id": prompt_id, - "variables": sorted(list(variables)), - "example_usage": { - "prompt_id": prompt_id, - "prompt_variables": {var: f"<{var}_value>" for var in variables}, - }, - } - - -@app.post("/prompts") -async def create_prompt( - prompt: PromptResponse, authorization: Optional[str] = Header(None) -): - """ - Create a new prompt (convenience endpoint for testing). - - This is NOT part of the LiteLLM spec - it's just for testing purposes. - """ - # Verify authentication - verify_api_key(authorization) - - if prompt.prompt_id in PROMPTS_DB: - raise HTTPException( - status_code=status.HTTP_409_CONFLICT, - detail=f"Prompt '{prompt.prompt_id}' already exists", - ) - - PROMPTS_DB[prompt.prompt_id] = prompt.dict() - - return { - "status": "created", - "prompt_id": prompt.prompt_id, - "message": "Prompt created successfully (in-memory only)", - } - - -# ============================================================================ -# Main -# ============================================================================ - -if __name__ == "__main__": - import uvicorn - - print("=" * 70) - print("Mock Prompt Management API Server") - print("=" * 70) - print(f"\nStarting server on http://localhost:8080") - print(f"\nAvailable prompts: {len(PROMPTS_DB)}") - for prompt_id in PROMPTS_DB.keys(): - print(f" - {prompt_id}") - print(f"\nValid API tokens: {len(VALID_API_TOKENS)}") - print(" - test-token-12345") - print(" - dev-token-67890") - print(" - prod-token-abcdef") - print("\nEndpoints:") - print(" GET /beta/litellm_prompt_management?prompt_id= (LiteLLM spec)") - print(" GET /health (health check)") - print(" GET /prompts (list all prompts)") - print( - " GET /prompts/{id}/variables (get prompt variables)" - ) - print(" POST /prompts (create prompt)") - print("\nExample usage:") - print( - ' curl "http://localhost:8080/beta/litellm_prompt_management?prompt_id=hello-world-prompt"' - ) - print("\nPress CTRL+C to stop the server") - print("=" * 70) - - uvicorn.run(app, host="0.0.0.0", port=8080, log_level="info") diff --git a/cookbook/nova_sonic_realtime.py b/cookbook/nova_sonic_realtime.py deleted file mode 100644 index 50844121cbf..00000000000 --- a/cookbook/nova_sonic_realtime.py +++ /dev/null @@ -1,292 +0,0 @@ -""" -Client script to test Nova Sonic realtime API through LiteLLM proxy. - -This script connects to LiteLLM proxy's realtime endpoint and enables -speech-to-speech conversation with Bedrock Nova Sonic. - -Prerequisites: -- LiteLLM proxy running with Bedrock configured -- pyaudio installed: pip install pyaudio -- websockets installed: pip install websockets - -Usage: - export LITELLM_MASTER_KEY="sk-$(openssl rand -hex 32)" - python nova_sonic_realtime.py -""" - -import asyncio -import base64 -import json -import os -import pyaudio -import websockets -from typing import Optional - -# Bounded queue size for audio chunks (configurable via env to avoid unbounded memory) -AUDIO_QUEUE_MAXSIZE = int(os.getenv("LITELLM_ASYNCIO_QUEUE_MAXSIZE", 10_000)) - -# Audio configuration (matching Nova Sonic requirements) -INPUT_SAMPLE_RATE = 16000 # Nova Sonic expects 16kHz input -OUTPUT_SAMPLE_RATE = 24000 # Nova Sonic outputs 24kHz -CHANNELS = 1 -FORMAT = pyaudio.paInt16 -CHUNK_SIZE = 1024 - -# LiteLLM proxy configuration -LITELLM_PROXY_URL = "ws://localhost:4000/v1/realtime?model=bedrock-sonic" -LITELLM_API_KEY = os.environ["LITELLM_MASTER_KEY"] - - -class RealtimeClient: - """Client for LiteLLM realtime API with audio support.""" - - def __init__(self, url: str, api_key: str): - self.url = url - self.api_key = api_key - self.ws: Optional[websockets.WebSocketClientProtocol] = None - self.is_active = False - self.audio_queue = asyncio.Queue(maxsize=AUDIO_QUEUE_MAXSIZE) - self.pyaudio = pyaudio.PyAudio() - self.input_stream = None - self.output_stream = None - - async def connect(self): - """Connect to LiteLLM proxy realtime endpoint.""" - print(f"Connecting to {self.url}...") - - headers = {} - if self.api_key: - headers["Authorization"] = f"Bearer {self.api_key}" - - self.ws = await websockets.connect( - self.url, - additional_headers=headers, - max_size=10 * 1024 * 1024, # 10MB max message size - ) - self.is_active = True - print("✓ Connected to LiteLLM proxy") - - async def send_session_update(self): - """Send session configuration.""" - session_update = { - "type": "session.update", - "session": { - "instructions": "You are a friendly assistant. Keep your responses short and conversational.", - "voice": "matthew", - "temperature": 0.8, - "max_response_output_tokens": 1024, - "modalities": ["text", "audio"], - "input_audio_format": "pcm16", - "output_audio_format": "pcm16", - "turn_detection": { - "type": "server_vad", - "threshold": 0.5, - "prefix_padding_ms": 300, - "silence_duration_ms": 500, - }, - }, - } - await self.ws.send(json.dumps(session_update)) - print("✓ Session configuration sent") - - async def receive_messages(self): - """Receive and process messages from the server.""" - try: - async for message in self.ws: - if not self.is_active: - break - - try: - data = json.loads(message) - event_type = data.get("type") - - if event_type == "session.created": - print(f"✓ Session created: {data.get('session', {}).get('id')}") - - elif event_type == "response.created": - print("🤖 Assistant is responding...") - - elif event_type == "response.text.delta": - # Print text transcription - delta = data.get("delta", "") - print(delta, end="", flush=True) - - elif event_type == "response.audio.delta": - # Queue audio for playback - audio_b64 = data.get("delta", "") - if audio_b64: - audio_bytes = base64.b64decode(audio_b64) - await self.audio_queue.put(audio_bytes) - - elif event_type == "response.text.done": - print() # New line after text - - elif event_type == "response.done": - print("✓ Response complete") - - elif event_type == "error": - print(f"❌ Error: {data.get('error', {})}") - - else: - # Debug: print other event types - print(f"[{event_type}]", end=" ") - - except json.JSONDecodeError: - print(f"Failed to parse message: {message[:100]}") - - except websockets.exceptions.ConnectionClosed: - print("\n✗ Connection closed") - except Exception as e: - print(f"\n✗ Error receiving messages: {e}") - finally: - self.is_active = False - - async def send_audio_chunk(self, audio_bytes: bytes): - """Send audio chunk to server.""" - if not self.is_active or not self.ws: - return - - audio_b64 = base64.b64encode(audio_bytes).decode("utf-8") - message = { - "type": "input_audio_buffer.append", - "audio": audio_b64, - } - await self.ws.send(json.dumps(message)) - - async def commit_audio_buffer(self): - """Commit the audio buffer to trigger processing.""" - if not self.is_active or not self.ws: - return - - message = {"type": "input_audio_buffer.commit"} - await self.ws.send(json.dumps(message)) - - async def capture_audio(self): - """Capture audio from microphone and send to server.""" - print("\n🎤 Starting audio capture...") - print("Speak into your microphone. Press Ctrl+C to stop.\n") - - self.input_stream = self.pyaudio.open( - format=FORMAT, - channels=CHANNELS, - rate=INPUT_SAMPLE_RATE, - input=True, - frames_per_buffer=CHUNK_SIZE, - ) - - try: - while self.is_active: - audio_data = self.input_stream.read( - CHUNK_SIZE, exception_on_overflow=False - ) - await self.send_audio_chunk(audio_data) - await asyncio.sleep(0.01) # Small delay to prevent overwhelming - except Exception as e: - print(f"Error capturing audio: {e}") - finally: - if self.input_stream: - self.input_stream.stop_stream() - self.input_stream.close() - - async def play_audio(self): - """Play audio responses from the server.""" - print("🔊 Starting audio playback...") - - self.output_stream = self.pyaudio.open( - format=FORMAT, - channels=CHANNELS, - rate=OUTPUT_SAMPLE_RATE, - output=True, - frames_per_buffer=CHUNK_SIZE, - ) - - try: - while self.is_active: - try: - audio_data = await asyncio.wait_for( - self.audio_queue.get(), timeout=0.1 - ) - if audio_data: - self.output_stream.write(audio_data) - except asyncio.TimeoutError: - continue - except Exception as e: - print(f"Error playing audio: {e}") - finally: - if self.output_stream: - self.output_stream.stop_stream() - self.output_stream.close() - - async def close(self): - """Close the connection and cleanup.""" - self.is_active = False - - if self.ws: - await self.ws.close() - - if self.input_stream: - self.input_stream.stop_stream() - self.input_stream.close() - - if self.output_stream: - self.output_stream.stop_stream() - self.output_stream.close() - - self.pyaudio.terminate() - print("\n✓ Connection closed") - - -async def main(): - """Main function to run the realtime client.""" - print("=" * 80) - print("Bedrock Nova Sonic Realtime Client") - print("=" * 80) - print() - - client = RealtimeClient(LITELLM_PROXY_URL, LITELLM_API_KEY) - - try: - # Connect to server - await client.connect() - - # Send session configuration - await client.send_session_update() - - # Wait a moment for session to be established - await asyncio.sleep(0.5) - - # Start tasks - receive_task = asyncio.create_task(client.receive_messages()) - capture_task = asyncio.create_task(client.capture_audio()) - playback_task = asyncio.create_task(client.play_audio()) - - # Wait for user to interrupt - await asyncio.gather( - receive_task, - capture_task, - playback_task, - return_exceptions=True, - ) - - except KeyboardInterrupt: - print("\n\n⚠ Interrupted by user") - except Exception as e: - print(f"\n❌ Error: {e}") - import traceback - - traceback.print_exc() - finally: - await client.close() - - -if __name__ == "__main__": - print("\nMake sure:") - print("1. LiteLLM proxy is running on port 4000") - print("2. Bedrock is configured in proxy_server_config.yaml") - print("3. AWS credentials are set") - print() - - try: - asyncio.run(main()) - except KeyboardInterrupt: - print("\n\nGoodbye!") diff --git a/cookbook/result.html b/cookbook/result.html deleted file mode 100644 index 0bd099bacc7..00000000000 --- a/cookbook/result.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
- - - - - - - - \ No newline at end of file diff --git a/cookbook/veo_video_generation.py b/cookbook/veo_video_generation.py deleted file mode 100644 index 8587032e0be..00000000000 --- a/cookbook/veo_video_generation.py +++ /dev/null @@ -1,321 +0,0 @@ -#!/usr/bin/env python3 -""" -Complete example for Veo video generation through LiteLLM proxy. - -This script demonstrates how to: -1. Generate videos using Google's Veo model -2. Poll for completion status -3. Download the generated video file - -Requirements: -- LiteLLM proxy running with Google AI Studio pass-through configured -- Google AI Studio API key with Veo access -""" - -import json -import os -import time -import requests -from typing import Optional - - -class VeoVideoGenerator: - """Complete Veo video generation client using LiteLLM proxy.""" - - def __init__( - self, - api_key: str, - base_url: str = "http://localhost:4000/gemini/v1beta", - ): - """ - Initialize the Veo video generator. - - Args: - base_url: Base URL for the LiteLLM proxy with Gemini pass-through - api_key: API key for LiteLLM proxy authentication - """ - self.base_url = base_url - self.api_key = api_key - self.headers = {"x-goog-api-key": api_key, "Content-Type": "application/json"} - - def generate_video(self, prompt: str) -> Optional[str]: - """ - Initiate video generation with Veo. - - Args: - prompt: Text description of the video to generate - - Returns: - Operation name if successful, None otherwise - """ - print(f"🎬 Generating video with prompt: '{prompt}'") - - url = f"{self.base_url}/models/veo-3.0-generate-preview:predictLongRunning" - payload = {"instances": [{"prompt": prompt}]} - - try: - response = requests.post(url, headers=self.headers, json=payload) - response.raise_for_status() - - data = response.json() - operation_name = data.get("name") - - if operation_name: - print(f"✅ Video generation started: {operation_name}") - return operation_name - else: - print("❌ No operation name returned") - print(f"Response: {json.dumps(data, indent=2)}") - return None - - except requests.RequestException as e: - print(f"❌ Failed to start video generation: {e}") - if hasattr(e, "response") and e.response is not None: - try: - error_data = e.response.json() - print(f"Error details: {json.dumps(error_data, indent=2)}") - except: - print(f"Error response: {e.response.text}") - return None - - def wait_for_completion( - self, operation_name: str, max_wait_time: int = 600 - ) -> Optional[str]: - """ - Poll operation status until video generation is complete. - - Args: - operation_name: Name of the operation to monitor - max_wait_time: Maximum time to wait in seconds (default: 10 minutes) - - Returns: - Video URI if successful, None otherwise - """ - print("⏳ Waiting for video generation to complete...") - - operation_url = f"{self.base_url}/{operation_name}" - start_time = time.time() - poll_interval = 10 # Start with 10 seconds - - while time.time() - start_time < max_wait_time: - try: - print( - f"🔍 Polling status... ({int(time.time() - start_time)}s elapsed)" - ) - - response = requests.get(operation_url, headers=self.headers) - response.raise_for_status() - - data = response.json() - - # Check for errors - if "error" in data: - print("❌ Error in video generation:") - print(json.dumps(data["error"], indent=2)) - return None - - # Check if operation is complete - is_done = data.get("done", False) - - if is_done: - print("🎉 Video generation complete!") - - try: - # Extract video URI from nested response - video_uri = data["response"]["generateVideoResponse"][ - "generatedSamples" - ][0]["video"]["uri"] - print(f"📹 Video URI: {video_uri}") - return video_uri - except KeyError as e: - print(f"❌ Could not extract video URI: {e}") - print("Full response:") - print(json.dumps(data, indent=2)) - return None - - # Wait before next poll, with exponential backoff - time.sleep(poll_interval) - poll_interval = min(poll_interval * 1.2, 30) # Cap at 30 seconds - - except requests.RequestException as e: - print(f"❌ Error polling operation status: {e}") - time.sleep(poll_interval) - - print(f"⏰ Timeout after {max_wait_time} seconds") - return None - - def download_video( - self, video_uri: str, output_filename: str = "generated_video.mp4" - ) -> bool: - """ - Download the generated video file. - - Args: - video_uri: URI of the video to download (from Google's response) - output_filename: Local filename to save the video - - Returns: - True if download successful, False otherwise - """ - print(f"⬇️ Downloading video...") - print(f"Original URI: {video_uri}") - - # Convert Google URI to LiteLLM proxy URI - # Example: files/abc123 -> /gemini/v1beta/files/abc123:download?alt=media - if video_uri.startswith("files/"): - download_path = f"{video_uri}:download?alt=media" - else: - download_path = video_uri - - litellm_download_url = f"{self.base_url}/{download_path}" - print(f"Download URL: {litellm_download_url}") - - try: - # Download with streaming and redirect handling - response = requests.get( - litellm_download_url, - headers=self.headers, - stream=True, - allow_redirects=True, # Handle redirects automatically - ) - response.raise_for_status() - - # Save video file - with open(output_filename, "wb") as f: - downloaded_size = 0 - for chunk in response.iter_content(chunk_size=8192): - if chunk: - f.write(chunk) - downloaded_size += len(chunk) - - # Progress indicator for large files - if downloaded_size % (1024 * 1024) == 0: # Every MB - print( - f"📦 Downloaded {downloaded_size / (1024*1024):.1f} MB..." - ) - - # Verify file was created and has content - if os.path.exists(output_filename): - file_size = os.path.getsize(output_filename) - if file_size > 0: - print(f"✅ Video downloaded successfully!") - print(f"📁 Saved as: {output_filename}") - print(f"📏 File size: {file_size / (1024*1024):.2f} MB") - return True - else: - print("❌ Downloaded file is empty") - os.remove(output_filename) - return False - else: - print("❌ File was not created") - return False - - except requests.RequestException as e: - print(f"❌ Download failed: {e}") - if hasattr(e, "response") and e.response is not None: - print(f"Status code: {e.response.status_code}") - print(f"Response headers: {dict(e.response.headers)}") - return False - - def generate_and_download(self, prompt: str, output_filename: str = None) -> bool: - """ - Complete workflow: generate video and download it. - - Args: - prompt: Text description for video generation - output_filename: Output filename (auto-generated if None) - - Returns: - True if successful, False otherwise - """ - # Auto-generate filename if not provided - if output_filename is None: - timestamp = int(time.time()) - safe_prompt = "".join( - c for c in prompt[:30] if c.isalnum() or c in (" ", "-", "_") - ).rstrip() - output_filename = ( - f"veo_video_{safe_prompt.replace(' ', '_')}_{timestamp}.mp4" - ) - - print("=" * 60) - print("🎬 VEO VIDEO GENERATION WORKFLOW") - print("=" * 60) - - # Step 1: Generate video - operation_name = self.generate_video(prompt) - if not operation_name: - return False - - # Step 2: Wait for completion - video_uri = self.wait_for_completion(operation_name) - if not video_uri: - return False - - # Step 3: Download video - success = self.download_video(video_uri, output_filename) - - if success: - print("=" * 60) - print("🎉 SUCCESS! Video generation complete!") - print(f"📁 Video saved as: {output_filename}") - print("=" * 60) - else: - print("=" * 60) - print("❌ FAILED! Video generation or download failed") - print("=" * 60) - - return success - - -def main(): - """ - Example usage of the VeoVideoGenerator. - - Configure these environment variables: - - LITELLM_BASE_URL: Your LiteLLM proxy URL (default: http://localhost:4000/gemini/v1beta) - - LITELLM_API_KEY: API key for LiteLLM proxy authentication - """ - - # Configuration from environment or defaults - base_url = os.getenv("LITELLM_BASE_URL", "http://localhost:4000/gemini/v1beta") - api_key = os.environ["LITELLM_API_KEY"] - - print("🚀 Starting Veo Video Generation Example") - print(f"📡 Using LiteLLM proxy at: {base_url}") - - # Initialize generator - generator = VeoVideoGenerator(base_url=base_url, api_key=api_key) - - # Example prompts - try different ones! - example_prompts = [ - "A cat playing with a ball of yarn in a sunny garden", - "Ocean waves crashing against rocky cliffs at sunset", - "A bustling city street with people walking and cars passing by", - "A peaceful forest with sunlight filtering through the trees", - ] - - # Use first example or get from user - prompt = example_prompts[0] - print(f"🎬 Using prompt: '{prompt}'") - - # Generate and download video - success = generator.generate_and_download(prompt) - - if success: - print("\n✅ Example completed successfully!") - print("💡 Try modifying the prompt in the script for different videos!") - else: - print("\n❌ Example failed!") - print("🔧 Check your LiteLLM proxy configuration and Google AI Studio API key") - - # Troubleshooting tips - print("\n🔍 Troubleshooting:") - print("1. Ensure LiteLLM proxy is running with Google AI Studio pass-through") - print("2. Verify your Google AI Studio API key has Veo access") - print("3. Check that your prompt meets Veo's content guidelines") - print("4. Review the LiteLLM proxy logs for detailed error information") - - -if __name__ == "__main__": - main() diff --git a/examples/bigmodel.md b/examples/bigmodel.md deleted file mode 100644 index 88a69796ebe..00000000000 --- a/examples/bigmodel.md +++ /dev/null @@ -1,63 +0,0 @@ -# BigModel (Zhipu AI) - -Use `bigmodel/` for the domestic BigModel platform and `zai/` for international Z.AI. Each platform uses its own credentials and default URL - -```yaml -model_list: - - model_name: glm - litellm_params: - model: bigmodel/glm-5.3 - api_key: os.environ/BIGMODEL_API_KEY - api_base: https://open.bigmodel.cn -``` - -One model configuration supports all three native APIs. The provider selects the upstream endpoint from the requested API - -| Proxy endpoint | BigModel endpoint | -| --- | --- | -| `/v1/chat/completions` | `/api/paas/v4/chat/completions` | -| `/v1/responses` | `/api/v1/responses` | -| `/v1/messages` | `/api/anthropic/v1/messages` | - -`api_base` is optional and defaults to `https://open.bigmodel.cn`. Set `BIGMODEL_API_BASE` to override the default, or pass an explicit `api_base` to override the environment value. Existing API-specific base URLs and complete endpoint URLs are normalized, preserving a custom proxy's path prefix - -A GLM Coding Plan key uses `https://open.bigmodel.cn/api/coding/paas/v4` as its `api_base`, since Coding Plan and standard keys do not work on each other's endpoints. Chat Completions then calls the Coding Plan endpoint, and Responses and Messages keep the endpoints in the table above - -The Admin UI lists BigModel (Zhipu AI), displays its official logo, and provides a required password API Key field and an optional API Base field with the default URL. Authentication uses an explicit `api_key` or `BIGMODEL_API_KEY` - -```python -import litellm - -chat = litellm.completion( - model="bigmodel/glm-5.3", - messages=[{"role": "user", "content": "Hello"}], - thinking={"type": "enabled"}, - reasoning_effort="low", -) - -response = litellm.responses( - model="bigmodel/glm-5.3", - input="Hello", - reasoning={"effort": "low"}, - store=True, -) - -async def messages(): - return await litellm.anthropic.messages.acreate( - model="bigmodel/glm-5.3", - max_tokens=1024, - messages=[{"role": "user", "content": "Hello"}], - thinking={"type": "adaptive"}, - output_config={"effort": "low"}, - ) -``` - -Each API retains its native response format and streaming events. The native Messages SDK entry point is asynchronous, as is the proxy's `/v1/messages` route - -GLM-5.3, GLM-5.3-Flash, and GLM-5.3-FlashX use always-on thinking. GLM-5.3 supports `low`, `high`, and `max` reasoning effort. Messages preserves native `thinking`, `output_config`, and `reasoning_effort` parameters - -Set `store=True` when creating a Responses request if you need continuation, retrieval, or deletion. Use the response ID returned by LiteLLM. BigModel documents a seven-day retention period and does not support cancel, compact, native WebSocket, or file_search - -The model catalog and packaged backup include GLM-5.3, GLM-5.3-Flash, and GLM-5.3-FlashX. Prices are expressed in USD/token using a static 7.0 CNY/USD conversion, with the source and verification date in each entry's metadata. Use existing `litellm_params` cost fields for contract-specific deployment prices - -API references: [Chat Completions](https://docs.bigmodel.cn/cn/guide/develop/openai/introduction), [Responses](https://docs.bigmodel.cn/cn/guide/develop/responses/introduction), [Messages](https://docs.bigmodel.cn/cn/guide/develop/claude/introduction), and [pricing](https://docs.bigmodel.cn/cn/guide/start/pricing), checked on 2026-10-27 diff --git a/examples/lar1_ollama_config.yaml b/examples/lar1_ollama_config.yaml deleted file mode 100644 index 998cbf169b3..00000000000 --- a/examples/lar1_ollama_config.yaml +++ /dev/null @@ -1,45 +0,0 @@ -model_list: - - model_name: agent-router - litellm_params: - model: ollama/qwen3.5:9b - api_base: http://127.0.0.1:11434 - model_info: - id: cloud-smart - type: cloud-smart - - - model_name: agent-router - litellm_params: - model: ollama/phi4-mini:latest - api_base: http://127.0.0.1:11434 - model_info: - id: cloud-fast - type: cloud-fast - - - model_name: agent-router - litellm_params: - model: ollama/llama3.2:3b - api_base: http://127.0.0.1:11434 - model_info: - id: local - type: local - - - model_name: agent-router - litellm_params: - model: ollama/lfm2.5-thinking:latest - api_base: http://127.0.0.1:11434 - model_info: - id: deep - type: deep - -router_settings: - routing_strategy: lar1 - routing_strategy_args: - confidence_threshold_low: 0.3 - confidence_threshold_medium: 0.5 - confidence_threshold_high: 0.7 - -general_settings: - master_key: sk-lar1-demo - -litellm_settings: - set_verbose: true diff --git a/helm/litellm/ci/postgres.yaml b/helm/litellm/ci/postgres.yaml index aa210e932b0..01472950b3b 100644 --- a/helm/litellm/ci/postgres.yaml +++ b/helm/litellm/ci/postgres.yaml @@ -1,4 +1,4 @@ -# Throwaway PostgreSQL for the CircleCI helm_chart_testing job. Applied with +# Throwaway PostgreSQL for the local chart smoke test. Applied with # kubectl before `helm install`; the chart itself ships no database. apiVersion: v1 kind: Secret diff --git a/helm/litellm/ci/test-values.yaml b/helm/litellm/ci/test-values.yaml index 40c68489ed3..850dd48ee63 100644 --- a/helm/litellm/ci/test-values.yaml +++ b/helm/litellm/ci/test-values.yaml @@ -1,4 +1,4 @@ -# Values for the CircleCI helm_chart_testing job: a monolith install on a +# Values for the local chart smoke test: a monolith install on a # kind cluster from the image built by the pipeline (image.repository / tag / # pullPolicy are passed with --set), backed by the throwaway PostgreSQL in # ci/postgres.yaml so the migrations Job and the proxy have a database. diff --git a/litellm-rust/Cargo.lock b/litellm-rust/Cargo.lock index ed658e074ee..2cdc9ee91c8 100644 --- a/litellm-rust/Cargo.lock +++ b/litellm-rust/Cargo.lock @@ -4013,6 +4013,7 @@ dependencies = [ "litellm-coroutine", "litellm-secret-value", "rstest", + "serde", "serde_json", "thiserror 2.0.19", "tokio", @@ -4155,9 +4156,12 @@ name = "litellm-inference-messages" version = "0.1.0" dependencies = [ "bytes", + "flate2", "futures-util", + "http 1.4.2", "litellm-auth", "litellm-auth-aws", + "litellm-cache", "litellm-cache-memory", "litellm-cache-response", "litellm-core-utils", @@ -4178,6 +4182,7 @@ dependencies = [ "rstest", "serde", "serde_json", + "thiserror 2.0.19", "tokio", "tracing", "wiremock", @@ -4292,6 +4297,7 @@ dependencies = [ "base64 0.22.1", "bytes", "data-url", + "fancy-regex 0.19.2", "futures-util", "litellm-auth", "litellm-auth-aws", @@ -4307,6 +4313,7 @@ dependencies = [ "litellm-router-types", "litellm-secret-value", "litellm-secrets", + "litellm-tracing", "reqwest", "rstest", "serde", diff --git a/litellm-rust/crates/cache-response/src/service.rs b/litellm-rust/crates/cache-response/src/service.rs index 0bdf948ec48..ed4dccdc355 100644 --- a/litellm-rust/crates/cache-response/src/service.rs +++ b/litellm-rust/crates/cache-response/src/service.rs @@ -27,6 +27,10 @@ impl Default for ResponseCacheConfig { pub trait ResponseCacheService: Send + Sync { fn config(&self) -> &ResponseCacheConfig; + fn keyed_by_caller(&self) -> bool { + false + } + fn lookup<'a>( &'a self, request: &'a ResponseCacheRequest, diff --git a/litellm-rust/crates/callbacks-legacy-python/python_contract.json b/litellm-rust/crates/callbacks-legacy-python/python_contract.json index 8a212223523..a96e9f04bdc 100644 --- a/litellm-rust/crates/callbacks-legacy-python/python_contract.json +++ b/litellm-rust/crates/callbacks-legacy-python/python_contract.json @@ -11,7 +11,8 @@ "logger", "kwargs", "start_time", - "end_time" + "end_time", + "cache_hit" ], "update_logging": [ "logger", @@ -41,13 +42,24 @@ "logger", "status", "headers", - "body" + "body", + "sent" + ], + "retried_request": [ + "logger", + "logged_body", + "body", + "reasons" ], "record_api_window": [ "logger", "start", "end" ], + "times_provider_exchange": [ + "client", + "timeout" + ], "defers_async_logging": [ "logger" ], @@ -89,6 +101,12 @@ "start", "end" ], + "cache_hit_success": [ + "logger", + "response", + "start", + "end" + ], "enqueue_logging": [ "coroutine" ], @@ -113,14 +131,16 @@ ], "stream_opened": [ "logger", - "head" + "head", + "keeps_requested" ], "stamp_stream_head": [ "head", "logger", "kwargs", "start_time", - "end_time" + "end_time", + "cache_hit" ], "stream_success": [ "logger", diff --git a/litellm-rust/crates/callbacks-legacy-python/src/adapter.rs b/litellm-rust/crates/callbacks-legacy-python/src/adapter.rs index f68541c5c7b..71ca89b0790 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/adapter.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/adapter.rs @@ -6,10 +6,10 @@ use crate::LoggingOperation; use litellm_host_python::PythonOwned; use litellm_host::{ - interceptors::{RawResponse, RequestContext, WireRequest}, + interceptors::{RawResponse, RequestContext, RetriedRequest, RetryReason, WireRequest}, lifecycle::{FailureOrigin, Timing, epoch_seconds}, }; -use litellm_host_python::{Error as HostError, HookStep, from_py, to_py}; +use litellm_host_python::{Error as HostError, HookStep, from_py, json_from_py, json_to_py, to_py}; use pyo3::{ exceptions::{PyBaseException, PyException}, gc::{PyTraverseError, PyVisit}, @@ -19,7 +19,7 @@ use pyo3::{ use serde_json::Value; use crate::{ - DeploymentHooks, LegacyCallbacks, PublicCall, PythonLogger, + DeploymentHooks, LegacyCallbacks, PublicCall, PythonLogger, SentRequest, deferred::{PendingLogging, PendingSuccess}, finalize, is_internal_call, python::{Logging, Streaming}, @@ -41,6 +41,7 @@ struct DeliveredStream { struct LoggedRequest { body: Py, headers: Py, + url: String, context: RequestContext, } @@ -59,6 +60,16 @@ pub struct LegacyLogging { cache_key: Option, /// When the provider request went out, until its window is recorded (Messages only). api_started: Option, + host_answered: bool, +} + +fn retry_reason(reason: &RetryReason) -> Value { + match reason { + RetryReason::ThinkingSignature => serde_json::json!({"kind": "thinking_signature"}), + RetryReason::StrictTools { dropped } => { + serde_json::json!({"kind": "strict_tools", "dropped": dropped}) + } + } } fn datetime(py: Python<'_>, epoch_seconds: f64) -> PyResult> { @@ -90,6 +101,7 @@ impl LegacyLogging { internal: false, cache_key: None, api_started: None, + host_answered: false, } } @@ -171,6 +183,14 @@ impl LegacyLogging { Ok(context) } + fn times_provider_exchange(&self, py: Python<'_>) -> PyResult { + let client = self.call.lookup(py, "client")?; + let timeout = self.call.lookup(py, "timeout")?; + Logging::TimesProviderExchange + .call(py, (client, timeout))? + .extract() + } + /// Python times the provider exchange inside the async `AsyncHTTPHandler.post`; its sync /// client is untimed. fn close_api_window(&mut self, py: Python<'_>, end: f64) -> PyResult<()> { @@ -264,6 +284,7 @@ impl LegacyLogging { self.call.kwargs(), &self.start, &self.end, + self.messages_cache_hit(), )?; self.response .as_ref() @@ -271,6 +292,60 @@ impl LegacyLogging { .ok_or_else(|| HostError::MissingState.into()) } + fn messages_cache_hit(&self) -> bool { + self.operation == LoggingOperation::Messages && self.cache_key.is_some() + } + + fn flag_unsent_messages_call(&self, py: Python<'_>) -> PyResult<()> { + if self.operation != LoggingOperation::Messages + || self.request.is_some() + || self.cache_key.is_some() + || self.host_answered + { + return Ok(()); + } + let details = self.logger()?.object(py).getattr("model_call_details")?; + details + .call_method1("setdefault", ("litellm_params", PyDict::new(py)))? + .set_item("aanthropic_messages", self.asynchronous) + } + + fn unstreamed_stream_request(&self, py: Python<'_>) -> PyResult { + if self.operation != LoggingOperation::Messages + || self.stream.is_some() + || self.messages_cache_hit() + { + return Ok(false); + } + let Some(stream) = self.call.kwargs().bind(py).get_item("stream")? else { + return Ok(false); + }; + if !stream.is_exact_instance_of::() || !stream.is_truthy()? { + return Ok(false); + } + let logger = self.logger()?.object(py); + logger.setattr("stream", true)?; + logger + .getattr("model_call_details")? + .set_item("stream", true)?; + Ok(true) + } + + fn dispatch_cache_hit(&self, py: Python<'_>) -> PyResult<()> { + let logger = self.logger()?; + let logged = Logging::CacheHitSuccess.call( + py, + (logger.object(py), &self.response, &self.start, &self.end), + ); + match logged { + Err(error) if error.is_instance_of::(py) => { + error.write_unraisable(py, Some(logger.object(py))); + Ok(()) + } + result => result.map(|_| ()), + } + } + fn dispatch_success(&self, py: Python<'_>) -> PyResult<()> { match self.try_dispatch_success(py) { Err(error) if error.is_instance_of::(py) => { @@ -489,6 +564,10 @@ impl LegacyLogging { self.logger = Some(result.logger()?); self.call.set_kwargs(result.kwargs()?); if self.runs_deployment_hooks() { + self.call + .kwargs() + .bind(py) + .set_item("litellm_logging_obj", self.logger()?.object(py))?; return Ok(HookStep::Await( DeploymentHooks::before_call(py, self.call.kwargs(), self.call_type())?, Self::resume_begin, @@ -512,9 +591,13 @@ impl LegacyLogging { context, self.logged_request_params(context).as_ref(), )?; - let body = to_py(py, &wire.body)? - .into_bound(py) - .cast_into::()?; + let lossless = self.operation == LoggingOperation::Messages; + let body = if lossless { + json_to_py(py, &wire.body)? + } else { + to_py(py, &wire.body)?.into_bound(py) + } + .cast_into::()?; for (name, sent) in wire.body.as_object().into_iter().flatten() { if let Some(value) = self.caller_value(py, name, sent)? { body.set_item(name, value)?; @@ -534,6 +617,7 @@ impl LegacyLogging { self.request = Some(LoggedRequest { body: body.clone().unbind(), headers: headers.clone().unbind(), + url: wire.url.clone(), context: context.clone(), }); let input = self.logged_input(py, &body)?; @@ -545,7 +629,10 @@ impl LegacyLogging { &headers, &wire.url, )?; - if self.operation == LoggingOperation::Messages && self.asynchronous { + if self.operation == LoggingOperation::Messages + && self.asynchronous + && self.times_provider_exchange(py)? + { self.api_started = Some(epoch_seconds()); } let headers = headers @@ -553,7 +640,11 @@ impl LegacyLogging { .map(|(name, value)| Ok((name.extract::()?, value.extract::()?))) .collect::>>()?; Ok(HookStep::Ready(Box::new(WireRequest { - body: from_py(&body)?, + body: if lossless { + json_from_py(body.as_any())? + } else { + from_py(&body)? + }, headers, ..*wire }))) @@ -567,7 +658,11 @@ impl LegacyLogging { ) -> PyResult>> { self.end = Some(datetime(py, timing.end_time)?); self.response = Some(response); - if self.runs_deployment_hooks() { + self.flag_unsent_messages_call(py)?; + if self.unstreamed_stream_request(py)? { + return self.finalize(py); + } + if self.runs_deployment_hooks() && !self.messages_cache_hit() { return Ok(HookStep::Await( DeploymentHooks::after_success( py, @@ -588,7 +683,21 @@ impl LegacyLogging { ) -> PyResult> { use litellm_host::interceptors::{Cost, ResultSource}; + self.cache_key = match &facts.source { + ResultSource::Provider => None, + ResultSource::Cache { key } => Some(key.clone()), + ResultSource::Host => { + self.host_answered = true; + return Ok(HookStep::Ready(())); + } + }; let logger = self.logger()?.object(py); + if self.messages_cache_hit() { + logger + .getattr("model_call_details")? + .set_item("cache_hit", true)?; + return Ok(HookStep::Ready(())); + } let params = logger .getattr("litellm_params")? .cast_into::()? @@ -616,10 +725,6 @@ impl LegacyLogging { }; logger.setattr("_provider_reported_cost", reported_cost)?; details.call_method1("pop", ("response_cost", py.None()))?; - self.cache_key = match &facts.source { - ResultSource::Provider => None, - ResultSource::Cache { key } => Some(key.clone()), - }; if self.cache_key.is_some() { details.set_item("cache_hit", true)?; } else { @@ -644,8 +749,13 @@ impl LegacyLogging { // response, and logging replays it through `AnthropicConfig.transform_response`. self.close_api_window(py, epoch_seconds())?; if let Some(head) = &raw.head { + let sent = self.request.as_ref().map(|request| SentRequest { + url: &request.url, + headers: &request.headers, + body: &request.body, + }); self.logger()? - .record_response(py, head.status, &head.headers, &raw.body)?; + .record_response(py, head.status, &head.headers, &raw.body, sent)?; } return Ok(HookStep::Ready(())); } @@ -664,6 +774,40 @@ impl LegacyLogging { Ok(HookStep::Ready(())) } + pub(crate) fn request_retried( + &mut self, + py: Python<'_>, + retry: &RetriedRequest, + ) -> PyResult> { + let Some(request) = &self.request else { + return Ok(HookStep::Ready(())); + }; + let reasons: Vec = retry.reasons.iter().map(retry_reason).collect(); + let retried = Logging::RetriedRequest.call( + py, + ( + self.logger()?.object(py), + request.body.bind(py), + to_py(py, &retry.body)?, + to_py(py, &reasons)?, + ), + )?; + let now = epoch_seconds(); + if self.api_started.is_some() { + self.close_api_window(py, now)?; + self.api_started = Some(now); + } + Ok(HookStep::Await(retried.unbind(), Self::resume_retried)) + } + + fn resume_retried( + &mut self, + _py: Python<'_>, + result: PyResult>, + ) -> PyResult> { + result.map(|_| HookStep::Ready(())) + } + pub(crate) fn succeeded( &mut self, py: Python<'_>, @@ -674,6 +818,8 @@ impl LegacyLogging { self.response = Some(response.clone_ref(py)); match &self.stream { Some(stream) => self.stream_success(py, stream, false)?, + None if self.messages_cache_hit() => self.dispatch_cache_hit(py)?, + None if self.unstreamed_stream_request(py)? => {} None => self.dispatch_success(py)?, } Ok(HookStep::Ready(())) @@ -708,7 +854,11 @@ impl LegacyLogging { if self.stream_billing().is_none() { return Err(HostError::MissingState.into()); } - if let Some(key) = &self.cache_key { + if let Some(key) = self + .cache_key + .as_ref() + .filter(|_| !self.messages_cache_hit()) + { head.bind(py).set_item("cache_key", key)?; head.bind(py).set_item("cache_hit", true)?; } @@ -723,10 +873,18 @@ impl LegacyLogging { self.call.kwargs(), &self.start, datetime(py, epoch_seconds())?, + self.messages_cache_hit(), ), )?; } - Streaming::Opened.call(py, (self.logger()?.object(py), head.bind(py)))?; + Streaming::Opened.call( + py, + ( + self.logger()?.object(py), + head.bind(py), + self.operation == LoggingOperation::Messages, + ), + )?; self.stream = Some(DeliveredStream { chunks: PyList::empty(py).unbind(), first_chunk: None, @@ -747,7 +905,7 @@ impl LegacyLogging { // A caller that goes away mid-stream cancels the call before it ends: Python's Messages // stream iterator still bills the chunks it read, straight away rather than deferred. fn bill_abandoned_stream(&mut self, py: Python<'_>) -> PyResult<()> { - if !self.asynchronous || self.end.is_some() { + if !self.asynchronous || self.end.is_some() || self.messages_cache_hit() { return Ok(()); } let Some(stream) = self.stream.take() else { @@ -918,6 +1076,24 @@ if asynchronous: }); } + #[rstest::rstest] + fn the_deployment_pre_call_hook_receives_the_logger_as_client_injects_it() { + Python::initialize(); + Python::attach(|py| { + let locals = namespace( + py, + c" +kwargs = {'logger': logger} +logger.hooks['pre'] = lambda value: seen.append(value.get('litellm_logging_obj')) or 'awaitable' +seen = [] +", + ); + let (_, step) = begin(py, &locals, true); + assert!(awaits_deployment_hook(&step)); + run(py, &locals, c"assert seen == [logger]"); + }); + } + #[rstest::rstest] fn kwargs_returned_by_the_pre_call_hook_are_what_the_call_prepares() { Python::initialize(); @@ -1038,6 +1214,82 @@ assert finalized is replacement }); } + #[rstest] + #[case::unary(false)] + #[case::stream(true)] + fn a_host_answer_keeps_the_logger_as_set_up_and_a_streamed_one_is_finalized_unstreamed( + #[case] stream: bool, + ) { + use litellm_host::interceptors::{Cost, ExecutionFacts, ProviderIdentity, ResultSource}; + + Python::initialize(); + Python::attach(|py| { + let locals = namespace( + py, + c" +kwargs = {'logger': logger} +response = object() +logger.hooks = {'pre': lambda kwargs: kwargs} +", + ); + local(&locals, "kwargs").set_item("stream", stream).unwrap(); + let (mut logging, step) = begin(py, &locals, true); + logging.operation = crate::LoggingOperation::Messages; + resume( + &mut logging, + step, + py, + Ok(local(&locals, "kwargs").unbind()), + ) + .unwrap(); + let facts = ExecutionFacts { + provider: ProviderIdentity { + model: "claude-sonnet-4-5".into(), + provider: "anthropic".into(), + }, + cost: Cost::Deferred, + source: ResultSource::Host, + }; + assert!(matches!( + logging.result_ready(py, &facts).unwrap(), + HookStep::Ready(()) + )); + let response = local(&locals, "response").unbind(); + let step = logging + .transform_response(py, response.clone_ref(py), TIMING) + .unwrap(); + assert_eq!(awaits_deployment_hook(&step), !stream); + if !stream { + return; + } + let HookStep::Ready(returned) = step else { + panic!("a host-answered stream is returned as is"); + }; + assert!(returned.bind(py).is(response.bind(py))); + logging + .on_event( + py, + PythonCallEvent::Succeeded { + timing: TIMING, + response: &response, + }, + ) + .unwrap(); + run( + py, + &locals, + c" +names = logger.names() +assert ('finalize', response) in logger.calls, names +assert 'update_logging' not in names, names +assert not [name for name in names if 'success' in name], names +assert logger.stream is True +assert logger.model_call_details['stream'] is True +", + ); + }); + } + #[rstest] #[case::pre_call(false)] #[case::post_call(true)] @@ -1129,7 +1381,9 @@ mod payload_tests { use std::ffi::CStr; use litellm_host::hooks::CallHooks; - use litellm_host::interceptors::{RawResponse, RequestContext, WireRequest}; + use litellm_host::interceptors::{ + RawResponse, RequestContext, RetriedRequest, RetryReason, WireRequest, + }; use litellm_host::lifecycle::ExecutionEvent; use litellm_host_python::{HookStep, PythonCallEvent, PythonOwned, to_py}; use litellm_secret_value::SecretValue; @@ -1296,6 +1550,61 @@ assert ('custom_llm_provider' in logger.update['litellm_params']) is in_params, json!({"type": "document_url", "document_url": source}) } + #[test] + fn a_retried_request_hands_the_logged_body_the_retried_body_and_the_reasons_to_logging() { + Python::initialize(); + Python::attach(|py| { + let locals = namespace(py, PAYLOAD_LOGGER); + let mut logging = LegacyLogging { + logger: Some(PythonLogger::new(local(&locals, "logger").unbind())), + ..legacy_call(py, &locals, false) + }; + let context = RequestContext { + model: "model".into(), + custom_llm_provider: "provider".into(), + optional_params: json!({}), + secret_fields: Vec::new(), + api_key: None, + }; + let wire = WireRequest { + url: "https://provider.invalid/v1/messages".into(), + headers: Vec::new(), + body: json!({"messages": [{"role": "user", "content": "hi"}], "thinking": {"type": "enabled"}}), + }; + logging + .before_provider_request(py, Box::new(wire.clone()), &context) + .unwrap(); + let retried = RetriedRequest { + reasons: vec![ + RetryReason::ThinkingSignature, + RetryReason::StrictTools { dropped: 2 }, + ], + body: json!({"messages": [{"role": "user", "content": "hi"}]}), + }; + + let step = logging + .on_event( + py, + PythonCallEvent::Execution(ExecutionEvent::ProviderRequestRetried { + retry: retried, + }), + ) + .unwrap(); + + assert!(matches!(step, HookStep::Await(_, _))); + run( + py, + &locals, + c" +[(logged, body, reasons)] = [value for name, value in logger.calls if name == 'retried_request'] +assert logged is logger.pre['complete_input_dict'], logged +assert body == {'messages': [{'role': 'user', 'content': 'hi'}]}, body +assert reasons == [{'kind': 'thinking_signature'}, {'kind': 'strict_tools', 'dropped': 2}], reasons +", + ); + }); + } + fn before_provider_request(script: &CStr, body: Value) -> WireRequest { before_send_with_secrets(script, json!({}), body, &[]) } @@ -2018,6 +2327,53 @@ mod terminal_tests { .unwrap() } + #[rstest] + #[case::requested_stream( + c"kwargs = {'logger': logger, 'stream': True}", + true, + &["finalize"] + )] + #[case::unstreamed(c"kwargs = {'logger': logger, 'stream': False}", false, &["success_hook"])] + #[case::stream_flag_not_true(c"kwargs = {'logger': logger, 'stream': 'true'}", false, &["success_hook"])] + fn a_whole_messages_result_for_a_requested_stream_is_finalized_without_success_logging( + #[case] script: &CStr, + #[case] handed_back: bool, + #[case] expected: &[&str], + ) { + Python::initialize(); + Python::attach(|py| { + let locals = namespace(py, c"response = object()"); + run(py, &locals, script); + let mut logging = LegacyLogging { + operation: crate::LoggingOperation::Messages, + ..logged(py, &locals, true) + }; + let step = logging + .transform_public_response(py, local(&locals, "response").unbind(), TIMING) + .unwrap(); + assert_eq!(matches!(step, HookStep::Ready(_)), handed_back); + if handed_back { + assert!(matches!( + succeed(py, &locals, &mut logging), + HookStep::Ready(()) + )); + } + let names: Vec = local(&locals, "logger") + .call_method0("names") + .unwrap() + .extract() + .unwrap(); + assert_eq!(names, expected); + if handed_back { + run( + py, + &locals, + c"assert logger.stream is True and logger.model_call_details['stream'] is True", + ); + } + }); + } + #[rstest] #[case::sync_listened(false, c"", &["submit"])] #[case::async_listened( diff --git a/litellm-rust/crates/callbacks-legacy-python/src/callbacks.rs b/litellm-rust/crates/callbacks-legacy-python/src/callbacks.rs index 093e86c43dc..9eed008910c 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/callbacks.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/callbacks.rs @@ -3,13 +3,19 @@ //! duplication. All of it expires with the legacy callback contract. use litellm_host::interceptors::{RequestContext, WireRequest}; -use litellm_host_python::to_py; +use litellm_host_python::json_to_py; use pyo3::{exceptions::PyBaseException, prelude::*, types::PyDict}; use serde_json::Value; use crate::logger::PythonLogger; use crate::python::{Logging, Wrapper}; +pub struct SentRequest<'a> { + pub url: &'a str, + pub headers: &'a Py, + pub body: &'a Py, +} + pub trait LegacyCallbacks { /// `Logging.update_from_kwargs`: what the logger is told about the request it is /// about to see, with consumed credentials redacted. @@ -41,6 +47,7 @@ pub trait LegacyCallbacks { status: u16, headers: &[(String, String)], body: &str, + request: Option>, ) -> PyResult<()>; /// Records one provider HTTP exchange's window, as Python's timed `AsyncHTTPHandler.post` @@ -117,9 +124,7 @@ impl LegacyCallbacks for PythonLogger { let redacted_kwargs = redact(py, kwargs, &secret_fields)?; let optional_params = redact( py, - &to_py(py, &context.optional_params)? - .into_bound(py) - .cast_into::()?, + &json_to_py(py, &context.optional_params)?.cast_into::()?, &secret_fields, )?; let params = PyDict::new(py); @@ -138,7 +143,7 @@ impl LegacyCallbacks for PythonLogger { } } for (name, value) in request_params.into_iter().flatten() { - params.set_item(name, to_py(py, value)?)?; + params.set_item(name, json_to_py(py, value)?)?; } Logging::Update.call( py, @@ -177,8 +182,13 @@ impl LegacyCallbacks for PythonLogger { status: u16, headers: &[(String, String)], body: &str, + request: Option>, ) -> PyResult<()> { - Logging::RecordResponse.call(py, (self.object(py), status, headers.to_vec(), body))?; + let request = request.map(|sent| (sent.url, sent.headers.bind(py), sent.body.bind(py))); + Logging::RecordResponse.call( + py, + (self.object(py), status, headers.to_vec(), body, request), + )?; Ok(()) } diff --git a/litellm-rust/crates/callbacks-legacy-python/src/lib.rs b/litellm-rust/crates/callbacks-legacy-python/src/lib.rs index f453237b469..3a8c15ae54c 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/lib.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/lib.rs @@ -17,7 +17,7 @@ mod mapping; mod python; pub use adapter::LegacyLogging; pub use call::PublicCall; -pub(crate) use callbacks::{LegacyCallbacks, is_internal_call}; +pub(crate) use callbacks::{LegacyCallbacks, SentRequest, is_internal_call}; pub(crate) use logger::{DeploymentHooks, PythonLogger, finalize, setup}; pub use mapping::{CallBoundary, CallbackMapping, Dispatch, callback_mappings}; diff --git a/litellm-rust/crates/callbacks-legacy-python/src/logger.rs b/litellm-rust/crates/callbacks-legacy-python/src/logger.rs index 38f3bf29828..3019d87a20b 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/logger.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/logger.rs @@ -77,8 +77,12 @@ pub fn finalize( kwargs: &Py, start: &Py, end: &Option>, + cache_hit: bool, ) -> PyResult<()> { - Wrapper::Finalize.call(py, (response, logger.object(py), kwargs, start, end))?; + Wrapper::Finalize.call( + py, + (response, logger.object(py), kwargs, start, end, cache_hit), + )?; Ok(()) } diff --git a/litellm-rust/crates/callbacks-legacy-python/src/mapping.rs b/litellm-rust/crates/callbacks-legacy-python/src/mapping.rs index cfa9e53aa7b..e321b93b03d 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/mapping.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/mapping.rs @@ -179,6 +179,9 @@ impl CallHooks for LegacyLogging { PythonCallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw }) => { (AFTER.invoke)(self, py, raw) } + PythonCallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) => { + self.request_retried(py, &retry) + } PythonCallEvent::Succeeded { timing, response } => { (SUCCESS.invoke)(self, py, timing, response) } diff --git a/litellm-rust/crates/callbacks-legacy-python/src/python.rs b/litellm-rust/crates/callbacks-legacy-python/src/python.rs index 5b6faa3dbc2..58ddf7c708a 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/python.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/python.rs @@ -50,6 +50,10 @@ pub(crate) enum Logging { RecordResponse, #[strum(serialize = "record_api_window")] RecordApiWindow, + #[strum(serialize = "times_provider_exchange")] + TimesProviderExchange, + #[strum(serialize = "retried_request")] + RetriedRequest, #[strum(serialize = "defers_async_logging")] DefersAsync, #[strum(serialize = "claim_async_success_log")] @@ -62,6 +66,8 @@ pub(crate) enum Logging { SubmitSuccess, #[strum(serialize = "async_success_handler")] AsyncSuccessHandler, + #[strum(serialize = "cache_hit_success")] + CacheHitSuccess, #[strum(serialize = "mark_async_success_enqueued")] MarkAsyncSuccessEnqueued, #[strum(serialize = "enqueue_logging")] diff --git a/litellm-rust/crates/callbacks-legacy-python/src/test_support.rs b/litellm-rust/crates/callbacks-legacy-python/src/test_support.rs index ee16e0c0059..5b8b2bc4f96 100644 --- a/litellm-rust/crates/callbacks-legacy-python/src/test_support.rs +++ b/litellm-rust/crates/callbacks-legacy-python/src/test_support.rs @@ -53,7 +53,7 @@ def setup(call_type, args, kwargs, start, asynchronous): FAKES = { 'setup': setup, - 'finalize': lambda response, logger, kwargs, start, end: logger.record('finalize', response), + 'finalize': lambda response, logger, kwargs, start, end, cache_hit: logger.record('finalize', response), 'update_logging': lambda logger, kwargs, model, optional_params, litellm_params, provider: logger.update_from_kwargs( kwargs=kwargs, model=model, @@ -66,12 +66,17 @@ FAKES = { 'post_call': lambda logger, original_response, api_key, additional_args: logger.post_call( original_response, api_key, additional_args ), - 'record_response': lambda logger, status, headers, body: logger.model_call_details.update( + 'record_response': lambda logger, status, headers, body, sent: logger.model_call_details.update( response_headers=dict(headers) ), + 'retried_request': lambda logger, logged_body, body, reasons: ( + logger.record('retried_request', (logged_body, body, reasons)), + 'awaitable', + )[1], 'record_api_window': lambda logger, start, end: logger.model_call_details.update( llm_api_duration_ms=(end - start) * 1000 ), + 'times_provider_exchange': lambda client, timeout: client is None, 'defers_async_logging': lambda logger: bool(getattr(logger, '_defer_async_logging', False)), 'claim_async_success_log': lambda logger: logger.claim_async_success_log(), 'defer_success': lambda logger, pending, response, start, end: ( @@ -86,6 +91,7 @@ FAKES = { )(error, ''.join(traceback.format_exception(error)), start, end), 'submit_success': lambda logger, response, start, end: logger.record('submit', (response, start, end)), 'async_success_handler': lambda logger, response, start, end: logger.async_success_handler(response, start, end), + 'cache_hit_success': lambda logger, response, start, end: logger.record('cache_hit_success', response), 'mark_async_success_enqueued': lambda logger: logger.record('mark_async_success_enqueued', None), 'enqueue_logging': lambda coroutine: coroutine.enqueue(), 'restore_context': lambda logger: logger.record('restore', None), @@ -96,8 +102,8 @@ FAKES = { 'success', response, call_type ), 'after_deployment_failure': lambda kwargs, error, call_type: kwargs['logger'].hook('failure', error, call_type), - 'stream_opened': lambda logger, head: logger.record('stream_opened', head), - 'stamp_stream_head': lambda head, logger, kwargs, start, end: logger.record('stamp_stream_head', head), + 'stream_opened': lambda logger, head, keeps_requested: logger.record('stream_opened', head), + 'stamp_stream_head': lambda head, logger, kwargs, start, end, cache_hit: logger.record('stamp_stream_head', head), 'stream_success': lambda logger, url_route, endpoint_type, request_body, chunks, start, end, first_chunk, stream_teardown: logger.record( 'stream_success', list(chunks) ), diff --git a/litellm-rust/crates/gateway-inference/tests/caching.rs b/litellm-rust/crates/gateway-inference/tests/caching.rs index 143bc1ba6db..030c8a66ee3 100644 --- a/litellm-rust/crates/gateway-inference/tests/caching.rs +++ b/litellm-rust/crates/gateway-inference/tests/caching.rs @@ -36,7 +36,12 @@ async fn all_inference_endpoints_share_native_cache( } else { "message_stop" }; - let events = format!("event: {terminal}\ndata: {{\"type\":\"{terminal}\"}}\n\n"); + let output = if is_responses { + "" + } else { + "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"hello\"}}\n\n" + }; + let events = format!("{output}event: {terminal}\ndata: {{\"type\":\"{terminal}\"}}\n\n"); let template = if stream { ResponseTemplate::new(200).set_body_raw(events.clone(), "text/event-stream") } else { diff --git a/litellm-rust/crates/host-native/src/driver.rs b/litellm-rust/crates/host-native/src/driver.rs index af3248848a2..bb1a7025e10 100644 --- a/litellm-rust/crates/host-native/src/driver.rs +++ b/litellm-rust/crates/host-native/src/driver.rs @@ -84,6 +84,13 @@ where reply.send(self.interceptors.after_provider_response(raw).await); Ok(()) } + HostRequest::Intercept(InterceptRequest::ProviderRequestRetried { + retry, + reply, + }) => { + reply.send(self.interceptors.provider_request_retried(retry).await); + Ok(()) + } HostRequest::Stream(StreamDelivery::Open(head, reply)) => { self.demand = Some(reply); return Ok(Boundary::Open(head)); diff --git a/litellm-rust/crates/host-python/Cargo.toml b/litellm-rust/crates/host-python/Cargo.toml index 0b0107d0548..1fa5fb38830 100644 --- a/litellm-rust/crates/host-python/Cargo.toml +++ b/litellm-rust/crates/host-python/Cargo.toml @@ -14,6 +14,7 @@ bytes.workspace = true futures-util.workspace = true parking_lot.workspace = true serde.workspace = true +serde_json.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["rt", "sync"] } @@ -23,4 +24,3 @@ pythonize = "0.29.0" [dev-dependencies] rstest.workspace = true -serde_json.workspace = true diff --git a/litellm-rust/crates/host-python/src/binding.rs b/litellm-rust/crates/host-python/src/binding.rs index fe6173dd100..97d6be88767 100644 --- a/litellm-rust/crates/host-python/src/binding.rs +++ b/litellm-rust/crates/host-python/src/binding.rs @@ -29,8 +29,8 @@ pub trait PythonBinding: PythonOwned { /// What the stream carries at hand-off, as the caller's stream receives it. /// The unary response after the deployment transform, before success hooks run. - fn deliver_response(&mut self, _py: Python<'_>, _response: &Bound<'_, PyAny>) -> PyResult<()> { - Ok(()) + fn deliver_response(&mut self, _py: Python<'_>, response: Py) -> PyResult> { + Ok(response) } fn encode_stream_head( diff --git a/litellm-rust/crates/host-python/src/driver.rs b/litellm-rust/crates/host-python/src/driver.rs index 052156cbc5d..ba0c174c875 100644 --- a/litellm-rust/crates/host-python/src/driver.rs +++ b/litellm-rust/crates/host-python/src/driver.rs @@ -310,6 +310,14 @@ where reply.send(Ok(())); Ok(()) } + HostRequest::Intercept(InterceptRequest::ProviderRequestRetried { retry, reply }) => { + self.notify(PythonCallEvent::Execution( + ExecutionEvent::ProviderRequestRetried { retry }, + )) + .await?; + reply.send(Ok(())); + Ok(()) + } HostRequest::Stream(StreamDelivery::Open(head, reply)) => { self.streaming = true; let head = { @@ -405,10 +413,10 @@ where }; let delivered = { let mut parts = self.parts(); - Python::attach(|py| parts.binding.deliver_response(py, response.bind(py))) + Python::attach(|py| parts.binding.deliver_response(py, response)) }; match delivered { - Ok(()) => self.succeeded(response).await, + Ok(response) => self.succeeded(response).await, Err(error) => self.failure(error, FailureOrigin::Host).await, } } diff --git a/litellm-rust/crates/host-python/src/hooks/chain/dispatch.rs b/litellm-rust/crates/host-python/src/hooks/chain/dispatch.rs index 4939995cefa..26d5a5692d2 100644 --- a/litellm-rust/crates/host-python/src/hooks/chain/dispatch.rs +++ b/litellm-rust/crates/host-python/src/hooks/chain/dispatch.rs @@ -241,6 +241,9 @@ fn retain_event(py: Python<'_>, event: PythonCallEvent<'_>) -> OwnedEvent { CallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw }) => { CallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw: raw.clone() }) } + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) => { + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) + } CallEvent::Succeeded { timing, response } => CallEvent::Succeeded { timing, response: response.clone_ref(py), @@ -280,6 +283,12 @@ fn dispatch( py, CallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw }), ), + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) => hooks.on_event( + py, + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { + retry: retry.clone(), + }), + ), CallEvent::Succeeded { timing, response } => hooks.on_event( py, CallEvent::Succeeded { diff --git a/litellm-rust/crates/host-python/src/lib.rs b/litellm-rust/crates/host-python/src/lib.rs index a9ebae427d9..1cd4d65e29e 100644 --- a/litellm-rust/crates/host-python/src/lib.rs +++ b/litellm-rust/crates/host-python/src/lib.rs @@ -31,7 +31,8 @@ pub use gil::{PythonContext, attach_blocking, release_count, release_gil}; pub use handle::{Execution, ExecutionBody, ExecutionStep, StepTypes, Suspension}; pub use hooks::{HookChain, HookResume, HookStep, PythonCallEvent, PythonCallHooks, PythonRuntime}; pub use marshal::{ - Pythonized, from_py, from_py_argument, json_loads, json_object_field, panic_to_pyerr, to_py, + Pythonized, from_py, from_py_argument, json_from_py, json_loads, json_object_field, json_to_py, + panic_to_pyerr, to_py, }; pub use owned::PythonOwned; pub use runtime::{ diff --git a/litellm-rust/crates/host-python/src/marshal.rs b/litellm-rust/crates/host-python/src/marshal.rs index 465521cf9d2..a6468d38d83 100644 --- a/litellm-rust/crates/host-python/src/marshal.rs +++ b/litellm-rust/crates/host-python/src/marshal.rs @@ -4,9 +4,10 @@ use std::panic::{AssertUnwindSafe, catch_unwind}; use pyo3::exceptions::PyValueError; use pyo3::panic::PanicException; use pyo3::prelude::*; -use pyo3::types::PyBytes; +use pyo3::types::{PyBool, PyBytes, PyDict, PyFloat, PyInt, PyList, PyString, PyTuple}; use serde::Serialize; use serde::de::DeserializeOwned; +use serde_json::{Map, Number, Value}; /// Converts a `#[pyo3(from_py_with = ...)]` argument, reporting failures as `ValueError` /// so a bad argument reads as a bad argument rather than as whatever the conversion hit. @@ -71,6 +72,119 @@ pub fn panic_to_pyerr(payload: Box) -> PyErr { PanicException::new_err(message.to_string()) } +pub fn json_from_py(value: &Bound<'_, PyAny>) -> PyResult { + if value.is_none() { + return Ok(Value::Null); + } + if let Ok(flag) = value.cast::() { + return Ok(Value::Bool(flag.is_true())); + } + if let Ok(int) = value.cast::() { + if let Ok(number) = int.extract::() { + return Ok(Value::from(number)); + } + if let Ok(number) = int.extract::() { + return Ok(Value::from(number)); + } + return raw_leaf(value); + } + if let Ok(float) = value.cast::() { + return match Number::from_f64(float.value()) { + Some(number) => Ok(Value::Number(number)), + None => raw_leaf(value), + }; + } + if let Ok(text) = value.cast::() { + return json_string(text); + } + if let Ok(dict) = value.cast::() { + if !dict + .keys() + .iter() + .all(|key| key.is_instance_of::()) + { + return from_py(value); + } + return dict + .iter() + .map(|(key, item)| Ok((json_key(key.cast::()?)?, json_from_py(&item)?))) + .collect::>>() + .map(Value::Object); + } + if let Ok(list) = value.cast::() { + return list + .iter() + .map(|item| json_from_py(&item)) + .collect::>() + .map(Value::Array); + } + if let Ok(tuple) = value.cast::() { + return tuple + .iter() + .map(|item| json_from_py(&item)) + .collect::>() + .map(Value::Array); + } + from_py(value) +} + +pub fn json_to_py<'py>(py: Python<'py>, value: &Value) -> PyResult> { + Ok(match value { + Value::Null => py.None().into_bound(py), + Value::Bool(flag) => PyBool::new(py, *flag).to_owned().into_any(), + Value::Number(number) => match (number.as_i64(), number.as_u64()) { + (Some(int), _) => int.into_pyobject(py)?.into_any(), + (None, Some(int)) => int.into_pyobject(py)?.into_any(), + (None, None) => PyFloat::new(py, number.as_f64().unwrap_or(f64::NAN)).into_any(), + }, + Value::String(text) => match litellm_host::raw_json::decode(text) { + Some(raw) => py.import("json")?.call_method1("loads", (raw,))?, + None => PyString::new(py, text).into_any(), + }, + Value::Array(items) => PyList::new( + py, + items + .iter() + .map(|item| json_to_py(py, item)) + .collect::>>()?, + )? + .into_any(), + Value::Object(fields) => { + let dict = PyDict::new(py); + for (key, item) in fields { + dict.set_item( + json_to_py(py, &Value::String(key.clone()))?, + json_to_py(py, item)?, + )?; + } + dict.into_any() + } + }) +} + +fn json_key(text: &Bound<'_, PyString>) -> PyResult { + match json_string(text)? { + Value::String(key) => Ok(key), + _ => unreachable!("a Python str converts to a JSON string"), + } +} + +fn json_string(text: &Bound<'_, PyString>) -> PyResult { + match text.to_str() { + Ok(text) if !litellm_host::raw_json::is_marked(text) => Ok(Value::String(text.to_owned())), + _ => raw_leaf(text.as_any()), + } +} + +fn raw_leaf(value: &Bound<'_, PyAny>) -> PyResult { + let raw: String = value + .py() + .import("json")? + .call_method1("dumps", (value,))? + .extract()?; + Ok(Value::String(litellm_host::raw_json::encode(&raw))) +} + #[cfg(test)] mod tests { use serde::Serializer; @@ -131,6 +245,72 @@ mod tests { }); } + #[rstest::rstest] + #[case::plain( + c"{'a': [1, 2.5, None, True, 'x'], 'b': (1,)}", + r#"{"a":[1,2.5,null,true,"x"],"b":[1]}"# + )] + #[case::nan(c"{'t': float('nan')}", r#"{"t":NaN}"#)] + #[case::infinities(c"[float('inf'), -float('inf')]", "[Infinity,-Infinity]")] + #[case::wide_integers( + c"[2**64, -(2**70), 2**64 - 1, -(2**63)]", + "[18446744073709551616,-1180591620717411303424,18446744073709551615,-9223372036854775808]" + )] + #[case::lone_surrogates(c"{'k\\udc00': 'a\\ud800b \\u00e9'}", r#"{"k\udc00":"a\ud800b é"}"#)] + #[case::marked_text(c"['\\uf8fflitellm-raw-json:1']", r#"["litellm-raw-json:1"]"#)] + fn json_values_keep_what_serde_json_cannot_hold( + #[case] source: &std::ffi::CStr, + #[case] wire: &str, + ) { + crate::initialize_python(); + Python::attach(|py| { + let value = py.eval(source, None, None).unwrap(); + let converted = json_from_py(&value).unwrap(); + let json = py.import("json").unwrap(); + let loads = |text: &str| json.call_method1("loads", (text,)).unwrap(); + let wire_bytes = litellm_host::raw_json::to_vec(&converted).unwrap(); + assert!( + loads(std::str::from_utf8(&wire_bytes).unwrap()) + .eq(loads(wire)) + .unwrap() + || wire.contains("NaN") + ); + assert_eq!( + json.call_method1("dumps", (loads(std::str::from_utf8(&wire_bytes).unwrap()),)) + .unwrap() + .extract::() + .unwrap(), + json.call_method1("dumps", (loads(wire),)) + .unwrap() + .extract::() + .unwrap() + ); + let back = json_to_py(py, &converted).unwrap(); + assert_eq!( + json.call_method1("dumps", (back,)) + .unwrap() + .extract::() + .unwrap(), + json.call_method1("dumps", (loads(wire),)) + .unwrap() + .extract::() + .unwrap() + ); + }); + } + + #[test] + fn values_json_cannot_hold_keep_their_old_conversion() { + crate::initialize_python(); + Python::attach(|py| { + let value = py.eval(c"{1: 'a'}", None, None).unwrap(); + assert_eq!( + json_from_py(&value).unwrap_err().to_string(), + from_py::(&value).unwrap_err().to_string() + ); + }); + } + #[test] fn depythonize_preserves_python_exception_identity_and_traceback() { crate::initialize_python(); diff --git a/litellm-rust/crates/host-python/tests/support/mod.rs b/litellm-rust/crates/host-python/tests/support/mod.rs index 15e864c0718..f4f0903cc45 100644 --- a/litellm-rust/crates/host-python/tests/support/mod.rs +++ b/litellm-rust/crates/host-python/tests/support/mod.rs @@ -422,6 +422,9 @@ impl CallHooks for SyntheticHooks { PythonCallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw }) => { format!("response:{}", raw.body) } + PythonCallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) => { + format!("retried:{}", retry.body) + } PythonCallEvent::Succeeded { response, .. } => { format!("succeeded:{}", response.bind(py)) } diff --git a/litellm-rust/crates/host/Cargo.toml b/litellm-rust/crates/host/Cargo.toml index e0ccab4e0ad..2c113bc644c 100644 --- a/litellm-rust/crates/host/Cargo.toml +++ b/litellm-rust/crates/host/Cargo.toml @@ -9,6 +9,7 @@ repository.workspace = true litellm-secret-value.workspace = true futures-util.workspace = true litellm-coroutine.workspace = true +serde.workspace = true serde_json.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["sync"] } diff --git a/litellm-rust/crates/host/src/interceptors.rs b/litellm-rust/crates/host/src/interceptors.rs index 9398ea4bad6..8146448cd98 100644 --- a/litellm-rust/crates/host/src/interceptors.rs +++ b/litellm-rust/crates/host/src/interceptors.rs @@ -10,6 +10,18 @@ pub struct WireRequest { pub body: Value, } +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum RetryReason { + ThinkingSignature, + StrictTools { dropped: usize }, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct RetriedRequest { + pub reasons: Vec, + pub body: Value, +} + /// What the route knows about the request it is sending, for a host that logs it. The /// route owns these facts; a host reads them beside the wire request and never rewrites /// them. @@ -62,6 +74,7 @@ pub struct ProviderIdentity { pub enum ResultSource { Provider, Cache { key: String }, + Host, } /// What the call cost, settled once by the route. A host records it; it never re-derives it. @@ -79,6 +92,7 @@ impl Cost { pub fn settle(source: &ResultSource, reported: Option) -> Self { match (source, reported) { (ResultSource::Cache { .. }, _) => Self::CacheHit, + (ResultSource::Host, _) => Self::Deferred, (ResultSource::Provider, Some(amount)) => Self::Reported { amount }, (ResultSource::Provider, None) => Self::Deferred, } @@ -107,6 +121,13 @@ pub trait Interceptors: Send + Sync { &self, raw: RawResponse, ) -> impl Future> + Send; + + fn provider_request_retried( + &self, + _retry: RetriedRequest, + ) -> impl Future> + Send { + async { Ok(()) } + } } impl + ?Sized> Interceptors for &T { @@ -128,6 +149,13 @@ impl + ?Sized> Interceptors for &T { ) -> impl Future> + Send { (**self).after_provider_response(raw) } + + fn provider_request_retried( + &self, + retry: RetriedRequest, + ) -> impl Future> + Send { + (**self).provider_request_retried(retry) + } } impl Interceptors for () { diff --git a/litellm-rust/crates/host/src/lib.rs b/litellm-rust/crates/host/src/lib.rs index 76fce582fb3..26c53c89f97 100644 --- a/litellm-rust/crates/host/src/lib.rs +++ b/litellm-rust/crates/host/src/lib.rs @@ -13,3 +13,4 @@ pub mod lifecycle; pub mod machine; pub mod observation; pub mod protocol; +pub mod raw_json; diff --git a/litellm-rust/crates/host/src/lifecycle.rs b/litellm-rust/crates/host/src/lifecycle.rs index e6b31381494..16456ea52d0 100644 --- a/litellm-rust/crates/host/src/lifecycle.rs +++ b/litellm-rust/crates/host/src/lifecycle.rs @@ -6,7 +6,10 @@ use std::{ use futures_util::TryStreamExt; -use crate::{call::CallOutput, interceptors::RawResponse}; +use crate::{ + call::CallOutput, + interceptors::{RawResponse, RetriedRequest}, +}; /// Seconds since the Unix epoch, on one clock for every host. pub fn epoch_seconds() -> f64 { @@ -50,7 +53,7 @@ pub enum CallEvent { }, } -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq)] pub enum ExecutionEvent { ResultReady { facts: crate::interceptors::ExecutionFacts, @@ -58,6 +61,9 @@ pub enum ExecutionEvent { ProviderResponseReceived { raw: Raw, }, + ProviderRequestRetried { + retry: RetriedRequest, + }, } impl> CallEvent { @@ -76,6 +82,11 @@ impl> CallEvent { + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { + retry: retry.clone(), + }) + } Self::Succeeded { timing, .. } => CallEvent::Succeeded { timing: *timing, response: (), diff --git a/litellm-rust/crates/host/src/machine/context.rs b/litellm-rust/crates/host/src/machine/context.rs index 1e53605ed7b..dacb470e97f 100644 --- a/litellm-rust/crates/host/src/machine/context.rs +++ b/litellm-rust/crates/host/src/machine/context.rs @@ -5,7 +5,7 @@ use litellm_coroutine::Co; use super::coroutine::MachineFault; use crate::{ - interceptors::{RawResponse, RequestContext, WireRequest}, + interceptors::{RawResponse, RequestContext, RetriedRequest, WireRequest}, protocol::{HostRequest, InterceptRequest, Protocol, Reply, StreamDelivery}, }; @@ -119,6 +119,14 @@ where }) .await? } + + async fn provider_request_retried(&self, retry: RetriedRequest) -> Result<(), P::Error> { + self.0 + .request_reply(|reply| { + HostRequest::Intercept(InterceptRequest::ProviderRequestRetried { retry, reply }) + }) + .await? + } } pub struct StreamSender(Channel

); diff --git a/litellm-rust/crates/host/src/protocol.rs b/litellm-rust/crates/host/src/protocol.rs index c24557b0348..5ec566b6a65 100644 --- a/litellm-rust/crates/host/src/protocol.rs +++ b/litellm-rust/crates/host/src/protocol.rs @@ -2,7 +2,7 @@ use std::ops::ControlFlow; pub use litellm_coroutine::{Abandoned, Answer, Reply, reply}; -use crate::interceptors::{RawResponse, RequestContext, WireRequest}; +use crate::interceptors::{RawResponse, RequestContext, RetriedRequest, WireRequest}; pub trait Protocol: Send + Sync + 'static { type Request: Send + 'static; @@ -33,6 +33,10 @@ pub enum InterceptRequest { raw: RawResponse, reply: Reply>, }, + ProviderRequestRetried { + retry: RetriedRequest, + reply: Reply>, + }, } pub enum StreamDelivery { diff --git a/litellm-rust/crates/host/src/raw_json.rs b/litellm-rust/crates/host/src/raw_json.rs new file mode 100644 index 00000000000..fbf9bbc6ecb --- /dev/null +++ b/litellm-rust/crates/host/src/raw_json.rs @@ -0,0 +1,362 @@ +use std::{borrow::Cow, io}; + +use serde::Serialize; +use serde_json::ser::{CharEscape, CompactFormatter, Formatter}; + +const MARK: char = '\u{F8FF}'; +const PREFIX: &str = "\u{F8FF}litellm-raw-json:"; + +pub fn encode(raw: &str) -> String { + format!("{PREFIX}{raw}") +} + +pub fn decode(text: &str) -> Option<&str> { + text.strip_prefix(PREFIX).filter(|raw| is_scalar(raw)) +} + +pub fn is_marked(text: &str) -> bool { + text.starts_with(PREFIX) +} + +pub fn to_vec(value: &T) -> serde_json::Result> { + let mut out = Vec::with_capacity(128); + let mut serializer = serde_json::Serializer::with_formatter(&mut out, RawLeaves::default()); + value.serialize(&mut serializer)?; + Ok(out) +} + +pub fn mark_wide_numbers(text: &str) -> Cow<'_, str> { + let bytes = text.as_bytes(); + let mut out = String::new(); + let mut copied = 0; + let mut index = 0; + while index < bytes.len() { + match bytes[index] { + b'"' => { + let end = string_end(bytes, index + 1); + if let Some(escaped) = escaped_marked_string(&text[index..end]) { + out.push_str(&text[copied..index]); + out.push_str(&escaped); + copied = end; + } + index = end; + } + b'-' | b'0'..=b'9' => { + let end = bytes[index..] + .iter() + .position(|byte| { + !matches!(byte, b'0'..=b'9' | b'-' | b'+' | b'.' | b'e' | b'E') + }) + .map_or(bytes.len(), |length| index + length); + if let Some(raw) = wide_number(&text[index..end]) { + out.push_str(&text[copied..index]); + out.push_str(&serde_json::Value::String(encode(raw)).to_string()); + copied = end; + } + index = end; + } + _ => index += 1, + } + } + if copied == 0 { + return Cow::Borrowed(text); + } + out.push_str(&text[copied..]); + Cow::Owned(out) +} + +fn escaped_marked_string(token: &str) -> Option { + let inner = token.strip_prefix('"')?; + let escaped_mark = inner + .get(..6) + .is_some_and(|head| head.eq_ignore_ascii_case("\\uf8ff")); + if !inner.starts_with(MARK) && !escaped_mark { + return None; + } + let text = serde_json::from_str::(token).ok()?; + is_marked(&text) + .then(|| serde_json::Value::String(encode(&ascii_string_literal(&text))).to_string()) +} + +fn ascii_string_literal(text: &str) -> String { + let mut literal = String::with_capacity(text.len() + 2); + literal.push('"'); + for character in text.chars() { + match character { + '"' => literal.push_str("\\\""), + '\\' => literal.push_str("\\\\"), + '\n' => literal.push_str("\\n"), + '\r' => literal.push_str("\\r"), + '\t' => literal.push_str("\\t"), + ' '..='~' => literal.push(character), + _ => { + let mut units = [0; 2]; + for unit in character.encode_utf16(&mut units) { + literal.push_str(&format!("\\u{unit:04x}")); + } + } + } + } + literal.push('"'); + literal +} + +fn string_end(bytes: &[u8], mut index: usize) -> usize { + while index < bytes.len() { + match bytes[index] { + b'\\' => index += 2, + b'"' => return index + 1, + _ => index += 1, + } + } + index +} + +fn wide_number(raw: &str) -> Option<&str> { + if is_integer(raw) { + return (raw.parse::().is_err() && raw.parse::().is_err()).then_some(raw); + } + match raw.parse::() { + Ok(number) if number == f64::INFINITY => Some("Infinity"), + Ok(number) if number == f64::NEG_INFINITY => Some("-Infinity"), + _ => None, + } +} + +fn is_scalar(raw: &str) -> bool { + matches!(raw, "NaN" | "Infinity" | "-Infinity") || is_integer(raw) || is_string_literal(raw) +} + +fn is_integer(raw: &str) -> bool { + let digits = raw.strip_prefix('-').unwrap_or(raw); + match digits.as_bytes() { + [b'0'] => true, + [b'1'..=b'9', rest @ ..] => rest.iter().all(u8::is_ascii_digit), + _ => false, + } +} + +fn is_string_literal(raw: &str) -> bool { + let Some(inner) = raw + .strip_prefix('"') + .and_then(|rest| rest.strip_suffix('"')) + else { + return false; + }; + let mut bytes = inner.bytes(); + while let Some(byte) = bytes.next() { + match byte { + b'\\' => match bytes.next() { + Some(b'"' | b'\\' | b'/' | b'b' | b'f' | b'n' | b'r' | b't') => {} + Some(b'u') => { + if !(0..4).all(|_| bytes.next().is_some_and(|hex| hex.is_ascii_hexdigit())) { + return false; + } + } + _ => return false, + }, + b'"' => return false, + 0x20..=0x7e => {} + _ => return false, + } + } + true +} + +fn unescaped(escape: CharEscape) -> char { + match escape { + CharEscape::Quote => '"', + CharEscape::ReverseSolidus => '\\', + CharEscape::Solidus => '/', + CharEscape::Backspace => '\u{8}', + CharEscape::FormFeed => '\u{c}', + CharEscape::LineFeed => '\n', + CharEscape::CarriageReturn => '\r', + CharEscape::Tab => '\t', + CharEscape::AsciiControl(byte) => char::from(byte), + } +} + +#[derive(Default)] +enum Text { + #[default] + Closed, + Opened, + Plain, + Marked(String), +} + +#[derive(Default)] +struct RawLeaves { + key: bool, + text: Text, +} + +impl Formatter for RawLeaves { + fn begin_object_key( + &mut self, + writer: &mut W, + first: bool, + ) -> io::Result<()> { + self.key = true; + CompactFormatter.begin_object_key(writer, first) + } + + fn end_object_key(&mut self, writer: &mut W) -> io::Result<()> { + self.key = false; + CompactFormatter.end_object_key(writer) + } + + fn begin_string(&mut self, _writer: &mut W) -> io::Result<()> { + self.text = Text::Opened; + Ok(()) + } + + fn write_string_fragment( + &mut self, + writer: &mut W, + fragment: &str, + ) -> io::Result<()> { + match &mut self.text { + Text::Opened if fragment.starts_with(MARK) => { + self.text = Text::Marked(fragment.to_owned()); + Ok(()) + } + Text::Opened => { + self.text = Text::Plain; + writer.write_all(b"\"")?; + writer.write_all(fragment.as_bytes()) + } + Text::Marked(held) => { + held.push_str(fragment); + Ok(()) + } + Text::Plain | Text::Closed => writer.write_all(fragment.as_bytes()), + } + } + + fn write_char_escape( + &mut self, + writer: &mut W, + escape: CharEscape, + ) -> io::Result<()> { + match &mut self.text { + Text::Opened => { + self.text = Text::Plain; + writer.write_all(b"\"")?; + CompactFormatter.write_char_escape(writer, escape) + } + Text::Marked(held) => { + held.push(unescaped(escape)); + Ok(()) + } + Text::Plain | Text::Closed => CompactFormatter.write_char_escape(writer, escape), + } + } + + fn end_string(&mut self, writer: &mut W) -> io::Result<()> { + match std::mem::take(&mut self.text) { + Text::Opened => writer.write_all(b"\"\""), + Text::Plain | Text::Closed => writer.write_all(b"\""), + Text::Marked(held) => match decode(&held) { + Some(raw) if !self.key || raw.starts_with('"') => writer.write_all(raw.as_bytes()), + _ => serde_json::to_writer(writer, &held).map_err(io::Error::other), + }, + } + } +} + +#[cfg(test)] +mod tests { + use rstest::rstest; + use serde_json::{Value, json}; + + use super::*; + + #[rstest] + #[case::nan("NaN")] + #[case::infinity("Infinity")] + #[case::negative_infinity("-Infinity")] + #[case::wide_integer("18446744073709551616")] + #[case::negative_wide_integer("-1180591620717411303424")] + #[case::zero("0")] + #[case::surrogate_string(r#""sys \ud800 lone""#)] + #[case::escaped_string(r#""a\"b\\c\n\u00e9""#)] + fn scalar_texts_are_written_back_verbatim(#[case] raw: &str) { + let body = json!({"leaf": encode(raw), "list": [encode(raw)]}); + assert_eq!( + String::from_utf8(to_vec(&body).unwrap()).unwrap(), + format!(r#"{{"leaf":{raw},"list":[{raw}]}}"#) + ); + } + + #[rstest] + #[case::structure("1, \"injected\": true")] + #[case::object("{}")] + #[case::leading_zero("012")] + #[case::float("1.5")] + #[case::unquoted_quote(r#""a"b""#)] + #[case::non_ascii("\"\u{e9}\"")] + #[case::bad_escape(r#""\x""#)] + #[case::short_unicode_escape(r#""\u12""#)] + #[case::empty("")] + fn other_marked_texts_stay_strings(#[case] raw: &str) { + let marked = encode(raw); + assert_eq!(decode(&marked), None); + assert_eq!( + to_vec(&json!([marked])).unwrap(), + serde_json::to_vec(&json!([marked])).unwrap() + ); + } + + #[test] + fn keys_take_only_string_texts() { + let body = Value::Object( + [ + (encode(r#""k\udc00""#), json!(1)), + (encode("NaN"), json!(2)), + ] + .into_iter() + .collect(), + ); + assert_eq!( + String::from_utf8(to_vec(&body).unwrap()).unwrap(), + format!( + r#"{{"k\udc00":1,{}:2}}"#, + serde_json::to_string(&encode("NaN")).unwrap() + ) + ); + } + + #[rstest] + #[case::wide_integer(r#"{"a":18446744073709551616}"#, json!({"a": encode("18446744073709551616")}))] + #[case::negative_wide_integer(r#"[-12345678901234567890123]"#, json!([encode("-12345678901234567890123")]))] + #[case::overflowing_float(r#"{"a":[1e400,-1E+400]}"#, json!({"a": [encode("Infinity"), encode("-Infinity")]}))] + #[case::numbers_that_fit(r#"{"a":[18446744073709551615,-9223372036854775808,-0.0,5e-324,1E2,0.30000000000000004]}"#, json!({"a": [18_446_744_073_709_551_615_u64, i64::MIN, -0.0, 5e-324, 100.0, 0.300_000_000_000_000_04]}))] + #[case::provider_marked_text("{\"a\":\"\u{F8FF}litellm-raw-json:42\"}", json!({"a": encode(r#""\uf8fflitellm-raw-json:42""#)}))] + #[case::provider_escaped_mark(r#"{"\uF8FFlitellm-raw-json:1":["\uf8fflitellm-raw-json:\"x\"\n\u00e9"]}"#, json!({encode(r#""\uf8fflitellm-raw-json:1""#): [encode(r#""\uf8fflitellm-raw-json:\"x\"\n\u00e9""#)]}))] + #[case::mark_not_leading(r#"["x\uf8fflitellm-raw-json:NaN"]"#, json!(["x\u{F8FF}litellm-raw-json:NaN"]))] + #[case::numbers_inside_strings(r#"{"18446744073709551616":"1e400 \" 18446744073709551616"}"#, json!({"18446744073709551616": "1e400 \" 18446744073709551616"}))] + fn wide_numbers_are_read_as_marked_texts(#[case] text: &str, #[case] read: Value) { + assert_eq!( + serde_json::from_str::(&mark_wide_numbers(text)).unwrap(), + read + ); + } + + #[test] + fn a_text_without_wide_numbers_is_borrowed() { + assert!(matches!( + mark_wide_numbers(r#"{"a":[1,2.5,"18446744073709551616"]}"#), + Cow::Borrowed(_) + )); + } + + #[rstest] + #[case::plain(json!({"a": "text", "b": ["", "\"quoted\"\n", "\u{F8FF}"], "c": 1.5, "d": null}))] + #[case::mark_inside(json!(["x\u{F8FF}litellm-raw-json:NaN"]))] + #[case::control(json!(["\u{1}\t"]))] + fn unmarked_documents_serialize_as_serde_json_does(#[case] body: Value) { + assert_eq!(to_vec(&body).unwrap(), serde_json::to_vec(&body).unwrap()); + } +} diff --git a/litellm-rust/crates/http/src/config.rs b/litellm-rust/crates/http/src/config.rs index 5e5f2d66fa2..8e9a7000e69 100644 --- a/litellm-rust/crates/http/src/config.rs +++ b/litellm-rust/crates/http/src/config.rs @@ -94,6 +94,8 @@ impl From<&HttpSettings> for Resolution { } } +const MAX_REDIRECTS: usize = 20; + impl TryFrom<&HttpClientConfig> for reqwest::ClientBuilder { type Error = Error; @@ -101,7 +103,9 @@ impl TryFrom<&HttpClientConfig> for reqwest::ClientBuilder { let base = reqwest::Client::builder() .tls_backend_preconfigured(rustls::ClientConfig::try_from(config)?) .connect_timeout(config.connect_timeout) - .pool_idle_timeout(config.pool_idle_timeout); + .pool_idle_timeout(config.pool_idle_timeout) + .referer(false) + .redirect(reqwest::redirect::Policy::limited(MAX_REDIRECTS)); let with_keepalive = match config.tcp_keepalive { None => base, Some(keepalive) => base @@ -186,17 +190,23 @@ mod tests { assert_eq!(resolution.unsupported, []); } - #[test] - fn unsupported_ecdh_curve_keeps_the_defaults_and_is_reported() { + #[rstest] + #[case::openssl_lacks_in_rustls("secp521r1")] + #[case::nist_name("P-256")] + #[case::nist_p384("P-384")] + #[case::sec_name("secp256r1")] + #[case::lowercase("x25519")] + #[case::padded(" X25519 ")] + fn unsupported_ecdh_curve_keeps_the_defaults_and_is_reported(#[case] curve: &str) { let settings = HttpSettings { - ssl_ecdh_curve: Some("secp521r1".into()), + ssl_ecdh_curve: Some(curve.into()), ..HttpSettings::default() }; let resolution = Resolution::from(&settings); assert_eq!(resolution.config.key_exchange_group, None); assert_eq!( resolution.unsupported, - [Unsupported::EcdhCurve("secp521r1".into())] + [Unsupported::EcdhCurve(curve.into())] ); } diff --git a/litellm-rust/crates/http/src/error.rs b/litellm-rust/crates/http/src/error.rs index 9505aacf44b..d9fdfb5486f 100644 --- a/litellm-rust/crates/http/src/error.rs +++ b/litellm-rust/crates/http/src/error.rs @@ -251,6 +251,10 @@ impl Error { Repr::ComputedHeader(name.into()).into() } + pub fn request_body(error: serde_json::Error) -> Self { + Repr::RequestBody(error).into() + } + pub fn unsignable_body() -> Self { Repr::UnsignableBody.into() } diff --git a/litellm-rust/crates/http/src/outbound.rs b/litellm-rust/crates/http/src/outbound.rs index 20b0b1be972..b11041151af 100644 --- a/litellm-rust/crates/http/src/outbound.rs +++ b/litellm-rust/crates/http/src/outbound.rs @@ -27,7 +27,20 @@ pub fn json( body: &impl Serialize, timeout: Option, ) -> Result { - let body = serde_json::to_vec(body).map_err(Repr::RequestBody)?; + json_bytes( + url, + headers, + serde_json::to_vec(body).map_err(Repr::RequestBody)?, + timeout, + ) +} + +pub fn json_bytes( + url: &str, + headers: &[(String, String)], + body: Vec, + timeout: Option, +) -> Result { let url = Url::parse(url).map_err(Repr::ParseUrl)?; let with_headers = headers.iter().fold( http::Request::post(url.as_str()), diff --git a/litellm-rust/crates/http/src/pool.rs b/litellm-rust/crates/http/src/pool.rs index 3b20bbda607..c56c5de4a11 100644 --- a/litellm-rust/crates/http/src/pool.rs +++ b/litellm-rust/crates/http/src/pool.rs @@ -16,6 +16,7 @@ use crate::{ #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum ClientVariant { Provider, + Undecoded, NoRedirect, Media, UnpinnedMedia, @@ -103,6 +104,7 @@ impl HttpClientPool { ) -> reqwest::ClientBuilder { match variant { ClientVariant::Provider => builder, + ClientVariant::Undecoded => builder.no_gzip().no_deflate().no_brotli().no_zstd(), ClientVariant::NoRedirect | ClientVariant::UnpinnedMedia | ClientVariant::WebSocket => { builder.redirect(reqwest::redirect::Policy::none()) } @@ -132,7 +134,9 @@ fn effective(config: &HttpClientConfig, variant: ClientVariant) -> HttpClientCon }, ..config.clone() }, - ClientVariant::Provider | ClientVariant::NoRedirect => config.clone(), + ClientVariant::Provider | ClientVariant::Undecoded | ClientVariant::NoRedirect => { + config.clone() + } } } @@ -367,6 +371,28 @@ mod tests { assert!(request.contains("user-agent: litellm-test/9"), "{request}"); } + #[tokio::test] + async fn provider_client_follows_twenty_redirects_without_a_referer() { + let (address, _, requests) = serve("HTTP/1.1 307 Temporary Redirect").await; + let followed = pool() + .client(&config("a"), ClientVariant::Provider) + .unwrap() + .get(format!("http://{address}/start")) + .timeout(Duration::from_secs(5)) + .send() + .await; + assert!(followed.is_err()); + let requests = requests.lock().unwrap().clone(); + assert_eq!(requests.len(), 21, "{requests:?}"); + assert!(requests[1].starts_with("GET /elsewhere "), "{requests:?}"); + assert!( + requests + .iter() + .all(|request| !request.to_ascii_lowercase().contains("referer:")), + "{requests:?}" + ); + } + #[tokio::test] async fn no_redirect_variant_returns_the_redirect_instead_of_following_it() { let (address, _, _) = serve("HTTP/1.1 302 Found").await; diff --git a/litellm-rust/crates/http/src/tls.rs b/litellm-rust/crates/http/src/tls.rs index a83b0018b2b..47a1429f1a4 100644 --- a/litellm-rust/crates/http/src/tls.rs +++ b/litellm-rust/crates/http/src/tls.rs @@ -23,10 +23,10 @@ impl FromStr for KeyExchangeGroup { type Err = Unsupported; fn from_str(name: &str) -> Result { - match name.trim().to_ascii_lowercase().as_str() { - "x25519" => Ok(Self::X25519), - "prime256v1" | "secp256r1" | "p-256" => Ok(Self::Secp256r1), - "secp384r1" | "p-384" => Ok(Self::Secp384r1), + match name { + "X25519" => Ok(Self::X25519), + "prime256v1" => Ok(Self::Secp256r1), + "secp384r1" => Ok(Self::Secp384r1), _ => Err(Unsupported::EcdhCurve(name.to_owned())), } } diff --git a/litellm-rust/crates/inference-chat/tests/caching.rs b/litellm-rust/crates/inference-chat/tests/caching.rs index dd229d3d657..d8d3a8956c8 100644 --- a/litellm-rust/crates/inference-chat/tests/caching.rs +++ b/litellm-rust/crates/inference-chat/tests/caching.rs @@ -117,6 +117,7 @@ async fn the_same_route_entrypoint_reports_facts_with_or_without_caching( assert!(caching); assert!(!key.is_empty()); } + ResultSource::Host => panic!("the host never answers a chat call"), } let summaries = traces.summaries("litellm.route"); assert_eq!(summaries.len(), 2); diff --git a/litellm-rust/crates/inference-messages/Cargo.toml b/litellm-rust/crates/inference-messages/Cargo.toml index 0c5be52550d..0ca371c3ce7 100644 --- a/litellm-rust/crates/inference-messages/Cargo.toml +++ b/litellm-rust/crates/inference-messages/Cargo.toml @@ -8,7 +8,9 @@ repository.workspace = true [dependencies] litellm-secret-value.workspace = true bytes.workspace = true +flate2 = { workspace = true, features = ["zlib-rs"] } futures-util.workspace = true +http.workspace = true litellm-auth = { workspace = true, features = ["aws", "azure", "gcp"] } litellm-auth-aws.workspace = true litellm-cache-response.workspace = true @@ -30,9 +32,11 @@ tracing.workspace = true [dev-dependencies] litellm-error.workspace = true litellm-framer = { workspace = true, features = ["sse"] } +litellm-cache.workspace = true litellm-cache-memory.workspace = true litellm-host-native.workspace = true litellm-http = { workspace = true, features = ["test-support"] } litellm-inference-testing.workspace = true rstest.workspace = true +thiserror.workspace = true wiremock.workspace = true diff --git a/litellm-rust/crates/inference-messages/src/constants.rs b/litellm-rust/crates/inference-messages/src/constants.rs index c0b023be7c7..5fae6e45dad 100644 --- a/litellm-rust/crates/inference-messages/src/constants.rs +++ b/litellm-rust/crates/inference-messages/src/constants.rs @@ -2,3 +2,6 @@ /// seconds. Mirrors the Python Anthropic Messages default. The per-request /// timeout from the caller still overrides this on the request builder. pub(crate) const MESSAGES_TIMEOUT_SECS: u64 = 600; + +pub(crate) const MESSAGES_HTTP_ERROR_ATTEMPTS: usize = 2; +pub(crate) const MESSAGES_STREAM_ERROR_BODY_READ_SECS: u64 = 5; diff --git a/litellm-rust/crates/inference-messages/src/encoding.rs b/litellm-rust/crates/inference-messages/src/encoding.rs new file mode 100644 index 00000000000..c315deb1a33 --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/encoding.rs @@ -0,0 +1,437 @@ +use bytes::Bytes; +use flate2::{Decompress, DecompressError, FlushDecompress, Status}; +use futures_util::StreamExt; +use reqwest::header::{CONTENT_ENCODING, HeaderMap}; + +type BoxError = Box; + +const MAX_WINDOW_BITS: u8 = 15; +const MAX_DECOMPRESS_SIZE: usize = 1 << 16; + +#[derive(Debug)] +pub struct DecodingError(String); + +impl std::fmt::Display for DecodingError { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str(&self.0) + } +} + +impl std::error::Error for DecodingError {} + +impl From for DecodingError { + fn from(error: DecompressError) -> Self { + Self(match (error.needs_dictionary(), error.message()) { + (Some(_), _) => "Error 2 while decompressing data".to_owned(), + (None, Some(message)) => format!("Error -3 while decompressing data: {message}"), + (None, None) => "Error -3 while decompressing data: invalid input data".to_owned(), + }) + } +} + +enum Codec { + Gzip, + Deflate, +} + +enum FirstAttempt { + Unread, + Reading(Vec), + Over, +} + +struct Inflater { + zlib: Decompress, + first_attempt: FirstAttempt, + pending: Vec, + saturated: bool, + stalled: bool, + finished: bool, +} + +impl Inflater { + fn new(codec: Codec) -> Self { + let (zlib, first_attempt) = match codec { + Codec::Gzip => (Decompress::new_gzip(MAX_WINDOW_BITS), FirstAttempt::Over), + Codec::Deflate => (Decompress::new(true), FirstAttempt::Unread), + }; + Self { + zlib, + first_attempt, + pending: Vec::new(), + saturated: false, + stalled: false, + finished: false, + } + } + + fn push(&mut self, data: &[u8]) { + self.first_attempt = match self.first_attempt { + FirstAttempt::Unread => FirstAttempt::Reading(data.to_vec()), + FirstAttempt::Reading(_) | FirstAttempt::Over => FirstAttempt::Over, + }; + if self.finished { + return; + } + self.pending.extend_from_slice(data); + self.stalled = false; + } + + fn has_work(&self) -> bool { + !self.finished && (self.saturated || (!self.pending.is_empty() && !self.stalled)) + } + + fn step(&mut self) -> Result, DecodingError> { + match (self.inflate(), &mut self.first_attempt) { + (Err(_), FirstAttempt::Reading(first)) => { + self.pending = std::mem::take(first); + self.first_attempt = FirstAttempt::Over; + self.zlib = Decompress::new_with_window_bits(false, MAX_WINDOW_BITS); + self.saturated = false; + self.stalled = false; + self.step() + } + (inflated, attempt) => { + if self.pending.is_empty() && !self.saturated { + *attempt = FirstAttempt::Over; + } + inflated + } + } + } + + fn inflate(&mut self) -> Result, DecodingError> { + let mut output = Vec::with_capacity(MAX_DECOMPRESS_SIZE); + let (read, written) = (self.zlib.total_in(), self.zlib.total_out()); + let status = self + .zlib + .decompress_vec(&self.pending, &mut output, FlushDecompress::Sync)?; + self.pending.drain(..(self.zlib.total_in() - read) as usize); + self.finished = matches!(status, Status::StreamEnd); + if self.finished { + self.pending.clear(); + } + self.saturated = !self.finished && output.len() == MAX_DECOMPRESS_SIZE; + self.stalled = self.zlib.total_in() == read && self.zlib.total_out() == written; + Ok(output) + } +} + +struct Decoder(Vec); + +impl Decoder { + fn detect(headers: &HeaderMap) -> Option { + let inflaters: Vec = header_pairs(headers) + .into_iter() + .filter(|(name, _)| name.as_str() == CONTENT_ENCODING.as_str()) + .flat_map(|(_, value)| { + value + .split(',') + .map(|coding| coding.trim().to_lowercase()) + .collect::>() + }) + .filter_map(|coding| match coding.as_str() { + "gzip" => Some(Codec::Gzip), + "deflate" => Some(Codec::Deflate), + _ => None, + }) + .rev() + .map(Inflater::new) + .collect(); + (!inflaters.is_empty()).then_some(Self(inflaters)) + } + + fn feed(&mut self, chunk: &[u8]) { + self.0[0].push(chunk); + } + + fn next(&mut self) -> Result, DecodingError> { + self.pull(self.0.len() - 1) + .map(|decoded| decoded.map(Bytes::from)) + } + + fn pull(&mut self, layer: usize) -> Result>, DecodingError> { + loop { + if self.0[layer].has_work() { + let decoded = self.0[layer].step()?; + if !decoded.is_empty() { + return Ok(Some(decoded)); + } + continue; + } + let Some(outer) = layer.checked_sub(1) else { + return Ok(None); + }; + match self.pull(outer)? { + Some(decoded) => self.0[layer].push(&decoded), + None => return Ok(None), + } + } + } +} + +pub(crate) fn header_pairs(headers: &HeaderMap) -> Vec<(String, String)> { + let utf8 = headers + .values() + .all(|value| std::str::from_utf8(value.as_bytes()).is_ok()); + headers + .iter() + .map(|(name, value)| { + let bytes = value.as_bytes(); + let text = if utf8 { + String::from_utf8_lossy(bytes).into_owned() + } else { + bytes.iter().copied().map(char::from).collect() + }; + (name.to_string(), text) + }) + .collect() +} + +pub(crate) fn decoded(response: reqwest::Response) -> reqwest::Response { + let Some(decoder) = Decoder::detect(response.headers()) else { + return response; + }; + let status = response.status(); + let version = response.version(); + let headers = response.headers().clone(); + let body = futures_util::stream::unfold( + Some((response.bytes_stream().boxed(), decoder)), + |state| async move { + let (mut body, mut decoder) = state?; + loop { + match decoder.next() { + Ok(Some(decoded)) => return Some((Ok(decoded), Some((body, decoder)))), + Ok(None) => {} + Err(error) => return Some((Err(BoxError::from(error)), None)), + } + match body.next().await? { + Ok(chunk) => decoder.feed(&chunk), + Err(error) => return Some((Err(BoxError::from(error)), None)), + } + } + }, + ); + let mut rebuilt = http::Response::new(reqwest::Body::wrap_stream(body)); + *rebuilt.status_mut() = status; + *rebuilt.version_mut() = version; + *rebuilt.headers_mut() = headers; + reqwest::Response::from(rebuilt) +} + +#[cfg(test)] +mod tests { + use std::io::Write; + + use flate2::{Compression, write::GzEncoder, write::ZlibEncoder}; + use futures_util::TryStreamExt; + use rstest::rstest; + + use reqwest::header::{HeaderMap, HeaderValue}; + + use super::{decoded, header_pairs}; + + fn encoded(encoding: &str, body: &[u8]) -> Vec { + match encoding { + "gzip" => { + let mut encoder = GzEncoder::new(Vec::new(), Compression::default()); + encoder.write_all(body).unwrap(); + encoder.finish().unwrap() + } + "deflate" => { + let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default()); + encoder.write_all(body).unwrap(); + encoder.finish().unwrap() + } + _ => body.to_vec(), + } + } + + fn response(encoding: &str, body: Vec) -> reqwest::Response { + let length = body.len().to_string(); + let mut response = http::Response::new(reqwest::Body::from(body)); + let headers = response.headers_mut(); + headers.insert("content-encoding", encoding.parse().unwrap()); + headers.insert("content-length", length.parse().unwrap()); + reqwest::Response::from(response) + } + + #[rstest] + #[case::gzip("gzip")] + #[case::deflate("deflate")] + #[case::unknown("br")] + #[tokio::test] + async fn decoded_bodies_keep_the_head_the_provider_sent(#[case] encoding: &str) { + let body = br#"{"type":"message"}"#; + let wire = encoded(encoding, body); + let length = wire.len().to_string(); + let response = decoded(response(encoding, wire.clone())); + + assert_eq!(response.headers()["content-encoding"], encoding); + assert_eq!(response.headers()["content-length"], length.as_str()); + let expected = if encoding == "br" { + wire + } else { + body.to_vec() + }; + assert_eq!( + response.bytes().await.unwrap().as_ref(), + expected.as_slice() + ); + } + + fn raw_deflate(body: &[u8]) -> Vec { + let mut encoder = flate2::write::DeflateEncoder::new(Vec::new(), Compression::default()); + encoder.write_all(body).unwrap(); + encoder.finish().unwrap() + } + + fn chunked(encoding: &str, wire: Vec, size: usize) -> reqwest::Response { + let chunks: Vec, std::io::Error>> = + wire.chunks(size).map(|chunk| Ok(chunk.to_vec())).collect(); + let mut response = http::Response::new(reqwest::Body::wrap_stream( + futures_util::stream::iter(chunks), + )); + response + .headers_mut() + .insert("content-encoding", encoding.parse().unwrap()); + reqwest::Response::from(response) + } + + async fn read(response: reqwest::Response) -> Result, String> { + response + .bytes() + .await + .map(|bytes| bytes.to_vec()) + .map_err(|error| { + litellm_error::find::(&error) + .map_or_else(|| error.to_string(), ToString::to_string) + }) + } + + const BODY: &[u8] = br#"{"type":"message","content":[{"type":"text","text":"Paris"}]}"#; + + #[rstest] + #[case::padded_upper_case(" GZIP ", encoded("gzip", BODY))] + #[case::listed_with_an_unknown_coding("gzip, br", encoded("gzip", BODY))] + #[case::applied_twice("gzip, gzip", encoded("gzip", &encoded("gzip", BODY)))] + #[case::deflate_without_its_zlib_header("deflate", raw_deflate(BODY))] + #[case::gzip_with_data_past_its_end("gzip", [encoded("gzip", BODY), b"\x1f\x8b trailing".to_vec()].concat())] + #[tokio::test] + async fn bodies_decode_as_httpx_decodes_them( + #[case] encoding: &str, + #[case] wire: Vec, + #[values(7, 4096)] chunk: usize, + ) { + assert_eq!( + read(decoded(chunked(encoding, wire, chunk))).await.unwrap(), + BODY + ); + } + + #[rstest] + #[case::x_gzip_alias(" X-Gzip ")] + #[case::unknown_only("br, identity")] + #[tokio::test] + async fn codings_httpx_has_no_decoder_for_pass_through(#[case] encoding: &str) { + let wire = encoded("gzip", BODY); + assert_eq!( + read(decoded(chunked(encoding, wire.clone(), 4096))) + .await + .unwrap(), + wire + ); + } + + #[rstest] + #[case::not_deflate("deflate", b"not deflate at all".to_vec(), "Error -3 while decompressing data: invalid block type")] + #[case::bad_gzip_trailer( + "gzip", + { let wire = encoded("gzip", BODY); [&wire[..wire.len() - 8], &[0; 8]].concat() }, + "Error -3 while decompressing data: incorrect data check" + )] + #[case::not_gzip("gzip", b"\x1f\x8b\x08\x00not really gzip data at all".to_vec(), "Error -3 while decompressing data: invalid stored block lengths")] + #[case::no_gzip_magic("gzip", b"plain text".to_vec(), "Error -3 while decompressing data: incorrect header check")] + #[tokio::test] + async fn corrupt_bodies_fail_with_zlib_s_error( + #[case] encoding: &str, + #[case] wire: Vec, + #[case] expected: &str, + ) { + assert_eq!( + read(decoded(chunked(encoding, wire, 4096))) + .await + .unwrap_err(), + expected + ); + } + + #[rstest] + #[case::gzip_in_gzip("gzip, gzip")] + #[case::deflate_in_gzip("deflate, gzip")] + #[tokio::test] + async fn a_nested_bomb_is_decoded_in_bounded_reads(#[case] encoding: &str) { + let zeros = vec![0; 8 << 20]; + let inner = if encoding.starts_with("deflate") { + encoded("deflate", &zeros) + } else { + encoded("gzip", &zeros) + }; + let wire = encoded("gzip", &inner); + let sizes: Vec = decoded(chunked(encoding, wire, 4096)) + .bytes_stream() + .map_ok(|chunk| chunk.len()) + .try_collect() + .await + .unwrap(); + assert!( + sizes.iter().all(|size| *size <= super::MAX_DECOMPRESS_SIZE), + "{sizes:?}" + ); + assert_eq!(sizes.iter().sum::(), zeros.len()); + } + + #[rstest] + #[tokio::test] + async fn a_truncated_body_yields_what_it_holds_without_an_error() { + let wire = encoded("gzip", BODY); + let decoded_body = read(decoded(chunked( + "gzip", + wire[..wire.len() - 8].to_vec(), + 4096, + ))) + .await + .unwrap(); + assert_eq!(decoded_body, BODY); + } + + #[rstest] + #[case::ascii(&[b"plain".as_slice()], &["plain"])] + #[case::utf_8(&[b"plain".as_slice(), b"caf\xc3\xa9"], &["plain", "caf\u{e9}"])] + #[case::latin_1_once_any_value_is_not_utf_8( + &[b"caf\xc3\xa9".as_slice(), b"caf\xe9"], + &["caf\u{c3}\u{a9}", "caf\u{e9}"] + )] + fn header_values_decode_as_httpx_decodes_them( + #[case] values: &[&[u8]], + #[case] expected: &[&str], + ) { + let headers: HeaderMap = values + .iter() + .enumerate() + .map(|(index, value)| { + ( + format!("x-fz-{index}") + .parse::() + .unwrap(), + HeaderValue::from_bytes(value).unwrap(), + ) + }) + .collect(); + let decoded: Vec = header_pairs(&headers) + .into_iter() + .map(|(_, value)| value) + .collect(); + assert_eq!(decoded, expected); + } +} diff --git a/litellm-rust/crates/inference-messages/src/handler.rs b/litellm-rust/crates/inference-messages/src/handler.rs index c7a7d93bf98..4796a640e25 100644 --- a/litellm-rust/crates/inference-messages/src/handler.rs +++ b/litellm-rust/crates/inference-messages/src/handler.rs @@ -18,7 +18,7 @@ use litellm_llms::base_llm::{ messages::{ context::MessagesTransformContext, streaming::{self, ByteStream, StreamDecoder}, - transformation::BaseMessagesConfig, + transformation::{BaseMessagesConfig, FederatedEnvironment}, }, }; use litellm_llms_types::formats::messages::{ @@ -29,13 +29,21 @@ use litellm_tracing::ByteChunk; use serde_json::{Map, Value}; use super::{ - Error, MessagesBody, MessagesCall, MessagesCallResponse, MessagesRoute, + Delivered, Error, HostAnswer, MessagesBody, MessagesCall, MessagesCallResponse, MessagesRoute, + Transport, TransportBody, TransportRequest, TransportResponse, UnencodableHeader, + WorkloadIdentity, common_utils::{MessagesProvider, merge_messages_header_sources, string_headers}, - constants::MESSAGES_TIMEOUT_SECS, + constants::{ + MESSAGES_HTTP_ERROR_ATTEMPTS, MESSAGES_STREAM_ERROR_BODY_READ_SECS, MESSAGES_TIMEOUT_SECS, + }, route::Messages, types::invalid_request, }; -use litellm_inference::{caching::CallCache, context::CallContext, outbound::outbound_request}; +use litellm_inference::{ + caching::{CacheRequest, CallCache}, + context::CallContext, + outbound::raw_leaf_outbound_request, +}; struct ProviderCall { identity: ProviderIdentity, @@ -44,6 +52,12 @@ struct ProviderCall { signer: Option, timeout: Option, stream: bool, + whole_sse_frames: bool, + joined_reads: bool, + transform_context: MessagesTransformContext, + ascii_response_headers: bool, + unencodable_request_header: Option>, + ascii_request_headers: bool, } impl ProviderCall { @@ -52,16 +66,122 @@ impl ProviderCall { } } +pub(super) async fn cached( + route: &MessagesRoute, + provider: MessagesProvider, + model: &str, + context: &CallContext<'_, impl Interceptors>, +) -> Result, Error> { + let Some(cache) = caller_keyed(route) else { + return Ok(None); + }; + let identity = ProviderIdentity { + model: model.to_owned(), + provider: provider.as_str().to_string(), + }; + let Some((output, source)) = CallCache::::new( + Some(cache), + context.cache, + CacheRequest::from_wire(identity.clone(), None), + ) + .lookup() + .await + else { + return Ok(None); + }; + context + .result_ready(execution_facts(provider, identity, &output, &source)) + .await?; + Ok(Some(output)) +} + +pub(super) async fn mocked( + route: &MessagesRoute, + provider: MessagesProvider, + model: String, + context: &CallContext<'_, impl Interceptors>, + mock: Map, + stream: bool, +) -> MessagesCallResponse { + let output = MessagesCallResponse::Complete(MessagesBody::Unchecked(mock)); + let Some(cache) = caller_keyed(route).filter(|_| !stream) else { + return output; + }; + let identity = ProviderIdentity { + model, + provider: provider.as_str().to_string(), + }; + CallCache::::new( + Some(cache), + context.cache, + CacheRequest::from_wire(identity, None), + ) + .finish(output, &ResultSource::Provider) + .await +} + +pub(super) async fn answered( + route: &MessagesRoute, + host_answer: &dyn HostAnswer, + provider: MessagesProvider, + model: String, + stream: bool, + context: &CallContext<'_, impl Interceptors>, +) -> Result { + host_answer.answer(stream).await?; + deliver_answer(route, provider, model, stream, context).await +} + +pub(super) async fn deliver_answer( + route: &MessagesRoute, + provider: MessagesProvider, + model: String, + stream: bool, + context: &CallContext<'_, impl Interceptors>, +) -> Result { + let identity = ProviderIdentity { + model, + provider: provider.as_str().to_string(), + }; + let cache = CallCache::::new( + caller_keyed(route), + context.cache, + CacheRequest::from_wire(identity.clone(), None), + ); + context + .result_ready(ExecutionFacts { + provider: identity, + source: ResultSource::Host, + cost: Cost::Deferred, + }) + .await?; + let output = MessagesCallResponse::Complete(MessagesBody::Unchecked(Map::new())); + if stream { + return Ok(output); + } + Ok(cache.finish(output, &ResultSource::Host).await) +} + +fn caller_keyed(route: &MessagesRoute) -> Option<&litellm_cache_response::ScopedCache> { + route + .cache + .as_ref() + .filter(|cache| cache.service.keyed_by_caller()) +} + pub(super) async fn execute( route: &MessagesRoute, provider: MessagesProvider, model: String, call: MessagesCall, secrets: Secrets, + requested_stream: bool, context: &CallContext<'_, impl Interceptors>, ) -> Result { + let caller_keyed = caller_keyed(route).is_some(); let request = provider_call( &route.auth, + route.workload_identity.as_deref(), provider, model, call, @@ -71,38 +191,64 @@ pub(super) async fn execute( .boxed() .await?; let cache = CallCache::::from_wire( - route.cache.as_ref().filter(|_| request.cacheable()), + route + .cache + .as_ref() + .filter(|_| caller_keyed || request.cacheable()), context.cache, &request.identity, &request.wire, ); let identity = request.identity.clone(); - let (output, source) = match cache.lookup().await { + let hit = match caller_keyed { + true => None, + false => cache.lookup().await, + }; + let (output, source) = match hit { Some(hit) => hit, None => ( - call_provider(&route.http, request, context).await?, + call_provider(&route.http, route.transport.as_deref(), request, context).await?, ResultSource::Provider, ), }; - let reported = match &output { + context + .result_ready(execution_facts(provider, identity, &output, &source)) + .await?; + let output = match source { + ResultSource::Provider => { + super::safeguards::stamped(route.safeguards.as_ref(), output).await? + } + ResultSource::Cache { .. } | ResultSource::Host => output, + }; + if !requested_stream && matches!(output, MessagesCallResponse::Stream { .. }) { + return Ok(output); + } + Ok(cache.finish(output, &source).await) +} + +fn execution_facts( + provider: MessagesProvider, + identity: ProviderIdentity, + output: &MessagesCallResponse, + source: &ResultSource, +) -> ExecutionFacts { + let reported = match output { MessagesCallResponse::Complete(response) => match response { MessagesBody::Message(message) => provider.config().reported_cost(message), MessagesBody::Unchecked(_) => None, }, MessagesCallResponse::Stream { .. } => None, }; - context - .result_ready(ExecutionFacts { - provider: identity, - cost: Cost::settle(&source, reported), - source: source.clone(), - }) - .await?; - Ok(cache.finish(output, &source).await) + ExecutionFacts { + provider: identity, + cost: Cost::settle(source, reported), + source: source.clone(), + } } async fn provider_call( auth: &AuthServices, + workload_identity: Option<&dyn WorkloadIdentity>, provider: MessagesProvider, model: String, call: MessagesCall, @@ -129,14 +275,18 @@ async fn provider_call( let sanitized = config.shape_request( MessagesRequest { model, ..body }, - shaping.settings.reasoning_auto_summary, + shaping.settings.shape_options(), )?; - let transform_context = - MessagesTransformContext::new(shaping.capabilities, shaping.settings.drop_params); - let without_listed = - without_additional_drop_params(sanitized, &shaping.settings.additional_drop_params)?; - let trimmed = requested_optional_params(without_listed, provider, &transform_context)?; - let requested_params = serde_json::to_value(&trimmed.params).map_err(serialize_failure)?; + let transform_context = MessagesTransformContext { + drops_unsupported_params: shaping.settings.drops_unsupported_params, + ..MessagesTransformContext::new(shaping.capabilities, shaping.settings.drop_params) + }; + let dropped_keys = top_level_paths(&shaping.settings.additional_drop_params); + let without_keys = without_additional_drop_params(sanitized, &dropped_keys)?; + let requested = requested_optional_params(without_keys, provider, &transform_context)?; + let requested_params = serde_json::to_value(&requested.params).map_err(serialize_failure)?; + let trimmed = + without_additional_drop_params(requested, &shaping.settings.additional_drop_params)?; let scoped = get_provider_specific_headers(provider_specific_header.as_ref(), provider.as_str()); @@ -144,35 +294,58 @@ async fn provider_call( extra_headers.unwrap_or_default(), scoped, ])))?; - let validated = config.validate_environment( + let validated = match config.validate_federated_environment( forwarded, api_key.as_deref(), &trimmed.model, &trimmed.params, &connection_params, &env_lookup, - )?; + )? { + FederatedEnvironment::Validated(validated) => validated, + FederatedEnvironment::Unauthenticated { + headers, + missing, + federate, + } => match workload_identity { + Some(identity) => match identity + .token(&connection_params, api_base.as_deref()) + .await? + { + Some(token) => federate(headers, token), + None => return Err(missing.into()), + }, + None => return Err(missing.into()), + }, + }; + let tool_custom_field = config.tool_custom_field(&trimmed.model); + let requested_output_format = trimmed.params.output_format.clone(); let body = config.request_body( - config.transform_anthropic_messages_request(trimmed, &transform_context)?, + tool_custom_field.apply( + config.transform_anthropic_messages_request(trimmed, &transform_context)?, + shaping.settings.drops_unsupported_params, + ), &validated.headers, shaping.settings.drop_params, )?; - let environment = ValidatedEnvironment { - headers: config.request_headers( - with_python_default_headers(validated.headers, config.default_headers()), - &body, - ), - auth: validated.auth, - }; - let url = config.get_complete_url( api_base.as_deref(), &body.model, &connection_params, - body.params.stream == Some(true), + body.params.streams(), &env_lookup, )?; + let environment = ValidatedEnvironment { + headers: config.headers_for_url( + config.request_headers( + with_python_default_headers(validated.headers, config.default_headers()), + &with_requested_output_format(&body, requested_output_format), + ), + &url, + ), + auth: validated.auth, + }; let request_context = RequestContext { model: body.model.clone(), @@ -197,19 +370,10 @@ async fn provider_call( request_context, ) .await?; - let stream = match wire.body.get("stream") { - None | Some(Value::Null) => false, - Some(Value::Bool(stream)) => *stream, - Some(value) => { - return Err(Error::invalid_request( - litellm_llms::ErrorDetail::InvalidValue { - field: "stream", - expected: "a boolean", - actual: value.clone(), - }, - )); - } - }; + let stream = wire + .body + .get("stream") + .is_some_and(litellm_llms_types::recognized::python_truthy); Ok(ProviderCall { identity, wire, @@ -217,9 +381,33 @@ async fn provider_call( signer: authenticated.signer, timeout: timeout.or_else(|| shaping.settings.request_timeout()), stream, + whole_sse_frames: shaping.settings.whole_sse_frames, + joined_reads: shaping.settings.joined_reads, + transform_context, + ascii_response_headers: shaping.settings.ascii_response_headers, + unencodable_request_header: shaping.settings.unencodable_request_header, + ascii_request_headers: shaping.settings.ascii_request_headers, }) } +fn with_requested_output_format( + body: &MessagesRequest, + requested: Option, +) -> std::borrow::Cow<'_, MessagesRequest> { + match requested { + Some(output_format) if body.params.output_format.is_none() => { + std::borrow::Cow::Owned(MessagesRequest { + params: MessagesOptionalParams { + output_format: Some(output_format), + ..body.params.clone() + }, + ..body.clone() + }) + } + _ => std::borrow::Cow::Borrowed(body), + } +} + /// Python sends its header dict through `httpx.Headers`, which folds names that differ only in /// case into one lowercase header whose values are joined with `", "`. fn joined_header_values(headers: Vec<(String, String)>) -> Vec<(String, String)> { @@ -278,6 +466,14 @@ fn requested_optional_params( }) } +fn top_level_paths(paths: &[String]) -> Vec { + paths + .iter() + .filter(|path| !path.contains(['.', '['])) + .cloned() + .collect() +} + fn without_additional_drop_params( request: MessagesRequest, paths: &[String], @@ -295,52 +491,57 @@ fn without_additional_drop_params( }) } +enum Upstream { + Native(reqwest::Response), + Hosted(TransportResponse), +} + async fn call_provider( http: &litellm_http::Client, + transport: Option<&dyn Transport>, request: ProviderCall, context: &CallContext<'_, impl Interceptors>, ) -> Result { + let timeout = request + .timeout + .unwrap_or(Duration::from_secs(MESSAGES_TIMEOUT_SECS)); + let response = match send_recovering(http, transport, &request, timeout, context).await? { + Upstream::Native(response) => response, + Upstream::Hosted(response) => return hosted_response(response, request, context).await, + }; let ProviderCall { identity, - wire, provider, - signer, - timeout, stream, + whole_sse_frames, + joined_reads, + .. } = request; let provider_name = provider.as_str(); - log_request_body(provider_name, stream, &wire.body); - let timeout = timeout.unwrap_or(Duration::from_secs(MESSAGES_TIMEOUT_SECS)); - let response = send( - http, - Authenticated { - headers: wire.headers, - signer, - }, - &wire.url, - &wire.body, - timeout, - stream, - ) - .await?; - if !response.status().is_success() { - return Err(provider_error(response, timeout).await); - } let config = provider.config(); + let head = ResponseHead { + status: response.status().as_u16(), + headers: super::encoding::header_pairs(response.headers()), + }; if stream { - return Ok(streaming_response( + context + .raw_response_received(RawResponse::new(String::new()).with_head(head)) + .await?; + let streamed = streaming_response( response, config.stream_decoder(), provider_name, timeout, - )); + joined_reads, + ); + return Ok(if whole_sse_frames { + framed(streamed) + } else { + streamed + }); } - let head = ResponseHead { - status: response.status().as_u16(), - headers: litellm_http::request::header_pairs(response.headers()), - }; let status = head.status; - let text = response.text().await.map_err(litellm_http::Error::from)?; + let text = read_body(response, timeout).await?; log_response_body(&text); context .raw_response_received(RawResponse::new(text.clone()).with_head(head)) @@ -353,6 +554,197 @@ async fn call_provider( decode_response(config, &identity.model, &text).map(MessagesCallResponse::Complete) } +async fn hosted_response( + response: TransportResponse, + request: ProviderCall, + context: &CallContext<'_, impl Interceptors>, +) -> Result { + let TransportResponse { + status, + headers, + delivered, + } = response; + let ProviderCall { + identity, + provider, + whole_sse_frames, + .. + } = request; + let provider_name = provider.as_str(); + let config = provider.config(); + let text = match delivered { + Delivered::Complete(text) => text, + Delivered::Stream(chunks) => { + context + .raw_response_received(RawResponse::new(String::new()).with_head(ResponseHead { + status, + headers: headers.clone(), + })) + .await?; + let streamed = + hosted_streaming_response(headers, chunks, config.stream_decoder(), provider_name); + return Ok(if whole_sse_frames { + framed(streamed) + } else { + streamed + }); + } + Delivered::Rejected { error, .. } => return Err(error), + }; + log_response_body(&text); + context + .raw_response_received( + RawResponse::new(text.clone()).with_head(ResponseHead { status, headers }), + ) + .await?; + if serde_json::from_str::(&text).is_err() { + return Err(litellm_http::Error::upstream(status, text).into()); + } + decode_response(config, &identity.model, &text).map(MessagesCallResponse::Complete) +} + +fn hosted_request( + authenticated: Authenticated, + url: &str, + body: &Value, + stream: bool, +) -> Result { + if authenticated.signer.is_none() { + return Ok(TransportRequest { + url: url.to_owned(), + headers: authenticated.headers, + body: TransportBody::Json(body.clone()), + stream, + }); + } + let names: Vec = authenticated + .headers + .iter() + .map(|(name, _)| name.clone()) + .collect(); + let signed = raw_leaf_outbound_request(authenticated, url, body, None)?; + let headers = signed + .headers() + .iter() + .filter_map(|(name, value)| { + let spelled = names + .iter() + .find(|known| known.eq_ignore_ascii_case(name.as_str())) + .cloned() + .unwrap_or_else(|| name.to_string()); + Some((spelled, value.to_str().ok()?.to_owned())) + }) + .collect(); + let bytes = signed + .body() + .and_then(reqwest::Body::as_bytes) + .map(Bytes::copy_from_slice) + .unwrap_or_default(); + Ok(TransportRequest { + url: signed.url().to_string(), + headers, + body: TransportBody::Signed(bytes), + stream, + }) +} + +async fn send_recovering( + http: &litellm_http::Client, + transport: Option<&dyn Transport>, + request: &ProviderCall, + timeout: Duration, + context: &CallContext<'_, impl Interceptors>, +) -> Result { + let config = request.provider.config(); + let mut body = std::borrow::Cow::Borrowed(&request.wire.body); + let mut attempt = 1; + loop { + log_request_body(request.provider.as_str(), request.stream, &body); + if let Some(value) = &request.unencodable_request_header { + return Err(Error::transport(UnencodableHeader::Sent(value.clone()))); + } + // The credential header built from the caller's api_key never passes the caller header + // check, so it is checked on the wire headers as Python's client encodes them. + if request.ascii_request_headers + && let Some((_, value)) = request + .wire + .headers + .iter() + .find(|(_, value)| !value.is_ascii()) + { + return Err(Error::transport(UnencodableHeader::Sent( + value.as_bytes().to_vec(), + ))); + } + let authenticated = Authenticated { + headers: request.wire.headers.clone(), + signer: request.signer.clone(), + }; + let response = match transport { + None => Upstream::Native( + send(http, authenticated, &request.wire.url, &body, timeout).await?, + ), + Some(transport) => Upstream::Hosted( + transport + .send(hosted_request( + authenticated, + &request.wire.url, + &body, + request.stream, + )?) + .await?, + ), + }; + if let Upstream::Native(response) = &response + && request.ascii_response_headers + && let Some(unencodable) = UnencodableHeader::received(response.headers()) + { + return Err(Error::transport(unencodable)); + } + let failure = match response { + Upstream::Native(response) if response.status().is_success() => { + return Ok(Upstream::Native(response)); + } + Upstream::Native(response) => { + provider_failure(response, timeout, request.stream).await? + } + Upstream::Hosted(TransportResponse { + status, + headers, + delivered: Delivered::Rejected { text, error }, + }) => { + log_error_body(status, &text); + ProviderFailure { + status, + text, + headers, + raised: Some(error), + } + } + hosted @ Upstream::Hosted(_) => return Ok(hosted), + }; + let retried = if attempt == MESSAGES_HTTP_ERROR_ATTEMPTS { + None + } else { + config.retry_after_http_error( + failure.status, + &failure.text, + &body, + &request.transform_context, + ) + }; + let Some(retried) = retried else { + return Err(failure.into()); + }; + attempt += 1; + tracing::debug!( + "Anthropic /v1/messages: retrying after a recoverable HTTP error (attempt {attempt}/{MESSAGES_HTTP_ERROR_ATTEMPTS})." + ); + body = std::borrow::Cow::Owned(retried.body.clone()); + context.provider_request_retried(retried).await?; + } +} + fn serialize_failure(err: serde_json::Error) -> Error { Error::invalid_request(litellm_llms::ErrorDetail::failed( "Anthropic messages request serialization", @@ -360,27 +752,37 @@ fn serialize_failure(err: serde_json::Error) -> Error { )) } -/// Python's httpx timeout bounds each phase and each read, never the whole exchange. A complete -/// response keeps the client's overall deadline; a stream is bounded until its head arrives and -/// then per read (see [`timed_chunks`]), so a long stream that keeps sending is not cut off. async fn send( http: &litellm_http::Client, authenticated: Authenticated, url: &str, body: &Value, timeout: Duration, - stream: bool, ) -> Result { - let request = outbound_request(authenticated, url, body, (!stream).then_some(timeout))?; - if !stream { - return Ok(litellm_inference::outbound::send(request, http).await?); - } + let request = raw_leaf_outbound_request(authenticated, url, body, None)?; tokio::time::timeout(timeout, litellm_inference::outbound::send(request, http)) .await .map_err(litellm_http::Error::read_timeout)? + .map(super::encoding::decoded) .map_err(Error::from) } +async fn read_body( + mut response: reqwest::Response, + timeout: Duration, +) -> Result { + let expected = response.content_length(); + let mut body = Vec::new(); + while let Some(chunk) = tokio::time::timeout(timeout, response.chunk()) + .await + .map_err(litellm_http::Error::read_timeout)? + .map_err(|error| litellm_http::Error::body_read(error, body.len() as u64, expected))? + { + body.extend_from_slice(&chunk); + } + Ok(String::from_utf8_lossy(&body).into_owned()) +} + /// The stream's body, each read bounded by `timeout` as httpx bounds each read. fn timed_chunks( response: reqwest::Response, @@ -402,30 +804,65 @@ fn timed_chunks( ) } -/// The provider's error, its body read under `timeout`: a stream has no overall deadline once -/// its head arrives, so an error body that stalls would otherwise hold the call forever. -async fn provider_error(response: reqwest::Response, timeout: Duration) -> Error { - let status = response.status().as_u16(); - let headers = litellm_http::request::header_pairs(response.headers()); - match tokio::time::timeout(timeout, response.text()).await { - Ok(Ok(text)) => { - log_error_body(status, &text); - litellm_http::Error::upstream_with_headers(status, text, headers).into() +struct ProviderFailure { + status: u16, + text: String, + headers: Vec<(String, String)>, + raised: Option, +} + +impl From for Error { + fn from(failure: ProviderFailure) -> Self { + match failure.raised { + Some(raised) => raised, + None => litellm_http::Error::upstream_with_headers( + failure.status, + failure.text, + failure.headers, + ) + .into(), } - Ok(Err(error)) => litellm_http::Error::from(error).into(), - Err(elapsed) => litellm_http::Error::read_timeout(elapsed).into(), } } +async fn provider_failure( + response: reqwest::Response, + timeout: Duration, + stream: bool, +) -> Result { + let status = response.status().as_u16(); + let headers = super::encoding::header_pairs(response.headers()); + let text = if stream { + tokio::time::timeout( + Duration::from_secs(MESSAGES_STREAM_ERROR_BODY_READ_SECS), + read_body(response, timeout), + ) + .await + .ok() + .and_then(Result::ok) + .unwrap_or_default() + } else { + read_body(response, timeout).await? + }; + log_error_body(status, &text); + Ok(ProviderFailure { + status, + text, + headers, + raised: None, + }) +} + fn decode_response( config: &dyn BaseMessagesConfig, model: &str, text: &str, ) -> Result { - let response = match serde_json::from_str::(text) { + let marked = litellm_host::raw_json::mark_wide_numbers(text); + let response = match serde_json::from_str::(&marked) { Ok(response) => response, Err(err) => { - let Ok(mut body) = serde_json::from_str::>(text) else { + let Ok(mut body) = serde_json::from_str::>(&marked) else { return Err(Error::invalid_response(litellm_llms::ErrorDetail::invalid( "messages response JSON", err, @@ -435,11 +872,34 @@ fn decode_response( return Ok(MessagesBody::Unchecked(body)); } }; - config + let message = config .transform_anthropic_messages_response(model, response) - .map(|message| MessagesBody::Message(Box::new(message))) .map_err(Error::from) - .map_err(Error::after_send) + .map_err(Error::after_send)?; + if text_has_stop_reason(text) { + return Ok(MessagesBody::Message(Box::new(message))); + } + match serde_json::to_value(message).map_err(serialize_failure)? { + Value::Object(mut body) => { + body.remove("stop_reason"); + Ok(MessagesBody::Unchecked(body)) + } + _ => unreachable!("a message serializes as a JSON object"), + } +} + +#[derive(serde::Deserialize)] +struct StopReasonKey { + #[serde(default, deserialize_with = "key_present")] + stop_reason: bool, +} + +fn key_present<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result { + >::deserialize(deserializer).map(|_| true) +} + +fn text_has_stop_reason(text: &str) -> bool { + serde_json::from_str::(text).is_ok_and(|key| key.stop_reason) } fn streaming_response( @@ -447,14 +907,15 @@ fn streaming_response( decoder: Option, provider: &'static str, timeout: Duration, + joined: bool, ) -> MessagesCallResponse { - let headers = response - .headers() - .iter() - .filter_map(|(name, value)| Some((name.to_string(), value.to_str().ok()?.to_string()))) - .collect(); - let chunks = timed_chunks(response, timeout) - .inspect_ok(move |chunk| log_chunk(provider, "provider_response", chunk)); + let headers = super::encoding::header_pairs(response.headers()); + let chunks = timed_chunks(response, timeout); + let chunks = match (joined, &decoder) { + (true, None) => super::reads::joined_reads(chunks), + _ => chunks.boxed(), + } + .inspect_ok(move |chunk| log_chunk(provider, "provider_response", chunk)); let chunks = match decoder { None => chunks.map_err(Error::from).boxed(), Some(decode) => decoded_chunks( @@ -469,6 +930,73 @@ fn streaming_response( } } +fn hosted_streaming_response( + headers: Vec<(String, String)>, + chunks: BoxStream<'static, Result>, + decoder: Option, + provider: &'static str, +) -> MessagesCallResponse { + let chunks = chunks.inspect_ok(move |chunk| log_chunk(provider, "provider_response", chunk)); + let chunks = match decoder { + None => chunks.boxed(), + Some(decode) => decoded_chunks( + chunks.map_err(std::io::Error::other).boxed(), + decode, + provider, + ), + }; + MessagesCallResponse::Stream { + head: super::route::MessagesStreamHead { headers }, + chunks, + } +} + +fn framed(response: MessagesCallResponse) -> MessagesCallResponse { + let MessagesCallResponse::Stream { head, chunks } = response else { + return response; + }; + MessagesCallResponse::Stream { + head, + chunks: whole_sse_frames(chunks), + } +} + +fn whole_sse_frames( + chunks: BoxStream<'static, Result>, +) -> BoxStream<'static, Result> { + futures_util::stream::try_unfold( + (Some(chunks), Vec::new()), + |(chunks, mut pending)| async move { + let Some(mut chunks) = chunks else { + return Ok(None); + }; + while let Some(chunk) = chunks.try_next().await? { + pending.extend_from_slice(&chunk); + let end = complete_frames_end(&pending); + if end > 0 { + let rest = pending.split_off(end); + return Ok(Some((Bytes::from(pending), (Some(chunks), rest)))); + } + } + Ok((!pending.is_empty()).then(|| (Bytes::from(pending), (None, Vec::new())))) + }, + ) + .boxed() +} + +fn complete_frames_end(pending: &[u8]) -> usize { + [b"\r\n\r\n".as_slice(), b"\n\n", b"\r\r"] + .iter() + .filter_map(|delimiter| { + pending + .windows(delimiter.len()) + .rposition(|window| window == *delimiter) + .map(|at| at + delimiter.len()) + }) + .max() + .unwrap_or(0) +} + fn decoded_chunks( bytes: ByteStream, decode: StreamDecoder, @@ -529,6 +1057,14 @@ mod tests { async fn provider_call_with_secrets( call: MessagesCall, secrets: &(dyn Lookup + Send + Sync), + ) -> Result { + provider_call_federating(call, secrets, None).await + } + + async fn provider_call_federating( + call: MessagesCall, + secrets: &(dyn Lookup + Send + Sync), + workload_identity: Option<&dyn WorkloadIdentity>, ) -> Result { let provider = resolve_llm_provider( &call.body.model, @@ -542,6 +1078,7 @@ mod tests { let context = CallContext::new(&interceptors, litellm_inference::CallOptions::default()); provider_call( &AuthServices::default(), + workload_identity, config, model, call, @@ -735,6 +1272,178 @@ mod tests { assert!(error.is_missing_credential(), "{error:?}"); } + struct ScriptedIdentity { + minted: Result, ()>, + asked: std::sync::Mutex, Option)>>, + } + + impl ScriptedIdentity { + fn new(minted: Result, ()>) -> Self { + Self { + minted, + asked: std::sync::Mutex::new(Vec::new()), + } + } + + fn asked(&self) -> Vec<(Option, Option)> { + self.asked.lock().unwrap().clone() + } + } + + impl WorkloadIdentity for ScriptedIdentity { + fn token<'a>( + &'a self, + litellm_params: &'a litellm_router_types::LitellmParams, + api_base: Option<&'a str>, + ) -> futures_util::future::BoxFuture<'a, Result, litellm_auth::Error>> + { + self.asked.lock().unwrap().push(( + litellm_params + .extra + .get("anthropic_federation_rule_id") + .cloned(), + api_base.map(str::to_owned), + )); + let minted = self.minted; + Box::pin(async move { + minted + .map(|token| token.map(SecretValue::new)) + .map_err(|()| litellm_auth::Error::InvalidHeader) + }) + } + } + + fn federated_call( + shaping: MessagesShaping, + api_key: Option<&str>, + extra_headers: Option, + ) -> MessagesCall { + MessagesCall { + body: body( + json!({"model": "claude-test", "messages": [{"role": "user", "content": "hi"}], "max_tokens": 16}), + ), + api_key: api_key.map(str::to_owned), + api_base: Some("https://anthropic.test".into()), + custom_llm_provider: Some("anthropic".into()), + litellm_params: crate::litellm_params( + serde_json::from_value( + json!({"model": "claude-test", "anthropic_federation_rule_id": "fdrl_1"}), + ) + .unwrap(), + ) + .unwrap(), + extra_headers: extra_headers.map(|headers| serde_json::from_value(headers).unwrap()), + provider_specific_header: None, + timeout: None, + shaping, + } + } + + fn sent_headers<'a>(call: &'a ProviderCall, names: &[&str]) -> Vec<(&'a str, &'a str)> { + call.wire + .headers + .iter() + .filter(|(name, _)| names.contains(&name.as_str())) + .map(|(name, value)| (name.as_str(), value.as_str())) + .collect() + } + + #[rstest] + #[case::alone(None, &[("anthropic-beta", "oauth-2025-04-20"), ("authorization", "Bearer sk-ant-oat01-minted")])] + #[case::beside_a_caller_beta( + Some(json!({"anthropic-beta": "files-api-2025-04-14"})), + &[("anthropic-beta", "files-api-2025-04-14,oauth-2025-04-20"), ("authorization", "Bearer sk-ant-oat01-minted")] + )] + #[tokio::test] + async fn a_minted_federation_token_is_sent_as_an_oauth_bearer( + shaping: MessagesShaping, + #[case] extra_headers: Option, + #[case] expected: &[(&str, &str)], + ) { + let identity = ScriptedIdentity::new(Ok(Some("sk-ant-oat01-minted"))); + let call = provider_call_federating( + federated_call(shaping, None, extra_headers), + &|_: &str| None, + Some(&identity), + ) + .await + .unwrap(); + let mut sent = sent_headers( + &call, + &[ + "anthropic-beta", + "authorization", + "x-api-key", + "anthropic-dangerous-direct-browser-access", + ], + ); + sent.sort_unstable(); + assert_eq!( + (sent.as_slice(), identity.asked()), + ( + expected, + vec![(Some(json!("fdrl_1")), Some("https://anthropic.test".into()))] + ) + ); + } + + #[rstest] + #[case::static_key(Some("sk-static"), None, &[("x-api-key", "sk-static")])] + #[case::caller_credential( + None, + Some(json!({"x-api-key": "sk-caller"})), + &[("x-api-key", "sk-caller")] + )] + #[tokio::test] + async fn a_configured_credential_is_never_federated( + shaping: MessagesShaping, + #[case] api_key: Option<&str>, + #[case] extra_headers: Option, + #[case] expected: &[(&str, &str)], + ) { + let identity = ScriptedIdentity::new(Ok(Some("sk-ant-oat01-minted"))); + let call = provider_call_federating( + federated_call(shaping, api_key, extra_headers), + &|_: &str| None, + Some(&identity), + ) + .await + .unwrap(); + assert_eq!( + ( + sent_headers(&call, &["authorization", "x-api-key"]), + identity.asked() + ), + (expected.to_vec(), Vec::new()) + ); + } + + #[rstest] + #[case::nothing_minted(Ok(None), true)] + #[case::minting_failed(Err(()), false)] + #[tokio::test] + async fn an_unminted_federation_token_fails_the_call( + shaping: MessagesShaping, + #[case] minted: Result, ()>, + #[case] missing_credential: bool, + ) { + let identity = ScriptedIdentity::new(minted); + let Err(error) = provider_call_federating( + federated_call(shaping, None, None), + &|_: &str| None, + Some(&identity), + ) + .await + else { + panic!("a call without a minted token fails"); + }; + assert_eq!( + error.is_missing_credential(), + missing_credential, + "{error:?}" + ); + } + #[rstest] #[case::nothing_configured(None, None, None)] #[case::configured_setting(None, Some(1800.0), Some(Duration::from_secs(1800)))] @@ -1037,7 +1746,7 @@ mod tests { .await .unwrap(); assert_eq!(call.wire.url, format!("{base}{path}")); - let signed = outbound_request( + let signed = raw_leaf_outbound_request( Authenticated { headers: call.wire.headers, signer: call.signer, @@ -1081,6 +1790,7 @@ mod tests { Some(streaming::event_stream), "test", Duration::from_secs(5), + false, ) else { panic!("a streaming response returns chunks"); }; @@ -1092,4 +1802,48 @@ mod tests { } assert!(chunks.next().await.is_none()); } + + #[rstest] + #[case::no_delimiter(b"data: a".as_slice(), 0)] + #[case::lf(b"data: a\n\ndata: b", 9)] + #[case::crlf(b"data: a\r\n\r\ndata: b", 11)] + #[case::cr(b"data: a\r\rdata: b", 9)] + #[case::last_of_several(b"data: a\n\ndata: b\n\ndata: c", 18)] + fn complete_frames_end_is_after_the_last_delimiter(#[case] pending: &[u8], #[case] end: usize) { + assert_eq!(complete_frames_end(pending), end); + } + + #[rstest] + #[case::split_frame( + vec![&b"data: a\n"[..], b"\ndata: ", b"b\n\n"], + vec![&b"data: a\n\n"[..], b"data: b\n\n"] + )] + #[case::several_frames_in_one_chunk( + vec![&b"data: a\n\ndata: b\n\nda"[..], b"ta: c\n\n"], + vec![&b"data: a\n\ndata: b\n\n"[..], b"data: c\n\n"] + )] + #[case::unterminated_tail_is_flushed( + vec![&b"data: a\n\nda"[..], b"ta: b"], + vec![&b"data: a\n\n"[..], b"data: b"] + )] + #[tokio::test] + async fn whole_sse_frames_regroups_chunks_at_frame_boundaries( + #[case] chunks: Vec<&'static [u8]>, + #[case] expected: Vec<&'static [u8]>, + ) { + let upstream = futures_util::stream::iter( + chunks + .into_iter() + .map(|chunk| Ok::<_, Error>(Bytes::from_static(chunk))), + ) + .boxed(); + let framed: Vec = whole_sse_frames(upstream).try_collect().await.unwrap(); + assert_eq!( + framed, + expected + .into_iter() + .map(Bytes::from_static) + .collect::>() + ); + } } diff --git a/litellm-rust/crates/inference-messages/src/host_answer.rs b/litellm-rust/crates/inference-messages/src/host_answer.rs new file mode 100644 index 00000000000..07d183406ea --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/host_answer.rs @@ -0,0 +1,11 @@ +use futures_util::future::BoxFuture; + +use crate::Error; + +pub trait HostAnswer: Send + Sync { + fn answer(&self, stream: bool) -> BoxFuture<'_, Result<(), Error>>; + + fn intercept(&self, stream: bool) -> BoxFuture<'_, Result> { + Box::pin(async move { self.answer(stream).await.map(|()| true) }) + } +} diff --git a/litellm-rust/crates/inference-messages/src/lib.rs b/litellm-rust/crates/inference-messages/src/lib.rs index 25ebeaacb49..cd312ee61b1 100644 --- a/litellm-rust/crates/inference-messages/src/lib.rs +++ b/litellm-rust/crates/inference-messages/src/lib.rs @@ -1,25 +1,41 @@ mod common_utils; mod constants; +mod encoding; mod handler; +mod host_answer; +mod pre_request; +mod reads; pub mod route; +mod safeguards; +mod transport; mod types; +mod workload_identity; use futures_util::FutureExt; use litellm_auth::AuthServices; use litellm_host::interceptors::Interceptors; use litellm_inference::context::CallContext; use litellm_inference::provider::resolve_llm_provider; +use litellm_llms_types::recognized::Recognized; use litellm_secrets::source::SecretSource; use std::sync::Arc; use crate::common_utils::messages_provider; pub use common_utils::merge_messages_header_sources; +pub use encoding::DecodingError; +pub use host_answer::HostAnswer; pub use litellm_inference::Error; +pub use pre_request::PreRequestHooks; +pub use safeguards::Safeguards; +pub use transport::{ + Delivered, Transport, TransportBody, TransportRequest, TransportResponse, UnencodableHeader, +}; pub use types::{ MessagesBody, MessagesCall, MessagesCallResponse, MessagesSettings, MessagesShaping, litellm_params, messages_body, }; +pub use workload_identity::WorkloadIdentity; #[derive(Clone)] pub struct MessagesRoute { @@ -27,6 +43,11 @@ pub struct MessagesRoute { auth: Arc, secrets: Arc, cache: Option, + workload_identity: Option>, + transport: Option>, + pre_request_hooks: Option>, + safeguards: Option>, + host_answer: Option>, } impl MessagesRoute { @@ -40,6 +61,51 @@ impl MessagesRoute { auth, secrets, cache: None, + workload_identity: None, + transport: None, + pre_request_hooks: None, + safeguards: None, + host_answer: None, + } + } + + #[must_use] + pub fn with_workload_identity(self, workload_identity: Arc) -> Self { + Self { + workload_identity: Some(workload_identity), + ..self + } + } + + #[must_use] + pub fn with_transport(self, transport: Arc) -> Self { + Self { + transport: Some(transport), + ..self + } + } + + #[must_use] + pub fn with_pre_request_hooks(self, hooks: Arc) -> Self { + Self { + pre_request_hooks: Some(hooks), + ..self + } + } + + #[must_use] + pub fn with_safeguards(self, safeguards: Arc) -> Self { + Self { + safeguards: Some(safeguards), + ..self + } + } + + #[must_use] + pub fn with_host_answer(self, host_answer: Arc) -> Self { + Self { + host_answer: Some(host_answer), + ..self } } @@ -67,7 +133,7 @@ impl MessagesRoute { model = %call.body.model, provider, resolved_model, - stream = call.body.params.stream == Some(true), + stream = call.body.params.streams(), outcome ))] async fn run( @@ -76,24 +142,69 @@ impl MessagesRoute { context: CallContext<'_, impl Interceptors>, ) -> Result { litellm_inference::diagnostic::call(async { - let provider = resolve_llm_provider( - &call.body.model, - call.custom_llm_provider.as_deref(), - "messages", - )?; - let config = messages_provider(provider.provider, provider.model).ok_or_else(|| { - Error::InvalidProvider(<&str>::from(provider.provider).to_string()) - })?; - litellm_inference::diagnostic::provider( - provider.model, - <&'static str>::from(provider.provider), - ); - let model = provider.model.to_owned(); + let requested_stream = call.body.params.streams(); + let client_streams = call.body.params.stream == Some(Recognized::Known(true)); + let call = match &self.pre_request_hooks { + None => call, + Some(hooks) => { + let (config, model, _) = Self::provider(&call)?; + if let Some(output) = handler::cached(self, config, &model, &context).await? { + return Ok(output); + } + hooks.run(call).await? + } + }; + let (config, model, provider) = Self::provider(&call)?; + litellm_inference::diagnostic::provider(&model, provider); + if self.pre_request_hooks.is_none() + && let Some(output) = handler::cached(self, config, &model, &context).await? + { + return Ok(output); + } + if let Some(host_answer) = self + .host_answer + .as_deref() + .filter(|_| call.shaping.settings.intercepted) + && host_answer.intercept(requested_stream).await? + { + return handler::deliver_answer(self, config, model, requested_stream, &context) + .await; + } + if let Some(mock) = call.shaping.settings.mock_response { + return Ok( + handler::mocked(self, config, model, &context, mock, requested_stream).await, + ); + } + if let Some(host_answer) = self + .host_answer + .as_deref() + .filter(|_| call.shaping.settings.mcp_gateway) + { + let stream = call.body.params.streams(); + return handler::answered(self, host_answer, config, model, stream, &context).await; + } let secrets = self.secrets.resolve(config.config().secret_names()).await?; - handler::execute(self, config, model, call, secrets, &context) + handler::execute(self, config, model, call, secrets, client_streams, &context) .boxed() .await }) .await } + + fn provider( + call: &MessagesCall, + ) -> Result<(common_utils::MessagesProvider, String, &'static str), Error> { + let provider = resolve_llm_provider( + &call.body.model, + call.custom_llm_provider.as_deref(), + "messages", + )?; + let config = messages_provider(provider.provider, provider.model) + .ok_or_else(|| Error::InvalidProvider(<&str>::from(provider.provider).to_string()))?; + Ok(( + config, + provider.model.to_owned(), + <&'static str>::from(provider.provider), + )) + } } diff --git a/litellm-rust/crates/inference-messages/src/pre_request.rs b/litellm-rust/crates/inference-messages/src/pre_request.rs new file mode 100644 index 00000000000..949dcd6585b --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/pre_request.rs @@ -0,0 +1,7 @@ +use futures_util::future::BoxFuture; + +use super::{Error, MessagesCall}; + +pub trait PreRequestHooks: Send + Sync { + fn run(&self, call: MessagesCall) -> BoxFuture<'_, Result>; +} diff --git a/litellm-rust/crates/inference-messages/src/reads.rs b/litellm-rust/crates/inference-messages/src/reads.rs new file mode 100644 index 00000000000..0e127a42a13 --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/reads.rs @@ -0,0 +1,394 @@ +use std::{collections::VecDeque, sync::Arc}; + +use bytes::Bytes; +use futures_util::{FutureExt, Stream, StreamExt, stream::BoxStream}; +use std::sync::Mutex; +use tokio::{sync::Notify, task::JoinHandle}; + +const READ_SIZE: usize = 16 * 1024; +const LOW_WATER: usize = 64 * 1024; +const HIGH_WATER: usize = 2 * LOW_WATER; +const SETTLE_YIELDS: usize = 64; + +struct Buffer { + chunks: VecDeque, + size: usize, + quiet: bool, + failure: Option, + ended: bool, +} + +impl Buffer { + fn take(&mut self) -> Bytes { + let mut joined = Vec::new(); + while let Some(mut chunk) = self.chunks.pop_front() { + let room = READ_SIZE - joined.len(); + if chunk.len() > room { + let rest = chunk.split_off(room); + self.chunks.push_front(rest); + } + if joined.is_empty() && (chunk.len() == READ_SIZE || self.chunks.is_empty()) { + self.size -= chunk.len(); + return chunk; + } + joined.extend_from_slice(&chunk); + self.size -= chunk.len(); + if joined.len() == READ_SIZE { + break; + } + } + Bytes::from(joined) + } +} + +struct Reads { + buffer: Mutex>, + received: Notify, + drained: Notify, +} + +enum Read { + Chunk(Bytes), + Failure(E), + End, +} + +impl Reads { + fn readable(&self) -> bool { + let buffer = self.buffer(); + buffer.failure.is_some() + || buffer.ended + || (!buffer.chunks.is_empty() && (buffer.quiet || buffer.size >= READ_SIZE)) + } + + fn quiet(&self) { + self.buffer().quiet = true; + self.received.notify_one(); + } + + fn read(&self) -> Option> { + let mut buffer = self.buffer(); + if !buffer.chunks.is_empty() { + let chunk = buffer.take(); + drop(buffer); + self.drained.notify_one(); + return Some(Read::Chunk(chunk)); + } + if let Some(failure) = buffer.failure.take() { + return Some(Read::Failure(failure)); + } + buffer.ended.then_some(Read::End) + } + + fn buffer(&self) -> std::sync::MutexGuard<'_, Buffer> { + self.buffer + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + } +} + +struct Reader(JoinHandle<()>); + +impl Drop for Reader { + fn drop(&mut self) { + self.0.abort(); + } +} + +pub(crate) fn joined_reads( + chunks: impl Stream> + Send + 'static, +) -> BoxStream<'static, Result> { + let Ok(runtime) = tokio::runtime::Handle::try_current() else { + return chunks.boxed(); + }; + let reads = Arc::new(Reads { + buffer: Mutex::new(Buffer { + chunks: VecDeque::new(), + size: 0, + quiet: false, + failure: None, + ended: false, + }), + received: Notify::new(), + drained: Notify::new(), + }); + let reader = Reader(runtime.spawn(fill(chunks.boxed(), Arc::clone(&reads)))); + futures_util::stream::unfold(Some((reads, reader)), |state| async move { + let (reads, reader) = state?; + loop { + let received = reads.received.notified(); + if reads.readable() { + break; + } + received.await; + } + let read = reads.read()?; + match read { + Read::Chunk(chunk) => Some((Ok(chunk), Some((reads, reader)))), + Read::Failure(failure) => Some((Err(failure), None)), + Read::End => None, + } + }) + .boxed() +} + +async fn fill(mut chunks: BoxStream<'static, Result>, reads: Arc>) { + loop { + let next = match settled_next(&mut chunks).await { + Some(next) => next, + None => { + reads.quiet(); + chunks.next().await + } + }; + let paused = { + let mut buffer = reads.buffer(); + buffer.quiet = false; + match next { + Some(Ok(chunk)) => { + buffer.size += chunk.len(); + if !chunk.is_empty() { + buffer.chunks.push_back(chunk); + } + } + Some(Err(failure)) => { + buffer.failure = Some(failure); + buffer.ended = true; + } + None => buffer.ended = true, + } + if buffer.ended { + drop(buffer); + reads.received.notify_one(); + return; + } + buffer.size > HIGH_WATER + }; + reads.received.notify_one(); + if paused { + reads.quiet(); + loop { + let drained = reads.drained.notified(); + if reads.buffer().size < LOW_WATER { + break; + } + drained.await; + } + } + } +} + +async fn settled_next( + chunks: &mut BoxStream<'static, Result>, +) -> Option>> { + for _ in 0..SETTLE_YIELDS { + if let Some(next) = chunks.next().now_or_never() { + return Some(next); + } + tokio::task::yield_now().await; + } + None +} + +#[cfg(test)] +mod tests { + use std::{ + pin::Pin, + sync::atomic::{AtomicUsize, Ordering}, + task::{Context, Poll}, + time::Duration, + }; + + use futures_util::{FutureExt, StreamExt, TryStreamExt}; + use tokio::sync::mpsc; + + use super::*; + + struct Upstream { + receiver: mpsc::UnboundedReceiver>, + pulled: Arc, + } + + impl Stream for Upstream { + type Item = Result; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + let next = self.receiver.poll_recv(cx); + if let Poll::Ready(Some(_)) = next { + self.pulled.fetch_add(1, Ordering::SeqCst); + } + next + } + } + + type Item = Result; + + fn upstream() -> ( + mpsc::UnboundedSender, + BoxStream<'static, Item>, + Arc, + ) { + let (sender, receiver) = mpsc::unbounded_channel(); + let pulled = Arc::new(AtomicUsize::new(0)); + let reads = joined_reads(Upstream { + receiver, + pulled: Arc::clone(&pulled), + }); + (sender, reads, pulled) + } + + async fn settled() { + tokio::time::sleep(Duration::from_millis(20)).await; + } + + #[rstest::rstest] + #[tokio::test] + async fn chunks_that_arrived_together_are_read_as_one() { + let (sender, mut reads, _) = upstream(); + sender.send(Ok(Bytes::from("event: a\n\n"))).unwrap(); + sender.send(Ok(Bytes::from("event: b\n\n"))).unwrap(); + sender.send(Ok(Bytes::from("event: c\n\n"))).unwrap(); + settled().await; + assert_eq!( + reads.try_next().await.unwrap().unwrap(), + "event: a\n\nevent: b\n\nevent: c\n\n" + ); + sender.send(Ok(Bytes::from("event: d\n\n"))).unwrap(); + settled().await; + assert_eq!(reads.try_next().await.unwrap().unwrap(), "event: d\n\n"); + drop(sender); + assert!(reads.try_next().await.unwrap().is_none()); + } + + #[rstest::rstest] + #[tokio::test] + async fn chunks_still_being_handed_over_join_the_read() { + let handed_over = futures_util::stream::unfold(0, |sent| async move { + tokio::task::yield_now().await; + (sent < 50).then(|| (Ok::<_, &str>(Bytes::from("event: ping\n\n")), sent + 1)) + }); + let read: Vec = joined_reads(handed_over) + .map_ok(|chunk| chunk.len()) + .try_collect() + .await + .unwrap(); + assert_eq!(read, [50 * "event: ping\n\n".len()]); + } + + #[rstest::rstest] + #[tokio::test] + async fn a_read_returns_the_first_chunk_without_waiting_for_more() { + let (sender, mut reads, _) = upstream(); + let first = tokio::spawn(async move { reads.try_next().await }); + settled().await; + sender.send(Ok(Bytes::from("event: a\n\n"))).unwrap(); + assert_eq!(first.await.unwrap().unwrap().unwrap(), "event: a\n\n"); + } + + #[rstest::rstest] + #[tokio::test] + async fn reads_are_cut_at_sixteen_kibibytes() { + let (sender, reads, _) = upstream(); + sender.send(Ok(Bytes::from(vec![b'a'; 10_000]))).unwrap(); + sender.send(Ok(Bytes::from(vec![b'b'; 30_000]))).unwrap(); + drop(sender); + settled().await; + let sizes: Vec = reads + .map_ok(|chunk| chunk.len()) + .try_collect() + .await + .unwrap(); + assert_eq!(sizes, [READ_SIZE, READ_SIZE, 40_000 - 2 * READ_SIZE]); + } + + #[rstest::rstest] + #[tokio::test] + async fn the_bytes_still_buffered_are_read_before_a_failure() { + let (sender, mut reads, _) = upstream(); + sender.send(Ok(Bytes::from("event: a\n\n"))).unwrap(); + sender.send(Ok(Bytes::from("event: b\n\n"))).unwrap(); + sender.send(Err("reset")).unwrap(); + settled().await; + assert_eq!( + reads.try_next().await.unwrap().unwrap(), + "event: a\n\nevent: b\n\n" + ); + assert_eq!(reads.try_next().await.unwrap_err(), "reset"); + assert!(reads.next().await.is_none()); + } + + #[rstest::rstest] + #[tokio::test] + async fn reading_pauses_above_the_high_water_mark_until_below_the_low_one() { + let (sender, mut reads, pulled) = upstream(); + std::iter::repeat_with(|| Bytes::from(vec![b'a'; READ_SIZE])) + .take(12) + .try_for_each(|chunk| sender.send(Ok(chunk))) + .unwrap(); + settled().await; + assert_eq!(pulled.load(Ordering::SeqCst), 9); + let read: Vec = (&mut reads).take(5).try_collect().await.unwrap(); + assert_eq!(read.len(), 5); + settled().await; + assert_eq!(pulled.load(Ordering::SeqCst), 9); + reads.try_next().await.unwrap(); + settled().await; + assert_eq!(pulled.load(Ordering::SeqCst), 12); + } + + async fn chunked_upstream(frames: usize) -> String { + use tokio::io::{AsyncReadExt, AsyncWriteExt}; + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + let mut request = [0_u8; 4096]; + let _ = socket.read(&mut request).await.unwrap(); + let frame = "event: ping\ndata: {\"type\": \"ping\"}\n\n"; + let body: String = + std::iter::repeat_n(format!("{:x}\r\n{frame}\r\n", frame.len()), frames).collect(); + let response = format!( + "HTTP/1.1 200 OK\r\ncontent-type: text/event-stream\r\ntransfer-encoding: chunked\r\nconnection: close\r\n\r\n{body}0\r\n\r\n" + ); + socket.write_all(response.as_bytes()).await.unwrap(); + tokio::time::sleep(Duration::from_secs(1)).await; + }); + format!("http://{address}") + } + + #[rstest::rstest] + #[case::fifty(50)] + #[case::a_thousand(1000)] + #[tokio::test(flavor = "multi_thread", worker_threads = 4)] + async fn http_chunks_written_together_are_read_together(#[case] frames: usize) { + let url = chunked_upstream(frames).await; + let response = litellm_http::Client::for_test() + .get(url) + .send() + .await + .unwrap(); + tokio::time::sleep(Duration::from_millis(50)).await; + let sizes: Vec = joined_reads(response.bytes_stream()) + .map_ok(|chunk| chunk.len()) + .try_collect() + .await + .unwrap(); + let total = frames * "event: ping\ndata: {\"type\": \"ping\"}\n\n".len(); + let expected: Vec = std::iter::repeat_n(READ_SIZE, total / READ_SIZE) + .chain((!total.is_multiple_of(READ_SIZE)).then_some(total % READ_SIZE)) + .collect(); + assert_eq!(sizes, expected); + } + + #[rstest::rstest] + fn without_a_runtime_the_chunks_pass_through() { + let chunks = + futures_util::stream::iter([Ok::<_, &str>(Bytes::from("a")), Ok(Bytes::from("b"))]); + let read: Vec = joined_reads(chunks) + .try_collect() + .now_or_never() + .unwrap() + .unwrap(); + assert_eq!(read, [Bytes::from("a"), Bytes::from("b")]); + } +} diff --git a/litellm-rust/crates/inference-messages/src/route.rs b/litellm-rust/crates/inference-messages/src/route.rs index 5f06d16d49f..fa850b23bf2 100644 --- a/litellm-rust/crates/inference-messages/src/route.rs +++ b/litellm-rust/crates/inference-messages/src/route.rs @@ -74,4 +74,103 @@ impl litellm_inference::caching::StreamCachable for Messages { fn bytes(chunk: &Self::Chunk) -> &[u8] { chunk.as_ref() } + + fn storable_stream(text: &str) -> bool { + let lines: Vec<&str> = sse_lines(text).collect(); + lines.contains(&"event: message_stop") + && !carries_provider_error(&lines) + && lines.iter().any(|line| line_carries_output(line)) + } +} + +fn sse_lines(text: &str) -> impl Iterator { + let mut rest = Some(text); + std::iter::from_fn(move || { + let current = rest?; + match current.find(['\r', '\n']) { + Some(at) => { + let skip = if current[at..].starts_with("\r\n") { + 2 + } else { + 1 + }; + rest = Some(¤t[at + skip..]); + Some(¤t[..at]) + } + None => { + rest = None; + (!current.is_empty()).then_some(current) + } + } + }) +} + +fn sse_data(line: &str, stripped: bool) -> Option> { + let data = line.strip_prefix("data:")?; + let data = if stripped { + data.trim_matches(|c: char| matches!(c, ' ' | '\t' | '\n' | '\r' | '\x0b' | '\x0c')) + } else { + data + }; + match serde_json::from_str(data) { + Ok(serde_json::Value::Object(map)) => Some(map), + _ => None, + } +} + +fn carries_provider_error(lines: &[&str]) -> bool { + lines + .iter() + .filter_map(|line| sse_data(line, true)) + .find(|event| event.get("type").and_then(serde_json::Value::as_str) == Some("error")) + .is_some_and(|event| event.get("error").is_some_and(serde_json::Value::is_object)) +} + +fn line_carries_output(line: &str) -> bool { + let Some(event) = sse_data(line, false) else { + return false; + }; + let block = match event.get("type").and_then(serde_json::Value::as_str) { + Some("content_block_start") => event.get("content_block"), + Some("content_block_delta") => event.get("delta"), + _ => None, + }; + block + .and_then(serde_json::Value::as_object) + .is_some_and(|fields| { + fields.iter().any(|(name, value)| { + name != "type" + && !matches!(value, serde_json::Value::Null) + && value.as_str() != Some("") + && value.as_array().is_none_or(|items| !items.is_empty()) + }) + }) +} + +#[cfg(test)] +mod tests { + use litellm_inference::caching::StreamCachable; + use rstest::rstest; + + use super::Messages; + + const TEXT: &str = "event: message_start\ndata: {\"type\":\"message_start\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris\"}}\n\n"; + const EMPTY: &str = "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\"}}\n\n"; + const STOP: &str = "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"; + + #[rstest] + #[case::complete(format!("{TEXT}{STOP}"), true)] + #[case::crlf_lines(format!("{TEXT}{STOP}").replace('\n', "\r\n"), true)] + #[case::done_sentinel(format!("{TEXT}{STOP}data: [DONE]\n\n"), true)] + #[case::data_only_frames(format!("{TEXT}{STOP}").replace("event: message_stop\n", ""), false)] + #[case::event_without_space(format!("{TEXT}{STOP}").replace("event: message_stop", "event:message_stop"), false)] + #[case::provider_error(format!("{TEXT}{STOP}event: error\ndata: {{\"type\":\"error\",\"error\":{{\"type\":\"overloaded_error\"}}}}\n\n"), false)] + #[case::error_without_body(format!("{TEXT}{STOP}data: {{\"type\":\"error\",\"error\":\"overloaded\"}}\n\n"), true)] + #[case::no_output(format!("{EMPTY}{STOP}"), false)] + fn a_stream_is_stored_by_python_s_message_stop_error_and_output_tests( + #[case] text: String, + #[case] stored: bool, + ) { + assert_eq!(Messages::storable_stream(&text), stored); + } } diff --git a/litellm-rust/crates/inference-messages/src/safeguards.rs b/litellm-rust/crates/inference-messages/src/safeguards.rs new file mode 100644 index 00000000000..78e4a752536 --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/safeguards.rs @@ -0,0 +1,248 @@ +use std::{collections::VecDeque, sync::Arc}; + +use bytes::Bytes; +use futures_util::{StreamExt, TryStreamExt, future::BoxFuture, stream::BoxStream}; +use serde_json::Value; + +use super::{Error, MessagesBody, MessagesCallResponse}; + +const SAFEGUARD_RESULTS: &str = "safeguard_results"; + +pub trait Safeguards: Send + Sync { + fn results<'a>( + &'a self, + response: &'a MessagesBody, + ) -> BoxFuture<'a, Result, Error>>; + + fn open_stream(&self) -> BoxFuture<'_, Result>; + + fn frames(&self, chunk: Bytes) -> BoxFuture<'_, Result, Error>>; + + fn flush(&self) -> BoxFuture<'_, Result, Error>>; +} + +pub(super) async fn stamped( + safeguards: Option<&Arc>, + output: MessagesCallResponse, +) -> Result { + let Some(safeguards) = safeguards else { + return Ok(output); + }; + match output { + MessagesCallResponse::Complete(response) => { + let results = safeguards.results(&response).await?; + Ok(MessagesCallResponse::Complete(match results { + Some(results) => with_results(response, results), + None => response, + })) + } + MessagesCallResponse::Stream { head, chunks } => { + if !safeguards.open_stream().await? { + return Ok(MessagesCallResponse::Stream { head, chunks }); + } + Ok(MessagesCallResponse::Stream { + head, + chunks: stamped_frames(Arc::clone(safeguards), chunks), + }) + } + } +} + +fn with_results(response: MessagesBody, results: Value) -> MessagesBody { + match response { + MessagesBody::Message(mut message) => { + message.extra.insert(SAFEGUARD_RESULTS.to_owned(), results); + MessagesBody::Message(message) + } + MessagesBody::Unchecked(mut body) => { + body.insert(SAFEGUARD_RESULTS.to_owned(), results); + MessagesBody::Unchecked(body) + } + } +} + +struct Framing { + chunks: Option>>, + safeguards: Arc, + ready: VecDeque, +} + +fn stamped_frames( + safeguards: Arc, + chunks: BoxStream<'static, Result>, +) -> BoxStream<'static, Result> { + let framing = Framing { + chunks: Some(chunks), + safeguards, + ready: VecDeque::new(), + }; + futures_util::stream::try_unfold(framing, |mut framing| async move { + loop { + if let Some(frame) = framing.ready.pop_front() { + return Ok(Some((frame, framing))); + } + let Some(mut chunks) = framing.chunks.take() else { + return Ok(None); + }; + let frames = match chunks.try_next().await? { + Some(chunk) => { + framing.chunks = Some(chunks); + framing.safeguards.frames(chunk).await? + } + None => framing.safeguards.flush().await?, + }; + framing.ready.extend(frames); + } + }) + .boxed() +} + +#[cfg(test)] +mod tests { + use std::sync::Mutex; + + use litellm_llms_types::formats::messages::MessagesResponse; + use rstest::rstest; + use serde_json::{Map, json}; + + use super::*; + use crate::route::MessagesStreamHead; + + struct Scripted { + results: Option, + streams: bool, + fed: Mutex>, + } + + impl Scripted { + fn new(results: Option, streams: bool) -> Arc { + Arc::new(Self { + results, + streams, + fed: Mutex::new(Vec::new()), + }) + } + } + + impl Safeguards for Scripted { + fn results<'a>( + &'a self, + _: &'a MessagesBody, + ) -> BoxFuture<'a, Result, Error>> { + Box::pin(async move { Ok(self.results.clone()) }) + } + + fn open_stream(&self) -> BoxFuture<'_, Result> { + Box::pin(async move { Ok(self.streams) }) + } + + fn frames(&self, chunk: Bytes) -> BoxFuture<'_, Result, Error>> { + Box::pin(async move { + self.fed.lock().unwrap().push(chunk.clone()); + Ok(chunk + .split_inclusive(|byte| *byte == b';') + .map(Bytes::copy_from_slice) + .collect()) + }) + } + + fn flush(&self) -> BoxFuture<'_, Result, Error>> { + Box::pin(async move { Ok(vec![Bytes::from_static(b"tail")]) }) + } + } + + fn message() -> MessagesBody { + let response: MessagesResponse = serde_json::from_value(json!({ + "id": "msg_1", "type": "message", "role": "assistant", "model": "m", + "content": [], "stop_reason": "end_turn", "stop_sequence": null, + })) + .unwrap(); + MessagesBody::Message(Box::new(response)) + } + + fn stream(chunks: &[&'static [u8]]) -> MessagesCallResponse { + let chunks: Vec> = chunks + .iter() + .map(|chunk| Ok(Bytes::from_static(chunk))) + .collect(); + MessagesCallResponse::Stream { + head: MessagesStreamHead { + headers: Vec::new(), + }, + chunks: futures_util::stream::iter(chunks).boxed(), + } + } + + async fn collected(output: MessagesCallResponse) -> Vec { + let MessagesCallResponse::Stream { chunks, .. } = output else { + panic!("expected a stream"); + }; + chunks.try_collect().await.unwrap() + } + + #[rstest] + #[case::message_gains_the_results(message(), Some(json!([{"type": "dangerous_tool_use"}])))] + #[case::unchecked_gains_the_results( + MessagesBody::Unchecked(Map::new()), + Some(json!([{"type": "dangerous_tool_use"}])) + )] + #[case::declined_leaves_it(message(), None)] + #[tokio::test] + async fn a_complete_response_carries_what_the_classifier_answered( + #[case] response: MessagesBody, + #[case] results: Option, + ) { + let safeguards: Arc = Scripted::new(results.clone(), false); + let MessagesCallResponse::Complete(stamped) = stamped( + Some(&safeguards), + MessagesCallResponse::Complete(response.clone()), + ) + .await + .unwrap() else { + panic!("expected a complete response"); + }; + let body = serde_json::to_value(&stamped).unwrap(); + assert_eq!(body.get(SAFEGUARD_RESULTS), results.as_ref()); + let mut unstamped = body; + unstamped.as_object_mut().unwrap().remove(SAFEGUARD_RESULTS); + assert_eq!(unstamped, serde_json::to_value(&response).unwrap()); + } + + #[tokio::test] + async fn a_stream_is_reframed_through_the_classifier_and_flushed_at_its_end() { + let scripted = Scripted::new(None, true); + let safeguards: Arc = scripted.clone(); + let frames = collected( + stamped(Some(&safeguards), stream(&[b"a;b", b";c;"])) + .await + .unwrap(), + ) + .await; + assert_eq!( + frames, + ["a;", "b", ";", "c;", "tail"] + .map(|frame| Bytes::from_static(frame.as_bytes())) + .to_vec() + ); + assert_eq!(scripted.fed.lock().unwrap().len(), 2); + } + + #[rstest] + #[case::declined(Some(Scripted::new(None, false) as Arc))] + #[case::not_classified(None)] + #[tokio::test] + async fn a_stream_the_classifier_does_not_answer_passes_through( + #[case] safeguards: Option>, + ) { + let frames = collected( + stamped(safeguards.as_ref(), stream(&[b"a;b", b";c;"])) + .await + .unwrap(), + ) + .await; + assert_eq!( + frames, + [b"a;b".as_slice(), b";c;"].map(Bytes::from_static).to_vec() + ); + } +} diff --git a/litellm-rust/crates/inference-messages/src/transport.rs b/litellm-rust/crates/inference-messages/src/transport.rs new file mode 100644 index 00000000000..1353592447b --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/transport.rs @@ -0,0 +1,59 @@ +use bytes::Bytes; +use futures_util::{future::BoxFuture, stream::BoxStream}; +use serde_json::Value; + +use crate::Error; + +pub enum TransportBody { + Json(Value), + Signed(Bytes), +} + +pub struct TransportRequest { + pub url: String, + pub headers: Vec<(String, String)>, + pub body: TransportBody, + pub stream: bool, +} + +pub enum Delivered { + Complete(String), + Stream(BoxStream<'static, Result>), + Rejected { text: String, error: Error }, +} + +pub struct TransportResponse { + pub status: u16, + pub headers: Vec<(String, String)>, + pub delivered: Delivered, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum UnencodableHeader { + Sent(Vec), + Received(Vec), +} + +impl std::fmt::Display for UnencodableHeader { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("a header value is not ASCII, which Python's HTTP client cannot encode") + } +} + +impl std::error::Error for UnencodableHeader {} + +impl UnencodableHeader { + pub(crate) fn received(headers: &reqwest::header::HeaderMap) -> Option { + headers + .values() + .find(|value| !value.as_bytes().is_ascii()) + .map(|value| Self::Received(value.as_bytes().to_vec())) + } +} + +pub trait Transport: Send + Sync { + fn send( + &self, + request: TransportRequest, + ) -> BoxFuture<'static, Result>; +} diff --git a/litellm-rust/crates/inference-messages/src/types.rs b/litellm-rust/crates/inference-messages/src/types.rs index 772ea6f7292..9dbc171ecb0 100644 --- a/litellm-rust/crates/inference-messages/src/types.rs +++ b/litellm-rust/crates/inference-messages/src/types.rs @@ -2,7 +2,10 @@ use std::time::Duration; use bytes::Bytes; use litellm_host::call::CallOutput; -use litellm_llms::{ErrorDetail, base_llm::messages::context::MessagesModelCapabilities}; +use litellm_llms::{ + ErrorDetail, + base_llm::messages::context::{MessagesModelCapabilities, MessagesShapeOptions}, +}; use litellm_llms_types::{ formats::messages::{MessagesRequest, MessagesResponse}, headers::ProviderSpecificHeaders, @@ -71,9 +74,38 @@ pub struct MessagesSettings { pub additional_drop_params: Vec, #[serde(default)] pub request_timeout: Option, + #[serde(default)] + pub mock_response: Option>, + #[serde(default)] + pub whole_sse_frames: bool, + #[serde(default)] + pub joined_reads: bool, + #[serde(default)] + pub presanitized: bool, + #[serde(default)] + pub drops_unsupported_params: bool, + #[serde(default)] + pub intercepted: bool, + #[serde(default)] + pub mcp_gateway: bool, + #[serde(default)] + pub ascii_response_headers: bool, + #[serde(default)] + pub unencodable_request_header: Option>, + /// Python's HTTP client encodes every header value it sends as ASCII, so a value it cannot + /// encode fails the call before the send. + #[serde(default)] + pub ascii_request_headers: bool, } impl MessagesSettings { + pub fn shape_options(&self) -> MessagesShapeOptions { + MessagesShapeOptions { + reasoning_auto_summary: self.reasoning_auto_summary, + presanitized: self.presanitized, + } + } + pub fn request_timeout(&self) -> Option { self.request_timeout .and_then(|secs| Duration::try_from_secs_f64(secs).ok()) @@ -140,7 +172,8 @@ mod tests { "drop_params": true, "reasoning_auto_summary": true, "additional_drop_params": ["metadata.user_id", "thinking"], - "request_timeout": 1800.0 + "request_timeout": 1800.0, + "drops_unsupported_params": true }), MessagesShaping { settings: MessagesSettings { @@ -148,6 +181,8 @@ mod tests { reasoning_auto_summary: true, additional_drop_params: vec!["metadata.user_id".to_string(), "thinking".to_string()], request_timeout: Some(1800.0), + drops_unsupported_params: true, + ..MessagesSettings::default() }, capabilities: MessagesModelCapabilities { supports_reasoning: true, @@ -185,6 +220,10 @@ mod tests { serialized["reasoning_auto_summary"], json!(expected.settings.reasoning_auto_summary) ); + assert_eq!( + serialized["drops_unsupported_params"], + json!(expected.settings.drops_unsupported_params) + ); assert_eq!( serialized["additional_drop_params"], json!(expected.settings.additional_drop_params) diff --git a/litellm-rust/crates/inference-messages/src/workload_identity.rs b/litellm-rust/crates/inference-messages/src/workload_identity.rs new file mode 100644 index 00000000000..56445de6eea --- /dev/null +++ b/litellm-rust/crates/inference-messages/src/workload_identity.rs @@ -0,0 +1,11 @@ +use futures_util::future::BoxFuture; +use litellm_router_types::LitellmParams; +use litellm_secret_value::SecretValue; + +pub trait WorkloadIdentity: Send + Sync { + fn token<'a>( + &'a self, + litellm_params: &'a LitellmParams, + api_base: Option<&'a str>, + ) -> BoxFuture<'a, Result, litellm_auth::Error>>; +} diff --git a/litellm-rust/crates/inference-messages/tests/caching.rs b/litellm-rust/crates/inference-messages/tests/caching.rs index 787501a8fed..ff83f4e41e1 100644 --- a/litellm-rust/crates/inference-messages/tests/caching.rs +++ b/litellm-rust/crates/inference-messages/tests/caching.rs @@ -301,3 +301,135 @@ async fn provider_reported_cost_is_delivered_once_and_never_charged_for_a_cache_ assert!(matches!(cached.source, ResultSource::Cache { .. })); assert_eq!(cached.cost, Cost::CacheHit); } + +#[derive(Default)] +struct CallerKeyed { + config: ResponseCacheConfig, + entry: std::sync::Mutex>, +} + +impl ResponseCacheService for CallerKeyed { + fn config(&self) -> &ResponseCacheConfig { + &self.config + } + + fn keyed_by_caller(&self) -> bool { + true + } + + fn lookup<'a>( + &'a self, + _: &'a litellm_cache_response::ResponseCacheRequest, + _: Duration, + ) -> std::pin::Pin< + Box< + dyn std::future::Future, litellm_cache::Error>> + + Send + + 'a, + >, + > { + Box::pin(async move { Ok(self.entry.lock().unwrap().clone()) }) + } + + fn store<'a>( + &'a self, + _: &'a litellm_cache_response::ResponseCacheRequest, + value: Value, + _: Duration, + ) -> std::pin::Pin< + Box> + Send + 'a>, + > { + Box::pin(async move { + *self.entry.lock().unwrap() = Some(value); + Ok(()) + }) + } +} + +#[tokio::test] +async fn a_caller_keyed_hit_is_served_before_the_request_is_built_or_intercepted() { + use litellm_inference_messages::{MessagesCall, MessagesCallResponse}; + + let response = json!({"id": "msg_caller", "type": "message", "role": "assistant", "model": "native-test", + "content": [{"type": "text", "text": "answer"}], "stop_reason": "end_turn", "stop_sequence": null, + "usage": {"input_tokens": 3, "output_tokens": 2}}); + let upstream = support::upstream([support::json_response(response)]).await; + let hooks = ChangingHooks::default(); + let route = support::messages_route(litellm_inference_testing::no_secrets()).with_cache( + ScopedCache::new(Arc::new(CallerKeyed::default()), CacheScope::Shared), + ); + let request = |api_key: Option<&str>| { + MessagesCall { + body: serde_json::from_value(json!({"model": "native-test", "messages": [{"role": "user", "content": "hi"}], "max_tokens": 16})).unwrap(), + api_key: api_key.map(Into::into), api_base: Some(upstream.uri()), custom_llm_provider: Some("anthropic".into()), + litellm_params: Default::default(), extra_headers: None, provider_specific_header: None, + timeout: None, shaping: Default::default(), + } + }; + let first = route + .execute(request(Some("key")), &hooks, None) + .await + .unwrap(); + let second = route.execute(request(None), &hooks, None).await.unwrap(); + let (MessagesCallResponse::Complete(first), MessagesCallResponse::Complete(second)) = + (first, second) + else { + panic!("expected Messages responses"); + }; + assert_eq!(first, second); + assert_eq!(support::received(&upstream).await.len(), 1); + assert_eq!(hooks.calls.load(Ordering::SeqCst), 1); + let facts = hooks.facts.lock().unwrap(); + let [provider, cached] = facts.as_slice() else { + panic!("expected provider and cache results"); + }; + assert_eq!(provider.source, ResultSource::Provider); + assert!(matches!(cached.source, ResultSource::Cache { .. })); + assert_eq!(cached.cost, Cost::CacheHit); +} + +#[rstest] +#[case::unary(false, true)] +#[case::streamed(true, false)] +#[tokio::test] +async fn a_mock_is_stored_under_the_caller_key_only_when_unstreamed( + #[case] stream: bool, + #[case] stored: bool, +) { + use litellm_inference_messages::{ + MessagesBody, MessagesCall, MessagesCallResponse, MessagesSettings, MessagesShaping, + }; + + let mock = json!({"id": "msg_mock", "type": "message", "role": "assistant", "model": "native-test", + "content": [{"type": "text", "text": "mocked"}], "stop_reason": "end_turn", "stop_sequence": null, + "usage": {"input_tokens": 3, "output_tokens": 2}}); + let upstream = support::upstream([]).await; + let hooks = ChangingHooks::default(); + let service = Arc::new(CallerKeyed::default()); + let route = support::messages_route(litellm_inference_testing::no_secrets()) + .with_cache(ScopedCache::new(service.clone(), CacheScope::Shared)); + let call = MessagesCall { + body: serde_json::from_value(json!({"model": "native-test", "messages": [{"role": "user", "content": "hi"}], "max_tokens": 16, "stream": stream})).unwrap(), + api_key: Some("key".into()), api_base: Some(upstream.uri()), custom_llm_provider: Some("anthropic".into()), + litellm_params: Default::default(), extra_headers: None, provider_specific_header: None, + timeout: None, + shaping: MessagesShaping { + settings: MessagesSettings { + mock_response: serde_json::from_value(mock.clone()).unwrap(), + ..Default::default() + }, + ..Default::default() + }, + }; + + let output = route.execute(call, &hooks, None).await.unwrap(); + + let MessagesCallResponse::Complete(MessagesBody::Unchecked(body)) = output else { + panic!("expected the mock as a whole response"); + }; + assert_eq!(Value::Object(body), mock); + assert!(support::received(&upstream).await.is_empty()); + assert_eq!(hooks.calls.load(Ordering::SeqCst), 0); + assert!(hooks.facts.lock().unwrap().is_empty()); + assert_eq!(service.entry.lock().unwrap().is_some(), stored); +} diff --git a/litellm-rust/crates/inference-messages/tests/messages/gateway.rs b/litellm-rust/crates/inference-messages/tests/messages/gateway.rs new file mode 100644 index 00000000000..d6e591c723c --- /dev/null +++ b/litellm-rust/crates/inference-messages/tests/messages/gateway.rs @@ -0,0 +1,99 @@ +use std::sync::atomic::{AtomicUsize, Ordering}; + +use futures_util::future::BoxFuture; +use litellm_inference_messages::{HostAnswer, MessagesRoute}; +use rstest::rstest; + +use super::*; + +#[derive(Default)] +struct CountingGateway(AtomicUsize); + +impl HostAnswer for CountingGateway { + fn answer(&self, _stream: bool) -> BoxFuture<'_, Result<(), Error>> { + self.0.fetch_add(1, Ordering::SeqCst); + Box::pin(async { Ok(()) }) + } +} + +fn gateway_call(call: MessagesCall, api_base: String, mcp_gateway: bool) -> MessagesCall { + MessagesCall { + api_key: Some("sk-ant-test".into()), + api_base: Some(api_base), + shaping: MessagesShaping { + settings: MessagesSettings { + mcp_gateway, + ..MessagesSettings::default() + }, + ..MessagesShaping::default() + }, + ..call + } +} + +async fn run_through(route: MessagesRoute, call: MessagesCall) -> Result { + let host = LocalMessagesHost::new(call); + litellm_host_native::in_process::run_hosted( + route.machine(host.request()?, None), + host.runtime(), + ) + .await +} + +#[rstest] +#[tokio::test] +async fn a_call_the_host_hands_to_the_mcp_gateway_never_reaches_the_provider(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let gateway = Arc::new(CountingGateway::default()); + let route = + messages_route(Arc::new(RecordingSecrets::empty())).with_host_answer(gateway.clone()); + + let output = run_through(route, gateway_call(call, upstream.uri(), true)) + .await + .unwrap(); + + let MessagesOutput::Complete(MessagesBody::Unchecked(body)) = output else { + panic!("the host answers in place of the provider"); + }; + assert!(body.is_empty()); + assert_eq!(gateway.0.load(Ordering::SeqCst), 1); + assert!(received(&upstream).await.is_empty()); +} + +#[rstest] +#[tokio::test] +async fn a_call_the_host_keeps_reaches_the_provider_past_the_gateway(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let gateway = Arc::new(CountingGateway::default()); + let route = + messages_route(Arc::new(RecordingSecrets::empty())).with_host_answer(gateway.clone()); + + let output = run_through(route, gateway_call(call, upstream.uri(), false)) + .await + .unwrap(); + + assert!(matches!( + output, + MessagesOutput::Complete(MessagesBody::Message(_)) + )); + assert_eq!(gateway.0.load(Ordering::SeqCst), 0); + only_request(&upstream).await; +} + +#[rstest] +#[tokio::test] +async fn a_mock_answers_before_the_gateway(call: MessagesCall) { + let gateway = Arc::new(CountingGateway::default()); + let route = + messages_route(Arc::new(RecordingSecrets::empty())).with_host_answer(gateway.clone()); + let mut mocked = gateway_call(call, UNREACHABLE_BASE.into(), true); + mocked.shaping.settings.mock_response = Some(object(json!({"mocked": true}))); + + let output = run_through(route, mocked).await.unwrap(); + + let MessagesOutput::Complete(MessagesBody::Unchecked(body)) = output else { + panic!("the mock is the call's response"); + }; + assert_eq!(body, object(json!({"mocked": true}))); + assert_eq!(gateway.0.load(Ordering::SeqCst), 0); +} diff --git a/litellm-rust/crates/inference-messages/tests/messages/host.rs b/litellm-rust/crates/inference-messages/tests/messages/host.rs index 063e9d18738..7254830a2b0 100644 --- a/litellm-rust/crates/inference-messages/tests/messages/host.rs +++ b/litellm-rust/crates/inference-messages/tests/messages/host.rs @@ -3,7 +3,7 @@ use litellm_host::lifecycle::ExecutionEvent; use std::sync::Mutex; use litellm_host::{ - interceptors::{ExecutionFacts, RequestContext, ResultSource, WireRequest}, + interceptors::{ExecutionFacts, RawResponse, RequestContext, ResultSource, WireRequest}, lifecycle::CallEvent, }; use litellm_inference_messages::{MessagesBody, MessagesCallResponse, route::Messages}; @@ -46,19 +46,23 @@ impl RecordingHost { Self::new(call, Box::new(Ok)) } - fn raw_responses(&self) -> Vec { + fn raw_heads(&self) -> Vec { self.events .lock() .unwrap() .iter() .filter_map(|event| match event { CallEvent::Execution(ExecutionEvent::ProviderResponseReceived { raw }) => { - Some(raw.body.clone()) + Some(raw.clone()) } _ => None, }) .collect() } + + fn raw_responses(&self) -> Vec { + self.raw_heads().into_iter().map(|raw| raw.body).collect() + } } impl RecordingHost { @@ -137,7 +141,7 @@ async fn rejected_results_are_not_delivered_or_cached( let response = if streaming { ResponseTemplate::new(200).set_body_raw( - "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Hi\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", "text/event-stream", ) } else { @@ -291,22 +295,23 @@ async fn what_before_send_returns_is_what_the_provider_receives(call: MessagesCa } #[rstest] -#[case::enable(false, json!(true), Some(true))] -#[case::disable(true, json!(false), Some(false))] -#[case::null(true, Value::Null, Some(false))] -#[case::invalid(false, json!("true"), None)] +#[case::enable(false, json!(true), true)] +#[case::disable(true, json!(false), false)] +#[case::null(true, Value::Null, false)] +#[case::truthy_string(false, json!("false"), true)] +#[case::falsy_integer(true, json!(0), false)] #[tokio::test] async fn response_mode_follows_the_intercepted_request( call: MessagesCall, traces: TraceCapture, #[case] original_stream: bool, #[case] rewritten_stream: Value, - #[case] expected_stream: Option, + #[case] expected_stream: bool, ) { use futures_util::TryStreamExt; let sse = "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"; - let response = if expected_stream == Some(true) { + let response = if expected_stream { ResponseTemplate::new(200).set_body_raw(sse, "text/event-stream") } else { message_response() @@ -332,14 +337,14 @@ async fn response_mode_follows_the_intercepted_request( .await?; match output { MessagesCallResponse::Stream { chunks, .. } => { - assert_eq!(expected_stream, Some(true)); + assert!(expected_stream); assert_eq!( chunks.try_collect::>().await?.concat(), sse.as_bytes() ); } MessagesCallResponse::Complete(message) => { - assert_eq!(expected_stream, Some(false)); + assert!(!expected_stream); assert_eq!( message, MessagesBody::Message(serde_json::from_value(message_body()).unwrap()) @@ -352,18 +357,12 @@ async fn response_mode_follows_the_intercepted_request( let summaries = traces.summaries("litellm.route"); assert_eq!(summaries.len(), 1); - let Some(expected_stream) = expected_stream else { - assert!(result.unwrap_err().is_request()); - assert!(received(&upstream).await.is_empty()); - assert_eq!(summaries[0]["outcome"], "failure"); - return; - }; result.unwrap(); assert_eq!( only_request(&upstream).await.json()["stream"], rewritten_stream ); - assert_eq!(host.raw_responses().len(), usize::from(!expected_stream)); + assert_eq!(host.raw_responses().len(), 1); assert_eq!(summaries[0]["stream"], expected_stream); assert_eq!(summaries[0]["outcome"], "success"); } @@ -405,14 +404,9 @@ async fn the_raw_upstream_text_is_emitted_once_for_a_message(call: MessagesCall) } #[rstest] -#[case::upstream_error(ResponseTemplate::new(500).set_body_string("boom"))] -#[case::stream(ResponseTemplate::new(200).set_body_raw("event: message_stop\ndata: {}\n\n", "text/event-stream"))] #[tokio::test] -async fn no_raw_response_is_emitted_for_a_stream_or_a_failure( - call: MessagesCall, - #[case] response: ResponseTemplate, -) { - let upstream = upstream([response]).await; +async fn no_raw_response_is_emitted_for_a_failure(call: MessagesCall) { + let upstream = upstream([ResponseTemplate::new(500).set_body_string("boom")]).await; let host = RecordingHost::passthrough(authenticated( with_fields(call, json!({"stream": true})), upstream.uri(), @@ -424,6 +418,32 @@ async fn no_raw_response_is_emitted_for_a_stream_or_a_failure( assert!(host.raw_responses().is_empty()); } +#[rstest] +#[tokio::test] +async fn a_stream_emits_its_head_without_a_body_before_any_chunk(call: MessagesCall) { + let upstream = upstream([ResponseTemplate::new(200) + .insert_header("request-id", "req_stream") + .set_body_raw("event: message_stop\ndata: {}\n\n", "text/event-stream")]) + .await; + let host = RecordingHost::passthrough(authenticated( + with_fields(call, json!({"stream": true})), + upstream.uri(), + )); + + let _ = run_through(&host).await; + + let [raw] = <[RawResponse; 1]>::try_from(host.raw_heads()) + .unwrap_or_else(|raws| panic!("expected one raw response, got {}", raws.len())); + assert_eq!(raw.body, ""); + let head = raw.head.expect("the stream's head is forwarded"); + assert_eq!(head.status, 200); + assert!( + head.headers + .iter() + .any(|(name, value)| name == "request-id" && value == "req_stream") + ); +} + /// Python logs `optional_params` after its requested-param gate, so a dropped param must /// not resurface in callbacks. #[rstest] @@ -456,6 +476,38 @@ async fn the_request_context_carries_the_shaped_params_without_model_or_messages assert_eq!(optional_params, json!({"max_tokens": 16})); } +#[rstest] +#[tokio::test] +async fn the_request_context_keeps_the_nested_fields_additional_drop_params_strip( + call: MessagesCall, +) { + let upstream = upstream([message_response()]).await; + let tool = json!({"name": "lookup", "input_schema": {"type": "object"}, "input_examples": [{"q": "x"}]}); + let host = RecordingHost::passthrough(authenticated( + MessagesCall { + shaping: MessagesShaping { + settings: MessagesSettings { + additional_drop_params: vec!["tools[*].input_examples".into()], + ..MessagesSettings::default() + }, + ..MessagesShaping::default() + }, + ..with_fields(call, json!({"tools": [tool.clone()]})) + }, + upstream.uri(), + )); + + run_through(&host).await.expect("messages call succeeds"); + + let [optional_params] = <[Value; 1]>::try_from(host.optional_params.into_inner().unwrap()) + .unwrap_or_else(|seen| panic!("before_provider_request runs once, saw {}", seen.len())); + assert_eq!(optional_params["tools"], json!([tool])); + assert_eq!( + only_request(&upstream).await.json()["tools"][0].get("input_examples"), + None + ); +} + #[rstest] #[tokio::test] async fn the_request_context_leaves_out_a_listed_param_the_model_refuses(call: MessagesCall) { @@ -534,3 +586,98 @@ async fn the_request_context_carries_the_requested_reasoning_not_its_translation ) ); } + +#[derive(Default)] +struct RecordingAnswer(Mutex>); + +impl litellm_inference_messages::HostAnswer for RecordingAnswer { + fn answer(&self, stream: bool) -> futures_util::future::BoxFuture<'_, Result<(), Error>> { + self.0.lock().unwrap().push(stream); + Box::pin(async { Ok(()) }) + } +} + +#[rstest] +#[case::unary(false)] +#[case::stream(true)] +#[tokio::test] +async fn an_intercepted_call_is_answered_by_the_host_before_the_mock_and_the_provider( + call: MessagesCall, + #[case] streaming: bool, +) { + let upstream = upstream([message_response()]).await; + let answer = Arc::new(RecordingAnswer::default()); + let route = messages_route(no_secrets()).with_host_answer(answer.clone()); + let mut request = authenticated( + with_fields(call, json!({"stream": streaming})), + upstream.uri(), + ); + request.shaping.settings.intercepted = true; + request.shaping.settings.mock_response = Some(object(json!({"id": "mocked"}))); + let host = RecordingHost::passthrough(request); + + let output = route + .execute(host.request().unwrap(), &host, None) + .await + .unwrap(); + + assert!(matches!( + output, + MessagesCallResponse::Complete(MessagesBody::Unchecked(body)) if body.is_empty() + )); + assert_eq!(*answer.0.lock().unwrap(), vec![streaming]); + assert!(received(&upstream).await.is_empty()); + let facts = host.facts.lock().unwrap(); + assert_eq!(facts.len(), 1); + assert_eq!(facts[0].source, ResultSource::Host); +} + +#[rstest] +#[tokio::test] +async fn a_call_no_interceptor_owns_never_asks_the_host(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let answer = Arc::new(RecordingAnswer::default()); + let route = messages_route(no_secrets()).with_host_answer(answer.clone()); + let host = RecordingHost::passthrough(authenticated(call, upstream.uri())); + + route + .execute(host.request().unwrap(), &host, None) + .await + .unwrap(); + + assert!(answer.0.lock().unwrap().is_empty()); + assert_eq!(received(&upstream).await.len(), 1); +} + +#[derive(Default)] +struct DecliningAnswer(Mutex>); + +impl litellm_inference_messages::HostAnswer for DecliningAnswer { + fn answer(&self, _stream: bool) -> futures_util::future::BoxFuture<'_, Result<(), Error>> { + panic!("a declined interception never asks for an answer") + } + + fn intercept(&self, stream: bool) -> futures_util::future::BoxFuture<'_, Result> { + self.0.lock().unwrap().push(stream); + Box::pin(async { Ok(false) }) + } +} + +#[rstest] +#[tokio::test] +async fn an_interception_no_interceptor_takes_reaches_the_provider(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let answer = Arc::new(DecliningAnswer::default()); + let route = messages_route(no_secrets()).with_host_answer(answer.clone()); + let mut request = authenticated(call, upstream.uri()); + request.shaping.settings.intercepted = true; + let host = RecordingHost::passthrough(request); + + route + .execute(host.request().unwrap(), &host, None) + .await + .unwrap(); + + assert_eq!(*answer.0.lock().unwrap(), vec![false]); + assert_eq!(received(&upstream).await.len(), 1); +} diff --git a/litellm-rust/crates/inference-messages/tests/messages/main.rs b/litellm-rust/crates/inference-messages/tests/messages/main.rs index fe203287766..1d515e87b90 100644 --- a/litellm-rust/crates/inference-messages/tests/messages/main.rs +++ b/litellm-rust/crates/inference-messages/tests/messages/main.rs @@ -19,12 +19,16 @@ use wiremock::ResponseTemplate; mod support; use support::*; +mod gateway; mod host; +mod pre_request; mod request; mod response; +mod retry; mod secrets; mod stream; mod tencent; +mod transport; const MODEL: &str = "claude-sonnet-4-5"; diff --git a/litellm-rust/crates/inference-messages/tests/messages/pre_request.rs b/litellm-rust/crates/inference-messages/tests/messages/pre_request.rs new file mode 100644 index 00000000000..13a632bdecd --- /dev/null +++ b/litellm-rust/crates/inference-messages/tests/messages/pre_request.rs @@ -0,0 +1,141 @@ +use futures_util::future::BoxFuture; +use litellm_inference_messages::PreRequestHooks; +use rstest::rstest; + +use super::*; + +struct Hooks { + rewrite: Box Result + Send + Sync>, + runs: Mutex, +} + +impl PreRequestHooks for Hooks { + fn run(&self, call: MessagesCall) -> BoxFuture<'_, Result> { + *self.runs.lock().unwrap() += 1; + let rewritten = (self.rewrite)(call); + Box::pin(async move { rewritten }) + } +} + +fn hooks( + rewrite: impl Fn(MessagesCall) -> Result + Send + Sync + 'static, +) -> Arc { + Arc::new(Hooks { + rewrite: Box::new(rewrite), + runs: Mutex::new(0), + }) +} + +async fn run_hooked(hooks: Arc, call: MessagesCall) -> Result { + let host = LocalMessagesHost::new(call); + let route = messages_route(Arc::new(RecordingSecrets::empty())).with_pre_request_hooks(hooks); + litellm_host_native::in_process::run_hosted( + route.machine(host.request()?, None), + host.runtime(), + ) + .await +} + +fn mocked(call: MessagesCall, mock: Map) -> MessagesCall { + MessagesCall { + shaping: MessagesShaping { + settings: MessagesSettings { + mock_response: Some(mock), + ..call.shaping.settings + }, + ..call.shaping + }, + ..call + } +} + +fn routed(call: MessagesCall, base: String) -> MessagesCall { + MessagesCall { + api_key: Some("sk-test".into()), + api_base: Some(base), + ..call + } +} + +#[rstest] +#[tokio::test] +async fn the_provider_receives_the_call_the_hooks_leave(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let hooks = hooks(|call| { + Ok(with_fields( + call, + json!({"system": "hooked", "max_tokens": 7}), + )) + }); + + run_hooked(hooks.clone(), routed(call, upstream.uri())) + .await + .expect("messages call succeeds"); + + let sent: Value = only_request(&upstream).await.body_json().unwrap(); + assert_eq!(sent["system"], "hooked"); + assert_eq!(sent["max_tokens"], 7); + assert_eq!(*hooks.runs.lock().unwrap(), 1); +} + +#[rstest] +#[case::hook_sets_the_mock(false, true, true)] +#[case::hook_keeps_the_callers_mock(true, false, true)] +#[case::hook_clears_the_callers_mock(true, true, false)] +#[tokio::test] +async fn the_mock_is_read_from_the_hooked_call( + call: MessagesCall, + #[case] called_with_mock: bool, + #[case] hook_rewrites_mock: bool, + #[case] mocked_response: bool, +) { + let upstream = upstream([message_response()]).await; + let mock = object(json!({"id": "mocked"})); + let call = routed(call, upstream.uri()); + let call = match called_with_mock { + true => mocked(call, mock.clone()), + false => call, + }; + let hooked_mock = (!called_with_mock).then(|| mock.clone()); + let hooks = hooks(move |call| { + Ok(match (hook_rewrites_mock, &hooked_mock) { + (false, _) => call, + (true, Some(mock)) => mocked(call, mock.clone()), + (true, None) => MessagesCall { + shaping: MessagesShaping { + settings: MessagesSettings { + mock_response: None, + ..call.shaping.settings + }, + ..call.shaping + }, + ..call + }, + }) + }); + + let output = run_hooked(hooks, call) + .await + .expect("messages call succeeds"); + + let mocked_output = matches!( + output, + MessagesOutput::Complete(MessagesBody::Unchecked(ref body)) if *body == mock + ); + assert_eq!(mocked_output, mocked_response); + assert_eq!(received(&upstream).await.is_empty(), mocked_response); +} + +#[rstest] +#[tokio::test] +async fn a_failing_hook_fails_the_call_before_the_provider(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let hooks = hooks(|_| Err(Error::InvalidProvider("refused".into()))); + + let Err(error) = run_hooked(hooks, routed(call, upstream.uri())).await else { + panic!("the hook's failure fails the call"); + }; + + assert!(matches!(error, Error::InvalidProvider(ref provider) if provider == "refused")); + assert!(received(&upstream).await.is_empty()); +} diff --git a/litellm-rust/crates/inference-messages/tests/messages/response.rs b/litellm-rust/crates/inference-messages/tests/messages/response.rs index f978da5e995..7c2f3250acf 100644 --- a/litellm-rust/crates/inference-messages/tests/messages/response.rs +++ b/litellm-rust/crates/inference-messages/tests/messages/response.rs @@ -2,7 +2,9 @@ use litellm_host::{ interceptors::{ExecutionFacts, ResultSource}, lifecycle::ExecutionEvent, }; -use litellm_inference_messages::{MessagesBody, MessagesCallResponse, messages_body}; +use litellm_inference_messages::{ + MessagesBody, MessagesCallResponse, UnencodableHeader, messages_body, +}; use litellm_inference_testing::{ RecordingSecrets, http_config, no_secrets, provider_http, resources, }; @@ -153,6 +155,37 @@ async fn the_message_passes_through_losslessly(call: MessagesCall) { assert_eq!(serde_json::to_value(&message).unwrap(), upstream_body); } +#[rstest] +#[case::without_stop_reason(json!({"stop_sequence": null}))] +#[case::without_stop_fields(json!({}))] +#[tokio::test] +async fn a_message_without_stop_reason_keeps_it_absent(call: MessagesCall, #[case] stop: Value) { + let mut upstream_body = json!({ + "id": "msg_3", "type": "message", "role": "assistant", "model": MODEL, + "content": [{"type": "text", "text": "hi"}], + "usage": {"input_tokens": 1, "output_tokens": 1} + }); + upstream_body + .as_object_mut() + .unwrap() + .extend(stop.as_object().unwrap().clone()); + let upstream = upstream([json_response(upstream_body.clone())]).await; + + let output = run(MessagesCall { + api_key: Some("sk".into()), + api_base: Some(upstream.uri()), + ..call + }) + .await + .expect("messages call succeeds"); + + let MessagesOutput::Complete(MessagesBody::Unchecked(body)) = output else { + panic!("a message without stop_reason is returned as sent"); + }; + upstream_body["stop_sequence"] = Value::Null; + assert_eq!(Value::Object(body), upstream_body); +} + #[rstest] #[tokio::test] async fn a_json_error_envelope_is_kept_verbatim(call: MessagesCall) { @@ -310,6 +343,88 @@ async fn a_provider_slower_than_the_timeout_fails_the_call(call: MessagesCall) { assert_eq!(error.upstream_response(), None); } +fn with_settings(call: MessagesCall, settings: MessagesSettings) -> MessagesCall { + MessagesCall { + shaping: MessagesShaping { + settings, + ..call.shaping + }, + ..call + } +} + +#[rstest] +#[case::unary(false)] +#[case::stream(true)] +#[tokio::test] +async fn a_non_ascii_response_header_fails_the_call_when_python_reads_heads_as_ascii( + call: MessagesCall, + #[case] stream: bool, +) { + let upstream = upstream([message_response().insert_header("x-fz-unicode", "café")]).await; + let call = with_fields( + MessagesCall { + api_key: Some("sk".into()), + api_base: Some(upstream.uri()), + ..call + }, + json!({"stream": stream}), + ); + let settings = MessagesSettings { + ascii_response_headers: true, + ..MessagesSettings::default() + }; + + let error = run(with_settings(call, settings)) + .await + .expect_err("the head cannot be encoded"); + + assert_eq!( + litellm_error::find::(&error), + Some(&UnencodableHeader::Received("café".as_bytes().to_vec())) + ); +} + +#[rstest] +#[tokio::test] +async fn a_non_ascii_response_header_is_served_when_python_keeps_raw_heads(call: MessagesCall) { + let upstream = upstream([message_response().insert_header("x-fz-unicode", "café")]).await; + + let message = run_message(MessagesCall { + api_key: Some("sk".into()), + api_base: Some(upstream.uri()), + ..call + }) + .await; + + assert_eq!(message.id, "msg_1"); +} + +#[rstest] +#[tokio::test] +async fn an_unencodable_request_header_fails_before_anything_is_sent(call: MessagesCall) { + let upstream = upstream([message_response()]).await; + let call = MessagesCall { + api_key: Some("sk".into()), + api_base: Some(upstream.uri()), + ..call + }; + let settings = MessagesSettings { + unencodable_request_header: Some(b"h\xed\xa0\x80".to_vec()), + ..MessagesSettings::default() + }; + + let error = run(with_settings(call, settings)) + .await + .expect_err("the header cannot be encoded"); + + assert_eq!( + litellm_error::find::(&error), + Some(&UnencodableHeader::Sent(b"h\xed\xa0\x80".to_vec())) + ); + assert!(received(&upstream).await.is_empty()); +} + #[rstest] #[tokio::test] async fn a_transport_error_does_not_echo_the_provider_url(call: MessagesCall) { @@ -365,7 +480,7 @@ async fn the_facade_sends_through_the_injected_http_pool_configuration(call: Mes } #[rstest] -#[case::mistyped_param(json!({"model": MODEL, "messages": [], "max_tokens": "16"}))] +#[case::mistyped_param(json!({"model": MODEL, "messages": "hello", "max_tokens": 16}))] #[case::missing_messages(json!({"model": MODEL, "max_tokens": 16}))] fn a_body_that_does_not_parse_is_an_invalid_request(#[case] raw: Value) { let error = messages_body(object(raw)).expect_err("the body is rejected"); diff --git a/litellm-rust/crates/inference-messages/tests/messages/retry.rs b/litellm-rust/crates/inference-messages/tests/messages/retry.rs new file mode 100644 index 00000000000..e48482dc8b0 --- /dev/null +++ b/litellm-rust/crates/inference-messages/tests/messages/retry.rs @@ -0,0 +1,364 @@ +use futures_util::TryStreamExt; +use litellm_host::{ + interceptors::{RetriedRequest, RetryReason}, + lifecycle::{CallEvent, ExecutionEvent}, +}; +use litellm_inference_messages::MessagesCallResponse; +use litellm_inference_testing::RecordingSecrets; +use litellm_llms::base_llm::messages::context::MessagesModelCapabilities; +use rstest::rstest; + +use super::*; + +const INVALID_SIGNATURE: &str = "messages.1.content.0: Invalid `signature` in `thinking` block"; +const BOUND_ELSEWHERE: &str = "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation."; + +fn rejection(status: u16, message: &str) -> ResponseTemplate { + status_response( + status, + json!({"type": "error", "error": {"type": "invalid_request_error", "message": message}}), + ) +} + +fn sse_response() -> ResponseTemplate { + ResponseTemplate::new(200).set_body_raw( + "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + "text/event-stream", + ) +} + +fn replay(call: MessagesCall, api_base: String, stream: bool, thinking: Value) -> MessagesCall { + MessagesCall { + api_key: Some("sk-ant".into()), + api_base: Some(api_base), + ..with_fields( + call, + json!({ + "max_tokens": 4096, + "stream": stream, + "thinking": thinking, + "messages": [ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [ + {"type": "thinking", "thinking": "plan", "signature": "sig"}, + {"type": "text", "text": "hello"} + ]}, + {"role": "assistant", "content": [{"type": "redacted_thinking", "data": "opaque"}]}, + {"role": "user", "content": "again"} + ] + }), + ) + } +} + +fn enabled() -> Value { + json!({"type": "enabled", "budget_tokens": 2048}) +} + +async fn execute( + host: &RecordingCall, +) -> Result<(MessagesCallResponse, Vec), Error> { + let route = messages_route(Arc::new(RecordingSecrets::empty())); + let response = route + .execute(host.request()?, host, Some(host.events.0.sender.clone())) + .await?; + match response { + MessagesCallResponse::Stream { head, chunks } => Ok(( + MessagesCallResponse::Stream { + head, + chunks: Box::pin(futures_util::stream::empty()), + }, + chunks.try_collect().await?, + )), + complete => Ok((complete, Vec::new())), + } +} + +fn observed_retries(host: &RecordingCall) -> Vec { + host.events + .0 + .lock() + .unwrap() + .iter() + .filter_map(|event| match event { + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { retry }) => { + Some(retry.clone()) + } + _ => None, + }) + .collect() +} + +#[rstest] +#[case::invalid_signature(INVALID_SIGNATURE)] +#[case::missing_signature( + "messages.1.content.0.thinking.signature.str: Input should be a valid string" +)] +#[case::empty_thinking("messages.1.content.0.thinking: each thinking block must contain thinking")] +#[case::unpinned_binding_mismatch(BOUND_ELSEWHERE)] +#[tokio::test] +async fn a_rejected_thinking_replay_is_sent_once_more_without_thinking( + call: MessagesCall, + #[case] message: &str, + #[values(false, true)] stream: bool, + #[values("anthropic", "azure_ai", "deepseek", "minimax")] provider: &str, +) { + let success = if stream { + sse_response() + } else { + message_response() + }; + let upstream = upstream([rejection(400, message), success]).await; + let host = RecordingCall::::new(replay( + MessagesCall { + custom_llm_provider: Some(provider.into()), + ..call + }, + upstream.uri(), + stream, + enabled(), + )); + + let (response, chunks) = execute(&host).await.expect("the retry succeeds"); + + let [first, second] = <[_; 2]>::try_from(received(&upstream).await).unwrap(); + assert_eq!(first.json()["thinking"], enabled()); + assert_eq!( + second.json()["messages"], + json!([ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [{"type": "text", "text": "hello"}]}, + {"role": "user", "content": "again"} + ]) + ); + let mut expected = first.json(); + expected.as_object_mut().unwrap().shift_remove("thinking"); + expected["messages"] = second.json()["messages"].clone(); + assert_eq!(second.json(), expected); + assert_eq!(first.header("x-hook"), second.header("x-hook")); + let expected_retry = RetriedRequest { + reasons: vec![RetryReason::ThinkingSignature], + body: second.json(), + }; + assert_eq!(*host.retried.lock().unwrap(), vec![expected_retry.clone()]); + assert_eq!(observed_retries(&host), vec![expected_retry]); + assert_eq!( + matches!(response, MessagesCallResponse::Stream { .. }), + stream + ); + assert_eq!(chunks.is_empty(), !stream); +} + +#[rstest] +#[tokio::test] +async fn a_second_rejection_is_the_error_the_caller_sees( + call: MessagesCall, + #[values(false, true)] stream: bool, +) { + let upstream = upstream([ + rejection(400, INVALID_SIGNATURE), + rejection( + 400, + "messages.0.content.0: Invalid `signature` in `thinking` block, again", + ), + ]) + .await; + let host = RecordingCall::::new(replay(call, upstream.uri(), stream, enabled())); + + let error = execute(&host).await.err().expect("the retry fails"); + + assert_eq!(received(&upstream).await.len(), 2); + let (status, body) = error.upstream_response().unwrap(); + assert_eq!(status, 400); + assert!(body.contains("again"), "{body}"); + assert_eq!(host.retried.lock().unwrap().len(), 1); +} + +#[rstest] +#[case::not_a_400(429, INVALID_SIGNATURE, json!({"type": "adaptive"}))] +#[case::unrelated_400(400, "max_tokens: 4096 > 64000", json!({"type": "adaptive"}))] +#[case::signature_without_thinking(400, "Invalid `signature` in `tool_use` block", json!({"type": "adaptive"}))] +#[case::caller_pinned_binding( + 400, + BOUND_ELSEWHERE, + json!({"type": "adaptive", "block_binding": {"prefix_mismatch_behavior": "error"}}) +)] +#[tokio::test] +async fn other_failures_reach_the_caller_without_a_retry( + call: MessagesCall, + #[case] status: u16, + #[case] message: &str, + #[case] thinking: Value, +) { + let upstream = upstream([rejection(status, message), message_response()]).await; + let adaptive = MessagesShaping { + capabilities: MessagesModelCapabilities { + supports_adaptive_thinking: true, + ..MessagesModelCapabilities::default() + }, + ..MessagesShaping::default() + }; + let host = RecordingCall::::new(replay( + MessagesCall { + shaping: adaptive, + ..call + }, + upstream.uri(), + false, + thinking.clone(), + )); + + let error = execute(&host).await.err().expect("the call fails"); + + let sent = only_request(&upstream).await; + assert_eq!(sent.json()["thinking"], thinking); + assert_eq!(error.upstream_response().unwrap().0, status); + assert!(host.retried.lock().unwrap().is_empty()); + assert!(observed_retries(&host).is_empty()); +} + +const STRICT_REJECTION: &str = "Too many strict tools (21). The maximum is 20."; + +fn strict_tools( + call: MessagesCall, + api_base: String, + stream: bool, + drop_params: bool, +) -> MessagesCall { + MessagesCall { + api_key: Some("sk-ant".into()), + api_base: Some(api_base), + shaping: MessagesShaping { + settings: MessagesSettings { + drop_params, + drops_unsupported_params: drop_params, + ..MessagesSettings::default() + }, + ..MessagesShaping::default() + }, + ..with_fields( + call, + json!({ + "max_tokens": 64, + "stream": stream, + "messages": [{"role": "user", "content": "hi"}], + "tools": [ + {"name": "a", "input_schema": {"type": "object"}, "strict": true}, + {"name": "b", "input_schema": {"type": "object"}, "strict": false}, + {"name": "c", "input_schema": {"type": "object"}} + ] + }), + ) + } +} + +#[rstest] +#[tokio::test] +async fn a_rejected_strict_tool_is_sent_once_more_without_strict_under_drop_params( + call: MessagesCall, + #[values(false, true)] stream: bool, +) { + let success = if stream { + sse_response() + } else { + message_response() + }; + let upstream = upstream([rejection(400, STRICT_REJECTION), success]).await; + let host = RecordingCall::::new(strict_tools(call, upstream.uri(), stream, true)); + + let (response, _) = execute(&host).await.expect("the retry succeeds"); + + let [first, second] = <[_; 2]>::try_from(received(&upstream).await).unwrap(); + assert_eq!(first.json()["tools"][0]["strict"], json!(true)); + let mut expected = first.json(); + expected["tools"] = json!([ + {"name": "a", "input_schema": {"type": "object"}}, + {"name": "b", "input_schema": {"type": "object"}}, + {"name": "c", "input_schema": {"type": "object"}} + ]); + assert_eq!(second.json(), expected); + let expected_retry = RetriedRequest { + reasons: vec![RetryReason::StrictTools { dropped: 1 }], + body: second.json(), + }; + assert_eq!(*host.retried.lock().unwrap(), vec![expected_retry.clone()]); + assert_eq!(observed_retries(&host), vec![expected_retry]); + assert_eq!( + matches!(response, MessagesCallResponse::Stream { .. }), + stream + ); +} + +#[rstest] +#[tokio::test] +async fn a_rejected_strict_tool_reaches_the_caller_without_drop_params(call: MessagesCall) { + let upstream = upstream([rejection(400, STRICT_REJECTION), message_response()]).await; + let host = RecordingCall::::new(strict_tools(call, upstream.uri(), false, false)); + + let error = execute(&host).await.err().expect("the call fails"); + + assert_eq!( + only_request(&upstream).await.json()["tools"][0]["strict"], + json!(true) + ); + assert_eq!(error.upstream_response().unwrap().0, 400); + assert!(observed_retries(&host).is_empty()); +} + +#[rstest] +#[tokio::test] +async fn strict_tools_and_a_thinking_replay_share_the_one_retry(call: MessagesCall) { + let upstream = upstream([ + rejection(400, STRICT_REJECTION), + rejection(400, INVALID_SIGNATURE), + message_response(), + ]) + .await; + let host = RecordingCall::::new(replay( + strict_tools(call, upstream.uri(), false, true), + upstream.uri(), + false, + enabled(), + )); + + let error = execute(&host) + .await + .err() + .expect("the second rejection is raised"); + + let [first, second] = <[_; 2]>::try_from(received(&upstream).await).unwrap(); + assert_eq!(first.json()["thinking"], enabled()); + assert_eq!(second.json()["thinking"], enabled()); + assert_eq!( + second.json()["tools"][0], + json!({"name": "a", "input_schema": {"type": "object"}}) + ); + assert_eq!(received(&upstream).await.len(), 2); + assert!(error.upstream_response().unwrap().1.contains("signature")); +} + +#[rstest] +#[tokio::test] +async fn a_truthy_global_drop_params_that_is_not_true_does_not_drop_strict(call: MessagesCall) { + let upstream = upstream([rejection(400, STRICT_REJECTION), message_response()]).await; + let strict = strict_tools(call, upstream.uri(), false, true); + let host = RecordingCall::::new(MessagesCall { + shaping: MessagesShaping { + settings: MessagesSettings { + drops_unsupported_params: false, + ..strict.shaping.settings.clone() + }, + ..strict.shaping.clone() + }, + ..strict + }); + + let error = execute(&host).await.err().expect("the call fails"); + + assert_eq!( + only_request(&upstream).await.json()["tools"][0]["strict"], + json!(true) + ); + assert_eq!(error.upstream_response().unwrap().0, 400); + assert!(observed_retries(&host).is_empty()); +} diff --git a/litellm-rust/crates/inference-messages/tests/messages/stream.rs b/litellm-rust/crates/inference-messages/tests/messages/stream.rs index 99ba08495aa..c9738fa2a0d 100644 --- a/litellm-rust/crates/inference-messages/tests/messages/stream.rs +++ b/litellm-rust/crates/inference-messages/tests/messages/stream.rs @@ -451,7 +451,7 @@ async fn stalling_error_upstream() -> (String, JoinHandle<()>) { #[rstest] #[tokio::test] -async fn the_timeout_covers_a_stalled_stream_error_body(call: MessagesCall) { +async fn a_stalled_stream_error_body_reads_as_empty(call: MessagesCall) { let (base, connection) = stalling_error_upstream().await; let host = RecordingStreamHost::new( MessagesCall { @@ -467,7 +467,7 @@ async fn the_timeout_covers_a_stalled_stream_error_body(call: MessagesCall) { .expect_err("a stalled error body fails the call"); assert!(error.dispatched(), "{error:?}"); - assert_eq!(error.upstream_response(), None); + assert_eq!(error.upstream_response(), Some((429, ""))); assert!(host.seen.into_inner().unwrap().is_empty()); tokio::time::timeout(Duration::from_secs(5), connection) .await diff --git a/litellm-rust/crates/inference-messages/tests/messages/transport.rs b/litellm-rust/crates/inference-messages/tests/messages/transport.rs new file mode 100644 index 00000000000..f561b09e55f --- /dev/null +++ b/litellm-rust/crates/inference-messages/tests/messages/transport.rs @@ -0,0 +1,256 @@ +use std::collections::VecDeque; + +use bytes::Bytes; +use futures_util::{StreamExt, TryStreamExt, future::BoxFuture}; +use litellm_inference_messages::{ + Delivered, MessagesCallResponse, Transport, TransportBody, TransportRequest, TransportResponse, +}; +use litellm_inference_testing::RecordingSecrets; +use rstest::rstest; + +use super::*; + +const INVALID_SIGNATURE: &str = "messages.1.content.0: Invalid `signature` in `thinking` block"; +const UNREACHABLE_BASE: &str = "http://127.0.0.1:9"; + +#[derive(Debug, thiserror::Error)] +#[error("raised by the host client")] +struct Raised; + +enum Scripted { + Complete(Value), + Stream(&'static [&'static str]), + Rejected(u16, &'static str), + Failed, +} + +struct Sent { + url: String, + headers: Vec<(String, String)>, + body: Value, + stream: bool, +} + +#[derive(Default)] +struct ScriptedTransport { + script: Mutex>, + sent: Mutex>, +} + +impl ScriptedTransport { + fn new(script: impl IntoIterator) -> Arc { + Arc::new(Self { + script: Mutex::new(script.into_iter().collect()), + sent: Mutex::default(), + }) + } + + fn sent(&self) -> std::sync::MutexGuard<'_, Vec> { + self.sent.lock().unwrap() + } +} + +impl Transport for ScriptedTransport { + fn send( + &self, + request: TransportRequest, + ) -> BoxFuture<'static, Result> { + let TransportBody::Json(body) = request.body else { + panic!("an unsigned request hands the host its JSON body"); + }; + self.sent.lock().unwrap().push(Sent { + url: request.url, + headers: request.headers, + body, + stream: request.stream, + }); + let next = self + .script + .lock() + .unwrap() + .pop_front() + .expect("a scripted answer"); + Box::pin(async move { + let (status, delivered) = match next { + Scripted::Complete(body) => (200, Delivered::Complete(body.to_string())), + Scripted::Stream(frames) => ( + 200, + Delivered::Stream( + futures_util::stream::iter( + frames.iter().map(|frame| Ok(Bytes::from_static(frame.as_bytes()))), + ) + .boxed(), + ), + ), + Scripted::Rejected(status, message) => ( + status, + Delivered::Rejected { + text: json!({"type": "error", "error": {"type": "invalid_request_error", "message": message}}) + .to_string(), + error: Error::transport(Raised), + }, + ), + Scripted::Failed => return Err(Error::transport(Raised)), + }; + Ok(TransportResponse { + status, + headers: vec![("request-id".into(), "req_1".into())], + delivered, + }) + }) + } +} + +fn hosted_call(call: MessagesCall, fields: Value) -> MessagesCall { + MessagesCall { + api_key: Some("sk-ant".into()), + api_base: Some(UNREACHABLE_BASE.into()), + ..with_fields(call, fields) + } +} + +async fn execute( + transport: Arc, + call: MessagesCall, +) -> Result<(MessagesCallResponse, Vec), Error> { + let host = RecordingCall::::new(call); + let route = messages_route(Arc::new(RecordingSecrets::empty())).with_transport(transport); + match route + .execute(host.request()?, &host, Some(host.events.0.sender.clone())) + .await? + { + MessagesCallResponse::Stream { head, chunks } => Ok(( + MessagesCallResponse::Stream { + head, + chunks: Box::pin(futures_util::stream::empty()), + }, + chunks.try_collect().await?, + )), + complete => Ok((complete, Vec::new())), + } +} + +#[rstest] +#[tokio::test] +async fn the_host_transport_sends_the_wire_request_instead_of_the_native_client( + call: MessagesCall, +) { + let transport = ScriptedTransport::new([Scripted::Complete(message_body())]); + + let (response, _) = execute(transport.clone(), hosted_call(call, json!({}))) + .await + .expect("the host transport answers"); + + let MessagesCallResponse::Complete(MessagesBody::Message(message)) = response else { + panic!("a complete message"); + }; + assert_eq!(message.id, "msg_1"); + let sent = transport.sent(); + let [request] = sent.as_slice() else { + panic!("one request"); + }; + assert_eq!(request.url, format!("{UNREACHABLE_BASE}/v1/messages")); + assert!(!request.stream); + assert_eq!(request.body["model"], MODEL); + assert!( + request + .headers + .iter() + .any(|(name, value)| name == "x-api-key" && value == "sk-ant"), + "{:?}", + request.headers + ); +} + +#[rstest] +#[tokio::test] +async fn a_host_stream_reaches_the_caller_chunk_by_chunk(call: MessagesCall) { + let frames: &'static [&'static str] = &[ + "event: message_start\ndata: {\"type\":\"message_start\"}\n\n", + "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n", + ]; + let transport = ScriptedTransport::new([Scripted::Stream(frames)]); + + let (response, chunks) = execute( + transport.clone(), + hosted_call(call, json!({"stream": true})), + ) + .await + .expect("the host stream opens"); + + let MessagesCallResponse::Stream { head, .. } = response else { + panic!("a stream"); + }; + assert_eq!( + head.headers, + vec![("request-id".to_string(), "req_1".to_string())] + ); + assert_eq!( + chunks, + frames + .iter() + .map(|frame| Bytes::from_static(frame.as_bytes())) + .collect::>() + ); + assert!(transport.sent()[0].stream); +} + +fn replayed_thinking() -> Value { + json!({ + "max_tokens": 4096, + "thinking": {"type": "enabled", "budget_tokens": 2048}, + "messages": [ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [ + {"type": "thinking", "thinking": "plan", "signature": "sig"}, + {"type": "text", "text": "hello"} + ]}, + {"role": "user", "content": "again"} + ] + }) +} + +#[rstest] +#[tokio::test] +async fn a_recoverable_rejection_is_retried_through_the_host_transport(call: MessagesCall) { + let transport = ScriptedTransport::new([ + Scripted::Rejected(400, INVALID_SIGNATURE), + Scripted::Complete(message_body()), + ]); + + execute(transport.clone(), hosted_call(call, replayed_thinking())) + .await + .expect("the retry succeeds"); + + let sent = transport.sent(); + let [first, second] = sent.as_slice() else { + panic!("two requests"); + }; + assert!(first.body.get("thinking").is_some()); + assert!(second.body.get("thinking").is_none()); +} + +#[rstest] +#[case::final_rejection(vec![Scripted::Rejected(429, "slow down")])] +#[case::spent_retry(vec![ + Scripted::Rejected(400, INVALID_SIGNATURE), + Scripted::Rejected(400, INVALID_SIGNATURE), +])] +#[case::client_failure(vec![Scripted::Failed])] +#[tokio::test] +async fn the_caller_gets_the_error_the_host_transport_raised( + call: MessagesCall, + #[case] script: Vec, +) { + let attempts = script.len(); + let transport = ScriptedTransport::new(script); + + let error = execute(transport.clone(), hosted_call(call, replayed_thinking())) + .await + .err() + .expect("the call fails"); + + assert!(litellm_error::find::(&error).is_some(), "{error:?}"); + assert_eq!(error.upstream_response(), None); + assert_eq!(transport.sent().len(), attempts); +} diff --git a/litellm-rust/crates/inference-messages/tests/support/mod.rs b/litellm-rust/crates/inference-messages/tests/support/mod.rs index 3cecc865070..9115b6e89bb 100644 --- a/litellm-rust/crates/inference-messages/tests/support/mod.rs +++ b/litellm-rust/crates/inference-messages/tests/support/mod.rs @@ -117,6 +117,7 @@ pub struct RecordingCall { pub events: Arc, pub chunks: Mutex>, pub head: Mutex>, + pub retried: Mutex>, } #[derive(Default)] @@ -167,6 +168,7 @@ impl RecordingCall

{ events: Arc::new(CallEvents::default()), chunks: Mutex::new(Vec::new()), head: Mutex::new(None), + retried: Mutex::new(Vec::new()), } } } @@ -195,6 +197,14 @@ impl litellm_host::interceptors::Intercepto ) -> Result<(), P::Error> { Ok(()) } + + async fn provider_request_retried( + &self, + retry: litellm_host::interceptors::RetriedRequest, + ) -> Result<(), P::Error> { + self.retried.lock().unwrap().push(retry); + Ok(()) + } } impl

RecordingCall

diff --git a/litellm-rust/crates/inference-ocr/tests/ocr/lifecycle.rs b/litellm-rust/crates/inference-ocr/tests/ocr/lifecycle.rs index 9f59bb9a2a2..509704340fe 100644 --- a/litellm-rust/crates/inference-ocr/tests/ocr/lifecycle.rs +++ b/litellm-rust/crates/inference-ocr/tests/ocr/lifecycle.rs @@ -22,6 +22,7 @@ pub(crate) fn event_name(event: &CallEvent) -> &'static str { CallEvent::Execution(ExecutionEvent::ResultReady { .. }) => "result_ready", CallEvent::Started { .. } => "started", CallEvent::Execution(ExecutionEvent::ProviderResponseReceived { .. }) => "response", + CallEvent::Execution(ExecutionEvent::ProviderRequestRetried { .. }) => "retried", CallEvent::Succeeded { .. } => "success", CallEvent::Failed { .. } => "failure", CallEvent::Cancelled { .. } => "cancelled", diff --git a/litellm-rust/crates/inference-ocr/tests/ocr/machine.rs b/litellm-rust/crates/inference-ocr/tests/ocr/machine.rs index c7a5d58ad3d..9da62e6ccf4 100644 --- a/litellm-rust/crates/inference-ocr/tests/ocr/machine.rs +++ b/litellm-rust/crates/inference-ocr/tests/ocr/machine.rs @@ -66,6 +66,11 @@ async fn drive_until( reply.send(host.after_provider_response(raw).await); Ok(()) } + HostRequest::Intercept(InterceptRequest::ProviderRequestRetried { reply, .. }) => { + ops.push("retried"); + reply.send(Ok(())); + Ok(()) + } }; if let Err(failure) = answer { break machine.interrupt(failure).await.map(completed); @@ -86,6 +91,7 @@ async fn drive_until_notified(machine: &mut OcrMachine, host: &LocalOcrHost, sto MachineStep::Suspended(HostRequest::HostCall(op)) => host.handle_host_call(op).await.unwrap(), MachineStep::Suspended(HostRequest::Intercept(InterceptRequest::BeforeProviderRequest { wire, reply, .. })) => reply.send(*wire), MachineStep::Suspended(HostRequest::Intercept(InterceptRequest::AfterProviderResponse { reply, .. })) => reply.send(Ok(())), + MachineStep::Suspended(HostRequest::Intercept(InterceptRequest::ProviderRequestRetried { reply, .. })) => reply.send(Ok(())), MachineStep::Suspended(HostRequest::Stream(stream)) => match stream { litellm_host::protocol::StreamDelivery::Open(head, _) => match head {}, litellm_host::protocol::StreamDelivery::Chunk(chunk, _) => match chunk {}, diff --git a/litellm-rust/crates/inference-responses/src/ids.rs b/litellm-rust/crates/inference-responses/src/ids.rs index b51aea1559e..fbba8f949a0 100644 --- a/litellm-rust/crates/inference-responses/src/ids.rs +++ b/litellm-rust/crates/inference-responses/src/ids.rs @@ -11,7 +11,7 @@ //! | Id | Applied to | Decoded plaintext | //! |---|---|---| //! | `resp_` | the response `id` | `litellm:custom_llm_provider:{provider};model_id:{model_id};response_id:{id}` | -//! | `encitem_` | the `id` of an output item with `encrypted_content` | `litellm:model_id:{model_id};item_id:{id}` | +//! | `encitem_` | the `id` of a reasoning or compaction output item, or of any item with `encrypted_content` | `litellm:model_id:{model_id};item_id:{id}` | //! | `litellm_enc:;{content}` | that item's `encrypted_content` | `` is `model_id:{model_id}`, and the original content follows the `;` unencoded | //! | `cntr_` | `container_id` on output items, `code_interpreter_call`, and message annotations | `litellm:custom_llm_provider:{provider};model_id:{model_id};container_id:{id}` | //! @@ -25,8 +25,9 @@ //! - `encitem_` and `litellm_enc:` carry encrypted-content affinity: encrypted reasoning only //! decrypts under the API key that produced it, so the router pins replays to that deployment. //! They are stamped only when the router sets `encrypted_content_affinity_enabled` and a -//! deployment `model_id` is known (see [`IdScope`]). Items without an `id`, such as Codex's, -//! carry the deployment in the wrapped content alone. +//! deployment `model_id` is known (see [`IdScope`]). Reasoning and compaction items get an +//! `encitem_` id by type, so it matches the one Python streams before their content arrives. +//! Items without an `id`, such as Codex's, carry the deployment in the wrapped content alone. //! - `cntr_` lets container calls find the provider and deployment that own a container. A //! container id that already names a provider is left as it is. //! - On the way in, [`restore_input`] turns `encitem_` ids and `litellm_enc:` content in the @@ -51,6 +52,7 @@ const RESPONSE_PREFIX: &str = "resp_"; const ITEM_PREFIX: &str = "encitem_"; const CONTAINER_PREFIX: &str = "cntr_"; const WRAPPED_CONTENT_PREFIX: &str = "litellm_enc:"; +const ENCRYPTED_ITEM_TYPES: [&str; 2] = ["reasoning", "compaction"]; /// Python's non-strict `base64.b64decode`: characters outside the alphabet are skipped and /// non-zero trailing bits are accepted @@ -211,15 +213,23 @@ pub fn decode_container_id(id: &str) -> DecodedContainerId { } fn encode_encrypted_item(item: &mut Map, model_id: &str) { - let Some(Value::String(content)) = item.get_mut("encrypted_content") else { - return; + let wrapped = match item.get_mut("encrypted_content") { + Some(Value::String(content)) if !content.is_empty() => { + *content = wrap_encrypted_content(content, model_id); + true + } + _ => false, }; - if content.is_empty() { + let encrypted_type = item + .get("type") + .and_then(Value::as_str) + .is_some_and(|item_type| ENCRYPTED_ITEM_TYPES.contains(&item_type)); + if !wrapped && !encrypted_type { return; } - *content = wrap_encrypted_content(content, model_id); if let Some(Value::String(id)) = item.get_mut("id") && !id.is_empty() + && decode_encrypted_item_id(id).is_none() { *id = encrypted_item_id(model_id, id); } @@ -456,6 +466,33 @@ mod tests { ); } + #[rstest] + #[case::reasoning_without_ciphertext( + json!({"type": "reasoning", "id": "rs_0a1b", "summary": []}), + json!({"type": "reasoning", "id": "encitem_bGl0ZWxsbTptb2RlbF9pZDpkZXBsb3ktMTtpdGVtX2lkOnJzXzBhMWI=", "summary": []}) + )] + #[case::compaction( + json!({"type": "compaction", "id": "cmp_0a1b", "encrypted_content": "gAAAA"}), + json!({ + "type": "compaction", + "id": "encitem_bGl0ZWxsbTptb2RlbF9pZDpkZXBsb3ktMTtpdGVtX2lkOmNtcF8wYTFi", + "encrypted_content": "litellm_enc:bW9kZWxfaWQ6ZGVwbG95LTE=;gAAAA" + }) + )] + #[case::already_encoded( + json!({"type": "reasoning", "id": "encitem_bGl0ZWxsbTptb2RlbF9pZDpkZXBsb3ktMTtpdGVtX2lkOnJzXzBhMWI=", "summary": []}), + json!({"type": "reasoning", "id": "encitem_bGl0ZWxsbTptb2RlbF9pZDpkZXBsb3ktMTtpdGVtX2lkOnJzXzBhMWI=", "summary": []}) + )] + #[case::message( + json!({"type": "message", "id": "msg_1", "content": []}), + json!({"type": "message", "id": "msg_1", "content": []}) + )] + fn encodes_item_ids_by_type_under_affinity(#[case] item: Value, #[case] expected: Value) { + let mut encoded = response("resp_1", json!([item])); + encode_response(&mut encoded, &scope(Some("openai"), Some("deploy-1"), true)); + assert_eq!(Value::Array(encoded.output), json!([expected])); + } + #[rstest] #[case::affinity_disabled(scope(Some("openai"), Some("deploy-1"), false))] #[case::no_model_id(scope(Some("openai"), None, true))] diff --git a/litellm-rust/crates/inference/AGENTS.md b/litellm-rust/crates/inference/AGENTS.md index bcbc98a209e..bc9be4825ea 100644 --- a/litellm-rust/crates/inference/AGENTS.md +++ b/litellm-rust/crates/inference/AGENTS.md @@ -81,3 +81,4 @@ - Cache lookup follows provider preparation, credential resolution, and the request interceptor - keys describe the effective provider URL, authenticated headers, and rewritten body - signed requests bypass caching until the signing identity has a stable cache representation +- A service that keys entries by the caller's arguments (`keyed_by_caller`, the Python host's legacy cache) is looked up before provider preparation, as Python's `@client` wrapper does, and a hit skips request building and the request interceptor diff --git a/litellm-rust/crates/inference/Cargo.toml b/litellm-rust/crates/inference/Cargo.toml index 807a3ea85d3..168b9a569ea 100644 --- a/litellm-rust/crates/inference/Cargo.toml +++ b/litellm-rust/crates/inference/Cargo.toml @@ -12,6 +12,7 @@ litellm-framer.workspace = true tokio-util = { version = "0.7", features = ["codec"] } litellm-secrets.workspace = true litellm-core-utils.workspace = true +litellm-error.workspace = true litellm-host.workspace = true bytes.workspace = true futures-util.workspace = true @@ -29,7 +30,6 @@ time.workspace = true url.workspace = true [dev-dependencies] -litellm-error.workspace = true litellm-cache-memory.workspace = true litellm-http = { workspace = true, features = ["test-support"] } litellm-llms = { workspace = true, features = ["test-support"] } diff --git a/litellm-rust/crates/inference/src/caching.rs b/litellm-rust/crates/inference/src/caching.rs index d9b5b891015..fa9ceb6bd73 100644 --- a/litellm-rust/crates/inference/src/caching.rs +++ b/litellm-rust/crates/inference/src/caching.rs @@ -61,6 +61,10 @@ pub trait StreamCachable: Cachable { fn replay(data: Bytes) -> Option>; fn bytes(chunk: &Self::Chunk) -> &[u8]; + + fn storable_stream(text: &str) -> bool { + successful_stream(text, Self::TERMINAL_EVENT) + } } #[derive(Serialize, Deserialize)] @@ -238,12 +242,19 @@ impl CallCache

{ identity: &ProviderIdentity, wire: &WireRequest, ) -> Self { + Self::new( + cache, + policy, + CacheRequest::from_wire(identity.clone(), Some(wire)), + ) + } + + pub fn new(cache: Option<&ScopedCache>, policy: CachePolicy, request: CacheRequest) -> Self { let session = cache.and_then(|cache| { if !policy.enabled() { return None; } let options = cache.options(Some(policy)); - let request = CacheRequest::from_wire(identity.clone(), Some(wire)); Some(CacheSession { request: options.request( &cache.service.config().namespace, @@ -281,7 +292,7 @@ impl CallCache

{ P::Response: Serialize, { let Some(session) = self.session.filter(|session| { - *source == ResultSource::Provider && session.request.controls.writes() + !matches!(source, ResultSource::Cache { .. }) && session.request.controls.writes() }) else { return output; }; @@ -322,7 +333,7 @@ fn capture_stream( None => { if let Some(data) = captured && let Ok(text) = String::from_utf8(data) - && successful_stream(&text, P::TERMINAL_EVENT) + && P::storable_stream(&text) && let Ok(entry) = serde_json::to_value(ResponseEnvelope::new( P::SURFACE, CachedOutput::::Stream(text), diff --git a/litellm-rust/crates/inference/src/context.rs b/litellm-rust/crates/inference/src/context.rs index ef2635d24a1..39b259a4c97 100644 --- a/litellm-rust/crates/inference/src/context.rs +++ b/litellm-rust/crates/inference/src/context.rs @@ -1,6 +1,6 @@ use litellm_cache_response::CachePolicy; use litellm_host::{ - interceptors::{ExecutionFacts, Interceptors, RawResponse, ResultSource}, + interceptors::{ExecutionFacts, Interceptors, RawResponse, ResultSource, RetriedRequest}, lifecycle::{CallEvent, ExecutionEvent}, observation::ObservationSender, }; @@ -57,4 +57,15 @@ impl<'a, I: Interceptors> CallContext<'a, I> { .await .map_err(Error::post_call) } + + pub async fn provider_request_retried(&self, retry: RetriedRequest) -> Result<(), Error> { + if let Some(observers) = &self.observers { + observers.emit(CallEvent::Execution( + ExecutionEvent::ProviderRequestRetried { + retry: retry.clone(), + }, + )); + } + self.interceptors.provider_request_retried(retry).await + } } diff --git a/litellm-rust/crates/inference/src/error.rs b/litellm-rust/crates/inference/src/error.rs index 4135424d6ef..5f6e1b3f70d 100644 --- a/litellm-rust/crates/inference/src/error.rs +++ b/litellm-rust/crates/inference/src/error.rs @@ -24,6 +24,8 @@ pub enum Error { Secret(#[from] SecretError), #[error("the host driver failed")] Host(#[source] MachineFault), + #[error("the host transport failed")] + Transport(#[source] litellm_error::Source), #[error("post-call hook failed")] PostCallHook(#[source] Arc), } @@ -47,6 +49,10 @@ impl Error { Self::PostCallHook(Arc::new(error)) } + pub fn transport(cause: impl std::error::Error + Send + Sync + 'static) -> Self { + Self::Transport(litellm_error::Source::new(cause)) + } + /// The caller's request is what is wrong, as opposed to the environment, the wire, or /// the provider's answer. pub fn is_request(&self) -> bool { @@ -55,7 +61,11 @@ impl Error { Self::Llm(error) => error.is_request(), Self::Auth(error) => error.is_request(), Self::Http(error) => error.is_request(), - Self::Declined(_) | Self::Secret(_) | Self::Host(_) | Self::PostCallHook(_) => false, + Self::Declined(_) + | Self::Secret(_) + | Self::Host(_) + | Self::Transport(_) + | Self::PostCallHook(_) => false, } } @@ -70,6 +80,7 @@ impl Error { | Self::Headers(_) | Self::Secret(_) | Self::Host(_) + | Self::Transport(_) | Self::PostCallHook(_) => false, } } @@ -85,6 +96,7 @@ impl Error { | Self::Http(_) | Self::Secret(_) | Self::Host(_) + | Self::Transport(_) | Self::PostCallHook(_) => false, } } @@ -100,6 +112,7 @@ impl Error { | Self::Http(_) | Self::Secret(_) | Self::Host(_) + | Self::Transport(_) | Self::PostCallHook(_) => None, } } @@ -121,7 +134,7 @@ impl Error { match self { Self::Llm(error) => error.dispatched(), Self::Http(error) => error.dispatched(), - Self::Host(_) | Self::PostCallHook(_) => true, + Self::Host(_) | Self::Transport(_) | Self::PostCallHook(_) => true, Self::InvalidProvider(_) | Self::UnresolvedProvider { .. } | Self::Declined(_) @@ -142,6 +155,7 @@ impl Error { | Self::Http(_) | Self::Secret(_) | Self::Host(_) + | Self::Transport(_) | Self::PostCallHook(_) => None, } } @@ -193,6 +207,7 @@ impl Error { | Self::Headers(_) | Self::Secret(_) | Self::Host(_) + | Self::Transport(_) | Self::PostCallHook(_) => None, } } diff --git a/litellm-rust/crates/inference/src/outbound.rs b/litellm-rust/crates/inference/src/outbound.rs index b0cc71d425d..87fae0bbe9e 100644 --- a/litellm-rust/crates/inference/src/outbound.rs +++ b/litellm-rust/crates/inference/src/outbound.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use litellm_http::outbound::{json, signed}; +use litellm_http::outbound::{json, json_bytes, signed}; use litellm_llms::base_llm::auth::Authenticated; use serde_json::Value; @@ -34,3 +34,18 @@ pub fn outbound_request( Some(signer) => signed(request, &signer), } } + +pub fn raw_leaf_outbound_request( + authenticated: Authenticated, + url: &str, + body: &Value, + timeout: Option, +) -> Result { + let Authenticated { headers, signer } = authenticated; + let bytes = litellm_host::raw_json::to_vec(body).map_err(litellm_http::Error::request_body)?; + let request = json_bytes(url, &headers, bytes, timeout)?; + match signer { + None => Ok(request), + Some(signer) => signed(request, &signer), + } +} diff --git a/litellm-rust/crates/llms-types/src/formats/messages/request.rs b/litellm-rust/crates/llms-types/src/formats/messages/request.rs index d30d21e74e7..2e53b3adc5f 100644 --- a/litellm-rust/crates/llms-types/src/formats/messages/request.rs +++ b/litellm-rust/crates/llms-types/src/formats/messages/request.rs @@ -320,7 +320,7 @@ impl ThinkingConfig { #[macro_rules_attribute::apply(crate::wire_type)] pub struct MessagesRequest { pub model: String, - pub messages: Vec, + pub messages: Vec>, #[serde(flatten)] pub params: MessagesOptionalParams, } @@ -329,7 +329,7 @@ pub struct MessagesRequest { #[derive(Default)] pub struct MessagesOptionalParams { #[serde(skip_serializing_if = "Option::is_none")] - pub max_tokens: Option, + pub max_tokens: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub system: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -337,13 +337,21 @@ pub struct MessagesOptionalParams { #[serde(skip_serializing_if = "Option::is_none")] pub stop_sequences: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub stream: Option, + pub stream: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::recognized::exact_float" + )] + pub temperature: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "crate::recognized::exact_float" + )] + pub top_p: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub temperature: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub top_p: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub top_k: Option, + pub top_k: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub tools: Option>>, #[serde(skip_serializing_if = "Option::is_none")] @@ -374,6 +382,12 @@ pub struct MessagesOptionalParams { pub extra: Map, } +impl MessagesOptionalParams { + pub fn streams(&self) -> bool { + self.stream.as_ref().is_some_and(Recognized::is_truthy) + } +} + impl Message { pub fn blocks(&self) -> &[ContentBlock] { match &self.content { @@ -447,8 +461,8 @@ mod tests { assert_eq!( ( - request.params.max_tokens, - request.params.stream, + request.params.max_tokens.clone(), + request.params.stream.clone(), request .params .extra @@ -456,11 +470,39 @@ mod tests { .map(String::as_str) .collect::>(), ), - (Some(16_u64), Some(true), vec!["safeguards"]) + ( + Some(Recognized::Known(16_u64)), + Some(Recognized::Known(true)), + vec!["safeguards"] + ) ); assert_eq!(serde_json::to_value(request).unwrap(), body); } + #[rstest] + #[case::numeric_string(json!({"max_tokens": "1024", "temperature": "0.5", "top_p": "x", "top_k": "5"}))] + #[case::string_stream(json!({"stream": "true"}))] + #[case::integer_stream(json!({"stream": 0}))] + #[case::floats(json!({"max_tokens": 1024.0, "top_k": 1.5}))] + #[case::booleans(json!({"max_tokens": true, "temperature": false}))] + #[case::wide_integers(json!({"max_tokens": 18_446_744_073_709_551_615_u64, "top_k": 9_223_372_036_854_775_808_u64}))] + #[case::nested(json!({"temperature": [1], "top_p": {"p": 1}}))] + fn scalar_params_of_any_type_round_trip_unchanged(#[case] params: Value) { + let body = Value::Object( + [ + ("model".to_string(), json!("m")), + ( + "messages".to_string(), + json!([{"role": "user", "content": "hi"}]), + ), + ] + .into_iter() + .chain(params.as_object().unwrap().clone()) + .collect(), + ); + assert_eq!(round_trip::(&body), body); + } + #[test] fn text_constructor_serializes_as_a_text_block() { assert_eq!( diff --git a/litellm-rust/crates/llms-types/src/providers/anthropic/beta.rs b/litellm-rust/crates/llms-types/src/providers/anthropic/beta.rs index 46c14a21c59..e3ad783c791 100644 --- a/litellm-rust/crates/llms-types/src/providers/anthropic/beta.rs +++ b/litellm-rust/crates/llms-types/src/providers/anthropic/beta.rs @@ -320,7 +320,6 @@ impl AnthropicBeta { Self::AfkMode20260131 | Self::CePlugins20260901 | Self::CeUserManagement20260713 - | Self::Compact20260904 | Self::Dreaming20260421 | Self::ExperimentalClaudeTag20261021 | Self::ExtendedCacheTtl20250411 @@ -403,7 +402,8 @@ impl AnthropicBeta { | Self::Output128k20250219 | Self::TokenEfficientTools20250219 | Self::WebSearch20250305 => &[BetaProvider::BedrockConverse, BetaProvider::Bedrock], - Self::MidConversationOutputConfig20260701 + Self::Compact20260904 + | Self::MidConversationOutputConfig20260701 | Self::MidConversationToolChanges20260701 => &[ BetaProvider::BedrockConverse, BetaProvider::BedrockMantle, diff --git a/litellm-rust/crates/llms-types/src/recognized.rs b/litellm-rust/crates/llms-types/src/recognized.rs index 0545389afbc..2c389103aef 100644 --- a/litellm-rust/crates/llms-types/src/recognized.rs +++ b/litellm-rust/crates/llms-types/src/recognized.rs @@ -17,6 +17,25 @@ where as serde::Deserialize<'de>>::deserialize(deserializer).map(Some) } +/// `deserialize_with` for an optional float Python forwards as the caller sent it: an integer +/// stays `Unrecognized` with its exact digits, as Python sends, logs and prints it, and `null` +/// stays absent as before. +pub fn exact_float<'de, D>(deserializer: D) -> Result>, D::Error> +where + D: serde::Deserializer<'de>, +{ + let value = ::deserialize(deserializer)?; + if value.is_null() { + return Ok(None); + } + if matches!(&value, Value::Number(number) if !number.is_f64()) { + return Ok(Some(Recognized::Unrecognized(value))); + } + serde_json::from_value(value) + .map(Some) + .map_err(serde::de::Error::custom) +} + impl Recognized { pub fn known(&self) -> Option<&T> { match self { @@ -24,6 +43,60 @@ impl Recognized { Self::Unrecognized(_) => None, } } + + pub fn map_known(self, f: impl FnOnce(T) -> T) -> Self { + match self { + Self::Known(value) => Self::Known(f(value)), + unrecognized => unrecognized, + } + } +} + +impl Recognized { + pub fn is_truthy(&self) -> bool { + match self { + Self::Known(flag) => *flag, + Self::Unrecognized(other) => python_truthy(other), + } + } +} + +pub fn python_truthy(value: &Value) -> bool { + match value { + Value::Null => false, + Value::Bool(flag) => *flag, + Value::Number(number) => number.as_f64().is_none_or(|number| number != 0.0), + Value::String(text) => !text.is_empty(), + Value::Array(items) => !items.is_empty(), + Value::Object(fields) => !fields.is_empty(), + } +} + +pub fn map_known_runs( + items: Vec>, + mut f: impl FnMut(Vec) -> Vec, +) -> Vec> { + let mut mapped = Vec::with_capacity(items.len()); + let mut run = Vec::new(); + for item in items { + match item { + Recognized::Known(value) => run.push(value), + unrecognized => { + if !run.is_empty() { + mapped.extend( + f(std::mem::take(&mut run)) + .into_iter() + .map(Recognized::Known), + ); + } + mapped.push(unrecognized); + } + } + } + if !run.is_empty() { + mapped.extend(f(run).into_iter().map(Recognized::Known)); + } + mapped } #[cfg(test)] @@ -32,6 +105,82 @@ mod tests { use rstest::rstest; use serde_json::json; + #[rstest] + #[case::known_true(Recognized::Known(true), true)] + #[case::known_false(Recognized::Known(false), false)] + #[case::string_true(Recognized::Unrecognized(json!("true")), true)] + #[case::string_false(Recognized::Unrecognized(json!("false")), true)] + #[case::empty_string(Recognized::Unrecognized(json!("")), false)] + #[case::zero(Recognized::Unrecognized(json!(0)), false)] + #[case::negative_zero(Recognized::Unrecognized(json!(-0.0)), false)] + #[case::one(Recognized::Unrecognized(json!(1)), true)] + #[case::null(Recognized::Unrecognized(Value::Null), false)] + #[case::empty_list(Recognized::Unrecognized(json!([])), false)] + #[case::list(Recognized::Unrecognized(json!([0])), true)] + #[case::empty_object(Recognized::Unrecognized(json!({})), false)] + #[case::object(Recognized::Unrecognized(json!({"a": 0})), true)] + fn flags_are_read_by_python_truthiness(#[case] flag: Recognized, #[case] expected: bool) { + assert_eq!(flag.is_truthy(), expected); + } + + #[test] + fn runs_of_known_items_are_mapped_around_unrecognized_ones() { + let items = vec![ + Recognized::Known(1), + Recognized::Known(2), + Recognized::Unrecognized(json!("x")), + Recognized::Known(3), + ]; + let mut runs = Vec::new(); + let mapped = map_known_runs(items, |run: Vec| { + runs.push(run.clone()); + run.into_iter() + .filter(|item| *item != 2) + .map(|item| item * 10) + .collect() + }); + assert_eq!(runs, vec![vec![1, 2], vec![3]]); + assert_eq!( + mapped, + vec![ + Recognized::Known(10), + Recognized::Unrecognized(json!("x")), + Recognized::Known(30), + ] + ); + assert_eq!( + map_known_runs(Vec::>::new(), |run| run), + vec![] + ); + } + + #[derive(serde::Deserialize)] + struct Sampling { + #[serde(default, deserialize_with = "exact_float")] + temperature: Option>, + } + + #[rstest] + #[case::float(json!({"temperature": 0.5}), Some(Recognized::Known(0.5)))] + #[case::small_int(json!({"temperature": 2}), Some(Recognized::Unrecognized(json!(2))))] + #[case::zero(json!({"temperature": 0}), Some(Recognized::Unrecognized(json!(0))))] + #[case::integral_float(json!({"temperature": 1.0}), Some(Recognized::Known(1.0)))] + #[case::largest_exact_int(json!({"temperature": 9_007_199_254_740_992_i64}), Some(Recognized::Unrecognized(json!(9_007_199_254_740_992_i64))))] + #[case::inexact_int(json!({"temperature": 1_152_921_504_606_846_977_i64}), Some(Recognized::Unrecognized(json!(1_152_921_504_606_846_977_i64))))] + #[case::inexact_negative_int(json!({"temperature": -9_223_372_036_854_775_807_i64}), Some(Recognized::Unrecognized(json!(-9_223_372_036_854_775_807_i64))))] + #[case::inexact_unsigned_int(json!({"temperature": 18_446_744_073_709_551_615_u64}), Some(Recognized::Unrecognized(json!(18_446_744_073_709_551_615_u64))))] + #[case::string(json!({"temperature": "0.5"}), Some(Recognized::Unrecognized(json!("0.5"))))] + #[case::null(json!({"temperature": null}), None)] + #[case::absent(json!({}), None)] + fn integers_keep_their_digits(#[case] value: Value, #[case] expected: Option>) { + assert_eq!( + serde_json::from_value::(value) + .unwrap() + .temperature, + expected + ); + } + #[rstest] #[case::known(json!(7), Recognized::Known(7))] #[case::wrong_type(json!("7"), Recognized::Unrecognized(json!("7")))] diff --git a/litellm-rust/crates/llms/Cargo.toml b/litellm-rust/crates/llms/Cargo.toml index 79ee17e8b97..d59cd1be1d2 100644 --- a/litellm-rust/crates/llms/Cargo.toml +++ b/litellm-rust/crates/llms/Cargo.toml @@ -23,9 +23,11 @@ litellm-http.workspace = true litellm-secrets.workspace = true litellm-python-compat.workspace = true litellm-router-types.workspace = true +litellm-tracing.workspace = true base64.workspace = true bytes.workspace = true data-url = "0.3.2" +fancy-regex.workspace = true futures-util.workspace = true reqwest.workspace = true serde.workspace = true diff --git a/litellm-rust/crates/llms/src/anthropic/beta_headers.rs b/litellm-rust/crates/llms/src/anthropic/beta_headers.rs index 7842b478dce..4a3575c9bbc 100644 --- a/litellm-rust/crates/llms/src/anthropic/beta_headers.rs +++ b/litellm-rust/crates/llms/src/anthropic/beta_headers.rs @@ -1,5 +1,5 @@ use litellm_http::request::{with_header, without_headers}; -use litellm_llms_types::providers::anthropic::{BETA_HEADER, BetaProvider, BetaSet}; +use litellm_llms_types::providers::anthropic::{AnthropicBeta, BETA_HEADER, BetaProvider, BetaSet}; use crate::{anthropic::common_utils::existing_betas, base_llm::auth::Headers}; @@ -33,6 +33,16 @@ impl BetaPolicy { } } +pub fn accepted_or_unlisted(betas: BetaSet, provider: BetaProvider) -> BetaSet { + betas + .into_iter() + .filter_map(|beta| match beta { + AnthropicBeta::Other(_) => Some(beta), + known => known.on(provider), + }) + .collect() +} + #[cfg(test)] mod tests { use crate::anthropic::beta_headers::BetaPolicy; diff --git a/litellm-rust/crates/llms/src/anthropic/common_utils.rs b/litellm-rust/crates/llms/src/anthropic/common_utils.rs index 0854820358b..cadc5711474 100644 --- a/litellm-rust/crates/llms/src/anthropic/common_utils.rs +++ b/litellm-rust/crates/llms/src/anthropic/common_utils.rs @@ -1,4 +1,7 @@ +use std::sync::LazyLock; + use crate::base_llm::messages::context::MessagesModelCapabilities; +use fancy_regex::Regex; use litellm_auth::CredentialPlacement; use litellm_secret_value::SecretValue; @@ -22,7 +25,7 @@ use serde_json::Value; use crate::{ anthropic::ANTHROPIC_OAUTH_TOKEN_PREFIX, - base_llm::auth::{AuthScheme, Headers}, + base_llm::auth::{AuthScheme, Headers, ValidatedEnvironment}, }; pub const ANTHROPIC_API_KEY_ENV: &str = "ANTHROPIC_API_KEY"; @@ -80,10 +83,21 @@ impl<'a> OauthToken<'a> { } pub fn into_auth(self) -> AuthScheme { - AuthScheme::Credential { - placement: CredentialPlacement::Bearer, - secret: SecretValue::new(self.0), - } + oauth_bearer(SecretValue::new(self.0)) + } +} + +fn oauth_bearer(secret: SecretValue) -> AuthScheme { + AuthScheme::Credential { + placement: CredentialPlacement::Bearer, + secret, + } +} + +pub fn minted_oauth_environment(headers: Headers, token: SecretValue) -> ValidatedEnvironment { + ValidatedEnvironment { + headers: with_oauth_companions(headers, &[], BrowserAccess::Omitted), + auth: oauth_bearer(token), } } @@ -92,11 +106,23 @@ pub fn get_api_key( api_key: Option<&str>, env_lookup: &dyn Fn(&str) -> Option, ) -> Option { - resolve_non_empty(api_key, env_lookup, &[ANTHROPIC_API_KEY_ENV]) + nonempty_secret(api_key.map(str::to_owned)) + .or_else(|| nonempty_secret(env_lookup(ANTHROPIC_API_KEY_ENV))) } pub fn get_auth_token(env_lookup: &dyn Fn(&str) -> Option) -> Option { - resolve_non_empty(None, env_lookup, &[ANTHROPIC_AUTH_TOKEN_ENV]) + nonempty_secret(env_lookup(ANTHROPIC_AUTH_TOKEN_ENV)) +} + +/// Python's `normalize_nonempty_secret_str`: `str.strip()` also strips the ASCII separators. +fn nonempty_secret(value: Option) -> Option { + value + .map(|value| { + value + .trim_matches(|c: char| c.is_whitespace() || ('\u{1c}'..='\u{1f}').contains(&c)) + .to_owned() + }) + .filter(|value| !value.is_empty()) } /// Python's `AnthropicModelInfo.get_auth_header`, naming the credential instead of building @@ -232,14 +258,24 @@ pub fn forwarded_oauth_bearer(headers: &[(String, String)]) -> Option Headers { - merge_beta_headers( +#[derive(Clone, Copy, PartialEq, Eq)] +enum BrowserAccess { + Granted, + Omitted, +} + +fn with_oauth_companions(headers: Headers, dropped: &[&str], browser: BrowserAccess) -> Headers { + let headers = merge_beta_headers( without_headers(headers, dropped), BetaSet::from_iter([AnthropicBeta::Oauth20250420]), - ) - .into_iter() - .chain([(DIRECT_BROWSER_ACCESS_HEADER.to_string(), "true".to_string())]) - .collect() + ); + match browser { + BrowserAccess::Granted => headers + .into_iter() + .chain([(DIRECT_BROWSER_ACCESS_HEADER.to_string(), "true".to_string())]) + .collect(), + BrowserAccess::Omitted => headers, + } } pub fn optionally_handle_anthropic_oauth(headers: Headers, api_key: Option<&str>) -> OauthHandling { @@ -247,13 +283,17 @@ pub fn optionally_handle_anthropic_oauth(headers: Headers, api_key: Option<&str> forwarded_oauth_bearer(&headers).map(|token| SecretValue::new(token.as_str())) { return OauthHandling::Bearer { - headers: with_oauth_companions(headers, &[API_KEY_HEADER, AUTHORIZATION]), + headers: with_oauth_companions( + headers, + &[API_KEY_HEADER, AUTHORIZATION], + BrowserAccess::Granted, + ), token, }; } if let Some(token) = api_key.and_then(OauthToken::parse) { return OauthHandling::Bearer { - headers: with_oauth_companions(headers, &[API_KEY_HEADER]), + headers: with_oauth_companions(headers, &[API_KEY_HEADER], BrowserAccess::Granted), token: SecretValue::new(token.as_str()), }; } @@ -278,12 +318,19 @@ pub fn has_advisor_tool(tools: Option<&[Recognized]>) -> bool { .any(|tool| matches!(tool, Recognized::Known(MessagesTool::Advisor { .. }))) } -pub fn requires_native_compaction_beta(compaction: Option<&Value>, messages: &[Message]) -> bool { +pub fn requires_native_compaction_beta( + compaction: Option<&Value>, + messages: &[Recognized], +) -> bool { compaction.is_some() - || messages.iter().flat_map(Message::blocks).any(|block| { - block.is_type(ContentBlockType::Compaction) - && block.signature.as_deref().is_some_and(|s| !s.is_empty()) - }) + || messages + .iter() + .filter_map(Recognized::known) + .flat_map(Message::blocks) + .any(|block| { + block.is_type(ContentBlockType::Compaction) + && block.signature.as_deref().is_some_and(|s| !s.is_empty()) + }) } fn is_blank(text: Option<&str>) -> bool { @@ -650,6 +697,113 @@ pub fn flatten_unencrypted_web_search_results(messages: Vec) -> Vec bool { + let lower = error_text.to_lowercase(); + if !lower.contains("thinking") { + return false; + } + (lower.contains("signature") && (lower.contains("invalid") || lower.contains("valid string"))) + || lower.contains("must contain thinking") +} + +pub fn is_anthropic_thinking_binding_mismatch_error(error_text: &str) -> bool { + error_text + .to_lowercase() + .contains("bound to a different conversation") +} + +pub fn anthropic_request_errors_on_thinking_binding_mismatch(request_body: &Value) -> bool { + request_body + .pointer("/thinking/block_binding/prefix_mismatch_behavior") + .and_then(Value::as_str) + == Some("error") +} + +fn is_thinking_value_block(block: &Value) -> bool { + matches!( + block.get("type").and_then(Value::as_str), + Some("thinking" | "redacted_thinking") + ) +} + +fn without_thinking_value_blocks(message: Value) -> Option { + let Value::Object(mut message) = message else { + return Some(message); + }; + if let Some(Value::Array(content)) = message.get_mut("content") { + content.retain(|block| !is_thinking_value_block(block)); + if content.is_empty() { + return None; + } + } + Some(Value::Object(message)) +} + +pub fn strip_thinking_blocks_from_anthropic_messages_request(request_body: Value) -> Value { + let Value::Object(mut body) = request_body else { + return request_body; + }; + if let Some(Value::Array(messages)) = body.get_mut("messages") { + *messages = std::mem::take(messages) + .into_iter() + .filter_map(without_thinking_value_blocks) + .collect(); + } + body.shift_remove("thinking"); + Value::Object(body) +} + +static CLAUDE_STRICT_TOOLS_REJECTION: LazyLock = LazyLock::new(|| { + Regex::new(concat!( + r"Too many strict tools \(\d+\)", + r"|Schemas contains too many (?:optional parameters|parameters with union types)", + r"|[Cc]ompiled grammar (?:is too large|size)", + r"|tools\.\d+\.custom(?:\.strict)?: ", + r"|Grammar compilation timed out", + )) + .expect("valid regex") +}); + +pub fn is_claude_strict_tools_rejection(status: u16, error_text: &str) -> bool { + status == 400 + && CLAUDE_STRICT_TOOLS_REJECTION + .is_match(error_text) + .unwrap_or(false) +} + +#[derive(Clone, Debug, PartialEq)] +pub struct ToolsWithoutStrict { + pub tools: Vec, + pub dropped_count: usize, +} + +pub fn tools_without_strict(tools: Option<&Value>) -> Option { + let tools = tools?.as_array()?; + if !tools.iter().all(Value::is_object) { + return None; + } + let dropped_count = tools + .iter() + .filter(|tool| tool.get("strict") == Some(&Value::Bool(true))) + .count(); + if dropped_count == 0 { + return None; + } + Some(ToolsWithoutStrict { + tools: tools + .iter() + .cloned() + .map(|mut tool| { + if let Value::Object(fields) = &mut tool { + fields.shift_remove("strict"); + } + tool + }) + .collect(), + dropped_count, + }) +} + #[cfg(test)] mod tests { use crate::base_llm::messages::context::SupportedEffortTiers; @@ -668,7 +822,7 @@ mod tests { serde_json::from_value(value).unwrap() } - fn history(messages: Value) -> Vec { + fn history(messages: Value) -> Vec> { serde_json::from_value(messages).unwrap() } @@ -1636,6 +1790,11 @@ mod tests { &[("ANTHROPIC_AUTH_TOKEN", "env-token")], Some(("Authorization", "env-token")), )] + #[case::auth_token_stripped_of_whitespace( + None, + &[("ANTHROPIC_AUTH_TOKEN", " env-token \t\n\u{1f}")], + Some(("Authorization", "env-token")), + )] #[case::auth_token_when_the_env_key_is_blank( None, &[("ANTHROPIC_API_KEY", " \t"), ("ANTHROPIC_AUTH_TOKEN", "env-token")], @@ -1647,7 +1806,19 @@ mod tests { &[("ANTHROPIC_API_KEY", OAUTH_BEARER)], Some(("Authorization", OAUTH_TOKEN)), )] + #[case::env_key_stripped_of_whitespace( + None, + &[("ANTHROPIC_API_KEY", " sk-env \t\n\u{1f}")], + Some(("x-api-key", "sk-env")), + )] + #[case::api_key_param_stripped_of_separators(Some("\u{1c}sk-param "), &[], Some(("x-api-key", "sk-param")))] + #[case::separator_only_env_key_falls_to_the_auth_token( + None, + &[("ANTHROPIC_API_KEY", "\u{1c}\u{1f}"), ("ANTHROPIC_AUTH_TOKEN", "env-token")], + Some(("Authorization", "env-token")), + )] #[case::no_credentials(None, &[], None)] + #[case::separator_only_auth_token(None, &[("ANTHROPIC_AUTH_TOKEN", "\u{1c}\u{1f}")], None)] #[case::blank_everything(Some(""), &[("ANTHROPIC_API_KEY", " "), ("ANTHROPIC_AUTH_TOKEN", " \t")], None)] fn auth_header_prefers_the_key_then_the_auth_token( #[case] api_key: Option<&str>, @@ -1974,4 +2145,166 @@ mod tests { fn the_messages_url_follows_python_ensure_api_route(#[case] api_base: &str, #[case] url: &str) { assert_eq!(complete_anthropic_url(Some(api_base), &|_| None), url); } + + fn shared_cases(table: &str) -> Vec<(String, String, bool)> { + let fixture: Value = serde_json::from_str(include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/fixtures/anthropic_messages_http_error_retry.json" + ))) + .unwrap(); + fixture[table] + .as_array() + .unwrap() + .iter() + .map(|case| { + ( + case["name"].as_str().unwrap().to_string(), + case["error_text"].as_str().unwrap().to_string(), + case["expected"].as_bool().unwrap(), + ) + }) + .collect() + } + + #[rstest] + #[case::invalid_thinking_block( + "invalid_thinking_block_error", + is_anthropic_invalid_thinking_block_error + )] + #[case::thinking_binding_mismatch( + "thinking_binding_mismatch_error", + is_anthropic_thinking_binding_mismatch_error + )] + fn error_texts_match_the_cases_shared_with_python( + #[case] table: &str, + #[case] recognizes: fn(&str) -> bool, + ) { + let cases = shared_cases(table); + assert!(!cases.is_empty()); + let mismatched: Vec<&String> = cases + .iter() + .filter(|(_, error_text, expected)| recognizes(error_text) != *expected) + .map(|(name, _, _)| name) + .collect(); + assert_eq!(mismatched, Vec::<&String>::new()); + } + + #[rstest] + #[case::pinned(json!({"thinking": {"block_binding": {"prefix_mismatch_behavior": "error"}}}), true)] + #[case::other_behavior(json!({"thinking": {"block_binding": {"prefix_mismatch_behavior": "drop"}}}), false)] + #[case::string_binding(json!({"thinking": {"block_binding": "strict"}}), false)] + #[case::no_thinking(json!({"messages": []}), false)] + #[case::not_an_object(json!(["thinking"]), false)] + fn a_pinned_binding_is_the_caller_asking_for_the_error( + #[case] body: Value, + #[case] expected: bool, + ) { + assert_eq!( + anthropic_request_errors_on_thinking_binding_mismatch(&body), + expected + ); + } + + #[rstest] + #[case::mixed_turn( + json!({"model": "m", "thinking": {"type": "enabled"}, "messages": [ + {"role": "assistant", "content": [ + {"type": "thinking", "thinking": "t", "signature": "s"}, + {"type": "text", "text": "a"}, + {"type": "redacted_thinking", "data": "d"} + ]} + ]}), + json!({"model": "m", "messages": [{"role": "assistant", "content": [{"type": "text", "text": "a"}]}]}) + )] + #[case::thinking_only_and_empty_turns_are_dropped( + json!({"messages": [ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [{"type": "redacted_thinking", "data": "d"}]}, + {"role": "assistant", "content": []}, + {"role": "user", "content": "again"} + ]}), + json!({"messages": [{"role": "user", "content": "hi"}, {"role": "user", "content": "again"}]}) + )] + #[case::non_object_entries_are_kept( + json!({"messages": ["raw", {"role": "user", "content": ["raw", {"type": "thinking"}]}]}), + json!({"messages": ["raw", {"role": "user", "content": ["raw"]}]}) + )] + #[case::messages_not_a_list( + json!({"messages": "hi", "thinking": {"type": "adaptive"}}), + json!({"messages": "hi"}) + )] + fn retrying_strips_thinking_from_the_replay_and_the_request( + #[case] body: Value, + #[case] expected: Value, + ) { + assert_eq!( + strip_thinking_blocks_from_anthropic_messages_request(body), + expected + ); + } + + #[test] + fn stripping_keeps_the_order_of_the_remaining_fields() { + let stripped = strip_thinking_blocks_from_anthropic_messages_request( + json!({"model": "m", "thinking": {}, "messages": [], "max_tokens": 1}), + ); + let keys: Vec<&str> = stripped + .as_object() + .unwrap() + .keys() + .map(String::as_str) + .collect(); + assert_eq!(keys, ["model", "messages", "max_tokens"]); + } + + fn shared_table(table: &str) -> Vec { + let fixture: Value = serde_json::from_str(include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/fixtures/anthropic_messages_http_error_retry.json" + ))) + .unwrap(); + fixture[table].as_array().unwrap().clone() + } + + #[test] + fn strict_tools_rejections_match_the_cases_shared_with_python() { + let cases = shared_table("claude_strict_tools_rejection"); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let status = u16::try_from(case["status"].as_u64().unwrap()).unwrap(); + is_claude_strict_tools_rejection(status, case["error_text"].as_str().unwrap()) + != case["expected"].as_bool().unwrap() + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); + } + + #[test] + fn tools_without_strict_matches_the_cases_shared_with_python() { + let cases = shared_table("tools_without_strict"); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let expected = case["expected"] + .as_object() + .map(|expected| ToolsWithoutStrict { + tools: expected["tools"].as_array().unwrap().clone(), + dropped_count: usize::try_from(expected["dropped_count"].as_u64().unwrap()) + .unwrap(), + }); + tools_without_strict(Some(&case["tools"])) != expected + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); + } + + #[test] + fn absent_tools_have_no_strict_to_drop() { + assert_eq!(tools_without_strict(None), None); + } } diff --git a/litellm-rust/crates/llms/src/anthropic/messages/handler.rs b/litellm-rust/crates/llms/src/anthropic/messages/handler.rs index 54f924ddec6..46a16e7d546 100644 --- a/litellm-rust/crates/llms/src/anthropic/messages/handler.rs +++ b/litellm-rust/crates/llms/src/anthropic/messages/handler.rs @@ -3,7 +3,7 @@ use litellm_llms_types::{ AdaptiveThinking, EnabledThinking, Message, MessagesOptionalParams, MessagesRequest, ThinkingConfig, ThinkingDisplay, }, - recognized::Recognized, + recognized::{Recognized, map_known_runs}, }; use serde_json::{Value, json}; @@ -13,14 +13,19 @@ use crate::{ flatten_unencrypted_web_search_results, sanitize_tool_use_ids, strip_empty_content_blocks, strip_provider_specific_fields, }, + base_llm::messages::context::MessagesShapeOptions, }; pub fn shape_anthropic_messages_request( request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { Ok(MessagesRequest { - messages: sanitize_anthropic_messages(request.messages), + messages: if options.presanitized { + map_known_runs(request.messages, strip_provider_specific_fields) + } else { + map_known_runs(request.messages, sanitize_anthropic_messages) + }, params: MessagesOptionalParams { metadata: request .params @@ -28,7 +33,10 @@ pub fn shape_anthropic_messages_request( .as_ref() .map(validate_anthropic_api_metadata) .transpose()?, - thinking: with_reasoning_auto_summary(request.params.thinking, reasoning_auto_summary), + thinking: with_reasoning_auto_summary( + request.params.thinking, + options.reasoning_auto_summary, + ), ..request.params }, ..request @@ -299,7 +307,10 @@ mod tests { "thinking": {"type": "enabled", "budget_tokens": 1024}, "safeguards": [{"type": "dangerous_tool_use"}] })), - true, + MessagesShapeOptions { + reasoning_auto_summary: true, + presanitized: false, + }, ) .unwrap(); assert_eq!( @@ -315,4 +326,27 @@ mod tests { }) ); } + + #[test] + fn presanitized_shaping_keeps_blocks_and_strips_only_provider_fields() { + let messages = json!([{"role": "user", "content": [ + {"type": "text", "text": " ", "cache_control": {"type": "ephemeral"}}, + {"type": "tool_result", "tool_use_id": "functions.Bash:0", "content": "ok", "provider_specific_fields": {"x": 1}} + ]}]); + let sanitized = shape_anthropic_messages_request( + request(json!({"model": "m", "messages": messages})), + MessagesShapeOptions { + reasoning_auto_summary: false, + presanitized: true, + }, + ) + .unwrap(); + assert_eq!( + serde_json::to_value(sanitized).unwrap(), + json!({"model": "m", "messages": [{"role": "user", "content": [ + {"type": "text", "text": " ", "cache_control": {"type": "ephemeral"}}, + {"type": "tool_result", "tool_use_id": "functions.Bash:0", "content": "ok"} + ]}]}) + ); + } } diff --git a/litellm-rust/crates/llms/src/anthropic/messages/mod.rs b/litellm-rust/crates/llms/src/anthropic/messages/mod.rs index 597a1d819d9..4fa24a3f0f5 100644 --- a/litellm-rust/crates/llms/src/anthropic/messages/mod.rs +++ b/litellm-rust/crates/llms/src/anthropic/messages/mod.rs @@ -1,3 +1,4 @@ pub mod handler; +mod scalar; pub mod thinking; pub mod transformation; diff --git a/litellm-rust/crates/llms/src/anthropic/messages/scalar.rs b/litellm-rust/crates/llms/src/anthropic/messages/scalar.rs new file mode 100644 index 00000000000..db9aa01d177 --- /dev/null +++ b/litellm-rust/crates/llms/src/anthropic/messages/scalar.rs @@ -0,0 +1,113 @@ +use litellm_host::raw_json; +use litellm_llms_types::recognized::Recognized; +use litellm_python_compat::{ + Value as PythonValue, + json::{from_json, loads}, + repr::to_str, +}; +use serde_json::Value; + +pub(crate) fn python_value(value: &Value) -> PythonValue { + match value { + Value::String(text) => raw_json::decode(text) + .and_then(|raw| loads(raw).ok()) + .unwrap_or_else(|| PythonValue::Str(text.clone())), + Value::Array(items) => PythonValue::List(items.iter().map(python_value).collect()), + Value::Object(entries) => PythonValue::Dict( + entries + .iter() + .map(|(key, item)| (PythonValue::Str(key.clone()), python_value(item))) + .collect(), + ), + Value::Null | Value::Bool(_) | Value::Number(_) => from_json(value.clone()), + } +} + +pub(crate) fn python_number(value: &Value) -> Option { + match value { + Value::Bool(flag) => Some(f64::from(u8::from(*flag))), + Value::Number(number) => number.as_f64(), + Value::String(text) => match raw_json::decode(text)? { + "NaN" => Some(f64::NAN), + "Infinity" => Some(f64::INFINITY), + "-Infinity" => Some(f64::NEG_INFINITY), + raw => raw.parse().ok(), + }, + _ => None, + } +} + +pub(crate) fn is_one(value: &Recognized) -> bool { + match value { + Recognized::Known(number) => *number == 1.0, + Recognized::Unrecognized(other) => python_number(other) == Some(1.0), + } +} + +pub(crate) fn python_str(value: &Recognized) -> String { + match value { + Recognized::Known(known) => serde_json::to_value(known) + .map(|known| to_str(&from_json(known))) + .unwrap_or_default(), + Recognized::Unrecognized(other) => unrecognized_str(other), + } +} + +fn unrecognized_str(value: &Value) -> String { + match value { + Value::Null => "None".into(), + Value::Bool(true) => "True".into(), + Value::Bool(false) => "False".into(), + Value::String(text) => match raw_json::decode(text) { + Some("NaN") => "nan".into(), + Some("Infinity") => "inf".into(), + Some("-Infinity") => "-inf".into(), + Some(raw) => raw.trim_matches('"').into(), + None => text.clone(), + }, + other => other.to_string(), + } +} + +#[cfg(test)] +mod tests { + use rstest::rstest; + use serde_json::json; + + use super::*; + + #[rstest] + #[case::int(json!(3), Some(3.0))] + #[case::float(json!(1.5), Some(1.5))] + #[case::bool(json!(true), Some(1.0))] + #[case::wide(json!(raw_json::encode("18446744073709551616")), Some(18_446_744_073_709_551_616.0))] + #[case::negative_infinity(json!(raw_json::encode("-Infinity")), Some(f64::NEG_INFINITY))] + #[case::string(json!("1"), None)] + #[case::marked_string(json!(raw_json::encode("\"1\"")), None)] + #[case::null(Value::Null, None)] + fn numbers_compare_as_python_compares_them( + #[case] value: Value, + #[case] expected: Option, + ) { + assert_eq!(python_number(&value), expected); + } + + #[test] + fn nan_is_a_number_unequal_to_everything() { + let nan = json!(raw_json::encode("NaN")); + assert!(python_number(&nan).is_some_and(f64::is_nan)); + assert!(!is_one(&Recognized::Unrecognized(nan))); + } + + #[rstest] + #[case::known(Recognized::Known(0.5), "0.5")] + #[case::known_wide(Recognized::Known(1e16), "1e+16")] + #[case::int(Recognized::Unrecognized(json!(0)), "0")] + #[case::bool(Recognized::Unrecognized(json!(false)), "False")] + #[case::string(Recognized::Unrecognized(json!("0.5")), "0.5")] + #[case::nan(Recognized::Unrecognized(json!(raw_json::encode("NaN"))), "nan")] + #[case::wide(Recognized::Unrecognized(json!(raw_json::encode("-1180591620717411303424"))), "-1180591620717411303424")] + fn values_print_as_python_prints_them(#[case] value: Recognized, #[case] expected: &str) { + assert_eq!(python_str(&value), expected); + } +} diff --git a/litellm-rust/crates/llms/src/anthropic/messages/thinking.rs b/litellm-rust/crates/llms/src/anthropic/messages/thinking.rs index 0ddbc915154..c6f7c1679ef 100644 --- a/litellm-rust/crates/llms/src/anthropic/messages/thinking.rs +++ b/litellm-rust/crates/llms/src/anthropic/messages/thinking.rs @@ -1,17 +1,20 @@ +use litellm_host::raw_json; use litellm_llms_types::{ formats::{ chat_completions::ReasoningEffort, messages::{ - AdaptiveThinking, DisabledThinking, EffortLevel, MessagesOptionalParams, - MessagesRequest, OutputConfig, ThinkingConfig, ThinkingDisplay, + AdaptiveThinking, DisabledThinking, EffortLevel, EnabledThinking, + MessagesOptionalParams, MessagesRequest, OutputConfig, ThinkingConfig, ThinkingDisplay, }, }, recognized::Recognized, }; -use litellm_python_compat::{json::from_json, repr::repr, truthy::truthy}; +use litellm_python_compat::{ + Value as PythonValue, json::from_json, repr::repr, reprlib::reprlib, truthy::truthy, +}; use serde_json::Value; -use strum::VariantArray; +use super::scalar::{is_one, python_number, python_str, python_value}; use crate::base_llm::messages::context::{ MessagesModelCapabilities, ThinkingBudgets, ThinkingContext, }; @@ -56,13 +59,61 @@ fn unmapped_effort(effort: &Value) -> Error { Error::InvalidRequest(crate::ErrorDetail::InvalidChoice { field: "reasoning effort", actual: repr(&from_json(effort.clone())), - choices: ReasoningEffort::VARIANTS - .iter() - .map(|effort| <&'static str>::from(*effort)) - .collect(), + choices: vec!["minimal", "low", "medium", "high", "xhigh", "max", "none"], }) } +fn invalid_adaptive_effort(effort: &Value) -> Error { + Error::InvalidRequest(crate::ErrorDetail::InvalidReasoningEffort { + actual: repr(&from_json(effort.clone())), + }) +} + +const NON_STRING_EFFORT_REASON: &str = "it is not a string. Send reasoning_effort as a level name such as 'high' to set a reasoning level."; +const NON_NUMERIC_BUDGET_REASON: &str = + "it is not a number. Send budget_tokens as an integer to set a reasoning level."; + +fn warn_dropped_reasoning( + param: &str, + value: &PythonValue, + model: &str, + reason: &str, + drop_params_gated: bool, +) { + let gate = if drop_params_gated { + " (drop_params=True)" + } else { + "" + }; + litellm_tracing::warn!( + "Dropping {param}={} for model={}{gate} because {reason}", + reprlib(value), + repr(&PythonValue::Str(model.to_owned())) + ); +} + +fn warn_non_string_reasoning_effort(effort: &Value, model: &str) { + let value = python_value(effort); + let requested = match &value { + PythonValue::Str(_) => return, + PythonValue::Dict(entries) => entries + .iter() + .find(|(key, _)| *key == PythonValue::Str("effort".to_owned())) + .map(|(_, level)| level), + other => Some(other), + }; + if matches!(requested, None | Some(PythonValue::None)) { + return; + } + warn_dropped_reasoning( + "reasoning_effort", + &value, + model, + NON_STRING_EFFORT_REASON, + false, + ); +} + fn unsupported_effort(level: EffortLevel, model: &str) -> Error { Error::InvalidRequest(crate::ErrorDetail::UnsupportedValue { field: "effort", @@ -82,11 +133,56 @@ fn output_effort(effort: ReasoningEffort) -> Option { } } -fn fit_budget_to_max_tokens(budget_tokens: u64, max_tokens: Option) -> Option { - let Some(max_tokens) = max_tokens else { - return Some(budget_tokens); +/// `cap_thinking_budget_to_max_tokens`, whose first comparison (`max_tokens <= 1024`) raises +/// `TypeError` for a `max_tokens` Python cannot order against an int, such as a string. +fn fit_budget_to_max_tokens( + budget_tokens: u64, + max_tokens: Option<&Recognized>, +) -> Result>, Error> { + let max_tokens = match max_tokens { + None => return Ok(Some(Recognized::Known(budget_tokens))), + Some(Recognized::Known(max_tokens)) => *max_tokens, + Some(Recognized::Unrecognized(other)) => { + return fit_budget_to_python_number(budget_tokens, other); + } }; - (max_tokens > ANTHROPIC_MIN_THINKING_BUDGET_TOKENS).then(|| budget_tokens.min(max_tokens - 1)) + Ok((max_tokens > ANTHROPIC_MIN_THINKING_BUDGET_TOKENS) + .then(|| Recognized::Known(budget_tokens.min(max_tokens - 1)))) +} + +fn enabled_thinking(budget_tokens: Recognized) -> ThinkingConfig { + ThinkingConfig::Enabled(EnabledThinking { + budget_tokens: Some(budget_tokens), + ..EnabledThinking::default() + }) +} + +fn fit_budget_to_python_number( + budget_tokens: u64, + max_tokens: &Value, +) -> Result>, Error> { + let Some(max_tokens) = python_number(max_tokens) else { + if max_tokens.is_null() { + return Ok(Some(Recognized::Known(budget_tokens))); + } + return Err(Error::InvalidRequest( + crate::ErrorDetail::UnorderableTypes { + op: "<=", + left: python_type_name(max_tokens), + right: "int", + }, + )); + }; + if max_tokens <= ANTHROPIC_MIN_THINKING_BUDGET_TOKENS as f64 { + return Ok(None); + } + if (budget_tokens as f64) < max_tokens { + return Ok(Some(Recognized::Known(budget_tokens))); + } + Ok(Some(Recognized::Unrecognized( + serde_json::Number::from_f64(max_tokens - 1.0) + .map_or_else(|| Value::String(raw_json::encode("NaN")), Value::Number), + ))) } fn known_thinking(request: &MessagesRequest) -> Option<&ThinkingConfig> { @@ -161,10 +257,17 @@ fn translate_reasoning_effort( }; let effort = match reasoning_effort { Recognized::Known(effort) => effort, - Recognized::Unrecognized(value @ Value::String(_)) => { - return Err(unmapped_effort(&value)); + Recognized::Unrecognized(value) if matches!(python_value(&value), PythonValue::Str(_)) => { + return Err(if context.capabilities.supports_adaptive_thinking { + invalid_adaptive_effort(&value) + } else { + unmapped_effort(&value) + }); + } + Recognized::Unrecognized(value) => { + warn_non_string_reasoning_effort(&value, &request.model); + return Ok(request); } - Recognized::Unrecognized(_) => return Ok(request), }; let (Some(level), Some(budget)) = ( output_effort(effort), @@ -203,10 +306,20 @@ fn translate_reasoning_effort( ..request }); } - let Some(budget) = fit_budget_to_max_tokens(budget, request.params.max_tokens) else { + let Some(budget) = fit_budget_to_max_tokens(budget, request.params.max_tokens.as_ref())? else { + litellm_tracing::warn!( + "Dropping `thinking` mapped from reasoning_effort={} for model={}: max_tokens={} is too small to fit the minimum thinking budget.", + <&'static str>::from(effort), + request.model, + request + .params + .max_tokens + .as_ref() + .map_or_else(|| "None".to_owned(), python_str) + ); return Ok(request); }; - let enabled = ThinkingConfig::enabled(budget); + let enabled = enabled_thinking(budget); Ok(MessagesRequest { params: MessagesOptionalParams { thinking: Some( @@ -340,6 +453,15 @@ fn translate_legacy_thinking_for_adaptive_model( crate::ErrorDetail::NonNumericThinkingBudget { actual }, )); } + if let (None, Some(Recognized::Unrecognized(dropped))) = (budget, &enabled.budget_tokens) { + warn_dropped_reasoning( + "thinking.budget_tokens", + &python_value(dropped), + &request.model, + NON_NUMERIC_BUDGET_REASON, + true, + ); + } let thinking = ThinkingConfig::Adaptive(AdaptiveThinking { display: kept_display(enabled.display.as_ref(), context), extra: carried_thinking_keys(&enabled.extra, context), @@ -396,11 +518,20 @@ fn translate_adaptive_effort_for_non_adaptive_model( } else { None }; + let thinking = match budget { + Some(budget) => fit_budget_to_max_tokens(budget, request.params.max_tokens.as_ref())? + .map(|budget| Recognized::Known(enabled_thinking(budget))), + None => None, + }; + if thinking.is_none() { + litellm_tracing::warn!( + "Dropping adaptive `thinking`/`output_config.effort` for model={}: the model does not support extended thinking, or max_tokens is too small to fit the minimum thinking budget.", + request.model + ); + } Ok(MessagesRequest { params: MessagesOptionalParams { - thinking: budget - .and_then(|budget| fit_budget_to_max_tokens(budget, request.params.max_tokens)) - .map(|budget| Recognized::Known(ThinkingConfig::enabled(budget))), + thinking, output_config: without_effort(request.params.output_config), ..request.params }, @@ -418,7 +549,8 @@ fn drop_incompatible_temperature_for_thinking( let pinned = request .params .temperature - .is_some_and(|temperature| temperature != 1.0); + .as_ref() + .is_some_and(|temperature| !is_one(temperature)); let thinking_enabled = matches!(known_thinking(&request), Some(ThinkingConfig::Enabled(_))); let effort_enabled = known_effort(&request).is_some(); if !pinned || !(thinking_enabled || effort_enabled) { @@ -451,7 +583,7 @@ mod tests { use super::*; use crate::base_llm::messages::context::SupportedEffortTiers; - const EFFORT_CHOICES: &str = "'none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'"; + const EFFORT_CHOICES: &str = "'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'none'"; fn request(fields: Value) -> MessagesRequest { let mut body = serde_json::json!({"model": "claude", "messages": [{"role": "user", "content": "Hello"}]}); @@ -819,17 +951,17 @@ mod tests { #[case::invalid_on_adaptive_model( opus_4_7(), serde_json::json!({"max_tokens": 1024, "reasoning_effort": "invalid"}), - format!("Unmapped reasoning effort: 'invalid'. Must be one of: {EFFORT_CHOICES}.") + format!("Invalid reasoning_effort: 'invalid'. Must be one of: {EFFORT_CHOICES}") )] #[case::disabled_on_adaptive_model( opus_4_7(), serde_json::json!({"max_tokens": 1024, "reasoning_effort": "disabled"}), - format!("Unmapped reasoning effort: 'disabled'. Must be one of: {EFFORT_CHOICES}.") + format!("Invalid reasoning_effort: 'disabled'. Must be one of: {EFFORT_CHOICES}") )] #[case::empty_on_adaptive_model( opus_4_7(), serde_json::json!({"max_tokens": 1024, "reasoning_effort": ""}), - format!("Unmapped reasoning effort: ''. Must be one of: {EFFORT_CHOICES}.") + format!("Invalid reasoning_effort: ''. Must be one of: {EFFORT_CHOICES}") )] #[case::xhigh_without_xhigh_tier_on_4_6( sonnet_4_6(), @@ -1434,6 +1566,34 @@ mod tests { ); } + #[rstest] + #[case::reasoning_effort(json!({"max_tokens": "8192", "reasoning_effort": "high"}), "str")] + #[case::caller_thinking( + json!({"max_tokens": "8192", "reasoning_effort": "low", "thinking": {"type": "enabled", "budget_tokens": 2048}}), + "str" + )] + #[case::adaptive_interface( + json!({"max_tokens": "8192", "thinking": {"type": "adaptive"}, "output_config": {"effort": "high"}}), + "str" + )] + #[case::list(json!({"max_tokens": [8192], "reasoning_effort": "high"}), "list")] + fn an_unorderable_max_tokens_raises_python_type_error_while_capping_the_budget( + haiku_4_5: MessagesModelCapabilities, + #[case] fields: Value, + #[case] left: &'static str, + ) { + assert_eq!( + translate(haiku_4_5, fields), + Err(Error::InvalidRequest( + crate::ErrorDetail::UnorderableTypes { + op: "<=", + left, + right: "int", + } + )) + ); + } + #[rstest] #[case::summarized("summarized", false, Some("summarized"))] #[case::updates_kept("updates", true, Some("updates"))] diff --git a/litellm-rust/crates/llms/src/anthropic/messages/transformation.rs b/litellm-rust/crates/llms/src/anthropic/messages/transformation.rs index 18789e5b2be..bbb9b4e4c17 100644 --- a/litellm-rust/crates/llms/src/anthropic/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/anthropic/messages/transformation.rs @@ -1,29 +1,45 @@ use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::{RetriedRequest, RetryReason}; +use litellm_http::request::{with_header, without_headers}; use litellm_llms_types::{ formats::messages::{ - ContentBlock, ContentBlockType, ContextEdit, ContextManagement, Message, + ContentBlock, ContentBlockType, ContextEdit, ContextManagement, Message, MessageContent, MessagesOptionalParams, MessagesRequest, Speed, ThinkingConfig, ThinkingDisplay, }, - providers::anthropic::{AnthropicBeta, BetaProvider, BetaSet, DEFAULT_HEADERS}, - recognized::Recognized, + providers::anthropic::{AnthropicBeta, BETA_HEADER, BetaProvider, BetaSet, DEFAULT_HEADERS}, + recognized::{Recognized, map_known_runs}, }; use litellm_router_types::LitellmParams; use serde_json::{Map, Value, json}; -use super::{handler::shape_anthropic_messages_request, thinking::translate_thinking}; -use crate::base_llm::messages::context::MessagesTransformContext; +use super::{ + handler::shape_anthropic_messages_request, + scalar::{is_one, python_str, python_value}, + thinking::translate_thinking, +}; +use crate::anthropic::beta_headers::accepted_or_unlisted; +use crate::base_llm::messages::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + tools::ToolCustomField, +}; use crate::{ Error, anthropic::common_utils::{ ANTHROPIC_API_BASE_ENV, ANTHROPIC_API_KEY_ENV, ANTHROPIC_AUTH_TOKEN_ENV, - ANTHROPIC_BASE_URL_ENV, OauthHandling, complete_anthropic_url, get_auth_header, - has_advisor_tool, has_anthropic_credential, is_tool_search_used, merge_beta_headers, - optionally_handle_anthropic_oauth, requires_native_compaction_beta, strip_advisor_blocks, - strip_encrypted_reasoning_blocks, + ANTHROPIC_BASE_URL_ENV, OauthHandling, + anthropic_request_errors_on_thinking_binding_mismatch, complete_anthropic_url, + existing_betas, get_auth_header, has_advisor_tool, has_anthropic_credential, + is_anthropic_invalid_thinking_block_error, is_anthropic_thinking_binding_mismatch_error, + is_claude_strict_tools_rejection, is_tool_search_used, merge_beta_headers, + minted_oauth_environment, optionally_handle_anthropic_oauth, + requires_native_compaction_beta, strip_advisor_blocks, strip_encrypted_reasoning_blocks, + strip_thinking_blocks_from_anthropic_messages_request, tools_without_strict, }, base_llm::{ auth::AuthScheme, - messages::transformation::{BaseMessagesConfig, Headers, ValidatedEnvironment}, + messages::transformation::{ + BaseMessagesConfig, FederatedEnvironment, Headers, ValidatedEnvironment, + }, }, }; @@ -35,9 +51,9 @@ impl BaseMessagesConfig for AnthropicMessagesConfig { fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn get_complete_url( @@ -59,6 +75,12 @@ impl BaseMessagesConfig for AnthropicMessagesConfig { transform_messages_request(request, &context.keeping_display_updates()) } + fn tool_custom_field(&self, model: &str) -> ToolCustomField { + ToolCustomField::Rewrite { + hoist_defer_loading: is_claude_model(model), + } + } + fn secret_names(&self) -> &'static [&'static str] { &[ ANTHROPIC_API_KEY_ENV, @@ -79,31 +101,22 @@ impl BaseMessagesConfig for AnthropicMessagesConfig { _litellm_params: &LitellmParams, env_lookup: &dyn Fn(&str) -> Option, ) -> Result { - let headers = match optionally_handle_anthropic_oauth(headers, api_key) { - OauthHandling::Bearer { headers, token } => { - return Ok(ValidatedEnvironment { - headers, - auth: AuthScheme::Credential { - placement: CredentialPlacement::Bearer, - secret: token, - }, - }); - } - OauthHandling::Untouched(headers) => headers, - }; - if has_anthropic_credential(&headers) { - return Ok(ValidatedEnvironment { - headers, - auth: AuthScheme::Forwarded, - }); + match anthropic_environment(headers, api_key, env_lookup) { + FederatedEnvironment::Validated(validated) => Ok(validated), + FederatedEnvironment::Unauthenticated { missing, .. } => Err(missing), } - let auth = get_auth_header(api_key, env_lookup).ok_or(Error::Auth( - litellm_auth::Error::MissingApiKey { - provider: "Anthropic", - environment_variable: ANTHROPIC_API_KEY_ENV, - }, - ))?; - Ok(ValidatedEnvironment { headers, auth }) + } + + fn validate_federated_environment( + &self, + headers: Headers, + api_key: Option<&str>, + _model: &str, + _optional_params: &MessagesOptionalParams, + _litellm_params: &LitellmParams, + env_lookup: &dyn Fn(&str) -> Option, + ) -> Result { + Ok(anthropic_environment(headers, api_key, env_lookup)) } fn default_headers(&self) -> &'static [(&'static str, &'static str)] { @@ -116,6 +129,157 @@ impl BaseMessagesConfig for AnthropicMessagesConfig { provider_feature_betas(request, BetaProvider::Anthropic), ) } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + + fn headers_for_url(&self, headers: Headers, url: &str) -> Headers { + if !is_foundry_url(url) { + return headers; + } + let betas = existing_betas(&headers); + if betas.is_empty() { + return headers; + } + let kept = accepted_or_unlisted(betas, BetaProvider::AzureAi); + if kept.is_empty() { + return without_headers(headers, &[BETA_HEADER]); + } + with_header(headers, BETA_HEADER, kept.to_string()) + } +} + +const FOUNDRY_HOST_SUFFIXES: [&str; 3] = [ + "services.ai.azure.com", + "openai.azure.com", + "cognitiveservices.azure.com", +]; + +fn is_foundry_url(url: &str) -> bool { + let absolute = if url.contains("://") { + url.to_string() + } else { + format!("https://{url}") + }; + url::Url::parse(&absolute) + .ok() + .and_then(|parsed| parsed.host_str().map(str::to_ascii_lowercase)) + .is_some_and(|host| { + FOUNDRY_HOST_SUFFIXES + .iter() + .any(|suffix| host == *suffix || host.ends_with(&format!(".{suffix}"))) + }) +} + +pub(crate) fn is_claude_model(model: &str) -> bool { + model.to_lowercase().contains("claude") +} + +pub fn should_retry_anthropic_messages_on_http_error( + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, +) -> bool { + if status != 400 { + return false; + } + let drops_rejected_strict_tools = context.drops_unsupported_params + && is_claude_strict_tools_rejection(status, error_text) + && tools_without_strict(request_body.get("tools")).is_some(); + if drops_rejected_strict_tools { + return true; + } + let caller_asked_for_this_error = + anthropic_request_errors_on_thinking_binding_mismatch(request_body) + && is_anthropic_thinking_binding_mismatch_error(error_text); + !caller_asked_for_this_error && is_anthropic_invalid_thinking_block_error(error_text) +} + +pub fn transform_anthropic_messages_request_on_http_error( + status: u16, + error_text: &str, + request_body: Value, +) -> RetriedRequest { + let mut reasons = Vec::new(); + let mut body = if status == 400 && is_anthropic_invalid_thinking_block_error(error_text) { + reasons.push(RetryReason::ThinkingSignature); + strip_thinking_blocks_from_anthropic_messages_request(request_body) + } else { + request_body + }; + let without_strict = if is_claude_strict_tools_rejection(status, error_text) { + tools_without_strict(body.get("tools")) + } else { + None + }; + if let (Some(without_strict), Value::Object(fields)) = (without_strict, &mut body) { + reasons.push(RetryReason::StrictTools { + dropped: without_strict.dropped_count, + }); + fields.insert("tools".to_owned(), Value::Array(without_strict.tools)); + } + RetriedRequest { reasons, body } +} + +pub fn retry_anthropic_messages_after_http_error( + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, +) -> Option { + should_retry_anthropic_messages_on_http_error(status, error_text, request_body, context).then( + || { + transform_anthropic_messages_request_on_http_error( + status, + error_text, + request_body.clone(), + ) + }, + ) +} + +fn anthropic_environment( + headers: Headers, + api_key: Option<&str>, + env_lookup: &dyn Fn(&str) -> Option, +) -> FederatedEnvironment { + let headers = match optionally_handle_anthropic_oauth(headers, api_key) { + OauthHandling::Bearer { headers, token } => { + return FederatedEnvironment::Validated(ValidatedEnvironment { + headers, + auth: AuthScheme::Credential { + placement: CredentialPlacement::Bearer, + secret: token, + }, + }); + } + OauthHandling::Untouched(headers) => headers, + }; + if has_anthropic_credential(&headers) { + return FederatedEnvironment::Validated(ValidatedEnvironment { + headers, + auth: AuthScheme::Forwarded, + }); + } + match get_auth_header(api_key, env_lookup) { + Some(auth) => FederatedEnvironment::Validated(ValidatedEnvironment { headers, auth }), + None => FederatedEnvironment::Unauthenticated { + headers, + missing: Error::Auth(litellm_auth::Error::MissingApiKey { + provider: "Anthropic", + environment_variable: ANTHROPIC_API_KEY_ENV, + }), + federate: minted_oauth_environment, + }, + } } pub(crate) fn transform_messages_request( @@ -125,6 +289,7 @@ pub(crate) fn transform_messages_request( if request.params.max_tokens.is_none() { return Err(Error::MissingField("max_tokens")); } + let request = without_unstructured_output_format(request, context); let request = drop_unsupported_params(request, context)?; let request = translate_thinking(request, &context.thinking)?; let context_management = request @@ -132,13 +297,20 @@ pub(crate) fn transform_messages_request( .context_management .clone() .map(map_openai_context_management_to_anthropic); - let messages = if has_advisor_tool(request.params.tools.as_deref()) { + let messages = if has_advisor_tool(request.params.tools.as_deref()) + || continues_message_thread(&request.params) + { request.messages } else { - strip_advisor_blocks(request.messages) + map_known_runs(request.messages, strip_advisor_blocks) + }; + let messages = if context.drops_unsupported_params { + drop_non_string_tool_result_texts(messages) + } else { + messages }; Ok(MessagesRequest { - messages: strip_encrypted_reasoning_blocks(messages), + messages: map_known_runs(messages, strip_encrypted_reasoning_blocks), params: MessagesOptionalParams { context_management, extra: without_null_safeguards(request.params.extra), @@ -148,6 +320,84 @@ pub(crate) fn transform_messages_request( }) } +fn without_unstructured_output_format( + request: MessagesRequest, + context: &MessagesTransformContext, +) -> MessagesRequest { + if !context.drops_unsupported_params + || request + .params + .output_format + .as_ref() + .is_none_or(Value::is_object) + { + return request; + } + MessagesRequest { + params: MessagesOptionalParams { + output_format: None, + ..request.params + }, + ..request + } +} + +fn is_python_str(value: &Value) -> bool { + match value { + Value::String(text) => { + litellm_host::raw_json::decode(text).is_none_or(|raw| raw.starts_with('"')) + } + _ => false, + } +} + +fn is_non_string_text(part: &Value) -> bool { + part.get("type").and_then(Value::as_str) == Some("text") + && part.get("text").is_some_and(|text| !is_python_str(text)) +} + +fn without_non_string_texts(content: &mut Value) { + if let Value::Array(parts) = content { + parts.retain(|part| !is_non_string_text(part)); + } +} + +fn drop_non_string_tool_result_texts( + messages: Vec>, +) -> Vec> { + messages + .into_iter() + .map(|message| match message { + Recognized::Known(mut message) => { + if message.role == "user" + && let MessageContent::Blocks(blocks) = &mut message.content + { + blocks + .iter_mut() + .filter(|block| block.is_type(ContentBlockType::ToolResult)) + .filter_map(|block| block.content.as_mut()) + .for_each(without_non_string_texts); + } + Recognized::Known(message) + } + Recognized::Unrecognized(mut message) => { + if message.get("role").and_then(Value::as_str) == Some("user") + && let Some(Value::Array(blocks)) = message.get_mut("content") + { + blocks + .iter_mut() + .filter(|block| { + block.get("type").and_then(Value::as_str) == Some("tool_result") + }) + .filter_map(|block| block.get_mut("content")) + .for_each(without_non_string_texts); + } + Recognized::Unrecognized(message) + } + }) + .collect() +} + fn without_null_safeguards(extra: Map) -> Map { extra .into_iter() @@ -193,22 +443,45 @@ fn mapped_host_betas(params: &MessagesOptionalParams) -> BetaSet { .collect() } +fn continues_message_thread(params: &MessagesOptionalParams) -> bool { + let Some(Value::Object(thread)) = params.extra.get("thread") else { + return false; + }; + thread.get("type").and_then(Value::as_str) == Some("continue") + && thread + .get("previous_message_id") + .is_none_or(Value::is_string) +} + +fn is_threaded(params: &MessagesOptionalParams) -> bool { + params + .extra + .get("thread") + .is_some_and(|thread| !thread.is_null()) +} + fn feature_betas(request: &MessagesRequest) -> BetaSet { let params = &request.params; let tools = params.tools.as_deref(); + let scanned_messages: &[Recognized] = if continues_message_thread(params) { + &[] + } else { + &request.messages + }; [ - requires_native_compaction_beta(params.compaction.as_ref(), &request.messages) + requires_native_compaction_beta(params.compaction.as_ref(), scanned_messages) .then_some(AnthropicBeta::Compact20260904), uses_structured_output(params).then_some(AnthropicBeta::StructuredOutputs20251113), (params.speed == Some(Recognized::Known(Speed::Fast))) .then_some(AnthropicBeta::FastMode20260201), - messages_carry_output_config(&request.messages) + messages_carry_output_config(scanned_messages) .then_some(AnthropicBeta::PerTurnControl20260701), + is_threaded(params).then_some(AnthropicBeta::MessageThreads20260812), uses_thinking_display_updates(params) .then_some(AnthropicBeta::ThinkingDisplayUpdates20260818), uses_thinking_block_binding(params) .then_some(AnthropicBeta::ThinkingBindingControls20260801), - messages_carry_tool_changes(&request.messages) + messages_carry_tool_changes(scanned_messages) .then_some(AnthropicBeta::MidConversationToolChanges20260701), has_advisor_tool(tools).then_some(AnthropicBeta::AdvisorTool20260301), is_tool_search_used(tools).then_some(AnthropicBeta::AdvancedToolUse20251120), @@ -254,9 +527,10 @@ fn carries_safeguards(params: &MessagesOptionalParams) -> bool { .is_some_and(|value| !value.is_null()) } -fn messages_carry_output_config(messages: &[Message]) -> bool { +fn messages_carry_output_config(messages: &[Recognized]) -> bool { messages .iter() + .filter_map(Recognized::known) .any(|message| message.extra.contains_key("output_config")) } @@ -301,9 +575,10 @@ fn is_tool_reference_change(block: &ContentBlock) -> bool { == Some("tool_reference") } -fn messages_carry_tool_changes(messages: &[Message]) -> bool { +fn messages_carry_tool_changes(messages: &[Recognized]) -> bool { messages .iter() + .filter_map(Recognized::known) .filter(|message| message.role == "system") .flat_map(Message::blocks) .any(is_tool_reference_change) @@ -334,7 +609,7 @@ pub fn drop_unsupported_params( let params = request.params; let speed = match ¶ms.speed { Some(speed) if !capabilities.supports_speed => { - reject("speed", format!("'{}'", speed_text(speed)), "")?; + reject("speed", speed_repr(speed), "")?; None } _ => params.speed.clone(), @@ -346,21 +621,21 @@ pub fn drop_unsupported_params( }); } let temperature = match params.temperature { - Some(temperature) if temperature != 1.0 => { + Some(temperature) if !is_one(&temperature) => { reject( "temperature", - json!(temperature).to_string(), + python_str(&temperature), "Only temperature=1 is supported. ", )?; None } temperature => temperature, }; - if let Some(top_p) = params.top_p { - reject("top_p", json!(top_p).to_string(), "")?; + if let Some(top_p) = ¶ms.top_p { + reject("top_p", python_str(top_p), "")?; } - if let Some(top_k) = params.top_k { - reject("top_k", json!(top_k).to_string(), "")?; + if let Some(top_k) = ¶ms.top_k { + reject("top_k", python_str(top_k), "")?; } Ok(MessagesRequest { params: MessagesOptionalParams { @@ -374,11 +649,10 @@ pub fn drop_unsupported_params( }) } -fn speed_text(speed: &Recognized) -> String { +fn speed_repr(speed: &Recognized) -> String { match speed { - Recognized::Known(speed) => <&'static str>::from(*speed).to_string(), - Recognized::Unrecognized(Value::String(text)) => text.clone(), - Recognized::Unrecognized(other) => other.to_string(), + Recognized::Known(speed) => format!("'{}'", <&'static str>::from(*speed)), + Recognized::Unrecognized(other) => litellm_python_compat::repr::repr(&python_value(other)), } } @@ -437,6 +711,7 @@ mod tests { use super::*; use crate::anthropic::common_utils::ENCRYPTED_REASONING_SIGNATURE_PREFIX; + use litellm_http::request::header_values; type Env = &'static [(&'static str, &'static str)]; @@ -679,6 +954,21 @@ mod tests { json!({"speed": "fast"}), "claude does not support speed='fast'. To drop unsupported params, set `litellm.drop_params = True`." )] + #[case::integer_temperature_keeps_no_decimal( + sampling_removed(), + json!({"temperature": 0}), + "claude does not support temperature=0. Only temperature=1 is supported. To drop unsupported params, set `litellm.drop_params = True`." + )] + #[case::integer_top_p( + sampling_removed(), + json!({"top_p": 1}), + "claude does not support top_p=1. To drop unsupported params, set `litellm.drop_params = True`." + )] + #[case::non_string_speed_is_reprd( + unmapped(), + json!({"speed": 2}), + "claude does not support speed=2. To drop unsupported params, set `litellm.drop_params = True`." + )] #[case::speed_ahead_of_sampling_params( sampling_removed(), json!({"speed": "fast", "temperature": 0.5}), @@ -696,6 +986,28 @@ mod tests { assert_eq!(detail.to_string(), message); } + #[rstest] + #[case::string_dropped(json!("json"), true, None)] + #[case::string_kept_without_drop_params(json!("json"), false, Some(json!("json")))] + #[case::object_kept(json!({"type": "json_schema"}), true, Some(json!({"type": "json_schema"})))] + fn a_non_object_output_format_is_dropped_under_drop_params( + #[case] output_format: Value, + #[case] drops_unsupported_params: bool, + #[case] expected: Option, + ) { + let context = MessagesTransformContext { + drops_unsupported_params, + ..MessagesTransformContext::with_lookup(unmapped(), false, &no_env) + }; + let transformed = ANTHROPIC_MESSAGES_CONFIG + .transform_anthropic_messages_request( + request(json!({"output_format": output_format})), + &context, + ) + .unwrap(); + assert_eq!(transformed.params.output_format, expected); + } + #[rstest] #[case::compaction_threshold( json!([{"type": "compaction", "compact_threshold": 200000}]), @@ -802,6 +1114,40 @@ mod tests { ); } + #[rstest] + #[case::continue_turn(json!({"type": "continue", "previous_message_id": "msg_1"}), false)] + #[case::continue_without_a_previous_message_id(json!({"type": "continue"}), false)] + #[case::continue_with_extra_keys(json!({"type": "continue", "previous_message_id": "msg_1", "note": 1}), false)] + #[case::create_turn(json!({"type": "create"}), true)] + #[case::continue_with_a_null_previous_message_id(json!({"type": "continue", "previous_message_id": null}), true)] + #[case::continue_with_a_numeric_previous_message_id(json!({"type": "continue", "previous_message_id": 1}), true)] + #[case::not_an_object(json!("continue"), true)] + fn advisor_history_is_kept_on_a_thread_continue_turn( + #[case] thread: Value, + #[case] stripped: bool, + unmapped: MessagesModelCapabilities, + ) { + let messages = if stripped { + json!([ + {"role": "user", "content": "Build a worker pool."}, + {"role": "assistant", "content": [ + {"type": "text", "text": "Let me consult the advisor."}, + {"type": "text", "text": "Here is the implementation."} + ]} + ]) + } else { + advisor_history() + }; + assert_eq!( + transform( + json!({"messages": advisor_history(), "thread": thread.clone()}), + unmapped, + false + ), + Ok(body(json!({"messages": messages, "thread": thread}))) + ); + } + #[rstest] fn bridge_minted_reasoning_is_stripped_from_the_wire(unmapped: MessagesModelCapabilities) { let messages = json!([ @@ -864,6 +1210,7 @@ mod tests { keeps_display_updates: false, }, drop_params: true, + drops_unsupported_params: false, } ); return; @@ -1165,6 +1512,55 @@ mod tests { ]}), &[] )] + #[case::thread_create(json!({"thread": {"type": "create"}}), &["message-threads-2026-08-12"])] + #[case::thread_continue( + json!({"thread": {"type": "continue", "previous_message_id": "msg_1"}}), + &["message-threads-2026-08-12"] + )] + #[case::thread_of_any_shape(json!({"thread": "opaque"}), &["message-threads-2026-08-12"])] + #[case::null_thread(json!({"thread": null}), &[])] + #[case::thread_create_still_scans_history( + json!({ + "thread": {"type": "create"}, + "messages": [ + {"role": "assistant", "content": [{"type": "compaction", "content": "summary", "signature": "sig"}]}, + {"role": "user", "content": "hi", "output_config": {"effort": "low"}}, + {"role": "system", "content": [{"type": "tool_addition", "tool": {"type": "tool_reference", "name": "ping"}}]}, + ], + }), + &[ + "compact-2026-09-04", + "message-threads-2026-08-12", + "mid-conversation-tool-changes-2026-07-01", + "per-turn-control-2026-07-01", + ] + )] + #[case::thread_continue_skips_history( + json!({ + "thread": {"type": "continue", "previous_message_id": "msg_1"}, + "messages": [ + {"role": "assistant", "content": [{"type": "compaction", "content": "summary", "signature": "sig"}]}, + {"role": "user", "content": "hi", "output_config": {"effort": "low"}}, + {"role": "system", "content": [{"type": "tool_addition", "tool": {"type": "tool_reference", "name": "ping"}}]}, + ], + }), + &["message-threads-2026-08-12"] + )] + #[case::thread_continue_keeps_param_betas( + json!({ + "thread": {"type": "continue", "previous_message_id": "msg_1"}, + "compaction": {}, + "speed": "fast", + }), + &["compact-2026-09-04", "fast-mode-2026-02-01", "message-threads-2026-08-12"] + )] + #[case::malformed_continue_scans_history( + json!({ + "thread": {"type": "continue", "previous_message_id": 7}, + "messages": [{"role": "user", "content": "hi", "output_config": {"effort": "low"}}], + }), + &["message-threads-2026-08-12", "per-turn-control-2026-07-01"] + )] fn feature_betas_follow_the_request(#[case] fields: Value, #[case] expected: &[&str]) { assert_eq!(feature_betas(&request(fields)), betas(expected)); } @@ -1352,4 +1748,158 @@ mod tests { .collect(); assert_eq!(undeclared, Vec::<&String>::new()); } + + const FOUNDRY: &str = "https://team.services.ai.azure.com/anthropic/v1/messages"; + + #[rstest] + #[case::drops_a_beta_foundry_lacks( + FOUNDRY, + "advisor-tool-2026-03-01,context-1m-2025-08-07", + Some("context-1m-2025-08-07") + )] + #[case::forwards_unknown_betas_sorted( + FOUNDRY, + "zzz,files-api-2025-04-14,aaa", + Some("aaa,files-api-2025-04-14,zzz") + )] + #[case::removes_the_header_when_nothing_is_left(FOUNDRY, "advisor-tool-2026-03-01", None)] + #[case::cognitive_services_host( + "team.cognitiveservices.azure.com/anthropic", + "advisor-tool-2026-03-01", + None + )] + #[case::anthropic_host_is_untouched( + "https://api.anthropic.com/v1/messages", + "advisor-tool-2026-03-01", + Some("advisor-tool-2026-03-01") + )] + #[case::lookalike_host_is_untouched( + "https://notservices.ai.azure.com.example/v1/messages", + "advisor-tool-2026-03-01", + Some("advisor-tool-2026-03-01") + )] + fn foundry_urls_filter_betas_through_the_azure_ai_row( + #[case] url: &str, + #[case] betas: &str, + #[case] expected: Option<&str>, + ) { + let filtered = ANTHROPIC_MESSAGES_CONFIG + .headers_for_url(headers(&[("x-a", "1"), (BETA_HEADER, betas)]), url); + assert_eq!( + header_values(&filtered, BETA_HEADER).collect::>(), + expected.into_iter().collect::>() + ); + assert_eq!(header_values(&filtered, "x-a").collect::>(), ["1"]); + } + + #[rstest] + fn foundry_url_without_betas_keeps_the_headers() { + let sent = headers(&[("x-a", "1")]); + assert_eq!( + ANTHROPIC_MESSAGES_CONFIG.headers_for_url(sent.clone(), FOUNDRY), + sent + ); + } + + #[test] + fn the_http_error_retry_matches_the_cases_shared_with_python() { + let fixture: Value = serde_json::from_str(include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/fixtures/anthropic_messages_http_error_retry.json" + ))) + .unwrap(); + let table = &fixture["http_error_retry"]; + let cases = table["cases"].as_array().unwrap(); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let mut body = table["request"].clone(); + body["thinking"] = case["thinking"].clone(); + let status = u16::try_from(case["status"].as_u64().unwrap()).unwrap(); + let error_text = case["error_text"].as_str().unwrap(); + let retried = should_retry_anthropic_messages_on_http_error( + status, + error_text, + &body, + &MessagesTransformContext::default(), + ); + let stripped = case["stripped"].as_bool().unwrap(); + let transformed = transform_anthropic_messages_request_on_http_error( + status, + error_text, + body.clone(), + ); + let expected = if stripped { + RetriedRequest { + reasons: vec![RetryReason::ThinkingSignature], + body: table["stripped_request"].clone(), + } + } else { + RetriedRequest { + reasons: Vec::new(), + body, + } + }; + retried != case["retried"].as_bool().unwrap() || transformed != expected + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); + } + + #[test] + fn the_strict_tools_retry_matches_the_cases_shared_with_python() { + let fixture: Value = serde_json::from_str(include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/fixtures/anthropic_messages_http_error_retry.json" + ))) + .unwrap(); + let replay = &fixture["http_error_retry"]; + let table = &fixture["strict_tools_retry"]; + let cases = table["cases"].as_array().unwrap(); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let mut body = replay["request"].clone(); + body["thinking"] = case["thinking"].clone(); + body["tools"] = table["tools"].clone(); + let status = u16::try_from(case["status"].as_u64().unwrap()).unwrap(); + let error_text = case["error_text"].as_str().unwrap(); + let context = MessagesTransformContext { + drops_unsupported_params: case["drops_unsupported_params"].as_bool().unwrap(), + ..MessagesTransformContext::default() + }; + let mut reasons = Vec::new(); + let mut expected = if case["stripped"].as_bool().unwrap() { + reasons.push(RetryReason::ThinkingSignature); + replay["stripped_request"].clone() + } else { + body.clone() + }; + expected["tools"] = if case["strict_dropped"].as_bool().unwrap() { + reasons.push(RetryReason::StrictTools { + dropped: usize::try_from(table["dropped"].as_u64().unwrap()).unwrap(), + }); + table["tools_without_strict"].clone() + } else { + table["tools"].clone() + }; + let retried = should_retry_anthropic_messages_on_http_error( + status, error_text, &body, &context, + ); + let transformed = + transform_anthropic_messages_request_on_http_error(status, error_text, body); + retried != case["retried"].as_bool().unwrap() + || transformed + != RetriedRequest { + reasons, + body: expected, + } + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); + } } diff --git a/litellm-rust/crates/llms/src/azure_ai/messages/transformation.rs b/litellm-rust/crates/llms/src/azure_ai/messages/transformation.rs index d13cfa81a94..fb50d229bc7 100644 --- a/litellm-rust/crates/llms/src/azure_ai/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/azure_ai/messages/transformation.rs @@ -1,3 +1,5 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; +use litellm_host::interceptors::RetriedRequest; use litellm_http::request::{has_bearer_auth, has_header}; use litellm_llms_types::{ formats::messages::{MessagesOptionalParams, MessagesRequest}, @@ -5,6 +7,7 @@ use litellm_llms_types::{ }; use litellm_router_types::LitellmParams; use litellm_secret_value::SecretValue; +use serde_json::Value; use crate::{ Error, @@ -21,7 +24,7 @@ use crate::{ base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, messages::{ - context::MessagesTransformContext, + context::{MessagesShapeOptions, MessagesTransformContext}, normalization::{normalize_system_role_messages, strip_cache_control_scope}, transformation::BaseMessagesConfig, }, @@ -36,12 +39,28 @@ pub const AZURE_ANTHROPIC_MESSAGES_CONFIG: AzureAnthropicMessagesConfig = AzureAnthropicMessagesConfig; impl BaseMessagesConfig for AzureAnthropicMessagesConfig { + fn tool_custom_field(&self, model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: crate::anthropic::messages::transformation::is_claude_model(model), + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn get_complete_url( diff --git a/litellm-rust/crates/llms/src/base_llm/messages/context.rs b/litellm-rust/crates/llms/src/base_llm/messages/context.rs index 3d8b0f41d8c..e5593d3b216 100644 --- a/litellm-rust/crates/llms/src/base_llm/messages/context.rs +++ b/litellm-rust/crates/llms/src/base_llm/messages/context.rs @@ -23,6 +23,12 @@ impl SupportedEffortTiers { } } +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct MessagesShapeOptions { + pub reasoning_auto_summary: bool, + pub presanitized: bool, +} + #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct MessagesModelCapabilities { #[serde(default)] @@ -123,6 +129,7 @@ pub struct ThinkingContext { pub struct MessagesTransformContext { pub thinking: ThinkingContext, pub drop_params: bool, + pub drops_unsupported_params: bool, } impl MessagesTransformContext { pub fn new(capabilities: MessagesModelCapabilities, drop_params: bool) -> Self { @@ -142,6 +149,7 @@ impl MessagesTransformContext { keeps_display_updates: false, }, drop_params, + drops_unsupported_params: false, } } diff --git a/litellm-rust/crates/llms/src/base_llm/messages/mod.rs b/litellm-rust/crates/llms/src/base_llm/messages/mod.rs index e9591daa9da..5c1563c7a23 100644 --- a/litellm-rust/crates/llms/src/base_llm/messages/mod.rs +++ b/litellm-rust/crates/llms/src/base_llm/messages/mod.rs @@ -2,4 +2,5 @@ pub mod context; pub mod mid_conversation_system; pub mod normalization; pub mod streaming; +pub mod tools; pub mod transformation; diff --git a/litellm-rust/crates/llms/src/base_llm/messages/normalization.rs b/litellm-rust/crates/llms/src/base_llm/messages/normalization.rs index 7e24da2b5eb..ee2f4dcaeef 100644 --- a/litellm-rust/crates/llms/src/base_llm/messages/normalization.rs +++ b/litellm-rust/crates/llms/src/base_llm/messages/normalization.rs @@ -1,6 +1,9 @@ -use litellm_llms_types::formats::messages::{ - CacheControl, ContentBlock, Message, MessageContent, MessagesOptionalParams, MessagesRequest, - SystemPrompt, +use litellm_llms_types::{ + formats::messages::{ + CacheControl, ContentBlock, Message, MessageContent, MessagesOptionalParams, + MessagesRequest, SystemPrompt, + }, + recognized::{Recognized, map_known_runs}, }; use crate::{ @@ -22,15 +25,22 @@ pub fn normalize_system_role_messages( let leading_count = request .messages .iter() - .take_while(|message| is_system_role_message(message)) + .take_while(|message| message.known().is_some_and(is_system_role_message)) .count(); let mut messages = request.messages.into_iter(); - let hoisted: Vec = messages.by_ref().take(leading_count).collect(); - let remaining: Vec = messages.collect(); + let hoisted: Vec = messages + .by_ref() + .take(leading_count) + .filter_map(|message| match message { + Recognized::Known(message) => Some(message), + Recognized::Unrecognized(_) => None, + }) + .collect(); + let remaining: Vec> = messages.collect(); let remaining = if supports_mid_conversation_system { remaining } else { - convert_mid_conversation_system_turns(remaining) + map_known_runs(remaining, convert_mid_conversation_system_turns) }; let system = if hoisted.is_empty() { request.params.system @@ -94,7 +104,7 @@ pub fn strip_cache_control_scope(request: MessagesRequest) -> MessagesRequest { messages: request .messages .into_iter() - .map(strip_scope_from_message) + .map(|message| message.map_known(strip_scope_from_message)) .collect(), params: MessagesOptionalParams { system: request.params.system.map(strip_scope_from_system), diff --git a/litellm-rust/crates/llms/src/base_llm/messages/tools.rs b/litellm-rust/crates/llms/src/base_llm/messages/tools.rs new file mode 100644 index 00000000000..49113872c56 --- /dev/null +++ b/litellm-rust/crates/llms/src/base_llm/messages/tools.rs @@ -0,0 +1,194 @@ +use litellm_llms_types::{ + formats::messages::{MessagesOptionalParams, MessagesRequest, MessagesTool}, + recognized::Recognized, +}; +use serde_json::{Map, Value}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ToolCustomField { + Keep, + Rewrite { hoist_defer_loading: bool }, +} + +impl ToolCustomField { + pub fn apply(self, request: MessagesRequest, drop_params: bool) -> MessagesRequest { + match self { + Self::Keep => request, + Self::Rewrite { + hoist_defer_loading, + } => tools_without_custom_field(request, hoist_defer_loading, drop_params), + } + } +} + +fn tools_without_custom_field( + request: MessagesRequest, + hoist: bool, + drop_custom: bool, +) -> MessagesRequest { + let tools = request.params.tools.map(|tools| { + tools + .into_iter() + .map(|tool| tool_without_custom_field(tool, hoist, drop_custom)) + .collect() + }); + MessagesRequest { + params: MessagesOptionalParams { + tools, + ..request.params + }, + ..request + } +} + +fn tool_without_custom_field( + tool: Recognized, + hoist: bool, + drop_custom: bool, +) -> Recognized { + let Ok(Value::Object(fields)) = serde_json::to_value(&tool) else { + return tool; + }; + let Some(custom) = fields.get("custom").cloned() else { + return tool; + }; + let defer_loading = hoist + .then(|| hoistable_defer_loading(&fields, &custom)) + .flatten(); + let without_custom = fields + .iter() + .filter(|(key, _)| *key != "custom") + .map(|(key, value)| (key.clone(), value.clone())); + let rebuilt: Map = match defer_loading { + None if drop_custom => without_custom.collect(), + None => return tool, + Some(defer_loading) => { + let unhoisted: Map = custom + .as_object() + .into_iter() + .flatten() + .filter(|(key, _)| *key != "defer_loading") + .map(|(key, value)| (key.clone(), value.clone())) + .collect(); + let kept_custom = (!unhoisted.is_empty() && !drop_custom) + .then(|| ("custom".to_string(), Value::Object(unhoisted))); + without_custom + .chain([("defer_loading".to_string(), Value::Bool(defer_loading))]) + .chain(kept_custom) + .collect() + } + }; + serde_json::from_value(Value::Object(rebuilt)).unwrap_or(tool) +} + +fn hoistable_defer_loading(tool: &Map, custom: &Value) -> Option { + if tool.contains_key("defer_loading") { + return None; + } + custom.as_object()?.get("defer_loading")?.as_bool() +} + +#[cfg(test)] +mod tests { + use rstest::rstest; + use serde_json::json; + + use super::*; + + const WEATHER: &str = "get_weather"; + + fn tool(fields: Value) -> Value { + merged( + json!({"name": WEATHER, "input_schema": {"type": "object"}}), + fields, + ) + } + + fn tools_after(policy: ToolCustomField, tools: Value, drop_custom: bool) -> Value { + let request: MessagesRequest = serde_json::from_value(json!({ + "model": "claude-sonnet-4-5", + "max_tokens": 16, + "messages": [{"role": "user", "content": "hi"}], + "tools": [tools] + })) + .unwrap(); + serde_json::to_value(policy.apply(request, drop_custom)).unwrap()["tools"][0].clone() + } + + fn merged(base: Value, fields: Value) -> Value { + let mut merged = base.as_object().unwrap().clone(); + merged.extend(fields.as_object().unwrap().clone()); + Value::Object(merged) + } + + const HOIST: ToolCustomField = ToolCustomField::Rewrite { + hoist_defer_loading: true, + }; + const NO_HOIST: ToolCustomField = ToolCustomField::Rewrite { + hoist_defer_loading: false, + }; + + #[rstest] + #[case::hoists_defer_loading( + HOIST, + json!({"custom": {"defer_loading": true}}), + false, + json!({"defer_loading": true}) + )] + #[case::keeps_other_custom_keys( + HOIST, + json!({"custom": {"defer_loading": false, "note": "kept"}}), + false, + json!({"defer_loading": false, "custom": {"note": "kept"}}) + )] + #[case::drops_other_custom_keys_with_drop_params( + HOIST, + json!({"custom": {"defer_loading": true, "note": "dropped"}}), + true, + json!({"defer_loading": true}) + )] + #[case::keeps_an_opaque_custom( + HOIST, + json!({"custom": "opaque"}), + false, + json!({"custom": "opaque"}) + )] + #[case::drops_an_opaque_custom_with_drop_params( + HOIST, + json!({"custom": "opaque"}), + true, + json!({}) + )] + #[case::own_defer_loading_wins( + HOIST, + json!({"defer_loading": false, "custom": {"defer_loading": true}}), + false, + json!({"defer_loading": false, "custom": {"defer_loading": true}}) + )] + #[case::not_hoisted_off_claude_hosts( + NO_HOIST, + json!({"custom": {"defer_loading": true}}), + false, + json!({"custom": {"defer_loading": true}}) + )] + fn tool_custom_field_follows_the_python_handler( + #[case] policy: ToolCustomField, + #[case] fields: Value, + #[case] drop_custom: bool, + #[case] expected: Value, + ) { + assert_eq!( + tools_after(policy, tool(fields), drop_custom), + tool(expected) + ); + } + + #[rstest] + fn keep_leaves_the_custom_field() { + let custom = tool(json!({"custom": {"defer_loading": true}})); + assert_eq!( + tools_after(ToolCustomField::Keep, custom.clone(), true), + custom + ); + } +} diff --git a/litellm-rust/crates/llms/src/base_llm/messages/transformation.rs b/litellm-rust/crates/llms/src/base_llm/messages/transformation.rs index 744ce89afdb..13c021c2aec 100644 --- a/litellm-rust/crates/llms/src/base_llm/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/base_llm/messages/transformation.rs @@ -1,19 +1,33 @@ +use litellm_host::interceptors::RetriedRequest; use litellm_llms_types::formats::messages::{ MessagesOptionalParams, MessagesRequest, MessagesResponse, }; use litellm_router_types::LitellmParams; +use litellm_secret_value::SecretValue; use serde_json::Value; -use super::context::MessagesTransformContext; +use super::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + tools::ToolCustomField, +}; pub use crate::base_llm::auth::{Headers, ValidatedEnvironment}; use crate::{Error, base_llm::messages::streaming::StreamDecoder}; +pub enum FederatedEnvironment { + Validated(ValidatedEnvironment), + Unauthenticated { + headers: Headers, + missing: Error, + federate: fn(Headers, SecretValue) -> ValidatedEnvironment, + }, +} + pub trait BaseMessagesConfig: Sync { fn shape_request( &self, request: MessagesRequest, - _reasoning_auto_summary: bool, + _options: MessagesShapeOptions, ) -> Result { Ok(request) } @@ -35,6 +49,10 @@ pub trait BaseMessagesConfig: Sync { Ok(request) } + fn tool_custom_field(&self, _model: &str) -> ToolCustomField { + ToolCustomField::Keep + } + fn transform_anthropic_messages_response( &self, _model: &str, @@ -62,6 +80,26 @@ pub trait BaseMessagesConfig: Sync { env_lookup: &dyn Fn(&str) -> Option, ) -> Result; + fn validate_federated_environment( + &self, + headers: Headers, + api_key: Option<&str>, + model: &str, + optional_params: &MessagesOptionalParams, + litellm_params: &LitellmParams, + env_lookup: &dyn Fn(&str) -> Option, + ) -> Result { + self.validate_environment( + headers, + api_key, + model, + optional_params, + litellm_params, + env_lookup, + ) + .map(FederatedEnvironment::Validated) + } + /// `None` relays the upstream bytes untouched, which is right for every host that already /// speaks Anthropic SSE. A host on another wire returns the decoder that lifts its frames /// into Anthropic stream events, and the route re-encodes those as Anthropic SSE. @@ -77,6 +115,10 @@ pub trait BaseMessagesConfig: Sync { headers } + fn headers_for_url(&self, headers: Headers, _url: &str) -> Headers { + headers + } + fn request_body( &self, request: MessagesRequest, @@ -91,6 +133,16 @@ pub trait BaseMessagesConfig: Sync { fn wire_body(&self, body: Value) -> Value { body } + + fn retry_after_http_error( + &self, + _status: u16, + _error_text: &str, + _request_body: &Value, + _context: &MessagesTransformContext, + ) -> Option { + None + } } #[cfg(test)] @@ -149,9 +201,10 @@ mod tests { } #[rstest] - #[case::disabled(false)] - #[case::enabled(true)] - fn default_shaping_preserves_provider_policy_inputs(#[case] reasoning_auto_summary: bool) { + fn default_shaping_preserves_provider_policy_inputs( + #[values(false, true)] reasoning_auto_summary: bool, + #[values(false, true)] presanitized: bool, + ) { let request: MessagesRequest = serde_json::from_value(serde_json::json!({ "model": "test-model", "metadata": {"user_id": 7, "extra": "keep"}, @@ -160,7 +213,13 @@ mod tests { })) .unwrap(); assert_eq!( - DefaultsConfig.shape_request(request.clone(), reasoning_auto_summary), + DefaultsConfig.shape_request( + request.clone(), + MessagesShapeOptions { + reasoning_auto_summary, + presanitized + } + ), Ok(request) ); assert_eq!( diff --git a/litellm-rust/crates/llms/src/bedrock/claude_platform/messages/transformation.rs b/litellm-rust/crates/llms/src/bedrock/claude_platform/messages/transformation.rs index 5b89345a1c5..4bf30b56f00 100644 --- a/litellm-rust/crates/llms/src/bedrock/claude_platform/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/bedrock/claude_platform/messages/transformation.rs @@ -1,3 +1,5 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; +use litellm_host::interceptors::RetriedRequest; use std::sync::LazyLock; use litellm_auth::{AwsParams, CredentialPlacement, ParamKind, ParamSpec}; @@ -21,7 +23,10 @@ use crate::{ }, base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, - messages::{context::MessagesTransformContext, transformation::BaseMessagesConfig}, + messages::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + transformation::BaseMessagesConfig, + }, }, bedrock::common_utils::validated_region, }; @@ -50,12 +55,28 @@ pub const BEDROCK_CLAUDE_PLATFORM_MESSAGES_CONFIG: BedrockClaudePlatformMessages BedrockClaudePlatformMessagesConfig; impl BaseMessagesConfig for BedrockClaudePlatformMessagesConfig { + fn tool_custom_field(&self, model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: crate::anthropic::messages::transformation::is_claude_model(model), + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn validate_environment( diff --git a/litellm-rust/crates/llms/src/bedrock/messages/invoke_transformations/anthropic_claude_transformation.rs b/litellm-rust/crates/llms/src/bedrock/messages/invoke_transformations/anthropic_claude_transformation.rs index 1d380c917f6..fa037974342 100644 --- a/litellm-rust/crates/llms/src/bedrock/messages/invoke_transformations/anthropic_claude_transformation.rs +++ b/litellm-rust/crates/llms/src/bedrock/messages/invoke_transformations/anthropic_claude_transformation.rs @@ -1,9 +1,11 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_core_utils::decline::Decline; +use litellm_host::interceptors::RetriedRequest; use std::convert::Infallible; use crate::{ anthropic::messages::handler::shape_anthropic_messages_request, - base_llm::messages::context::MessagesTransformContext, + base_llm::messages::context::{MessagesShapeOptions, MessagesTransformContext}, }; use futures_util::StreamExt; use litellm_auth::AwsParams; @@ -103,12 +105,22 @@ fn invoke_url( } impl BaseMessagesConfig for AmazonAnthropicClaudeMessagesConfig { + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn get_complete_url( diff --git a/litellm-rust/crates/llms/src/bedrock_mantle/messages/transformation.rs b/litellm-rust/crates/llms/src/bedrock_mantle/messages/transformation.rs index f139b93e259..0e67ea1a139 100644 --- a/litellm-rust/crates/llms/src/bedrock_mantle/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/bedrock_mantle/messages/transformation.rs @@ -1,3 +1,5 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; +use litellm_host::interceptors::RetriedRequest; use std::sync::LazyLock; use litellm_auth::{AwsParams, CredentialPlacement}; @@ -17,6 +19,7 @@ use serde_json::Value; use crate::{ Error, anthropic::{ + beta_headers::accepted_or_unlisted, common_utils::{existing_betas, merge_beta_headers}, messages::{ handler::shape_anthropic_messages_request, @@ -26,7 +29,7 @@ use crate::{ base_llm::{ auth::AuthScheme, messages::{ - context::MessagesTransformContext, + context::{MessagesShapeOptions, MessagesTransformContext}, transformation::{BaseMessagesConfig, Headers, ValidatedEnvironment}, }, }, @@ -56,6 +59,16 @@ pub const BEDROCK_MANTLE_MESSAGES_CONFIG: BedrockMantleAnthropicMessagesConfig = BedrockMantleAnthropicMessagesConfig; impl BaseMessagesConfig for BedrockMantleAnthropicMessagesConfig { + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn validate_environment( &self, headers: Headers, @@ -129,9 +142,9 @@ impl BaseMessagesConfig for BedrockMantleAnthropicMessagesConfig { fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn wire_body(&self, body: Value) -> Value { @@ -191,14 +204,10 @@ impl BaseMessagesConfig for BedrockMantleAnthropicMessagesConfig { .filter_map(Value::as_str) .filter_map(|beta| beta.parse::().ok()) .collect(); - let caller: BetaSet = existing_betas(&headers) - .union(body_betas) - .into_iter() - .filter_map(|beta| match beta { - AnthropicBeta::Other(_) => Some(beta), - _ => beta.on(BetaProvider::BedrockMantle), - }) - .collect(); + let caller = accepted_or_unlisted( + existing_betas(&headers).union(body_betas), + BetaProvider::BedrockMantle, + ); let safeguards: BetaSet = request .params .extra diff --git a/litellm-rust/crates/llms/src/deepseek/messages/transformation.rs b/litellm-rust/crates/llms/src/deepseek/messages/transformation.rs index 0dbcea01439..ee2aec9efb9 100644 --- a/litellm-rust/crates/llms/src/deepseek/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/deepseek/messages/transformation.rs @@ -1,4 +1,6 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::RetriedRequest; use litellm_secret_value::SecretValue; use litellm_core_utils::settings::resolve_non_empty; @@ -21,7 +23,10 @@ use crate::{ }, base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, - messages::{context::MessagesTransformContext, transformation::BaseMessagesConfig}, + messages::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + transformation::BaseMessagesConfig, + }, }, }; @@ -42,12 +47,28 @@ pub const DEEPSEEK_ANTHROPIC_MESSAGES_CONFIG: DeepSeekAnthropicMessagesConfig = DeepSeekAnthropicMessagesConfig; impl BaseMessagesConfig for DeepSeekAnthropicMessagesConfig { + fn tool_custom_field(&self, _model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: false, + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn get_complete_url( diff --git a/litellm-rust/crates/llms/src/edenai/messages/transformation.rs b/litellm-rust/crates/llms/src/edenai/messages/transformation.rs index d5944484522..d4f577e09a9 100644 --- a/litellm-rust/crates/llms/src/edenai/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/edenai/messages/transformation.rs @@ -1,4 +1,6 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::RetriedRequest; use litellm_secret_value::SecretValue; use litellm_core_utils::settings::resolve_non_empty; @@ -33,6 +35,22 @@ pub struct EdenAIAnthropicMessagesConfig; pub const EDENAI_MESSAGES_CONFIG: EdenAIAnthropicMessagesConfig = EdenAIAnthropicMessagesConfig; impl BaseMessagesConfig for EdenAIAnthropicMessagesConfig { + fn tool_custom_field(&self, _model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: false, + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn validate_environment( &self, headers: Headers, diff --git a/litellm-rust/crates/llms/src/error.rs b/litellm-rust/crates/llms/src/error.rs index 2975ceee3cb..77ee1f1036f 100644 --- a/litellm-rust/crates/llms/src/error.rs +++ b/litellm-rust/crates/llms/src/error.rs @@ -168,6 +168,10 @@ pub enum ErrorDetail { actual: String, choices: Vec<&'static str>, }, + #[error( + "Invalid reasoning_effort: {actual}. Must be one of: 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'none'" + )] + InvalidReasoningEffort { actual: String }, #[error("{field}='{value}' is not supported by this model. Got model: {model}")] UnsupportedValue { field: &'static str, @@ -187,6 +191,14 @@ pub enum ErrorDetail { "thinking.budget_tokens must be a number, got {actual}. To drop it, set `litellm.drop_params=True`, or `drop_params: true` under `litellm_settings` on the proxy" )] NonNumericThinkingBudget { actual: &'static str }, + /// Python's comparison of two operands it cannot order, which raises `TypeError` with this + /// text before any request is sent. + #[error("'{op}' not supported between instances of '{left}' and '{right}'")] + UnorderableTypes { + op: &'static str, + left: &'static str, + right: &'static str, + }, #[error( "Missing API Base - A call is being made to LLM Provider but no api base is set either in the environment variables ({{LLM_PROVIDER}}_API_KEY) or via params" )] diff --git a/litellm-rust/crates/llms/src/minimax/messages/transformation.rs b/litellm-rust/crates/llms/src/minimax/messages/transformation.rs index dafe5fbd16b..2eaf182e657 100644 --- a/litellm-rust/crates/llms/src/minimax/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/minimax/messages/transformation.rs @@ -1,5 +1,8 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::RetriedRequest; use litellm_secret_value::SecretValue; +use serde_json::Value; use litellm_core_utils::settings::resolve_non_empty; use litellm_llms_types::{ @@ -19,7 +22,10 @@ use crate::{ }, base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, - messages::{context::MessagesTransformContext, transformation::BaseMessagesConfig}, + messages::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + transformation::BaseMessagesConfig, + }, }, }; @@ -31,12 +37,28 @@ pub struct MinimaxMessagesConfig; pub const MINIMAX_MESSAGES_CONFIG: MinimaxMessagesConfig = MinimaxMessagesConfig; impl BaseMessagesConfig for MinimaxMessagesConfig { + fn tool_custom_field(&self, _model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: false, + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn validate_environment( diff --git a/litellm-rust/crates/llms/src/openrouter/messages/transformation.rs b/litellm-rust/crates/llms/src/openrouter/messages/transformation.rs index eeb3d1cb7f8..dc09f4e4149 100644 --- a/litellm-rust/crates/llms/src/openrouter/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/openrouter/messages/transformation.rs @@ -1,5 +1,8 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::RetriedRequest; use litellm_secret_value::SecretValue; +use serde_json::Value; use litellm_core_utils::settings::resolve_non_empty; use litellm_http::request::{has_bearer_auth, without_headers}; @@ -31,6 +34,16 @@ pub const OPENROUTER_MESSAGES_CONFIG: OpenRouterAnthropicMessagesConfig = OpenRouterAnthropicMessagesConfig; impl BaseMessagesConfig for OpenRouterAnthropicMessagesConfig { + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn validate_environment( &self, headers: Headers, diff --git a/litellm-rust/crates/llms/src/tencent/messages/transformation.rs b/litellm-rust/crates/llms/src/tencent/messages/transformation.rs index 621a09f4fb0..b3ee28b7474 100644 --- a/litellm-rust/crates/llms/src/tencent/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/tencent/messages/transformation.rs @@ -1,5 +1,8 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::CredentialPlacement; +use litellm_host::interceptors::RetriedRequest; use litellm_secret_value::SecretValue; +use serde_json::Value; use litellm_core_utils::settings::resolve_non_empty; use litellm_llms_types::{ @@ -19,7 +22,10 @@ use crate::{ }, base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, - messages::{context::MessagesTransformContext, transformation::BaseMessagesConfig}, + messages::{ + context::{MessagesShapeOptions, MessagesTransformContext}, + transformation::BaseMessagesConfig, + }, }, }; @@ -32,12 +38,28 @@ pub struct TencentAnthropicMessagesConfig; pub const TENCENT_MESSAGES_CONFIG: TencentAnthropicMessagesConfig = TencentAnthropicMessagesConfig; impl BaseMessagesConfig for TencentAnthropicMessagesConfig { + fn tool_custom_field(&self, _model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: false, + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn validate_environment( diff --git a/litellm-rust/crates/llms/src/vertex_ai/messages/transformation.rs b/litellm-rust/crates/llms/src/vertex_ai/messages/transformation.rs index 038617c2e10..674b9951d3e 100644 --- a/litellm-rust/crates/llms/src/vertex_ai/messages/transformation.rs +++ b/litellm-rust/crates/llms/src/vertex_ai/messages/transformation.rs @@ -1,8 +1,10 @@ +use crate::anthropic::messages::transformation::retry_anthropic_messages_after_http_error; use litellm_auth::VertexParams; use litellm_auth_gcp::{ VertexConfig, get_vertex_ai_location, get_vertex_ai_project, get_vertex_ai_project_from_credentials, secret_names, }; +use litellm_host::interceptors::RetriedRequest; use litellm_http::request::{has_header, header_value, without_headers}; use litellm_llms_types::{ formats::messages::{MessagesOptionalParams, MessagesRequest, MessagesTool, OutputConfig}, @@ -24,7 +26,7 @@ use crate::{ base_llm::{ auth::{AuthScheme, Headers, ValidatedEnvironment}, messages::{ - context::MessagesTransformContext, + context::{MessagesShapeOptions, MessagesTransformContext}, normalization::{normalize_system_role_messages, strip_cache_control_scope}, transformation::BaseMessagesConfig, }, @@ -47,12 +49,28 @@ pub const VERTEX_ANTHROPIC_MESSAGES_CONFIG: VertexAiPartnerModelsAnthropicMessag VertexAiPartnerModelsAnthropicMessagesConfig; impl BaseMessagesConfig for VertexAiPartnerModelsAnthropicMessagesConfig { + fn tool_custom_field(&self, model: &str) -> crate::base_llm::messages::tools::ToolCustomField { + crate::base_llm::messages::tools::ToolCustomField::Rewrite { + hoist_defer_loading: crate::anthropic::messages::transformation::is_claude_model(model), + } + } + + fn retry_after_http_error( + &self, + status: u16, + error_text: &str, + request_body: &Value, + context: &MessagesTransformContext, + ) -> Option { + retry_anthropic_messages_after_http_error(status, error_text, request_body, context) + } + fn shape_request( &self, request: MessagesRequest, - reasoning_auto_summary: bool, + options: MessagesShapeOptions, ) -> Result { - shape_anthropic_messages_request(request, reasoning_auto_summary) + shape_anthropic_messages_request(request, options) } fn get_complete_url( @@ -700,6 +718,7 @@ mod tests { ..ThinkingContext::default() }, drop_params: false, + drops_unsupported_params: false, }, ); assert_eq!(body["system"], json!("be terse")); @@ -717,6 +736,7 @@ mod tests { ..ThinkingContext::default() }, drop_params: false, + drops_unsupported_params: false, } } diff --git a/litellm-rust/crates/llms/tests/fixtures/anthropic_messages_http_error_retry.json b/litellm-rust/crates/llms/tests/fixtures/anthropic_messages_http_error_retry.json new file mode 100644 index 00000000000..843a1689056 --- /dev/null +++ b/litellm-rust/crates/llms/tests/fixtures/anthropic_messages_http_error_retry.json @@ -0,0 +1,623 @@ +{ + "invalid_thinking_block_error": [ + { + "name": "invalid_signature", + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "expected": true + }, + { + "name": "invalid_signature_in_an_error_envelope", + "error_text": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.3.content.3: Invalid `signature` in `thinking` block\"},\"request_id\":\"req_011Ca2EtQDxp7x6RGUY2jVn9\"}", + "expected": true + }, + { + "name": "signature_not_a_string", + "error_text": "{\"message\":\"messages.2.content.0.thinking.signature.str: Input should be a valid string\"}", + "expected": true + }, + { + "name": "signature_not_a_string_bare", + "error_text": "messages.4.content.1.thinking.signature.str: Input should be a valid string", + "expected": true + }, + { + "name": "empty_thinking", + "error_text": "messages.1.content.0.thinking: each thinking block must contain thinking", + "expected": true + }, + { + "name": "bound_to_a_different_conversation", + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation.", + "expected": true + }, + { + "name": "uppercase", + "error_text": "MESSAGES.1: INVALID SIGNATURE IN THINKING BLOCK", + "expected": true + }, + { + "name": "signature_without_a_verdict", + "error_text": "thinking signature is malformed", + "expected": false + }, + { + "name": "invalid_without_thinking", + "error_text": "Invalid `signature` in `tool_use` block", + "expected": false + }, + { + "name": "model_not_found", + "error_text": "invalid_request_error: model not found", + "expected": false + }, + { + "name": "rate_limited", + "error_text": "rate limit exceeded", + "expected": false + }, + { + "name": "unrelated", + "error_text": "max_tokens: 4096 > 64000", + "expected": false + }, + { + "name": "empty", + "error_text": "", + "expected": false + } + ], + "thinking_binding_mismatch_error": [ + { + "name": "bound_elsewhere", + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation.", + "expected": true + }, + { + "name": "mixed_case", + "error_text": "The block is Bound To A Different Conversation.", + "expected": true + }, + { + "name": "plain_signature", + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "expected": false + } + ], + "http_error_retry": { + "request": { + "model": "claude-sonnet-4-5", + "max_tokens": 4096, + "messages": [ + { + "role": "user", + "content": "hi" + }, + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "plan", + "signature": "sig" + }, + { + "type": "text", + "text": "hello" + } + ] + }, + { + "role": "assistant", + "content": [ + { + "type": "redacted_thinking", + "data": "opaque" + } + ] + }, + { + "role": "user", + "content": "again" + } + ] + }, + "stripped_request": { + "model": "claude-sonnet-4-5", + "max_tokens": 4096, + "messages": [ + { + "role": "user", + "content": "hi" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "hello" + } + ] + }, + { + "role": "user", + "content": "again" + } + ] + }, + "cases": [ + { + "name": "invalid_signature", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": true, + "stripped": true + }, + { + "name": "missing_signature", + "status": 400, + "error_text": "messages.1.content.0.thinking.signature.str: Input should be a valid string", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": true, + "stripped": true + }, + { + "name": "empty_thinking", + "status": 400, + "error_text": "messages.1.content.0.thinking: each thinking block must contain thinking", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": true, + "stripped": true + }, + { + "name": "unpinned_binding_mismatch", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation.", + "thinking": { + "type": "adaptive" + }, + "retried": true, + "stripped": true + }, + { + "name": "caller_pinned_binding", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation.", + "thinking": { + "type": "adaptive", + "block_binding": { + "prefix_mismatch_behavior": "error" + } + }, + "retried": false, + "stripped": true + }, + { + "name": "caller_pinned_binding_other_signature_error", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "thinking": { + "type": "adaptive", + "block_binding": { + "prefix_mismatch_behavior": "error" + } + }, + "retried": true, + "stripped": true + }, + { + "name": "not_a_400", + "status": 429, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": false, + "stripped": false + }, + { + "name": "unrelated_400", + "status": 400, + "error_text": "max_tokens: 4096 > 64000", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": false, + "stripped": false + }, + { + "name": "signature_without_thinking", + "status": 400, + "error_text": "Invalid `signature` in `tool_use` block", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "retried": false, + "stripped": false + } + ] + }, + "claude_strict_tools_rejection": [ + { + "name": "too_many_strict_tools", + "status": 400, + "error_text": "Too many strict tools (21). The maximum number of strict tools is 20.", + "expected": true + }, + { + "name": "too_many_strict_tools_in_an_error_envelope", + "status": 400, + "error_text": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Too many strict tools (24). The maximum is 20.\"}}", + "expected": true + }, + { + "name": "non_ascii_digits", + "status": 400, + "error_text": "Too many strict tools (٢١)", + "expected": true + }, + { + "name": "optional_parameters", + "status": 400, + "error_text": "Schemas contains too many optional parameters (30)", + "expected": true + }, + { + "name": "union_types", + "status": 400, + "error_text": "Schemas contains too many parameters with union types", + "expected": true + }, + { + "name": "compiled_grammar_too_large", + "status": 400, + "error_text": "The compiled grammar is too large", + "expected": true + }, + { + "name": "compiled_grammar_size", + "status": 400, + "error_text": "Compiled grammar size exceeds the limit", + "expected": true + }, + { + "name": "custom_strict", + "status": 400, + "error_text": "tools.3.custom.strict: Extra inputs are not permitted", + "expected": true + }, + { + "name": "custom", + "status": 400, + "error_text": "tools.0.custom: Extra inputs are not permitted", + "expected": true + }, + { + "name": "grammar_compilation_timed_out", + "status": 400, + "error_text": "Grammar compilation timed out", + "expected": true + }, + { + "name": "no_count", + "status": 400, + "error_text": "tools.0.strict: too many strict tools", + "expected": false + }, + { + "name": "empty_count", + "status": 400, + "error_text": "Too many strict tools ()", + "expected": false + }, + { + "name": "lowercase_grammar_timeout", + "status": 400, + "error_text": "grammar compilation timed out", + "expected": false + }, + { + "name": "custom_without_separator", + "status": 400, + "error_text": "tools.0.custom.strict", + "expected": false + }, + { + "name": "uppercase_schemas", + "status": 400, + "error_text": "SCHEMAS CONTAINS TOO MANY OPTIONAL PARAMETERS", + "expected": false + }, + { + "name": "not_a_400", + "status": 429, + "error_text": "Too many strict tools (21). The maximum number of strict tools is 20.", + "expected": false + }, + { + "name": "empty", + "status": 400, + "error_text": "", + "expected": false + } + ], + "tools_without_strict": [ + { + "name": "strict_dropped_from_every_tool", + "tools": [ + { + "name": "a", + "strict": true, + "input_schema": {} + }, + { + "name": "b", + "strict": false + }, + { + "name": "c" + } + ], + "expected": { + "tools": [ + { + "name": "a", + "input_schema": {} + }, + { + "name": "b" + }, + { + "name": "c" + } + ], + "dropped_count": 1 + } + }, + { + "name": "only_a_true_strict_counts", + "tools": [ + { + "name": "a", + "strict": 1 + }, + { + "name": "b", + "strict": "true" + } + ], + "expected": null + }, + { + "name": "no_strict", + "tools": [ + { + "name": "a" + } + ], + "expected": null + }, + { + "name": "empty", + "tools": [], + "expected": null + }, + { + "name": "non_object_tool", + "tools": [ + { + "name": "a", + "strict": true + }, + "b" + ], + "expected": null + }, + { + "name": "not_a_list", + "tools": { + "name": "a", + "strict": true + }, + "expected": null + }, + { + "name": "null", + "tools": null, + "expected": null + } + ], + "strict_tools_retry": { + "tools": [ + { + "name": "a", + "input_schema": { + "type": "object" + }, + "strict": true + }, + { + "name": "b", + "input_schema": { + "type": "object" + }, + "strict": false + }, + { + "name": "c", + "input_schema": { + "type": "object" + } + } + ], + "tools_without_strict": [ + { + "name": "a", + "input_schema": { + "type": "object" + } + }, + { + "name": "b", + "input_schema": { + "type": "object" + } + }, + { + "name": "c", + "input_schema": { + "type": "object" + } + } + ], + "dropped": 1, + "cases": [ + { + "name": "strict_rejection_under_drop_params", + "status": 400, + "error_text": "Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": true, + "retried": true, + "stripped": false, + "strict_dropped": true + }, + { + "name": "strict_rejection_without_drop_params", + "status": 400, + "error_text": "Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": false, + "retried": false, + "stripped": false, + "strict_dropped": true + }, + { + "name": "compiled_grammar_under_drop_params", + "status": 400, + "error_text": "The compiled grammar is too large", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": true, + "retried": true, + "stripped": false, + "strict_dropped": true + }, + { + "name": "strict_text_on_a_429", + "status": 429, + "error_text": "Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": true, + "retried": false, + "stripped": false, + "strict_dropped": false + }, + { + "name": "unrelated_400_under_drop_params", + "status": 400, + "error_text": "max_tokens: 4096 > 64000", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": true, + "retried": false, + "stripped": false, + "strict_dropped": false + }, + { + "name": "thinking_rejection_keeps_strict", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": true, + "retried": true, + "stripped": true, + "strict_dropped": false + }, + { + "name": "thinking_rejection_without_drop_params_keeps_strict", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": false, + "retried": true, + "stripped": true, + "strict_dropped": false + }, + { + "name": "one_error_naming_both_without_drop_params", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "enabled", + "budget_tokens": 2048 + }, + "drops_unsupported_params": false, + "retried": true, + "stripped": true, + "strict_dropped": true + }, + { + "name": "pinned_binding_mismatch_with_a_strict_rejection_under_drop_params", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "adaptive", + "block_binding": { + "prefix_mismatch_behavior": "error" + } + }, + "drops_unsupported_params": true, + "retried": true, + "stripped": true, + "strict_dropped": true + }, + { + "name": "pinned_binding_mismatch_with_a_strict_rejection_without_drop_params", + "status": 400, + "error_text": "messages.1.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Too many strict tools (21). The maximum number of strict tools is 20.", + "thinking": { + "type": "adaptive", + "block_binding": { + "prefix_mismatch_behavior": "error" + } + }, + "drops_unsupported_params": false, + "retried": false, + "stripped": true, + "strict_dropped": true + } + ] + } +} diff --git a/litellm-rust/crates/llms/tests/messages_http_error_retry.rs b/litellm-rust/crates/llms/tests/messages_http_error_retry.rs new file mode 100644 index 00000000000..ac8ceac4ac6 --- /dev/null +++ b/litellm-rust/crates/llms/tests/messages_http_error_retry.rs @@ -0,0 +1,138 @@ +use litellm_host::interceptors::{RetriedRequest, RetryReason}; +use litellm_llms::{ + anthropic::messages::transformation::ANTHROPIC_MESSAGES_CONFIG, + azure_ai::messages::transformation::AZURE_ANTHROPIC_MESSAGES_CONFIG, + base_llm::messages::{context::MessagesTransformContext, transformation::BaseMessagesConfig}, + bedrock::{ + claude_platform::messages::transformation::BEDROCK_CLAUDE_PLATFORM_MESSAGES_CONFIG, + messages::invoke_transformations::anthropic_claude_transformation::BEDROCK_ANTHROPIC_MESSAGES_CONFIG, + }, + bedrock_mantle::messages::transformation::BEDROCK_MANTLE_MESSAGES_CONFIG, + deepseek::messages::transformation::DEEPSEEK_ANTHROPIC_MESSAGES_CONFIG, + edenai::messages::transformation::EDENAI_MESSAGES_CONFIG, + minimax::messages::transformation::MINIMAX_MESSAGES_CONFIG, + openrouter::messages::transformation::OPENROUTER_MESSAGES_CONFIG, + tencent::messages::transformation::TENCENT_MESSAGES_CONFIG, + vertex_ai::messages::transformation::VERTEX_ANTHROPIC_MESSAGES_CONFIG, +}; +use rstest::rstest; +use serde_json::Value; + +#[rstest] +#[case::anthropic(&ANTHROPIC_MESSAGES_CONFIG)] +#[case::azure_ai(&AZURE_ANTHROPIC_MESSAGES_CONFIG)] +#[case::bedrock_invoke(&BEDROCK_ANTHROPIC_MESSAGES_CONFIG)] +#[case::bedrock_claude_platform(&BEDROCK_CLAUDE_PLATFORM_MESSAGES_CONFIG)] +#[case::bedrock_mantle(&BEDROCK_MANTLE_MESSAGES_CONFIG)] +#[case::deepseek(&DEEPSEEK_ANTHROPIC_MESSAGES_CONFIG)] +#[case::edenai(&EDENAI_MESSAGES_CONFIG)] +#[case::minimax(&MINIMAX_MESSAGES_CONFIG)] +#[case::openrouter(&OPENROUTER_MESSAGES_CONFIG)] +#[case::tencent(&TENCENT_MESSAGES_CONFIG)] +#[case::vertex_ai(&VERTEX_ANTHROPIC_MESSAGES_CONFIG)] +fn every_messages_provider_retries_like_the_python_base_config( + #[case] config: &dyn BaseMessagesConfig, +) { + let fixture: Value = serde_json::from_str(include_str!( + "fixtures/anthropic_messages_http_error_retry.json" + )) + .unwrap(); + let table = &fixture["http_error_retry"]; + let cases = table["cases"].as_array().unwrap(); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let mut body = table["request"].clone(); + body["thinking"] = case["thinking"].clone(); + let status = u16::try_from(case["status"].as_u64().unwrap()).unwrap(); + let expected = case["retried"].as_bool().unwrap().then(|| { + if case["stripped"].as_bool().unwrap() { + RetriedRequest { + reasons: vec![RetryReason::ThinkingSignature], + body: table["stripped_request"].clone(), + } + } else { + RetriedRequest { + reasons: Vec::new(), + body: body.clone(), + } + } + }); + config.retry_after_http_error( + status, + case["error_text"].as_str().unwrap(), + &body, + &MessagesTransformContext::default(), + ) != expected + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); +} + +#[rstest] +#[case::anthropic(&ANTHROPIC_MESSAGES_CONFIG)] +#[case::azure_ai(&AZURE_ANTHROPIC_MESSAGES_CONFIG)] +#[case::bedrock_invoke(&BEDROCK_ANTHROPIC_MESSAGES_CONFIG)] +#[case::bedrock_claude_platform(&BEDROCK_CLAUDE_PLATFORM_MESSAGES_CONFIG)] +#[case::bedrock_mantle(&BEDROCK_MANTLE_MESSAGES_CONFIG)] +#[case::deepseek(&DEEPSEEK_ANTHROPIC_MESSAGES_CONFIG)] +#[case::edenai(&EDENAI_MESSAGES_CONFIG)] +#[case::minimax(&MINIMAX_MESSAGES_CONFIG)] +#[case::openrouter(&OPENROUTER_MESSAGES_CONFIG)] +#[case::tencent(&TENCENT_MESSAGES_CONFIG)] +#[case::vertex_ai(&VERTEX_ANTHROPIC_MESSAGES_CONFIG)] +fn every_messages_provider_drops_rejected_strict_tools_like_the_python_base_config( + #[case] config: &dyn BaseMessagesConfig, +) { + let fixture: Value = serde_json::from_str(include_str!( + "fixtures/anthropic_messages_http_error_retry.json" + )) + .unwrap(); + let replay = &fixture["http_error_retry"]; + let table = &fixture["strict_tools_retry"]; + let cases = table["cases"].as_array().unwrap(); + assert!(!cases.is_empty()); + let mismatched: Vec<&str> = cases + .iter() + .filter(|case| { + let mut body = replay["request"].clone(); + body["thinking"] = case["thinking"].clone(); + body["tools"] = table["tools"].clone(); + let status = u16::try_from(case["status"].as_u64().unwrap()).unwrap(); + let expected = case["retried"].as_bool().unwrap().then(|| { + let mut reasons = Vec::new(); + let mut expected = if case["stripped"].as_bool().unwrap() { + reasons.push(RetryReason::ThinkingSignature); + replay["stripped_request"].clone() + } else { + body.clone() + }; + expected["tools"] = if case["strict_dropped"].as_bool().unwrap() { + reasons.push(RetryReason::StrictTools { + dropped: usize::try_from(table["dropped"].as_u64().unwrap()).unwrap(), + }); + table["tools_without_strict"].clone() + } else { + table["tools"].clone() + }; + RetriedRequest { + reasons, + body: expected, + } + }); + config.retry_after_http_error( + status, + case["error_text"].as_str().unwrap(), + &body, + &MessagesTransformContext { + drops_unsupported_params: case["drops_unsupported_params"].as_bool().unwrap(), + ..MessagesTransformContext::default() + }, + ) != expected + }) + .map(|case| case["name"].as_str().unwrap()) + .collect(); + assert_eq!(mismatched, Vec::<&str>::new()); +} diff --git a/litellm-rust/crates/python-bridge/src/cache/AGENTS.md b/litellm-rust/crates/python-bridge/src/cache/AGENTS.md index e79562b8762..a95229c5bf4 100644 --- a/litellm-rust/crates/python-bridge/src/cache/AGENTS.md +++ b/litellm-rust/crates/python-bridge/src/cache/AGENTS.md @@ -2,6 +2,6 @@ This folder owns how Rust inference reaches the selected Python cache. Cache algorithms, storage protocols and response-cache semantics belong to their cache crates -`mod.rs` exposes the cache boundary to routes. `selection.rs` asks `litellm.rust_bridge.host.cache` for the live configured cache and owns route admission and inference protocol composition +`mod.rs` exposes the cache boundary to routes. `selection.rs` asks `litellm.rust_bridge.host.cache` for the live configured cache and owns route admission. A route's protocol carries cache operations through any host call type that converts from `CacheCall` `python/` delegates operations to the selected Python cache without discovering configuration. Routes use only the parent module's exports diff --git a/litellm-rust/crates/python-bridge/src/cache/mod.rs b/litellm-rust/crates/python-bridge/src/cache/mod.rs index fe9e06b3d23..959c211b1d3 100644 --- a/litellm-rust/crates/python-bridge/src/cache/mod.rs +++ b/litellm-rust/crates/python-bridge/src/cache/mod.rs @@ -2,7 +2,7 @@ mod python; mod selection; pub(crate) use python::{CacheCall, PythonCache}; -pub(crate) use selection::{Cached, Selection, configure, ensure_cache_disabled}; +pub(crate) use selection::{Selection, configure, ensure_cache_disabled}; use pyo3::{exceptions::PyRuntimeError, prelude::*}; diff --git a/litellm-rust/crates/python-bridge/src/cache/python/AGENTS.md b/litellm-rust/crates/python-bridge/src/cache/python/AGENTS.md index 3b516251f43..9aba11a3376 100644 --- a/litellm-rust/crates/python-bridge/src/cache/python/AGENTS.md +++ b/litellm-rust/crates/python-bridge/src/cache/python/AGENTS.md @@ -1,6 +1,6 @@ # Python cache delegation -This directory lets Rust inference use a selected Python cache. `service.rs` implements the injected Rust response-cache service and yields typed cache operations. `host.rs` calls the Python cache's sync or async API and delivers the result back to Rust. +This directory lets Rust inference use a selected Python cache. `service.rs` implements the injected Rust response-cache service and yields typed cache operations. `host.rs` delivers each operation's result back to Rust. Asynchronous lookups and stream stores go through `litellm.rust_bridge.host.cache`, which reads with the `LLMCachingHandler` the `@client` wrapper uses, for the legacy function the route names, and writes with its dual cache. `configure` disables the cache for synchronous calls. Keep the shared inference protocol wrapper and adapter selection in the parent module. Receive the configured cache and prepared arguments from the parent module. Do not discover global configuration, choose native backends, or move inference to Python. Core remains independent of Python objects and cache implementation details diff --git a/litellm-rust/crates/python-bridge/src/cache/python/host.rs b/litellm-rust/crates/python-bridge/src/cache/python/host.rs index a8cbd0ce607..208f40a324b 100644 --- a/litellm-rust/crates/python-bridge/src/cache/python/host.rs +++ b/litellm-rust/crates/python-bridge/src/cache/python/host.rs @@ -1,6 +1,6 @@ use litellm_cache::Error; use litellm_host::protocol::Reply; -use litellm_host_python::{from_py, to_py}; +use litellm_host_python::{json_from_py, to_py}; use pyo3::{ gc::{PyTraverseError, PyVisit}, prelude::*, @@ -18,7 +18,9 @@ enum Pending { pub(crate) struct PythonCache { cache: Option>, + function: Option>, arguments: Option>, + read_handler: Option>, pending: Option, asynchronous: bool, deferred: bool, @@ -28,19 +30,27 @@ impl PythonCache { pub fn new(asynchronous: bool) -> Self { Self { cache: None, + function: None, arguments: None, + read_handler: None, pending: None, asynchronous, deferred: false, } } + pub(in crate::cache) fn asynchronous(&self) -> bool { + self.asynchronous + } + pub(in crate::cache) fn bind( &mut self, cache: Bound<'_, PyAny>, + function: &Bound<'_, PyAny>, arguments: &Bound<'_, PyDict>, ) { self.cache = Some(cache.unbind()); + self.function = Some(function.clone().unbind()); self.arguments = Some(arguments.clone().unbind()); } @@ -59,7 +69,7 @@ impl PythonCache { self.pending = Some(Pending::Lookup(reply)); ( if self.asynchronous { - "async_get_cache" + "lookup" } else { "get_cache" }, @@ -77,7 +87,7 @@ impl PythonCache { self.pending = Some(Pending::Store(reply)); ( if self.asynchronous { - "async_add_cache" + "store_stream" } else { "add_cache" }, @@ -86,9 +96,20 @@ impl PythonCache { } }; let result = match result { + Some(value) if self.asynchronous => py + .import(CACHE_HOST_MODULE)? + .getattr(method)? + .call((cache, value), Some(&arguments)), Some(value) => cache .bind(py) .call_method(method, (value,), Some(&arguments)), + None if self.asynchronous => py.import(CACHE_HOST_MODULE)?.getattr(method)?.call( + ( + cache, + self.function.as_ref().ok_or(HandleError::Unconfigured)?, + ), + Some(&arguments), + ), None => cache.bind(py).call_method(method, (), Some(&arguments)), } .map(Bound::unbind); @@ -98,7 +119,12 @@ impl PythonCache { self.resume(py, result) } - pub fn store_response(&mut self, py: Python<'_>, response: &Bound<'_, PyAny>) -> PyResult<()> { + pub fn store_response( + &mut self, + py: Python<'_>, + response: &Bound<'_, PyAny>, + verbatim: bool, + ) -> PyResult<()> { if !std::mem::take(&mut self.deferred) { return Ok(()); } @@ -106,11 +132,30 @@ impl PythonCache { return Err(HandleError::Unconfigured.into()); }; py.import(CACHE_HOST_MODULE)? - .getattr("store_response")? + .getattr(if verbatim { + "store_verbatim" + } else { + "store_response" + })? .call((cache, response), Some(&arguments.bind(py).copy()?))?; Ok(()) } + pub fn wrap_stream(&self, py: Python<'_>, stream: Py) -> PyResult> { + let (Some(cache), Some(function), Some(arguments)) = + (&self.cache, &self.function, &self.arguments) + else { + return Ok(stream); + }; + py.import(CACHE_HOST_MODULE)? + .getattr("wrap_stream")? + .call( + (cache, function, stream, &self.read_handler), + Some(&arguments.bind(py).copy()?), + ) + .map(Bound::unbind) + } + pub fn resume( &mut self, py: Python<'_>, @@ -125,11 +170,14 @@ impl PythonCache { }; match self.pending.take() { Some(Pending::Lookup(reply)) => { + if self.asynchronous { + self.read_handler = self.caching_handler(py).ok().flatten(); + } let value = result.map_err(Error::unavailable).and_then(|value| { if value.bind(py).is_none() { Ok(None) } else { - from_py(value.bind(py)) + json_from_py(value.bind(py)) .map(Some) .map_err(Error::invalid_entry) } @@ -144,15 +192,30 @@ impl PythonCache { Ok(None) } + fn caching_handler(&self, py: Python<'_>) -> PyResult>> { + let Some(arguments) = self.arguments.as_ref() else { + return Ok(None); + }; + let handler = py + .import(CACHE_HOST_MODULE)? + .getattr("caching_handler")? + .call((), Some(arguments.bind(py)))?; + Ok((!handler.is_none()).then(|| handler.unbind())) + } + pub fn close(&mut self) { self.pending = None; + self.read_handler = None; self.deferred = false; self.cache = None; + self.function = None; self.arguments = None; } pub fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { visit.call(&self.cache)?; - visit.call(&self.arguments) + visit.call(&self.function)?; + visit.call(&self.arguments)?; + visit.call(&self.read_handler) } } diff --git a/litellm-rust/crates/python-bridge/src/cache/python/service.rs b/litellm-rust/crates/python-bridge/src/cache/python/service.rs index 018c8647043..bd54accc0dc 100644 --- a/litellm-rust/crates/python-bridge/src/cache/python/service.rs +++ b/litellm-rust/crates/python-bridge/src/cache/python/service.rs @@ -55,11 +55,12 @@ struct PythonCacheService { config: ResponseCacheConfig, } -pub(in crate::cache) fn service>( +pub(in crate::cache) fn service( services: HostServices

, namespace: String, ) -> std::sync::Arc where + P::HostCall: From, P::Error: From + std::error::Error, { std::sync::Arc::new(PythonCacheService { @@ -71,14 +72,19 @@ where }) } -impl> ResponseCacheService for PythonCacheService

+impl ResponseCacheService for PythonCacheService

where + P::HostCall: From, P::Error: From + std::error::Error, { fn config(&self) -> &ResponseCacheConfig { &self.config } + fn keyed_by_caller(&self) -> bool { + true + } + fn lookup<'a>( &'a self, _: &'a ResponseCacheRequest, @@ -86,7 +92,7 @@ where ) -> Pin, Error>> + Send + 'a>> { Box::pin(async move { self.services - .call(|reply| CacheCall::Lookup { reply }) + .call(|reply| CacheCall::Lookup { reply }.into()) .await .map_err(Error::unavailable)?? .map(from_python) @@ -104,10 +110,13 @@ where let value = to_python(value)?; let unary = value.get(STREAM_EVENTS_KEY).is_none(); self.services - .call(|reply| CacheCall::Store { - value, - unary, - reply, + .call(|reply| { + CacheCall::Store { + value, + unary, + reply, + } + .into() }) .await .map_err(Error::unavailable)? diff --git a/litellm-rust/crates/python-bridge/src/cache/selection.rs b/litellm-rust/crates/python-bridge/src/cache/selection.rs index 78c1606ea40..6e4d222a1d0 100644 --- a/litellm-rust/crates/python-bridge/src/cache/selection.rs +++ b/litellm-rust/crates/python-bridge/src/cache/selection.rs @@ -6,17 +6,6 @@ use litellm_host::{ }; use pyo3::{prelude::*, types::PyDict}; -pub(crate) struct Cached

(std::marker::PhantomData

); - -impl Protocol for Cached

{ - type Request = (P::Request, Selection); - type Response = P::Response; - type Error = P::Error; - type HostCall = python::CacheCall; - type Chunk = P::Chunk; - type StreamHead = P::StreamHead; -} - enum Backend { Disabled, Python { namespace: String }, @@ -28,11 +17,12 @@ pub(crate) struct Selection { } impl Selection { - pub(crate) fn attach>( + pub(crate) fn attach( self, services: HostServices

, ) -> (Option, CacheOptions) where + P::HostCall: From, P::Error: From + std::error::Error, { let service = match self.backend { @@ -51,15 +41,21 @@ fn selected_cache<'py>( kwargs: &Bound<'py, PyDict>, call_type: &str, ) -> PyResult>> { + if kwargs + .get_item("caching")? + .is_some_and(|value| value.is(pyo3::types::PyBool::new(py, false))) + { + return Ok(None); + } + configured_cache(py, call_type) +} + +fn configured_cache<'py>(py: Python<'py>, call_type: &str) -> PyResult>> { let configured = py .import(CACHE_HOST_MODULE)? .getattr("configured_cache")? .call0()?; - if configured.is_none() - || kwargs - .get_item("caching")? - .is_some_and(|value| value.is(pyo3::types::PyBool::new(py, false))) - { + if configured.is_none() { return Ok(None); } let supported = configured.getattr("supported_call_types")?; @@ -90,9 +86,14 @@ pub(crate) fn configure( python: &mut python::PythonCache, py: Python<'_>, arguments: &Bound<'_, PyDict>, - call_type: &str, + function: &Bound<'_, PyAny>, ) -> PyResult { - let selected = selected_cache(py, arguments, call_type)?; + let call_type: String = function.getattr("__name__")?.extract()?; + let selected = if python.asynchronous() { + configured_cache(py, &call_type)? + } else { + None + }; let Some(cache) = selected else { return Ok(Selection { backend: Backend::Disabled, @@ -102,6 +103,9 @@ pub(crate) fn configure( let enabled = cache .call_method("should_use_cache", (), Some(arguments))? .extract::()?; + let skips_read = arguments + .get_item("caching")? + .is_some_and(|value| !value.is_none() && !value.is(pyo3::types::PyBool::new(py, true))); let controls = arguments .get_item("cache")? .filter(|value| !value.is_none()); @@ -117,7 +121,7 @@ pub(crate) fn configure( }; let options = CacheOptions { policy: CachePolicy { - no_cache: boolean("no-cache")?, + no_cache: boolean("no-cache")? || skips_read, no_store: boolean("no-store")?, ..CachePolicy::default() }, @@ -129,7 +133,7 @@ pub(crate) fn configure( .map(|value| value.extract()) .transpose()? .unwrap_or_default(); - python.bind(cache, arguments); + python.bind(cache, function, arguments); Ok(Selection { backend: if enabled { Backend::Python { namespace } diff --git a/litellm-rust/crates/python-bridge/src/errors.rs b/litellm-rust/crates/python-bridge/src/errors.rs index db5696d52ce..29c26ed30a3 100644 --- a/litellm-rust/crates/python-bridge/src/errors.rs +++ b/litellm-rust/crates/python-bridge/src/errors.rs @@ -3,7 +3,7 @@ use std::error::Error as StdError; use litellm_error::Report; use litellm_inference::Error; use pyo3::{ - exceptions::{PyRuntimeError, PyValueError}, + exceptions::{PyRuntimeError, PyTypeError, PyValueError}, prelude::*, }; use reqwest::header::HeaderMap; @@ -36,6 +36,37 @@ const MESSAGES_MISSING_CREDENTIAL: &str = "messages_missing_credential"; /// Python refuses the request only once its logger knows the resolved model and provider (the /// provider config's request transform), so the failure logs them. const MESSAGES_LATE_REJECTION: &str = "messages_late_rejection"; +/// Python's request transform raises a builtin exception (`TypeError`) that its handler does not +/// map, so the caller gets the native exception as it is. +const MESSAGES_PYTHON_RAISED: &str = "messages_python_raised"; +/// The text of a refusal Python's provider config raises from its request transform, which its +/// HTTP handler maps as a provider error. +const MESSAGES_PROVIDER_REJECTION: &str = "messages_provider_rejection"; + +fn provider_rejection(rejection: &(dyn StdError + 'static)) -> Option { + match rejection.downcast_ref::() { + Some(litellm_llms::Error::MissingField("max_tokens")) => { + return Some("max_tokens is required for Anthropic /v1/messages API".to_owned()); + } + Some(_) => return None, + None => {} + } + match rejection.downcast_ref::() { + Some( + detail @ litellm_llms::ErrorDetail::InvalidChoice { + field: "reasoning effort", + .. + }, + ) => Some(format!("litellm.BadRequestError: {detail}")), + Some( + detail @ (litellm_llms::ErrorDetail::InvalidReasoningEffort { .. } + | litellm_llms::ErrorDetail::UnsupportedValue { + field: "effort", .. + }), + ) => Some(detail.to_string()), + _ => None, + } +} pub(crate) fn upstream_error( py: Python<'_>, @@ -90,6 +121,9 @@ pub(crate) fn route_failure( if let Some(raised) = crate::secrets::python_error(py, &error) { return Ok(raised); } + if let Some(raised) = crate::routes::messages::workload_identity::python_error(py, &error) { + return Ok(raised); + } if let Some((status, body)) = error.upstream_response() { let headers = error .upstream_headers() @@ -104,6 +138,18 @@ pub(crate) fn route_failure( return public(upstream_error(py, status, body, &headers)?); } let native = match (marker, error.rejected_request()) { + (RequestMarker::Messages, Some(rejection)) + if matches!( + rejection.downcast_ref::(), + Some(litellm_llms::ErrorDetail::UnorderableTypes { .. }) + ) => + { + let native = PyTypeError::new_err(rejection.to_string()); + let value = native.value(py); + value.setattr(MESSAGES_LATE_REJECTION, true)?; + value.setattr(MESSAGES_PYTHON_RAISED, true)?; + native + } (RequestMarker::Messages, Some(rejection)) => { let native = PyValueError::new_err(Report::new(rejection).to_string()); let value = native.value(py); @@ -123,6 +169,9 @@ pub(crate) fn route_failure( ) { value.setattr(MESSAGES_LATE_REJECTION, true)?; } + if let Some(text) = provider_rejection(rejection) { + value.setattr(MESSAGES_PROVIDER_REJECTION, text)?; + } native } (RequestMarker::Messages, None) => { @@ -324,6 +373,72 @@ mod tests { }); } + #[rstest::rstest] + #[case::missing_max_tokens( + litellm_llms::Error::MissingField("max_tokens").into(), + Some("max_tokens is required for Anthropic /v1/messages API") + )] + #[case::unmapped_effort( + Error::invalid_request(litellm_llms::ErrorDetail::InvalidChoice { + field: "reasoning effort", + actual: "'ultra'".into(), + choices: vec!["low", "none"], + }), + Some("litellm.BadRequestError: Unmapped reasoning effort: 'ultra'. Must be one of: 'low', 'none'.") + )] + #[case::other_missing_field(litellm_llms::Error::MissingField("model").into(), None)] + #[case::unsupported_param( + Error::invalid_request(litellm_llms::ErrorDetail::UnsupportedParameter { + model: "claude".into(), + param: "top_k".into(), + value: "5".into(), + hint: String::new(), + }), + None + )] + fn provider_config_rejections_carry_python_text( + #[case] error: Error, + #[case] expected: Option<&str>, + ) { + Python::initialize(); + Python::attach(|py| { + let native = route_failure(py, error, RequestMarker::Messages, Ok).unwrap(); + let text = native + .value(py) + .getattr_opt(MESSAGES_PROVIDER_REJECTION) + .unwrap() + .map(|value| value.extract::().unwrap()); + assert_eq!(text.as_deref(), expected); + }); + } + + #[test] + fn an_unorderable_comparison_raises_python_type_error_as_it_is() { + Python::initialize(); + Python::attach(|py| { + let error = Error::invalid_request(litellm_llms::ErrorDetail::UnorderableTypes { + op: "<=", + left: "str", + right: "int", + }); + let native = route_failure(py, error, RequestMarker::Messages, Ok).unwrap(); + assert!(native.is_instance_of::(py)); + let value = native.value(py); + assert_eq!( + value.str().unwrap().to_string(), + "'<=' not supported between instances of 'str' and 'int'" + ); + assert!(value.getattr_opt(MESSAGES_PYTHON_RAISED).unwrap().is_some()); + assert!( + value + .getattr_opt(MESSAGES_LATE_REJECTION) + .unwrap() + .is_some() + ); + assert!(value.getattr_opt(MESSAGES_REQUEST_ERROR).unwrap().is_none()); + }); + } + #[rstest::rstest] #[case::rejected_request( Error::invalid_request(litellm_llms::ErrorDetail::UnsupportedParameter { diff --git a/litellm-rust/crates/python-bridge/src/http.rs b/litellm-rust/crates/python-bridge/src/http.rs index 57c58c3f7cd..e7cc8e35172 100644 --- a/litellm-rust/crates/python-bridge/src/http.rs +++ b/litellm-rust/crates/python-bridge/src/http.rs @@ -101,15 +101,22 @@ pub(crate) fn call_config( kwargs: &Bound<'_, PyDict>, asynchronous: bool, ) -> PyResult { - let settings = HttpSettings::from_layers([ + Ok(resolved(py, call_settings(py, kwargs, asynchronous)?)) +} + +fn call_settings( + py: Python<'_>, + kwargs: &Bound<'_, PyDict>, + asynchronous: bool, +) -> PyResult { + Ok(HttpSettings::from_layers([ for_call(call_ssl_verify(kwargs)?, asynchronous), HttpSettingsLayer::from_environment(&ProcessEnvironment), match PythonSettings::Http.read_or_unset(py)? { Some(snapshot) => configured(&snapshot)?, None => HttpSettingsLayer::default(), }, - ]); - Ok(resolved(py, settings)) + ])) } pub(crate) fn settings_config( @@ -132,10 +139,31 @@ pub(crate) fn settings_config( Ok(resolved(py, settings)) } +#[pyfunction] +#[pyo3(signature = (ssl_security_level=None, ssl_ecdh_curve=None))] +pub(crate) fn unsupported_tls_settings( + ssl_security_level: Option, + ssl_ecdh_curve: Option, +) -> Vec { + let settings = HttpSettings::from_layers([HttpSettingsLayer { + ssl_security_level, + ssl_ecdh_curve, + ..HttpSettingsLayer::default() + }]); + Resolution::from(&settings) + .unsupported + .iter() + .map(ToString::to_string) + .collect() +} + +fn resolution(settings: HttpSettings) -> Resolution { + Resolution::from(&settings.without_missing_files(&|path: &Path| path.exists())) +} + /// The client config `settings` resolve to, warning once per process about each setting the client cannot apply fn resolved(py: Python<'_>, settings: HttpSettings) -> HttpClientConfig { - let resolution = - Resolution::from(&settings.without_missing_files(&|path: &Path| path.exists())); + let resolution = resolution(settings); for unsupported in unreported(&REPORTED_UNSUPPORTED, resolution.unsupported) { crate::logger::capture(py).scope(|| litellm_tracing::warn!("{unsupported}")); } @@ -151,6 +179,15 @@ pub(crate) fn provider_client( Ok(pool().client(&config, ClientVariant::Provider)) } +pub(crate) fn messages_client( + py: Python<'_>, + kwargs: &Bound<'_, PyDict>, + asynchronous: bool, +) -> PyResult> { + let config = resolution(call_settings(py, kwargs, asynchronous)?).config; + Ok(pool().client(&config, ClientVariant::Undecoded)) +} + pub(crate) fn host_client(py: Python<'_>, variant: ClientVariant) -> PyResult { let config = call_config(py, &PyDict::new(py), true)?; pool().client(&config, variant).map_err(client_error) diff --git a/litellm-rust/crates/python-bridge/src/lib.rs b/litellm-rust/crates/python-bridge/src/lib.rs index 7edf13035c1..45ea95560e1 100644 --- a/litellm-rust/crates/python-bridge/src/lib.rs +++ b/litellm-rust/crates/python-bridge/src/lib.rs @@ -35,6 +35,8 @@ mod _native { #[pymodule_export] use crate::errors::{RustBridgeDeclined, RustUpstreamError}; #[pymodule_export] + use crate::http::unsupported_tls_settings; + #[pymodule_export] use crate::logger::NativeDiagnosticProcessor; #[pymodule_export] use crate::model_cost::{ @@ -191,6 +193,7 @@ mod tests { "gil_stats", "process_state_started", "reserve_process_for_forking", + "unsupported_tls_settings", ]; #[cfg(feature = "huggingface")] expected.push("HuggingFaceEncoding"); diff --git a/litellm-rust/crates/python-bridge/src/marshal.rs b/litellm-rust/crates/python-bridge/src/marshal.rs index dec8ff0b0ce..927ed741669 100644 --- a/litellm-rust/crates/python-bridge/src/marshal.rs +++ b/litellm-rust/crates/python-bridge/src/marshal.rs @@ -4,7 +4,7 @@ use std::{ }; use litellm_auth::InputSource; -use litellm_host_python::{from_py, from_py_argument, to_py}; +use litellm_host_python::{from_py, from_py_argument, json_to_py, to_py}; use pyo3::{exceptions::PyValueError, prelude::*, types::PyDict}; use serde::{Serialize, de::DeserializeOwned}; use serde_json::{Map, Value}; @@ -143,6 +143,19 @@ pub(crate) fn public_response( .map(Bound::unbind) } +pub(crate) fn public_json_response( + py: Python<'_>, + module: &str, + response: &(impl Serialize + ?Sized), +) -> PyResult> { + let factory = py.import(module)?.getattr("response")?; + let document = + serde_json::to_value(response).map_err(|error| PyValueError::new_err(error.to_string()))?; + factory + .call1((json_to_py(py, &document)?,)) + .map(Bound::unbind) +} + struct RequestFieldSources<'py> { body: Option>, credentials: Option>, diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/agentic.rs b/litellm-rust/crates/python-bridge/src/routes/messages/agentic.rs new file mode 100644 index 00000000000..f6652d82050 --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/agentic.rs @@ -0,0 +1,172 @@ +use std::sync::{Arc, Mutex, PoisonError}; + +use litellm_host::{ + hooks::CallHooks, + interceptors::{RequestContext, WireRequest}, + lifecycle::Timing, +}; +use litellm_host_python::{HookStep, PythonOwned, PythonRuntime, json_to_py, to_py}; +use pyo3::{ + gc::{PyTraverseError, PyVisit}, + prelude::*, + types::PyDict, +}; + +use super::host::ROUTE_HOST_MODULE; + +/// What the provider was sent, which Python's agentic hooks read back as the handler's own +/// model, provider and request params. +struct Sent { + request: Py, + hooked: bool, + body: Py, + model: String, + provider: String, + requested: Py, +} + +/// Python's Messages handler hands the provider's answer to the callbacks overriding +/// `async_should_run_agentic_loop` before `@client` sees it, and wraps a stream so they run +/// once it ends. This hook asks the route host to do both at the same points. +pub(super) type HookedRequest = Arc>>>; + +pub(super) struct AgenticLoop { + asynchronous: bool, + request: Option>, + hooked: HookedRequest, + decided: bool, + sent: Option, +} + +impl AgenticLoop { + pub(super) fn new(asynchronous: bool, hooked: HookedRequest) -> Self { + Self { + asynchronous, + request: None, + hooked, + decided: false, + sent: None, + } + } + + fn hooked_request(&self, py: Python<'_>) -> Option> { + self.hooked + .lock() + .unwrap_or_else(PoisonError::into_inner) + .as_ref() + .map(|request| request.clone_ref(py)) + } + + fn host_call<'py>( + &self, + py: Python<'py>, + name: &str, + subject: &Bound<'py, PyAny>, + sent: &Sent, + ) -> PyResult> { + py.import(ROUTE_HOST_MODULE)?.getattr(name)?.call1(( + subject, + sent.request.bind(py), + sent.body.bind(py), + &sent.model, + &sent.provider, + sent.requested.bind(py), + sent.hooked, + )) + } + + fn resume_response( + &mut self, + _: Python<'_>, + result: PyResult>, + ) -> PyResult>> { + result.map(HookStep::Ready) + } +} + +impl CallHooks for AgenticLoop { + fn arguments_prepared(&mut self, py: Python<'_>, arguments: &Py) -> PyResult<()> { + if self.asynchronous { + self.request = Some(arguments.clone_ref(py)); + } + Ok(()) + } + + fn before_provider_request( + &mut self, + py: Python<'_>, + wire: Box, + context: &RequestContext, + ) -> PyResult>> { + if self.decided { + return Ok(HookStep::Ready(wire)); + } + let Some(caller) = &self.request else { + return Ok(HookStep::Ready(wire)); + }; + self.decided = true; + let hooked = self.hooked_request(py); + let hooked_flag = hooked.is_some(); + let request = hooked.unwrap_or_else(|| caller.clone_ref(py)); + let module = py.import(ROUTE_HOST_MODULE)?; + if module + .getattr("runs_agentic_hooks")? + .call1((request.bind(py),))? + .extract::()? + { + module + .getattr("record_agentic_loop")? + .call1((request.bind(py), &context.custom_llm_provider))?; + self.sent = Some(Sent { + request, + hooked: hooked_flag, + body: to_py(py, &wire.body)?, + model: context.model.clone(), + provider: context.custom_llm_provider.clone(), + requested: json_to_py(py, &context.optional_params)?.unbind(), + }); + } + Ok(HookStep::Ready(wire)) + } + + fn transform_response( + &mut self, + py: Python<'_>, + response: Py, + _: Timing, + ) -> PyResult>> { + let Some(sent) = &self.sent else { + return Ok(HookStep::Ready(response)); + }; + let awaitable = self.host_call(py, "agentic_response", response.bind(py), sent)?; + Ok(HookStep::Await(awaitable.unbind(), Self::resume_response)) + } + + fn on_stream_open(&mut self, py: Python<'_>, head: &Py) -> PyResult<()> { + if let Some(sent) = &self.sent { + self.host_call(py, "agentic_stream", head.bind(py), sent)?; + } + Ok(()) + } +} + +impl PythonOwned for AgenticLoop { + fn close(&mut self, _: Python<'_>) { + self.request = None; + self.sent = None; + self.hooked + .lock() + .unwrap_or_else(PoisonError::into_inner) + .take(); + } + + fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { + visit.call(&self.request)?; + if let Some(sent) = &self.sent { + visit.call(&sent.request)?; + visit.call(&sent.body)?; + visit.call(&sent.requested)?; + } + Ok(()) + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/answer.rs b/litellm-rust/crates/python-bridge/src/routes/messages/answer.rs new file mode 100644 index 00000000000..80cf2002287 --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/answer.rs @@ -0,0 +1,29 @@ +use futures_util::future::BoxFuture; +use litellm_host::machine::HostServices; +use litellm_inference_messages::{Error, HostAnswer}; + +use super::host::{MessagesHostCall, MessagesHosted}; + +pub(super) struct PythonAnswer(HostServices); + +impl PythonAnswer { + pub(super) fn new(services: HostServices) -> Self { + Self(services) + } +} + +impl HostAnswer for PythonAnswer { + fn answer(&self, stream: bool) -> BoxFuture<'_, Result<(), Error>> { + Box::pin( + self.0 + .call(move |reply| MessagesHostCall::Answer { stream, reply }), + ) + } + + fn intercept(&self, stream: bool) -> BoxFuture<'_, Result> { + Box::pin( + self.0 + .call(move |reply| MessagesHostCall::Intercept { stream, reply }), + ) + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/host.rs b/litellm-rust/crates/python-bridge/src/routes/messages/host.rs index c975ac339c2..67a96cac32d 100644 --- a/litellm-rust/crates/python-bridge/src/routes/messages/host.rs +++ b/litellm-rust/crates/python-bridge/src/routes/messages/host.rs @@ -1,34 +1,121 @@ -use crate::cache::{CacheCall, Cached, PythonCache, Selection}; +use crate::cache::{CacheCall, PythonCache, Selection}; use litellm_host_python::{PythonHostCalls, PythonOwned}; +use std::sync::{ + Arc, + atomic::{AtomicBool, Ordering}, +}; + use bytes::Bytes; -use litellm_host_python::{InvokeError, PythonBinding, from_py, to_py}; +use litellm_host::protocol::Reply; +use litellm_host_python::{ + InvokeError, PythonBinding, effective_py_args, from_py, json_from_py, to_py, +}; use litellm_inference_messages::{ - Error, MessagesCall, MessagesSettings, MessagesShaping, litellm_params, messages_body, + DecodingError, Error, MessagesCall, MessagesSettings, MessagesShaping, UnencodableHeader, + litellm_params, messages_body, route::{Messages, MessagesStreamHead}, }; use litellm_llms::base_llm::messages::context::MessagesModelCapabilities; use litellm_llms_types::headers::ProviderSpecificHeaders; use litellm_router_types::LitellmParams; use pyo3::{ - exceptions::PyException, + exceptions::{PyException, PyUnicodeEncodeError}, gc::{PyTraverseError, PyVisit}, prelude::*, - types::{PyBytes, PyDict}, + sync::PyOnceLock, + types::{PyBytes, PyDict, PyList, PyMapping, PyString, PyTuple}, }; use serde_json::{Map, Value}; +use super::agentic::HookedRequest; +use super::safeguards::{SafeguardsCall, SafeguardsHost}; +use super::transport::{HostedTransport, TransportCall, python_failure}; use crate::{ errors::{RequestMarker, route_failure}, marshal::{ - ArgumentError, optional_timeout, project_optional_fields, public_response, + ArgumentError, optional_timeout, project_optional_fields, public_json_response, python_timeout_seconds, }, python_settings::PythonSettings, routes::RequestView, }; -const ROUTE_HOST_MODULE: &str = "litellm.rust_bridge.host.routes.messages"; +type MergedHeaders = (Option>, Option>); + +fn ascii_headers<'py>( + headers: &Bound<'py, PyAny>, + unencodable: &mut Option>, +) -> PyResult> { + let Ok(headers) = headers.cast::() else { + return Ok(headers.clone()); + }; + let py = headers.py(); + let kept = PyDict::new(py); + for (name, value) in headers.iter() { + if value.is_instance_of::() + && let Err(error) = value.call_method1("encode", ("ascii",)) + { + if !error.is_instance_of::(py) { + return Err(error); + } + if unencodable.is_none() { + let sent = value.call_method1("encode", ("utf-8", "surrogatepass"))?; + *unencodable = Some(sent.cast::()?.as_bytes().to_vec()); + } + continue; + } + kept.set_item(name, value)?; + } + Ok(kept.into_any()) +} + +const PROVIDER_SPECIFIC_HEADERS_MODULE: &str = + "litellm.litellm_core_utils.get_provider_specific_headers"; + +fn ascii_scoped_headers<'py>(value: &Bound<'py, PyAny>) -> PyResult> { + let ascii_entry = |entry: Bound<'py, PyAny>| -> PyResult> { + let Ok(entry) = entry.cast::() else { + return Ok(entry); + }; + let Some(headers) = entry.get_item("extra_headers")? else { + return Ok(entry.clone().into_any()); + }; + let kept = entry.copy()?; + kept.set_item("extra_headers", ascii_headers(&headers, &mut None)?)?; + Ok(kept.into_any()) + }; + if let Ok(entries) = value.cast::() { + return Ok(PyList::new( + value.py(), + entries + .iter() + .map(ascii_entry) + .collect::>>()?, + )? + .into_any()); + } + if let Ok(entries) = value.cast::() { + return Ok(PyTuple::new( + value.py(), + entries + .iter() + .map(ascii_entry) + .collect::>>()?, + )? + .into_any()); + } + ascii_entry(value.clone()) +} + +fn json_messages(messages: &Bound<'_, PyAny>) -> PyResult { + if messages.is_instance_of::() || messages.is_instance_of::() { + return json_from_py(messages); + } + json_from_py(&messages.py().get_type::().call1((messages,))?) +} + +pub(super) const ROUTE_HOST_MODULE: &str = "litellm.rust_bridge.host.routes.messages"; const MODEL_CAPABILITIES_MODULE: &str = "litellm.rust_bridge.host.model_capabilities"; fn merge_headers( @@ -41,6 +128,19 @@ fn merge_headers( (!merged.is_empty()).then_some(merged) } +const FEDERATING_PROVIDER: &str = "anthropic"; + +fn workload_identity_fields(py: Python<'_>) -> PyResult<&'static [String]> { + static FIELDS: PyOnceLock> = PyOnceLock::new(); + FIELDS + .get_or_try_init(py, || { + py.import(ROUTE_HOST_MODULE)? + .getattr("WORKLOAD_IDENTITY_FIELDS")? + .extract() + }) + .map(Vec::as_slice) +} + fn module_global<'py>(py: Python<'py>, name: &str) -> PyResult>> { PythonSettings::ProviderDefaults .read_or_unset(py)? @@ -50,11 +150,17 @@ fn module_global<'py>(py: Python<'py>, name: &str) -> PyResult( +fn project_litellm_params<'a, 'py>( + names: impl IntoIterator, argument: impl Fn(&str) -> PyResult>>, global: impl Fn(&str) -> PyResult>>, ) -> PyResult> { - let fields = project_optional_fields(LitellmParams::fields(), &argument)?; + let fields = project_optional_fields( + LitellmParams::fields() + .map(|name| -> &'a str { name }) + .chain(names), + &argument, + )?; let globals = LitellmParams::specs() .filter(|spec| !spec.wire.iter().any(|name| fields.contains_key(*name))) .filter_map(|spec| spec.module_global); @@ -62,36 +168,279 @@ fn project_litellm_params<'py>( Ok(litellm_params(fields.into_iter().chain(folded).collect())) } +pub(super) struct MessagesHosted; + +impl litellm_host::protocol::Protocol for MessagesHosted { + type Request = (MessagesCall, Selection, bool); + type Response = ::Response; + type Error = Error; + type HostCall = MessagesHostCall; + type Chunk = Bytes; + type StreamHead = MessagesStreamHead; +} + +pub(super) enum MessagesHostCall { + Answer { stream: bool, reply: Reply<()> }, + Intercept { stream: bool, reply: Reply }, + Cache(CacheCall), + PreRequest(Reply>), + Safeguards(SafeguardsCall), + Transport(TransportCall), +} + +impl From for MessagesHostCall { + fn from(call: CacheCall) -> Self { + Self::Cache(call) + } +} + +impl From for MessagesHostCall { + fn from(call: TransportCall) -> Self { + Self::Transport(call) + } +} + +enum Answered { + Stream, + Whole { verbatim: bool }, +} + +#[derive(serde::Deserialize)] +struct HostSettings { + #[serde(flatten)] + settings: MessagesSettings, + model: String, + stream_cost_model: Option, + extra_headers: Option>, +} + /// The Python side of the Messages route: projects the prepared arguments and builds the /// public response, chunks and exceptions. pub(super) struct MessagesPythonHost { view: RequestView, cache: PythonCache, + transport: HostedTransport, + safeguards: SafeguardsHost, + classifies: Arc, + awaiting_safeguards: bool, + stream_cost_model: Option, + asynchronous: bool, + pre_request: Option>>, + hooked: bool, + hooked_request: HookedRequest, + requested_stream: bool, + arguments: Option>, + interceptor: Option>, + pending_answer: Option>, + pending_intercept: Option>, + pending_short_circuit: Option<(bool, Reply)>, + answer: Option>, + answered: Option, } impl MessagesPythonHost { - pub(super) fn new(view: RequestView, asynchronous: bool) -> Self { + pub(super) fn new( + view: RequestView, + asynchronous: bool, + hooked_request: HookedRequest, + classifies: Arc, + ) -> Self { Self { view, cache: PythonCache::new(asynchronous), + transport: HostedTransport::default(), + safeguards: SafeguardsHost::default(), + classifies, + awaiting_safeguards: false, + stream_cost_model: None, + asynchronous, + pre_request: None, + hooked: false, + hooked_request, + requested_stream: false, + arguments: None, + interceptor: None, + pending_answer: None, + pending_intercept: None, + pending_short_circuit: None, + answer: None, + answered: None, } } + fn interceptor(&self, py: Python<'_>) -> PyResult>> { + if !self.asynchronous { + return Ok(None); + } + let interceptor = py + .import(ROUTE_HOST_MODULE)? + .getattr("interceptor")? + .call1((self.view.request(py)?,))?; + Ok((!interceptor.is_none()).then(|| interceptor.unbind())) + } + + fn may_intercept(&self, py: Python<'_>) -> PyResult { + if !self.asynchronous { + return Ok(false); + } + let module = py.import(ROUTE_HOST_MODULE)?; + Ok(module.getattr("has_interceptors")?.call0()?.extract()? + || module.getattr("short_circuits")?.call0()?.extract()?) + } + + fn begin_intercept( + &mut self, + py: Python<'_>, + stream: bool, + reply: Reply, + ) -> PyResult>> { + let module = py.import(ROUTE_HOST_MODULE)?; + if !module + .getattr("short_circuits")? + .call0()? + .extract::()? + { + return self.begin_interceptor(py, stream, reply); + } + let pending = module.getattr("short_circuit")?.call1(( + self.view.request(py)?, + stream, + self.hooked, + ))?; + self.pending_short_circuit = Some((stream, reply)); + Ok(Some(pending.unbind())) + } + + fn resume_short_circuit( + &mut self, + py: Python<'_>, + stream: bool, + reply: Reply, + answer: Py, + ) -> PyResult>> { + if answer.is_none(py) { + return self.begin_interceptor(py, stream, reply); + } + self.answer = Some(answer); + self.answered = Some(match stream { + true => Answered::Stream, + false => Answered::Whole { verbatim: false }, + }); + reply.send(true); + Ok(None) + } + + fn begin_interceptor( + &mut self, + py: Python<'_>, + stream: bool, + reply: Reply, + ) -> PyResult>> { + self.interceptor = self.interceptor(py)?; + if self.interceptor.is_none() { + reply.send(false); + return Ok(None); + } + let pending = self.start_answer(py, stream)?; + self.pending_intercept = Some(reply); + Ok(Some(pending)) + } + + fn begin_answer( + &mut self, + py: Python<'_>, + stream: bool, + reply: Reply<()>, + ) -> PyResult>> { + let pending = self.start_answer(py, stream)?; + self.pending_answer = Some(reply); + Ok(Some(pending)) + } + + fn start_answer(&mut self, py: Python<'_>, stream: bool) -> PyResult> { + let module = py.import(ROUTE_HOST_MODULE)?; + let request = self.view.request(py)?; + let pending = match &self.interceptor { + Some(interceptor) => { + module + .getattr("answer")? + .call1((interceptor, request, stream, self.hooked))? + } + None => module + .getattr("gateway")? + .call1((request, self.asynchronous, self.hooked))?, + }; + if pending.is_none() { + return Err(litellm_host_python::Error::MissingState.into()); + } + self.answered = Some(match (stream, &self.interceptor) { + (true, _) => Answered::Stream, + (false, Some(_)) => Answered::Whole { verbatim: false }, + (false, None) => Answered::Whole { verbatim: true }, + }); + Ok(pending.unbind()) + } + + fn host_settings( + &self, + py: Python<'_>, + arguments: &Bound<'_, PyDict>, + ) -> PyResult { + from_py(&py.import(ROUTE_HOST_MODULE)?.getattr("settings")?.call1(( + arguments, + self.view.request(py)?, + self.asynchronous, + ))?) + } + + fn body_params( + &self, + py: Python<'_>, + arguments: &Bound<'_, PyDict>, + ) -> PyResult> { + let request = effective_py_args(self.view.request(py)?, arguments)?; + let params = py + .import(ROUTE_HOST_MODULE)? + .getattr("body_params")? + .call1((request, self.asynchronous, self.hooked))? + .cast_into::()?; + params + .items()? + .iter() + .map(|item| { + let (name, value): (Bound<'_, PyAny>, Bound<'_, PyAny>) = item.extract()?; + let name: String = name.extract()?; + let value = match name.as_str() { + "messages" => json_messages(&value)?, + _ => json_from_py(&value)?, + }; + Ok((name, value)) + }) + .collect() + } + fn projection( &self, py: Python<'_>, arguments: &Bound<'_, PyDict>, + settings: HostSettings, ) -> PyResult> { let argument = |name: &str| self.view.argument(py, arguments, name); let string = |name: &str| -> PyResult> { argument(name)?.map(|value| value.extract()).transpose() }; - let model = string("model")?.ok_or(ArgumentError::Required("model"))?; + let model = settings.model; let messages = argument("messages")?.ok_or(ArgumentError::Required("messages"))?; - let fields = self.view.body_params(py, arguments, ROUTE_HOST_MODULE)?; + let mut fields = self.body_params(py, arguments)?; + let prepared = fields.remove("messages"); + let presanitized = prepared.is_some(); + let messages = match prepared { + Some(messages) => messages, + None => json_messages(&messages)?, + }; let body = [ ("model".to_string(), Value::String(model.clone())), - ("messages".to_string(), from_py(&messages)?), + ("messages".to_string(), messages), ] .into_iter() .chain(fields) @@ -112,10 +461,35 @@ impl MessagesPythonHost { .call1((&model, api_base.as_deref()))? .extract()?, }; - let shaping = self.shaping(py, &model, custom_llm_provider.as_deref(), arguments)?; - let extra_headers = self.merged_headers(py, arguments)?; - let provider_specific_header = self.provider_specific_header(py, arguments)?; - let litellm_params = project_litellm_params(argument, |name| module_global(py, name))?; + let (extra_headers, mut unencodable_request_header) = match settings.extra_headers { + Some(headers) => (Some(headers), None), + None => self.merged_headers(py, arguments)?, + }; + let provider_specific_header = self.provider_specific_header( + py, + arguments, + custom_llm_provider.as_deref(), + &mut unencodable_request_header, + )?; + let shaping = MessagesShaping { + capabilities: self.capabilities(py, &model, custom_llm_provider.as_deref())?, + settings: MessagesSettings { + whole_sse_frames: settings.stream_cost_model.is_some(), + presanitized, + intercepted: self.may_intercept(py)?, + unencodable_request_header, + ..settings.settings + }, + }; + let federation_fields: &[String] = match custom_llm_provider.as_deref() { + Some(FEDERATING_PROVIDER) => workload_identity_fields(py)?, + _ => &[], + }; + let litellm_params = project_litellm_params( + federation_fields.iter().map(String::as_str), + argument, + |name| module_global(py, name), + )?; Ok(messages_body(body).and_then(|body| { Ok(MessagesCall { body, @@ -135,49 +509,55 @@ impl MessagesPythonHost { &self, py: Python<'_>, arguments: &Bound<'_, PyDict>, - ) -> PyResult>> { - let mapping = |name: &str| -> PyResult>> { + ) -> PyResult { + let mut unencodable = None; + let mut mapping = |name: &str| -> PyResult>> { self.view .argument(py, arguments, name)? - .map(|value| from_py(&value)) + .map(|value| from_py(&ascii_headers(&value, &mut unencodable)?)) .transpose() }; - Ok(merge_headers( - mapping("headers")?, - mapping("extra_headers")?, - )) + let headers = mapping("headers")?; + let extra_headers = mapping("extra_headers")?; + Ok((merge_headers(headers, extra_headers), unencodable)) } fn provider_specific_header( &self, py: Python<'_>, arguments: &Bound<'_, PyDict>, + provider: Option<&str>, + unencodable: &mut Option>, ) -> PyResult> { - self.view + let Some(value) = self + .view .argument(py, arguments, "provider_specific_header")? - .map(|value| from_py(&value)) - .transpose() + else { + return Ok(None); + }; + if unencodable.is_none() + && let Some(provider) = provider + && let Ok(scoped) = py + .import(PROVIDER_SPECIFIC_HEADERS_MODULE)? + .getattr("ProviderSpecificHeaderUtils")? + .call_method1("get_provider_specific_headers", (&value, provider, true)) + { + ascii_headers(&scoped, unencodable)?; + } + from_py(&ascii_scoped_headers(&value)?).map(Some) } - fn shaping( + fn capabilities( &self, py: Python<'_>, model: &str, custom_llm_provider: Option<&str>, - arguments: &Bound<'_, PyDict>, - ) -> PyResult { - let module = py.import(ROUTE_HOST_MODULE)?; - let capabilities: MessagesModelCapabilities = from_py( + ) -> PyResult { + from_py( &py.import(MODEL_CAPABILITIES_MODULE)? .getattr("anthropic_model_capabilities")? .call1((model, custom_llm_provider))?, - )?; - let settings: MessagesSettings = - from_py(&module.getattr("settings")?.call1((arguments,))?)?; - Ok(MessagesShaping { - capabilities, - settings, - }) + ) } fn provider(&self, py: Python<'_>) -> String { @@ -190,6 +570,14 @@ impl MessagesPythonHost { .unwrap_or_else(|| "anthropic".into()) } + fn map_transport_failure(&self, py: Python<'_>, error: PyErr) -> PyResult { + let mapped = py + .import(ROUTE_HOST_MODULE)? + .getattr("map_transport_failure")? + .call1((error.value(py), self.view.request(py)?, self.provider(py)))?; + Ok(PyErr::from_value(mapped)) + } + fn map_failure(&self, py: Python<'_>, error: PyErr) -> PyErr { if !error.is_instance_of::(py) { return error; @@ -197,7 +585,14 @@ impl MessagesPythonHost { let mapped = py .import(ROUTE_HOST_MODULE) .and_then(|module| module.getattr("map_failure")) - .and_then(|map| map.call1((error.value(py), self.view.request(py)?, self.provider(py)))) + .and_then(|map| { + map.call1(( + error.value(py), + self.view.request(py)?, + self.provider(py), + self.asynchronous, + )) + }) .and_then(|mapped| { mapped .extract::>() @@ -210,25 +605,109 @@ impl MessagesPythonHost { } } +impl MessagesPythonHost { + fn decode_call( + &mut self, + py: Python<'_>, + arguments: &Bound<'_, PyDict>, + ) -> Result> { + let settings = self + .host_settings(py, arguments) + .map_err(InvokeError::Python)?; + self.stream_cost_model = settings.stream_cost_model.clone(); + self.projection(py, arguments, settings) + .map_err(|error| InvokeError::Python(self.map_failure(py, error)))? + .map_err(InvokeError::Native) + } + + fn begin_pre_request( + &mut self, + py: Python<'_>, + reply: Reply>, + ) -> PyResult> { + let hooks = py + .import(ROUTE_HOST_MODULE)? + .getattr("pre_request_hooks")? + .call1((self.view.request(py)?,))?; + self.pre_request = Some(reply); + Ok(hooks.unbind()) + } + + fn resume_pre_request( + &mut self, + py: Python<'_>, + reply: Reply>, + result: PyResult>, + ) -> Result<(), InvokeError> { + let hooked = result?; + let arguments = hooked + .bind(py) + .cast::() + .map_err(|error| InvokeError::Python(error.into()))?; + self.view + .resolve(py, arguments) + .map_err(InvokeError::Python)?; + self.hooked = true; + let effective = self + .view + .request(py) + .and_then(|request| effective_py_args(request, arguments)) + .map_err(InvokeError::Python)?; + self.safeguards + .rebind(py, &effective) + .map_err(InvokeError::Python)?; + *self + .hooked_request + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) = Some(arguments.clone().unbind()); + match self.decode_call(py, arguments) { + Ok(call) => reply.send(Ok(call)), + Err(InvokeError::Native(error)) => reply.send(Err(error)), + Err(error) => return Err(error), + } + Ok(()) + } +} + impl PythonBinding for MessagesPythonHost { - type Protocol = Cached; + type Protocol = MessagesHosted; type Failure = PyErr; fn decode_request( &mut self, py: Python<'_>, arguments: &Bound<'_, PyDict>, - ) -> Result<(MessagesCall, Selection), InvokeError> { + ) -> Result<(MessagesCall, Selection, bool), InvokeError> { self.view .resolve(py, arguments) .map_err(InvokeError::Python)?; - let selection = - crate::cache::configure(&mut self.cache, py, arguments, "anthropic_messages") - .map_err(InvokeError::Python)?; - self.projection(py, arguments) - .map_err(|error| InvokeError::Python(self.map_failure(py, error)))? - .map_err(InvokeError::Native) - .map(|request| (request, selection)) + let function = py + .import(ROUTE_HOST_MODULE) + .and_then(|module| module.call_method0("cached_function")) + .map_err(InvokeError::Python)?; + let selection = crate::cache::configure(&mut self.cache, py, arguments, &function) + .map_err(InvokeError::Python)?; + let effective = self + .view + .request(py) + .and_then(|request| effective_py_args(request, arguments)) + .map_err(InvokeError::Python)?; + let classifies = self + .safeguards + .configure(py, &effective) + .map_err(InvokeError::Python)?; + self.classifies.store(classifies, Ordering::Release); + self.requested_stream = arguments + .get_item("stream") + .map_err(InvokeError::Python)? + .is_some_and(|stream| stream.is(pyo3::types::PyBool::new(py, true))); + self.arguments = Some(arguments.clone().unbind()); + let request = self.decode_call(py, arguments)?; + let hosted = self + .transport + .select(py, self.view.request(py).map_err(InvokeError::Python)?) + .map_err(InvokeError::Python)?; + Ok((request, selection, hosted)) } fn encode_response( @@ -236,11 +715,23 @@ impl PythonBinding for MessagesPythonHost { py: Python<'_>, response: litellm_inference_messages::MessagesBody, ) -> PyResult> { - public_response(py, ROUTE_HOST_MODULE, &response) + if let Some(answer) = self.answer.take() { + return Ok(answer); + } + let public = public_json_response(py, ROUTE_HOST_MODULE, &response)?; + self.safeguards.published(py, public) } - fn deliver_response(&mut self, py: Python<'_>, response: &Bound<'_, PyAny>) -> PyResult<()> { - self.cache.store_response(py, response) + fn deliver_response(&mut self, py: Python<'_>, response: Py) -> PyResult> { + match self.answered.take() { + Some(Answered::Stream) => return self.cache.wrap_stream(py, response), + Some(Answered::Whole { verbatim }) => { + self.cache.store_response(py, response.bind(py), verbatim)?; + } + None if self.requested_stream => {} + None => self.cache.store_response(py, response.bind(py), false)?, + } + Ok(response) } fn encode_stream_head( @@ -248,17 +739,63 @@ impl PythonBinding for MessagesPythonHost { py: Python<'_>, head: MessagesStreamHead, ) -> PyResult> { - py.import(ROUTE_HOST_MODULE)? + let module = py.import(ROUTE_HOST_MODULE)?; + let head = module .getattr("stream_hidden_params")? - .call1((to_py(py, &head.headers)?,)) - .map(Bound::unbind) + .call1((to_py(py, &head.headers)?,))?; + if let Some(arguments) = self + .arguments + .as_ref() + .filter(|_| self.asynchronous && !self.requested_stream) + { + module + .getattr("unrequested_stream")? + .call1((&head, arguments))?; + } + Ok(head.unbind()) } fn encode_chunk(&mut self, py: Python<'_>, chunk: Bytes) -> PyResult> { - Ok(PyBytes::new(py, &chunk).into_any().unbind()) + let frames = PyBytes::new(py, &chunk).into_any(); + let Some(model) = &self.stream_cost_model else { + return Ok(frames.unbind()); + }; + py.import(ROUTE_HOST_MODULE)? + .getattr("inject_stream_cost")? + .call1((frames, model, self.view.request(py)?)) + .map(Bound::unbind) } fn map_error(&self, py: Python<'_>, error: Error) -> PyResult { + if let Some((raised, raw)) = python_failure(py, &error) { + return if raw { + Ok(raised) + } else { + self.map_transport_failure(py, raised) + }; + } + if let Some(unencodable) = litellm_error::find::(&error) { + let (value, received) = match unencodable { + UnencodableHeader::Sent(value) => (value, false), + UnencodableHeader::Received(value) => (value, true), + }; + let raised = py + .import(ROUTE_HOST_MODULE)? + .getattr("unencodable_header")? + .call1((PyBytes::new(py, value), received))?; + return self.map_transport_failure(py, PyErr::from_value(raised)); + } + if let Some(undecodable) = litellm_error::find::(&error) { + let raised = py + .import(ROUTE_HOST_MODULE)? + .getattr("decoding_failure")? + .call1(( + undecodable.to_string(), + self.view.request(py)?, + self.provider(py), + ))?; + return Ok(PyErr::from_value(raised)); + } route_failure(py, error, RequestMarker::Messages, |native| { Ok(self.map_failure(py, native)) }) @@ -269,24 +806,35 @@ impl PythonBinding for MessagesPythonHost { } } -impl PythonHostCalls> for MessagesPythonHost { +impl PythonHostCalls for MessagesPythonHost { fn handle_host_call( &mut self, py: Python<'_>, - op: CacheCall, + op: MessagesHostCall, ) -> Result<(), InvokeError> { - self.cache - .begin(py, op) - .map(|_| ()) - .map_err(InvokeError::Python) + self.begin_host_call(py, op).map(|_| ()) } fn begin_host_call( &mut self, py: Python<'_>, - op: CacheCall, + op: MessagesHostCall, ) -> Result>, InvokeError> { - self.cache.begin(py, op).map_err(InvokeError::Python) + self.awaiting_safeguards = matches!(op, MessagesHostCall::Safeguards(_)); + match op { + MessagesHostCall::Cache(op) => self.cache.begin(py, op), + MessagesHostCall::Transport(op) => { + let request = self.view.request(py).map_err(InvokeError::Python)?; + self.transport.begin(py, op, request) + } + MessagesHostCall::PreRequest(reply) => self.begin_pre_request(py, reply).map(Some), + MessagesHostCall::Safeguards(op) => self.safeguards.begin(py, op).map(Some), + MessagesHostCall::Answer { stream, reply } => self.begin_answer(py, stream, reply), + MessagesHostCall::Intercept { stream, reply } => { + self.begin_intercept(py, stream, reply) + } + } + .map_err(InvokeError::Python) } fn resume_host_call( @@ -294,6 +842,37 @@ impl PythonHostCalls> for MessagesPythonHost { py: Python<'_>, result: PyResult>, ) -> Result>, InvokeError> { + if let Some(reply) = self.pre_request.take() { + return self.resume_pre_request(py, reply, result).map(|()| None); + } + if let Some((stream, reply)) = self.pending_short_circuit.take() { + return self + .resume_short_circuit(py, stream, reply, result?) + .map_err(InvokeError::Python); + } + if let Some(reply) = self.pending_answer.take() { + self.answer = Some(result?); + reply.send(()); + return Ok(None); + } + if let Some(reply) = self.pending_intercept.take() { + self.answer = Some(result?); + reply.send(true); + return Ok(None); + } + if std::mem::take(&mut self.awaiting_safeguards) { + return self + .safeguards + .resume(py, result) + .map(|()| None) + .map_err(InvokeError::Python); + } + if self.transport.pending() { + return self + .transport + .resume(py, result) + .map_err(InvokeError::Python); + } self.cache.resume(py, result).map_err(InvokeError::Python) } } @@ -302,10 +881,25 @@ impl PythonOwned for MessagesPythonHost { fn close(&mut self, _: Python<'_>) { self.view.close(); self.cache.close(); + self.transport.close(); + self.pre_request = None; + self.safeguards.close(); + self.interceptor = None; + self.pending_answer = None; + self.pending_intercept = None; + self.pending_short_circuit = None; + self.answer = None; + self.answered = None; + self.arguments = None; } fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { self.view.traverse(visit)?; - self.cache.traverse(visit) + self.cache.traverse(visit)?; + self.transport.traverse(visit)?; + self.safeguards.traverse(visit)?; + visit.call(&self.interceptor)?; + visit.call(&self.arguments)?; + visit.call(&self.answer) } } @@ -416,7 +1010,40 @@ mod tests { assert_projection(kwargs, globals, expected); } + #[rstest] + #[case::named_fields_are_projected( + json!({"model": "m", "anthropic_federation_rule_id": "fdrl_1", "anthropic_issuer_ttl_seconds": 60}), + Ok(json!({"model": "m", "anthropic_federation_rule_id": "fdrl_1", "anthropic_issuer_ttl_seconds": 60})), + )] + #[case::unnamed_fields_are_not( + json!({"model": "m", "anthropic_unrelated": "x"}), + Ok(json!({"model": "m"})), + )] + fn workload_identity_fields_are_projected_by_the_names_the_host_lists( + #[case] kwargs: Value, + #[case] expected: Result, + ) { + assert_projection_of( + &[ + "anthropic_federation_rule_id", + "anthropic_issuer_ttl_seconds", + ], + kwargs, + json!({}), + expected, + ); + } + fn assert_projection(kwargs: Value, globals: Value, expected: Result) { + assert_projection_of(&[], kwargs, globals, expected); + } + + fn assert_projection_of( + names: &[&str], + kwargs: Value, + globals: Value, + expected: Result, + ) { Python::initialize(); Python::attach(|py| { let dict = |value: &Value| { @@ -430,6 +1057,7 @@ mod tests { let globals = dict(&globals); let bound = PyDict::new(py); let projected = project_litellm_params( + names.iter().copied(), |name| present(&kwargs, &bound, name), |name| present(&globals, &bound, name), ) diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/mod.rs b/litellm-rust/crates/python-bridge/src/routes/messages/mod.rs index a9ae01bd7ee..9a1de064051 100644 --- a/litellm-rust/crates/python-bridge/src/routes/messages/mod.rs +++ b/litellm-rust/crates/python-bridge/src/routes/messages/mod.rs @@ -1,7 +1,15 @@ +mod agentic; +mod answer; mod host; +mod modify_params; +mod pre_request; +mod safeguards; +mod transport; +pub(crate) mod workload_identity; use host::MessagesPythonHost; use litellm_callbacks_legacy_python::LoggingOperation; +use modify_params::ModifyParams; use pyo3::prelude::*; use super::NativeCall; @@ -9,23 +17,61 @@ use super::NativeCall; fn run_messages(py: Python<'_>, call: NativeCall<'_>, asynchronous: bool) -> PyResult> { let (arguments, hooks) = crate::routes::call_hooks(py, LoggingOperation::Messages, &call, asynchronous)?; - crate::routes::run_public_call( + let hooked_request = agentic::HookedRequest::default(); + let hooks = litellm_host_python::HookChain::new() + .with(agentic::AgenticLoop::new( + asynchronous, + std::sync::Arc::clone(&hooked_request), + )) + .with(hooks); + let modify_params = ModifyParams::new(&call.args, &call.kwargs)?; + let classifies = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)); + let classified = std::sync::Arc::clone(&classifies); + crate::routes::run_public_call_after_policy( py, arguments, move |py, arguments, request| { + let hooked = pre_request::runs_pre_request_hooks(py)?; let route = litellm_inference_messages::MessagesRoute::new( - crate::http::provider_client(py, arguments, asynchronous)? + crate::http::messages_client(py, arguments, asynchronous)? .map_err(crate::http::client_error)?, crate::http::resources().auth.clone(), crate::secrets::source(py)?, - ); + ) + .with_workload_identity(std::sync::Arc::new( + workload_identity::PythonWorkloadIdentity::new( + litellm_host_python::PythonContext::capture(py)?, + ), + )); Ok(litellm_host::call::hosted_call( request, None, - move |(call, selection): (_, crate::cache::Selection), + move |(call, selection, hosted): (_, crate::cache::Selection, bool), services, interceptors, observers| async move { + let route = if hosted { + route.with_transport(std::sync::Arc::new(transport::PythonTransport::new( + services.clone(), + ))) + } else { + route + }; + let route = match hooked { + true => route.with_pre_request_hooks(std::sync::Arc::new( + pre_request::HostPreRequestHooks::new(services.clone()), + )), + false => route, + }; + let route = match classified.load(std::sync::atomic::Ordering::Acquire) { + true => route.with_safeguards(std::sync::Arc::new( + safeguards::PythonSafeguards::new(services.clone()), + )), + false => route, + }; + let route = route.with_host_answer(std::sync::Arc::new( + answer::PythonAnswer::new(services.clone()), + )); let (cache, options) = selection.attach(services); let route = match cache { Some(cache) => route.with_cache(cache), @@ -44,24 +90,32 @@ fn run_messages(py: Python<'_>, call: NativeCall<'_>, asynchronous: bool) -> PyR }, )) }, - MessagesPythonHost::new(call.view()?, asynchronous), + MessagesPythonHost::new(call.view()?, asynchronous, hooked_request, classifies), hooks, + modify_params, asynchronous, ) } -/// Python's sync Messages handler raises for every native provider before it sends anything -/// or opens a logging object (`BaseLLMHTTPHandler.anthropic_messages_handler`), and Rust copies -/// that until both sides serve sync calls. +/// Python's sync Messages handler answers a mock without logging, hands proxy MCP tools to the +/// gateway, and raises for every other native provider call before it sends anything or opens a +/// logging object (`BaseLLMHTTPHandler.anthropic_messages_handler`), and Rust copies that until +/// both sides serve sync calls. const SYNC_NOT_IMPLEMENTED: &str = "anthropic_messages_handler is not implemented for sync calls"; #[pyfunction] #[pyo3(signature = (call))] -pub(crate) fn messages(call: NativeCall<'_>) -> PyResult> { - drop(call); - Err(pyo3::exceptions::PyValueError::new_err( - SYNC_NOT_IMPLEMENTED, - )) +pub(crate) fn messages(py: Python<'_>, call: NativeCall<'_>) -> PyResult> { + let answer = py + .import(host::ROUTE_HOST_MODULE)? + .getattr("sync_answer")? + .call1((call.resolved()?,))?; + if answer.is_none() { + return Err(pyo3::exceptions::PyValueError::new_err( + SYNC_NOT_IMPLEMENTED, + )); + } + Ok(answer.unbind()) } #[pyfunction] diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/modify_params.rs b/litellm-rust/crates/python-bridge/src/routes/messages/modify_params.rs new file mode 100644 index 00000000000..c6f846478ad --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/modify_params.rs @@ -0,0 +1,152 @@ +use litellm_host::hooks::CallHooks; +use litellm_host_python::{PythonOwned, PythonRuntime}; +use pyo3::{ + exceptions::PyException, + gc::{PyTraverseError, PyVisit}, + prelude::*, + types::{PyDict, PyTuple}, +}; + +use super::host::ROUTE_HOST_MODULE; + +pub(super) struct ModifyParams { + call: Option<(Py, Py)>, +} + +impl ModifyParams { + pub(super) fn new(args: &Bound<'_, PyTuple>, kwargs: &Bound<'_, PyDict>) -> PyResult { + let model = match args.get_item(0) { + Ok(model) => model, + Err(_) => kwargs + .get_item("model")? + .unwrap_or_else(|| args.py().None().into_bound(args.py())), + }; + Ok(Self { + call: Some((model.unbind(), args.clone().unbind())), + }) + } +} + +impl CallHooks for ModifyParams { + fn arguments_prepared(&mut self, py: Python<'_>, arguments: &Py) -> PyResult<()> { + let Some((model, args)) = &self.call else { + return Ok(()); + }; + let clamped = py + .import(ROUTE_HOST_MODULE) + .and_then(|module| module.getattr("modify_max_tokens")) + .and_then(|clamp| clamp.call1((model, args, arguments))); + match clamped { + Err(error) if !error.is_instance_of::(py) => Err(error), + _ => Ok(()), + } + } +} + +impl PythonOwned for ModifyParams { + fn close(&mut self, _: Python<'_>) { + self.call = None; + } + + fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { + if let Some((model, args)) = &self.call { + visit.call(model)?; + visit.call(args)?; + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use pyo3::{ + prelude::*, + types::{PyDict, PyTuple}, + }; + use rstest::rstest; + + use super::{ModifyParams, ROUTE_HOST_MODULE}; + use litellm_host::hooks::CallHooks; + + #[rstest] + #[case::keyword_model( + "()", + "{'model': 'anthropic/claude-sonnet-4-5'}", + "'anthropic/claude-sonnet-4-5'" + )] + #[case::first_positional_wins("(64, [])", "{'model': 'anthropic/claude-sonnet-4-5'}", "64")] + #[case::no_model("()", "{}", "None")] + fn reads_the_model_the_client_wrapper_reads( + #[case] args: &str, + #[case] kwargs: &str, + #[case] expected: &str, + ) { + Python::initialize(); + Python::attach(|py| { + let eval = |source: &str| { + py.eval(&std::ffi::CString::new(source).unwrap(), None, None) + .unwrap() + }; + let args = eval(args).cast_into::().unwrap(); + let kwargs = eval(kwargs).cast_into::().unwrap(); + let hook = ModifyParams::new(&args, &kwargs).unwrap(); + let (model, captured) = hook.call.as_ref().unwrap(); + assert!(model.bind(py).eq(eval(expected)).unwrap()); + assert!(captured.bind(py).is(&args)); + }); + } + + #[rstest] + #[case::exception_leaves_max_tokens("ValueError", true)] + #[case::base_exception_propagates("KeyboardInterrupt", false)] + fn a_failing_clamp_behaves_like_the_client_wrappers_swallowed_try( + #[case] raised: &str, + #[case] swallowed: bool, + ) { + Python::initialize(); + Python::attach(|py| { + let locals = PyDict::new(py); + locals.set_item("name", ROUTE_HOST_MODULE).unwrap(); + locals.set_item("raised", raised).unwrap(); + py.run( + c" +import builtins, sys, types +for parent in ('litellm', 'litellm.rust_bridge', 'litellm.rust_bridge.host', 'litellm.rust_bridge.host.routes'): + sys.modules.setdefault(parent, types.ModuleType(parent)) +saved = sys.modules.get(name) +stub = types.ModuleType(name) +def modify_max_tokens(model, args, kwargs): + kwargs['max_tokens'] = 1 + raise getattr(builtins, raised)() +stub.modify_max_tokens = modify_max_tokens +sys.modules[name] = stub +", + Some(&locals), + Some(&locals), + ) + .unwrap(); + let args = PyTuple::empty(py); + let kwargs = PyDict::new(py); + kwargs + .set_item("model", "anthropic/claude-sonnet-4-5") + .unwrap(); + let mut hook = ModifyParams::new(&args, &kwargs).unwrap(); + let result = hook.arguments_prepared(py, &kwargs.clone().unbind()); + py.run( + c" +if saved is None: + sys.modules.pop(name, None) +else: + sys.modules[name] = saved +", + Some(&locals), + Some(&locals), + ) + .unwrap(); + assert_eq!(result.is_ok(), swallowed); + if let Err(error) = result { + assert!(error.is_instance_of::(py)); + } + }); + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/pre_request.rs b/litellm-rust/crates/python-bridge/src/routes/messages/pre_request.rs new file mode 100644 index 00000000000..0553fc0fa7f --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/pre_request.rs @@ -0,0 +1,35 @@ +use futures_util::future::BoxFuture; +use litellm_host::machine::HostServices; +use litellm_inference_messages::{Error, MessagesCall, PreRequestHooks}; +use pyo3::prelude::*; + +use super::host::{MessagesHostCall, MessagesHosted, ROUTE_HOST_MODULE}; + +pub(super) fn runs_pre_request_hooks(py: Python<'_>) -> PyResult { + py.import(ROUTE_HOST_MODULE)? + .getattr("runs_pre_request_hooks")? + .call0()? + .extract() +} + +pub(super) struct HostPreRequestHooks { + services: HostServices, +} + +impl HostPreRequestHooks { + pub(super) fn new(services: HostServices) -> Self { + Self { services } + } +} + +impl PreRequestHooks for HostPreRequestHooks { + fn run(&self, call: MessagesCall) -> BoxFuture<'_, Result> { + drop(call); + Box::pin(async move { + self.services + .call(MessagesHostCall::PreRequest) + .await + .and_then(|hooked| hooked) + }) + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/safeguards.rs b/litellm-rust/crates/python-bridge/src/routes/messages/safeguards.rs new file mode 100644 index 00000000000..af478521cb3 --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/safeguards.rs @@ -0,0 +1,183 @@ +use bytes::Bytes; +use futures_util::future::BoxFuture; +use litellm_host::{machine::HostServices, protocol::Reply}; +use litellm_host_python::{from_py, to_py}; +use litellm_inference_messages::{Error, MessagesBody, Safeguards}; +use pyo3::{ + exceptions::PyRuntimeError, + gc::{PyTraverseError, PyVisit}, + prelude::*, + types::{PyBytes, PyDict}, +}; +use serde_json::Value; + +use super::host::{MessagesHostCall, MessagesHosted, ROUTE_HOST_MODULE}; + +pub(super) enum SafeguardsCall { + Results { + response: MessagesBody, + reply: Reply>, + }, + OpenStream { + reply: Reply, + }, + Frames { + chunk: Bytes, + reply: Reply>, + }, + Flush { + reply: Reply>, + }, +} + +pub(super) struct PythonSafeguards { + services: HostServices, +} + +impl PythonSafeguards { + pub(super) fn new(services: HostServices) -> Self { + Self { services } + } + + async fn ask( + &self, + call: impl FnOnce(Reply) -> SafeguardsCall + Send, + ) -> Result { + self.services + .call(|reply| MessagesHostCall::Safeguards(call(reply))) + .await + } +} + +impl Safeguards for PythonSafeguards { + fn results<'a>( + &'a self, + response: &'a MessagesBody, + ) -> BoxFuture<'a, Result, Error>> { + let response = response.clone(); + Box::pin(self.ask(|reply| SafeguardsCall::Results { response, reply })) + } + + fn open_stream(&self) -> BoxFuture<'_, Result> { + Box::pin(self.ask(|reply| SafeguardsCall::OpenStream { reply })) + } + + fn frames(&self, chunk: Bytes) -> BoxFuture<'_, Result, Error>> { + Box::pin(self.ask(|reply| SafeguardsCall::Frames { chunk, reply })) + } + + fn flush(&self) -> BoxFuture<'_, Result, Error>> { + Box::pin(self.ask(|reply| SafeguardsCall::Flush { reply })) + } +} + +enum Pending { + Results(Reply>), + OpenStream(Reply), + Frames(Reply>), +} + +#[derive(Default)] +pub(super) struct SafeguardsHost { + classifier: Option>, + pending: Option, +} + +impl SafeguardsHost { + pub(super) fn configure( + &mut self, + py: Python<'_>, + request: &Bound<'_, PyDict>, + ) -> PyResult { + let classifier = py + .import(ROUTE_HOST_MODULE)? + .getattr("safeguards")? + .call1((request,))?; + self.classifier = (!classifier.is_none()).then(|| classifier.unbind()); + Ok(self.classifier.is_some()) + } + + pub(super) fn rebind(&mut self, py: Python<'_>, request: &Bound<'_, PyDict>) -> PyResult<()> { + if self.classifier.is_none() { + return Ok(()); + } + let classifier = py + .import(ROUTE_HOST_MODULE)? + .getattr("safeguards")? + .call1((request,))?; + if !classifier.is_none() { + self.classifier = Some(classifier.unbind()); + } + Ok(()) + } + + pub(super) fn begin(&mut self, py: Python<'_>, call: SafeguardsCall) -> PyResult> { + let classifier = self + .classifier + .as_ref() + .ok_or_else(|| PyRuntimeError::new_err("safeguards call without a classifier"))? + .bind(py); + let (awaitable, pending) = match call { + SafeguardsCall::Results { response, reply } => ( + classifier.call_method1("results", (to_py(py, &response)?,))?, + Pending::Results(reply), + ), + SafeguardsCall::OpenStream { reply } => ( + classifier.call_method0("open_stream")?, + Pending::OpenStream(reply), + ), + SafeguardsCall::Frames { chunk, reply } => ( + classifier.call_method1("frames", (PyBytes::new(py, &chunk),))?, + Pending::Frames(reply), + ), + SafeguardsCall::Flush { reply } => { + (classifier.call_method0("flush")?, Pending::Frames(reply)) + } + }; + self.pending = Some(pending); + Ok(awaitable.unbind()) + } + + pub(super) fn resume(&mut self, py: Python<'_>, result: PyResult>) -> PyResult<()> { + let pending = self + .pending + .take() + .ok_or_else(|| PyRuntimeError::new_err("safeguards reply without a pending call"))?; + let value = result?.into_bound(py); + match pending { + Pending::Results(reply) => reply.send(if value.is_none() { + None + } else { + Some(from_py(&value)?) + }), + Pending::OpenStream(reply) => reply.send(value.extract()?), + Pending::Frames(reply) => reply.send( + value + .extract::>>()? + .iter() + .map(|frame| Bytes::copy_from_slice(frame.as_bytes())) + .collect(), + ), + } + Ok(()) + } + + pub(super) fn published(&self, py: Python<'_>, public: Py) -> PyResult> { + match &self.classifier { + Some(classifier) => classifier + .bind(py) + .call_method1("published", (public,)) + .map(Bound::unbind), + None => Ok(public), + } + } + + pub(super) fn close(&mut self) { + self.classifier = None; + self.pending = None; + } + + pub(super) fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { + visit.call(&self.classifier) + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/transport.rs b/litellm-rust/crates/python-bridge/src/routes/messages/transport.rs new file mode 100644 index 00000000000..12e782f61aa --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/transport.rs @@ -0,0 +1,275 @@ +use std::fmt; + +use bytes::Bytes; +use futures_util::{StreamExt, future::BoxFuture}; +use litellm_host::{ + machine::HostServices, + protocol::{Protocol, Reply}, +}; +use litellm_host_python::{json_to_py, to_py}; +use litellm_inference_messages::{ + Delivered, Error, Transport, TransportBody, TransportRequest, TransportResponse, +}; +use pyo3::{ + exceptions::{PyBaseException, PyException, PyStopAsyncIteration}, + gc::{PyTraverseError, PyVisit}, + prelude::*, + types::{PyBytes, PyDict}, +}; + +use super::host::ROUTE_HOST_MODULE; + +pub(crate) enum TransportCall { + Send { + request: TransportRequest, + reply: Reply>, + }, + Read { + reply: Reply, Error>>, + }, +} + +pub(crate) struct Sent { + status: u16, + headers: Vec<(String, String)>, + body: SentBody, +} + +enum SentBody { + Text(String), + Stream, + Rejected { text: String, error: Error }, +} + +pub(super) struct PythonTransport { + services: HostServices

, +} + +impl PythonTransport

{ + pub(super) fn new(services: HostServices

) -> Self { + Self { services } + } +} + +impl

Transport for PythonTransport

+where + P: Protocol, + P::HostCall: From, +{ + fn send( + &self, + request: TransportRequest, + ) -> BoxFuture<'static, Result> { + let services = self.services.clone(); + Box::pin(async move { + let sent = services + .call(|reply| TransportCall::Send { request, reply }.into()) + .await??; + let delivered = match sent.body { + SentBody::Text(text) => Delivered::Complete(text), + SentBody::Rejected { text, error } => Delivered::Rejected { text, error }, + SentBody::Stream => Delivered::Stream( + futures_util::stream::try_unfold(services, |services| async move { + let chunk = services + .call(|reply| TransportCall::Read { reply }.into()) + .await??; + Ok(chunk.map(|chunk| (chunk, services))) + }) + .boxed(), + ), + }; + Ok(TransportResponse { + status: sent.status, + headers: sent.headers, + delivered, + }) + }) + } +} + +#[derive(thiserror::Error)] +#[error("the Python HTTP client failed")] +struct HostTransportFailure { + error: Py, + raw: bool, +} + +impl fmt::Debug for HostTransportFailure { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("HostTransportFailure") + } +} + +fn failed(py: Python<'_>, error: PyErr, raw: bool) -> Error { + Error::transport(HostTransportFailure { + error: error.into_value(py), + raw, + }) +} + +pub(super) fn python_failure( + py: Python<'_>, + error: &(dyn std::error::Error + 'static), +) -> Option<(PyErr, bool)> { + litellm_error::find::(error).map(|failure| { + ( + PyErr::from_value(failure.error.clone_ref(py).into_bound(py).into_any()), + failure.raw, + ) + }) +} + +enum Pending { + Send(Reply>), + Read(Reply, Error>>), +} + +#[derive(Default)] +pub(super) struct HostedTransport { + handler: Option>, + chunks: Option>, + pending: Option, +} + +impl HostedTransport { + pub(super) fn select(&mut self, py: Python<'_>, request: &Bound<'_, PyDict>) -> PyResult { + let handler = py + .import(ROUTE_HOST_MODULE)? + .getattr("transport_handler")? + .call1((request,))?; + self.handler = (!handler.is_none()).then(|| handler.unbind()); + Ok(self.handler.is_some()) + } + + pub(super) fn pending(&self) -> bool { + self.pending.is_some() + } + + pub(super) fn begin( + &mut self, + py: Python<'_>, + call: TransportCall, + request: &Bound<'_, PyDict>, + ) -> PyResult>> { + match call { + TransportCall::Send { + request: sent, + reply, + } => { + let handler = self + .handler + .as_ref() + .ok_or(litellm_host_python::Error::MissingState)?; + let body = match &sent.body { + TransportBody::Json(body) => json_to_py(py, body)?.unbind(), + TransportBody::Signed(bytes) => PyBytes::new(py, bytes).into_any().unbind(), + }; + let awaitable = py + .import(ROUTE_HOST_MODULE)? + .getattr("transport_send")? + .call1(( + handler, + request, + &sent.url, + to_py(py, &sent.headers)?, + body, + sent.stream, + ))?; + self.pending = Some(Pending::Send(reply)); + Ok(Some(awaitable.unbind())) + } + TransportCall::Read { reply } => { + let Some(chunks) = self.chunks.as_ref() else { + reply.send(Ok(None)); + return Ok(None); + }; + let awaitable = chunks.bind(py).call_method0("__anext__")?; + self.pending = Some(Pending::Read(reply)); + Ok(Some(awaitable.unbind())) + } + } + } + + pub(super) fn resume( + &mut self, + py: Python<'_>, + result: PyResult>, + ) -> PyResult>> { + let result = match result { + Err(error) if !error.is_instance_of::(py) => { + self.pending = None; + return Err(error); + } + result => result, + }; + match self.pending.take() { + Some(Pending::Send(reply)) => { + reply.send(match result { + Ok(sent) => self.sent(py, sent.bind(py))?, + Err(error) => Err(self.send_failure(py, error)?), + }); + } + Some(Pending::Read(reply)) => reply.send(match result { + Ok(chunk) => Ok(Some(Bytes::copy_from_slice( + chunk.bind(py).cast::()?.as_bytes(), + ))), + Err(error) if error.is_instance_of::(py) => { + self.chunks = None; + Ok(None) + } + Err(error) => { + self.chunks = None; + Err(failed(py, error, true)) + } + }), + None => return Err(litellm_host_python::Error::MissingState.into()), + } + Ok(None) + } + + fn send_failure(&self, py: Python<'_>, error: PyErr) -> PyResult { + let raw = py + .import(ROUTE_HOST_MODULE)? + .getattr("RawTransportFailure")?; + if error.value(py).is_instance(&raw)? { + let raised = error.value(py).getattr("error")?; + return Ok(failed(py, PyErr::from_value(raised), true)); + } + Ok(failed(py, error, false)) + } + + fn sent(&mut self, py: Python<'_>, sent: &Bound<'_, PyAny>) -> PyResult> { + let status: u16 = sent.getattr("status")?.extract()?; + let headers: Vec<(String, String)> = sent.getattr("headers")?.extract()?; + let text: Option = sent.getattr("text")?.extract()?; + let rejection = sent.getattr("rejection")?; + let chunks = sent.getattr("chunks")?; + let body = if !rejection.is_none() { + SentBody::Rejected { + text: text.unwrap_or_default(), + error: failed(py, PyErr::from_value(rejection), false), + } + } else if !chunks.is_none() { + self.chunks = Some(chunks.unbind()); + SentBody::Stream + } else { + SentBody::Text(text.unwrap_or_default()) + }; + Ok(Ok(Sent { + status, + headers, + body, + })) + } + + pub(super) fn close(&mut self) { + self.pending = None; + self.chunks = None; + self.handler = None; + } + + pub(super) fn traverse(&self, visit: &PyVisit<'_>) -> Result<(), PyTraverseError> { + visit.call(&self.handler)?; + visit.call(&self.chunks) + } +} diff --git a/litellm-rust/crates/python-bridge/src/routes/messages/workload_identity.rs b/litellm-rust/crates/python-bridge/src/routes/messages/workload_identity.rs new file mode 100644 index 00000000000..b8824d96584 --- /dev/null +++ b/litellm-rust/crates/python-bridge/src/routes/messages/workload_identity.rs @@ -0,0 +1,74 @@ +use std::fmt; + +use futures_util::future::BoxFuture; +use litellm_host_python::{PythonContext, attach_blocking, to_py}; +use litellm_inference_messages::WorkloadIdentity; +use litellm_router_types::{ExtraParams, LitellmParams}; +use litellm_secret_value::SecretValue; +use pyo3::{exceptions::PyBaseException, prelude::*}; + +const MODULE: &str = "litellm.rust_bridge.host.routes.messages"; + +pub(super) struct PythonWorkloadIdentity { + context: PythonContext, +} + +impl PythonWorkloadIdentity { + pub(super) fn new(context: PythonContext) -> Self { + Self { context } + } +} + +impl WorkloadIdentity for PythonWorkloadIdentity { + fn token<'a>( + &'a self, + litellm_params: &'a LitellmParams, + api_base: Option<&'a str>, + ) -> BoxFuture<'a, Result, litellm_auth::Error>> { + let params = litellm_params.extra.clone(); + let api_base = api_base.map(str::to_owned); + let context = self.context.clone(); + Box::pin(async move { + attach_blocking(context, move |py| { + mint(py, ¶ms, api_base).map_err(|error| raised(py, error)) + }) + .await + .map_err(|error| Python::attach(|py| raised(py, error))) + .and_then(|minted| minted) + .map(|token| token.map(SecretValue::new)) + }) + } +} + +fn mint( + py: Python<'_>, + params: &ExtraParams, + api_base: Option, +) -> PyResult> { + py.import(MODULE)? + .getattr("workload_identity_token")? + .call1((to_py(py, &**params)?, api_base))? + .extract() +} + +#[derive(thiserror::Error)] +#[error("Python workload identity federation failed")] +struct PythonWorkloadIdentityError(Py); + +impl fmt::Debug for PythonWorkloadIdentityError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("PythonWorkloadIdentityError") + } +} + +fn raised(py: Python<'_>, error: PyErr) -> litellm_auth::Error { + litellm_auth::Error::provider(PythonWorkloadIdentityError(error.into_value(py))) +} + +pub(crate) fn python_error( + py: Python<'_>, + error: &(dyn std::error::Error + 'static), +) -> Option { + litellm_error::find::(error) + .map(|error| PyErr::from_value(error.0.clone_ref(py).into_bound(py).into_any())) +} diff --git a/litellm-rust/crates/python-bridge/src/routes/mod.rs b/litellm-rust/crates/python-bridge/src/routes/mod.rs index f51c755c33e..9fcd792bdaa 100644 --- a/litellm-rust/crates/python-bridge/src/routes/mod.rs +++ b/litellm-rust/crates/python-bridge/src/routes/mod.rs @@ -166,6 +166,38 @@ fn run_public_call( hooks: impl PythonCallHooks + 'static, asynchronous: bool, ) -> PyResult> +where + H: PythonBinding + PythonHostCalls + 'static, + M: Machine + 'static, + M::Complete: Into::Response>>, +{ + run_public_call_after_policy( + py, + arguments, + start, + host, + hooks, + HookChain::new(), + asynchronous, + ) +} + +fn run_public_call_after_policy( + py: Python<'_>, + arguments: Py, + start: impl FnOnce( + Python<'_>, + &Bound<'_, PyDict>, + ::Request, + ) -> PyResult + + Send + + Sync + + 'static, + host: H, + hooks: impl PythonCallHooks + 'static, + after_policy: impl PythonCallHooks + 'static, + asynchronous: bool, +) -> PyResult> where H: PythonBinding + PythonHostCalls + 'static, M: Machine + 'static, @@ -179,7 +211,8 @@ where host, HookChain::new() .with(hooks) - .with(crate::preflight::SdkPolicy), + .with(crate::preflight::SdkPolicy) + .with(after_policy), arguments, CallOptions::new(asynchronous, execution_steps), ) diff --git a/litellm-rust/crates/python-compat/src/lib.rs b/litellm-rust/crates/python-compat/src/lib.rs index 2cc0eeac397..e23dbdb285e 100644 --- a/litellm-rust/crates/python-compat/src/lib.rs +++ b/litellm-rust/crates/python-compat/src/lib.rs @@ -7,6 +7,7 @@ //! |---|---| //! | [`literal`] | `ast.literal_eval(text)` | //! | [`repr`] | `repr(value)` and `str(value)` | +//! | [`reprlib`] | `reprlib.repr(value)` | //! | [`json`] | `json.dumps(value)` and `json.loads(text)` | //! | [`pickle`] | `pickle.loads(data)` and `pickle.dumps(value)` for plain data | //! | [`truthy`] | `bool(value)` | @@ -29,6 +30,7 @@ pub mod literal; pub mod number; pub mod pickle; pub mod repr; +pub mod reprlib; pub mod truthy; mod value; diff --git a/litellm-rust/crates/python-compat/src/reprlib.rs b/litellm-rust/crates/python-compat/src/reprlib.rs new file mode 100644 index 00000000000..5d04b4e1ca7 --- /dev/null +++ b/litellm-rust/crates/python-compat/src/reprlib.rs @@ -0,0 +1,179 @@ +use crate::{Value, repr::repr}; + +const MAX_LEVEL: usize = 6; +const MAX_TUPLE: usize = 6; +const MAX_LIST: usize = 6; +const MAX_SET: usize = 6; +const MAX_DICT: usize = 4; +const MAX_STRING: usize = 30; +const MAX_LONG: usize = 40; +const MAX_OTHER: usize = 30; +const FILL: &str = "..."; + +pub fn reprlib(value: &Value) -> String { + repr1(value, MAX_LEVEL) +} + +fn repr1(value: &Value, level: usize) -> String { + match value { + Value::Str(text) => repr_str(text), + Value::Int(_) => shortened(repr(value), MAX_LONG), + Value::Tuple(values) => repr_iterable(values, level, ("(", ")"), MAX_TUPLE, ","), + Value::List(values) => repr_iterable(values, level, ("[", "]"), MAX_LIST, ""), + Value::Set(values) if values.is_empty() => "set()".to_owned(), + Value::Set(values) => repr_iterable(&sorted(values), level, ("{", "}"), MAX_SET, ""), + Value::Dict(entries) => repr_dict(entries, level), + Value::None + | Value::Bool(_) + | Value::Float(_) + | Value::Complex { .. } + | Value::Bytes(_) => shortened(repr(value), MAX_OTHER), + } +} + +fn shortened(text: String, limit: usize) -> String { + let chars: Vec = text.chars().collect(); + if chars.len() <= limit { + return text; + } + let head = (limit - FILL.len()) / 2; + let tail = limit - FILL.len() - head; + let mut out: String = chars[..head].iter().collect(); + out.push_str(FILL); + out.extend(&chars[chars.len() - tail..]); + out +} + +fn repr_str(text: &str) -> String { + let chars: Vec = text.chars().collect(); + let quoted = repr(&Value::Str(chars.iter().take(MAX_STRING).collect())); + if quoted.chars().count() <= MAX_STRING { + return quoted; + } + let head = (MAX_STRING - FILL.len()) / 2; + let tail = MAX_STRING - FILL.len() - head; + let kept: String = chars[..head.min(chars.len())] + .iter() + .chain(&chars[chars.len().saturating_sub(tail)..]) + .collect(); + let quoted: Vec = repr(&Value::Str(kept)).chars().collect(); + let mut out: String = quoted[..head].iter().collect(); + out.push_str(FILL); + out.extend("ed[quoted.len() - tail..]); + out +} + +fn repr_iterable( + values: &[Value], + level: usize, + (left, right): (&str, &str), + max_items: usize, + trail: &str, +) -> String { + if level == 0 && !values.is_empty() { + return format!("{left}{FILL}{right}"); + } + let mut pieces: Vec = values + .iter() + .take(max_items) + .map(|value| repr1(value, level - 1)) + .collect(); + if values.len() > max_items { + pieces.push(FILL.to_owned()); + } + let trail = if values.len() == 1 { trail } else { "" }; + format!("{left}{}{trail}{right}", pieces.join(", ")) +} + +fn repr_dict(entries: &[(Value, Value)], level: usize) -> String { + if entries.is_empty() { + return "{}".to_owned(); + } + if level == 0 { + return format!("{{{FILL}}}"); + } + let mut pieces: Vec = sorted_entries(entries) + .into_iter() + .take(MAX_DICT) + .map(|(key, value)| format!("{}: {}", repr1(key, level - 1), repr1(value, level - 1))) + .collect(); + if entries.len() > MAX_DICT { + pieces.push(FILL.to_owned()); + } + format!("{{{}}}", pieces.join(", ")) +} + +fn sorted_entries(entries: &[(Value, Value)]) -> Vec<&(Value, Value)> { + let mut ordered: Vec<&(Value, Value)> = entries.iter().collect(); + if entries.iter().all(|(key, _)| matches!(key, Value::Str(_))) { + ordered.sort_by(|(left, _), (right, _)| match (left, right) { + (Value::Str(left), Value::Str(right)) => left.cmp(right), + _ => std::cmp::Ordering::Equal, + }); + } + ordered +} + +fn sorted(values: &[Value]) -> Vec { + let mut ordered = values.to_vec(); + if values.iter().all(|value| matches!(value, Value::Str(_))) { + ordered.sort_by(|left, right| match (left, right) { + (Value::Str(left), Value::Str(right)) => left.cmp(right), + _ => std::cmp::Ordering::Equal, + }); + } + ordered +} + +#[cfg(test)] +mod tests { + use rstest::rstest; + + use super::*; + + fn list(values: impl IntoIterator) -> Value { + Value::List(values.into_iter().collect()) + } + + fn dict(entries: &[(&str, Value)]) -> Value { + Value::Dict( + entries + .iter() + .map(|(key, value)| (Value::from(*key), value.clone())) + .collect(), + ) + } + + fn nested(depth: usize) -> Value { + (0..depth).fold(list([Value::from(1)]), |inner, _| list([inner])) + } + + #[rstest] + #[case::none(Value::None, "None")] + #[case::bool(Value::Bool(true), "True")] + #[case::int(Value::from(3), "3")] + #[case::wide_int(Value::Int("1".repeat(45).parse().unwrap()), "111111111111111111...1111111111111111111")] + #[case::float(Value::Float(0.1), "0.1")] + #[case::long_float(Value::Float(1.0 / 3.0), "0.3333333333333333")] + #[case::nan(Value::Float(f64::NAN), "nan")] + #[case::short_str(Value::from("high"), "'high'")] + #[case::long_str( + Value::from("abcdefghijklmnopqrstuvwxyz0123456789"), + "'abcdefghijkl...xyz0123456789'" + )] + #[case::quoted_str( + Value::from("it's a fairly long string with a quote"), + "\"it's a fairl... with a quote\"" + )] + #[case::list(list([Value::from(1)]), "[1]")] + #[case::long_list(list((0..8).map(Value::from)), "[0, 1, 2, 3, 4, 5, ...]")] + #[case::one_tuple(Value::Tuple(vec![Value::from(1)]), "(1,)")] + #[case::sorted_dict(dict(&[("b", Value::from(2)), ("a", Value::from(1))]), "{'a': 1, 'b': 2}")] + #[case::long_dict(dict(&[("e", Value::None), ("d", Value::None), ("c", Value::None), ("b", Value::None), ("a", Value::None)]), "{'a': None, 'b': None, 'c': None, 'd': None, ...}")] + #[case::empty_dict(dict(&[]), "{}")] + #[case::deep(nested(6), "[[[[[[[...]]]]]]]")] + #[case::deep_dict(dict(&[("a", dict(&[("b", dict(&[("c", dict(&[("d", dict(&[("e", dict(&[("f", dict(&[("g", Value::None)]))]))]))]))]))]))]), "{'a': {'b': {'c': {'d': {'e': {'f': {...}}}}}}}")] + fn values_shorten_as_reprlib_shortens_them(#[case] value: Value, #[case] expected: &str) { + assert_eq!(reprlib(&value), expected); + } +} diff --git a/litellm-rust/crates/router/src/lib.rs b/litellm-rust/crates/router/src/lib.rs index b75c1a14446..6955b8a927a 100644 --- a/litellm-rust/crates/router/src/lib.rs +++ b/litellm-rust/crates/router/src/lib.rs @@ -31,6 +31,8 @@ impl Router { .model_list .iter() .map(|model| { + let drop_params = + drops_params_globally || is_on(model.litellm_params.drop_params.as_ref(), env); ( model.model_name.clone(), Deployment { @@ -45,8 +47,8 @@ impl Router { litellm_params: model.litellm_params.clone(), shaping: MessagesShaping { settings: MessagesSettings { - drop_params: drops_params_globally - || is_on(model.litellm_params.drop_params.as_ref(), env), + drop_params, + drops_unsupported_params: drop_params, ..MessagesSettings::default() }, ..MessagesShaping::default() @@ -113,15 +115,18 @@ mod tests { )) .unwrap(); + let settings = Router::from_config(&config, &|name: &str| { + (name == "DROP_PARAMS_FLAG").then(|| " Yes ".to_owned()) + }) + .get("public-model") + .unwrap() + .shaping + .settings + .clone(); + assert_eq!( - Router::from_config(&config, &|name: &str| (name == "DROP_PARAMS_FLAG") - .then(|| " Yes ".to_owned())) - .get("public-model") - .unwrap() - .shaping - .settings - .drop_params, - expected + (settings.drop_params, settings.drops_unsupported_params), + (expected, expected) ); } } diff --git a/litellm/__init__.py b/litellm/__init__.py index bfe0e2b5f3e..8a48b0812d9 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -27,7 +27,7 @@ from typing import ( from collections.abc import Mapping from litellm.types.integrations.datadog import DatadogInitParams from litellm.types.integrations.newrelic import NewRelicInitParams -from litellm.litellm_core_utils.core_helpers import drop_params_env_flag +from litellm.litellm_core_utils.core_helpers import drop_params_env_flag, env_flag from litellm.types.integrations.pointfive import PointFiveInitParams from litellm.types.integrations.zerobus import ZerobusInitParams from litellm._logging import ( @@ -227,7 +227,7 @@ token: Optional[str] = ( ) max_tokens: int = DEFAULT_MAX_TOKENS # OpenAI Defaults drop_params = drop_params_env_flag(os.environ, verbose_logger) -modify_params = bool(os.getenv("LITELLM_MODIFY_PARAMS", False)) +modify_params = env_flag(os.environ, "LITELLM_MODIFY_PARAMS", verbose_logger) bedrock_neutralize_orphaned_tool_blocks: bool = True use_chat_completions_url_for_anthropic_messages: bool = bool( os.getenv("LITELLM_USE_CHAT_COMPLETIONS_URL_FOR_ANTHROPIC_MESSAGES", False) diff --git a/litellm/anthropic_beta_headers_manager.py b/litellm/anthropic_beta_headers_manager.py index fd72bf7d2e7..b93c88cb935 100644 --- a/litellm/anthropic_beta_headers_manager.py +++ b/litellm/anthropic_beta_headers_manager.py @@ -49,7 +49,6 @@ _BETA_HEADERS_CONFIG_ADAPTER: Final = TypeAdapter(BetaHeadersConfig) _DECODED_JSON: Final = TypeAdapter(object) BetaPlacement: TypeAlias = Literal["header", "body"] -UnlistedBetas: TypeAlias = Literal["drop", "forward"] _HEADER_ONLY_COLUMN_SUFFIX: Final = "_header_only" @@ -281,13 +280,12 @@ def filter_and_transform_beta_headers( beta_headers: list[str], provider: str, placement: BetaPlacement = "header", - unlisted: UnlistedBetas = "drop", ) -> list[str]: """ Filter and transform beta headers based on provider's mapping configuration. This function: - 1. Only allows headers that are present in the provider's mapping keys, unless ``unlisted`` is "forward" + 1. Only allows headers that are present in the provider's mapping keys 2. Filters out headers with null values (unsupported) 3. Maps headers to provider-specific names (e.g., advanced-tool-use -> tool-search-tool) @@ -295,7 +293,6 @@ def filter_and_transform_beta_headers( beta_headers: List of Anthropic beta header values provider: Provider name (e.g., "anthropic", "bedrock", "vertex_ai") placement: Whether the betas travel as the anthropic-beta header or the anthropic_beta body field - unlisted: Whether a beta missing from the mapping is dropped or forwarded as sent Returns: List of filtered and transformed beta headers for the provider @@ -310,10 +307,6 @@ def filter_and_transform_beta_headers( for header in beta_headers: header = header.strip() - if header not in provider_mapping and unlisted == "forward": - filtered_headers.add(header) - continue - # Check if header is in the mapping if header not in provider_mapping: verbose_logger.debug( @@ -426,7 +419,6 @@ def update_headers_with_filtered_beta( headers: dict, provider: str, api_base: str | None = None, - unlisted: UnlistedBetas = "drop", keep: frozenset[str] = frozenset(), ) -> dict: """ @@ -437,7 +429,6 @@ def update_headers_with_filtered_beta( headers: Request headers dict (will be modified in place) provider: Provider name api_base: Deployment api_base, used to pick the allowlist row (Foundry hosts use ``azure_ai``) - unlisted: Whether a beta missing from the row is dropped or forwarded as sent keep: Betas the routed model accepts, forwarded as sent whatever the row says Returns: @@ -457,7 +448,6 @@ def update_headers_with_filtered_beta( *filter_and_transform_beta_headers( beta_headers=[b for b in beta_values if b not in keep], provider=resolve_beta_provider(provider, api_base), - unlisted=unlisted, ), *(b for b in beta_values if b in keep), ] diff --git a/litellm/caching/caching_handler.py b/litellm/caching/caching_handler.py index a3cf54916f1..1e89b700137 100644 --- a/litellm/caching/caching_handler.py +++ b/litellm/caching/caching_handler.py @@ -19,6 +19,7 @@ import datetime import inspect import time from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Mapping +from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Final, Optional, Protocol, TypeVar from pydantic import ConfigDict, SkipValidation, TypeAdapter, ValidationError @@ -80,6 +81,19 @@ from litellm.litellm_core_utils.streaming_handler import CustomStreamWrapper EmbeddingCacheInputElement = str | list[int] | ChatCompletionFileObject +@dataclass(frozen=True, slots=True) +class CacheRead: + kwargs: dict[str, object] # mutable-ok: the @client call kwargs the embedding path keeps reading and rewriting + checked: bool = False + cached_result: object | None = None + model: str = "" + end_time: datetime.datetime | None = None + + @property + def hit(self) -> bool: + return self.end_time is not None + + class CachingHandlerResponse(LiteLLMBaseModel): """ This is the response object for the caching handler. We need to separate embedding cached responses and (completion / text_completion / transcription) cached responses @@ -313,6 +327,10 @@ def _request_cache_key(request_kwargs: Mapping[str, Any]) -> str | None: return request_kwargs.get("cache_key", None) +def _is_cache_miss(cached_result: object) -> bool: + return cached_result is None or isinstance(cached_result, list) + + def _set_cached_hidden_param(response: object, key: str, value: object) -> None: if isinstance(response, TextCompletionResponse): setattr(response.hidden_params, key, value) @@ -406,121 +424,146 @@ class LLMCachingHandler: Raises: None """ + if not self.reads_cache(model=model, kwargs=kwargs): + return None + args = args or () + final_embedding_cached_response: EmbeddingResponse | None = None + embedding_all_elements_cache_hit: bool = False + read: Final = await self.async_read_cache( + model=model, + original_function=original_function, + logging_obj=logging_obj, + call_type=call_type, + kwargs=kwargs, + args=args, + ) + kwargs = read.kwargs + cached_result: object | None = read.cached_result + if litellm.cache is not None and read.checked: + if read.end_time is not None: + cached_result = self._convert_cached_result_to_model_response( + cached_result=cached_result, + call_type=original_function.__name__, + kwargs=kwargs, + logging_obj=logging_obj, + model=read.model, + custom_llm_provider=kwargs.get("custom_llm_provider", None), + args=args, + ) + if not _should_defer_streaming_cache_hit_callbacks(cached_result=cached_result): + # LOG SUCCESS + self._async_log_cache_hit_on_callbacks( + logging_obj=logging_obj, + cached_result=cached_result, + start_time=start_time, + end_time=read.end_time, + cache_hit=True, + ) + _set_cached_hidden_param(cached_result, "cache_key", self.hit_cache_key()) + return CachingHandlerResponse(cached_result=cached_result) + elif ( + call_type == CallTypes.aembedding.value + and cached_result is not None + and isinstance(cached_result, list) + and litellm.cache is not None + and not isinstance(litellm.cache.cache, S3Cache) # s3 doesn't support bulk writing. Exclude. + ): + ( + final_embedding_cached_response, + embedding_all_elements_cache_hit, + ) = self._process_async_embedding_cached_response( + final_embedding_cached_response=final_embedding_cached_response, + cached_result=cached_result, + kwargs=kwargs, + logging_obj=logging_obj, + start_time=start_time, + model=model, + ) + return CachingHandlerResponse( + final_embedding_cached_response=final_embedding_cached_response, + embedding_all_elements_cache_hit=embedding_all_elements_cache_hit, + embedding_uncached_input=self.handle_kwargs_input_list_or_str(kwargs), + ) + + verbose_logger.debug("CACHE RESULT: %s", cached_result) + return CachingHandlerResponse( + cached_result=cached_result, + final_embedding_cached_response=final_embedding_cached_response, + ) + + _async_get_cache = async_get_cache + + def reads_cache( + self, + model: str, + kwargs: dict[str, Any], # pyright: ignore[reportExplicitAny] # mutable-ok: the @client call kwargs, read as the wrapper reads them + ) -> bool: if _is_response_cache_excluded(model=model, kwargs=kwargs): self.request_kwargs = _drop_logging_obj_from_kwargs(kwargs) - return None - - # Check if caching should be performed BEFORE doing expensive operations - if ( + return False + return ( (kwargs.get("caching", None) is None and litellm.cache is not None) or kwargs.get("caching", False) is True ) and ( not _cache_reads_disabled(kwargs) - ): # allow users to control returning cached responses from the completion function - args = args or () - final_embedding_cached_response: EmbeddingResponse | None = None - embedding_all_elements_cache_hit: bool = False - cached_result: object | None = None - kwargs = kwargs.copy() - ######################################################### - # Init cache timing metrics - ######################################################### - cache_check_start_time: Final = time.perf_counter() - cache_check_end_time: float | None = None - ######################################################### - parent_otel_span: Final = get_parent_otel_span_from_kwargs(kwargs) - kwargs["parent_otel_span"] = parent_otel_span + ) # allow users to control returning cached responses from the completion function - if litellm.cache is not None and self._is_call_type_supported_by_cache(original_function=original_function): - verbose_logger.debug("Checking Async Cache") - logging_obj.reset_caching_details() - cached_result = await self._retrieve_from_cache( - call_type=call_type, - kwargs=kwargs, - args=args, - ) - cache_check_end_time = time.perf_counter() + async def async_read_cache( + self, + model: str, + original_function: Callable[..., object], + logging_obj: LiteLLMLoggingObj, + call_type: str, + kwargs: Mapping[str, Any], # pyright: ignore[reportExplicitAny] # the @client call kwargs, read as the wrapper reads them + args: tuple[object, ...], + ) -> CacheRead: + cache_check_start_time: Final = time.perf_counter() + read_kwargs: Final = dict(kwargs) + read_kwargs["parent_otel_span"] = get_parent_otel_span_from_kwargs(read_kwargs) + if litellm.cache is None or not self._is_call_type_supported_by_cache(original_function=original_function): + return CacheRead(kwargs=read_kwargs) + verbose_logger.debug("Checking Async Cache") + logging_obj.reset_caching_details() + cached_result: Final = await self._retrieve_from_cache( + call_type=call_type, + kwargs=read_kwargs, + args=args, + ) + cache_check_end_time: Final = time.perf_counter() + if _is_cache_miss(cached_result): + return CacheRead(kwargs=read_kwargs, checked=True, cached_result=cached_result) + verbose_logger.debug("Cache Hit!") + end_time: Final = datetime.datetime.now() + provider_model, custom_llm_provider, _, _ = litellm.get_llm_provider( + model=model, + custom_llm_provider=read_kwargs.get("custom_llm_provider", None), + api_base=read_kwargs.get("api_base", None), + api_key=read_kwargs.get("api_key", None), + ) + self._update_litellm_logging_obj_environment( + logging_obj=logging_obj, + model=provider_model, + kwargs=read_kwargs, + cached_result=cached_result, + is_async=True, + custom_llm_provider=custom_llm_provider, + cache_duration_ms=(cache_check_end_time - cache_check_start_time) * 1000, + ) + return CacheRead( + kwargs=read_kwargs, + checked=True, + cached_result=cached_result, + model=provider_model, + end_time=end_time, + ) - if cached_result is not None and not isinstance(cached_result, list): - verbose_logger.debug("Cache Hit!") - cache_hit: Final = True - end_time: Final = datetime.datetime.now() - provider_model, custom_llm_provider, _, _ = litellm.get_llm_provider( - model=model, - custom_llm_provider=kwargs.get("custom_llm_provider", None), - api_base=kwargs.get("api_base", None), - api_key=kwargs.get("api_key", None), - ) - cache_duration_ms: Final = (cache_check_end_time - cache_check_start_time) * 1000 - self._update_litellm_logging_obj_environment( - logging_obj=logging_obj, - model=provider_model, - kwargs=kwargs, - cached_result=cached_result, - is_async=True, - custom_llm_provider=custom_llm_provider, - cache_duration_ms=cache_duration_ms, - ) - - call_type = original_function.__name__ - - cached_result = self._convert_cached_result_to_model_response( - cached_result=cached_result, - call_type=call_type, - kwargs=kwargs, - logging_obj=logging_obj, - model=provider_model, - custom_llm_provider=kwargs.get("custom_llm_provider", None), - args=args, - ) - if not _should_defer_streaming_cache_hit_callbacks(cached_result=cached_result): - # LOG SUCCESS - self._async_log_cache_hit_on_callbacks( - logging_obj=logging_obj, - cached_result=cached_result, - start_time=start_time, - end_time=end_time, - cache_hit=cache_hit, - ) - cache_key: Final = ( - self.preset_cache_key - or self.request_kwargs.get("cache_key") - or litellm.cache.get_cache_key(**self.request_kwargs) - ) - _set_cached_hidden_param(cached_result, "cache_key", cache_key) - return CachingHandlerResponse(cached_result=cached_result) - elif ( - call_type == CallTypes.aembedding.value - and cached_result is not None - and isinstance(cached_result, list) - and litellm.cache is not None - and not isinstance(litellm.cache.cache, S3Cache) # s3 doesn't support bulk writing. Exclude. - ): - ( - final_embedding_cached_response, - embedding_all_elements_cache_hit, - ) = self._process_async_embedding_cached_response( - final_embedding_cached_response=final_embedding_cached_response, - cached_result=cached_result, - kwargs=kwargs, - logging_obj=logging_obj, - start_time=start_time, - model=model, - ) - return CachingHandlerResponse( - final_embedding_cached_response=final_embedding_cached_response, - embedding_all_elements_cache_hit=embedding_all_elements_cache_hit, - embedding_uncached_input=self.handle_kwargs_input_list_or_str(kwargs), - ) - - verbose_logger.debug("CACHE RESULT: %s", cached_result) - return CachingHandlerResponse( - cached_result=cached_result, - final_embedding_cached_response=final_embedding_cached_response, - ) - # Caching disabled - return None to indicate no caching attempted - return None - - _async_get_cache = async_get_cache + def hit_cache_key(self) -> object: + if litellm.cache is None: + return None + return ( + self.preset_cache_key + or self.request_kwargs.get("cache_key") + or litellm.cache.get_cache_key(**self.request_kwargs) + ) def sync_get_cache( self, @@ -893,14 +936,14 @@ class LLMCachingHandler: _combine_cached_embedding_response_with_api_result = combine_cached_embedding_response_with_api_result - def _async_log_cache_hit_on_callbacks( + def async_log_cache_hit_on_callbacks( self, logging_obj: LiteLLMLoggingObj, cached_result: object, start_time: datetime.datetime, end_time: datetime.datetime, cache_hit: bool, - ): + ) -> None: """ Helper function to log the success of a cached result on callbacks @@ -941,6 +984,8 @@ class LLMCachingHandler: cache_hit=cache_hit, ) + _async_log_cache_hit_on_callbacks = async_log_cache_hit_on_callbacks + async def _retrieve_from_cache( self, call_type: str, kwargs: dict[str, object], args: tuple[object, ...] ) -> object | None: diff --git a/litellm/constants.py b/litellm/constants.py index 5d0eab30b90..966a5b71b8c 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -736,6 +736,12 @@ ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE: Final = get_env_int( # upstream stream immediately, instead of continuing to drain for the real # terminal usage. ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS: Final = get_env_int("ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS", 100) +ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS: Final = get_env_float( + "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 600.0 +) +ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS: Final = get_env_float( + "ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS", 600.0 +) LOGGING_WORKER_CONCURRENCY: Final = get_env_int("LOGGING_WORKER_CONCURRENCY", 100) # Must be above 0 LOGGING_WORKER_MAX_QUEUE_SIZE: Final = get_env_int("LOGGING_WORKER_MAX_QUEUE_SIZE", 50_000) LOGGING_WORKER_MAX_TIME_PER_COROUTINE: Final = get_env_float("LOGGING_WORKER_MAX_TIME_PER_COROUTINE", 20.0) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 233ff48e8a3..a37160b4528 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -64,6 +64,7 @@ from litellm.litellm_core_utils.llm_cost_calc.utils import ( select_cost_metric_for_model, ) from litellm.litellm_core_utils.llm_response_utils.response_metadata import response_ms_since_logging_start +from litellm.litellm_core_utils.redact_messages import should_redact_message_logging from litellm.llms.anthropic.cost_calculation import ( cost_per_token as anthropic_cost_per_token, ) @@ -1665,6 +1666,14 @@ def _response_time_ms_for_cost( return litellm_logging_obj.get_response_ms() +def _model_is_none_error(completion_response_text: str, litellm_logging_obj: LitellmLoggingObject | None) -> ValueError: + message: Final = "Model is None and does not exist in passed completion_response." + model_call_details: Final = {} if litellm_logging_obj is None else litellm_logging_obj.model_call_details + if should_redact_message_logging(model_call_details) or model_call_details.get("query_image") is not None: + return ValueError(message) + return ValueError(f"{message} Passed completion_response={completion_response_text}, model=None") + + def _breakdown_total(litellm_logging_obj: LitellmLoggingObject | None) -> float | None: breakdown: Final = None if litellm_logging_obj is None else litellm_logging_obj.cost_breakdown total: Final[object] = None if breakdown is None else breakdown.get("total_cost") @@ -2013,9 +2022,7 @@ def completion_cost( else: if model is None: - raise ValueError( - f"Model is None and does not exist in passed completion_response. Passed completion_response={completion_response}, model={model}" - ) + raise _model_is_none_error(f"{completion_response}", litellm_logging_obj) if len(messages) > 0: prompt_tokens = token_counter(model=model, messages=messages) elif len(prompt) > 0: @@ -2029,9 +2036,7 @@ def completion_cost( return A2ACostCalculator.calculate_a2a_cost(litellm_logging_obj=litellm_logging_obj) if model is None: - raise ValueError( - f"Model is None and does not exist in passed completion_response. Passed completion_response={completion_response}, model={model}" - ) + raise _model_is_none_error(f"{completion_response}", litellm_logging_obj) if custom_llm_provider is None: try: model, custom_llm_provider, _, _ = litellm.get_llm_provider( @@ -2276,9 +2281,7 @@ def completion_cost( return get_replicate_completion_pricing(completion_response, response_time_ms) if model is None: - raise ValueError( - f"Model is None and does not exist in passed completion_response. Passed completion_response={completion_response}, model={model}" - ) + raise _model_is_none_error(f"{completion_response}", litellm_logging_obj) if custom_llm_provider is not None and custom_llm_provider == "vertex_ai": # Calculate the prompt characters + response characters diff --git a/litellm/integrations/custom_guardrail.py b/litellm/integrations/custom_guardrail.py index ae469a104f8..fafbdb1f95a 100644 --- a/litellm/integrations/custom_guardrail.py +++ b/litellm/integrations/custom_guardrail.py @@ -386,6 +386,10 @@ def _guardrails_listed_in(metadata: object) -> list[str | dict[str, DynamicGuard return metadata.get("guardrails") or [] +class GuardrailSetupError(Exception): + pass + + class CustomGuardrail(CustomLogger): mcp_block_behavior: Literal["tool_result", "raise"] | None = None # If True, during_call runs async_moderation_hook instead of the unified apply_guardrail path. diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/dashboard_all_metrics/grafana_dashboard.json b/litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_all_metrics/grafana_dashboard.json similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/dashboard_all_metrics/grafana_dashboard.json rename to litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_all_metrics/grafana_dashboard.json diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/dashboard_all_metrics/readme.md b/litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_all_metrics/readme.md similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/dashboard_all_metrics/readme.md rename to litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_all_metrics/readme.md diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/dashboard_genai_otel/grafana_dashboard.json b/litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_genai_otel/grafana_dashboard.json similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/dashboard_genai_otel/grafana_dashboard.json rename to litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_genai_otel/grafana_dashboard.json diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/dashboard_genai_otel/readme.md b/litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_genai_otel/readme.md similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/dashboard_genai_otel/readme.md rename to litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_genai_otel/readme.md diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/dashboard_v2/grafana_dashboard.json b/litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_v2/grafana_dashboard.json similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/dashboard_v2/grafana_dashboard.json rename to litellm/integrations/prometheus_helpers/grafana_dashboards/dashboard_v2/grafana_dashboard.json diff --git a/cookbook/litellm_proxy_server/grafana_dashboard/readme.md b/litellm/integrations/prometheus_helpers/grafana_dashboards/readme.md similarity index 100% rename from cookbook/litellm_proxy_server/grafana_dashboard/readme.md rename to litellm/integrations/prometheus_helpers/grafana_dashboards/readme.md diff --git a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py index f40a166e67d..80341cb282d 100644 --- a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py +++ b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py @@ -35,6 +35,7 @@ from litellm.types.vector_stores import ( VectorStoreSearchResponse, VectorStoreSearchResult, ) +from litellm.vector_stores.search_query import store_search_params if TYPE_CHECKING: from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj @@ -327,7 +328,7 @@ class VectorStorePreCallHook(CustomLogger): "query": query, "custom_llm_provider": custom_llm_provider, "metadata": request_metadata, - **litellm_params_for_vector_store, + **store_search_params(litellm_params_for_vector_store), }, ) except Exception as search_error: diff --git a/litellm/litellm_core_utils/core_helpers.py b/litellm/litellm_core_utils/core_helpers.py index 71b20f92cf7..70cb517168c 100644 --- a/litellm/litellm_core_utils/core_helpers.py +++ b/litellm/litellm_core_utils/core_helpers.py @@ -259,19 +259,21 @@ def drop_params_flag(value: object, source: str, logger: logging.Logger) -> bool DROP_PARAMS_ENV_VAR: Final = "LITELLM_DROP_PARAMS" -def drop_params_env_flag(environ: Mapping[str, str], logger: logging.Logger) -> bool: - configured: Final = environ.get(DROP_PARAMS_ENV_VAR, "").strip() +def env_flag(environ: Mapping[str, str], name: str, logger: logging.Logger) -> bool: + configured: Final = environ.get(name, "").strip() if configured == "": return False - normalized: Final = normalize_drop_params(configured) + normalized: Final = lax_bool(configured) if normalized is None: - logger.warning( - "%s=%r is not a flag value, treating it as on. Set it to true or false", DROP_PARAMS_ENV_VAR, configured - ) + logger.warning("%s=%r is not a flag value, treating it as on. Set it to true or false", name, configured) return True return normalized +def drop_params_env_flag(environ: Mapping[str, str], logger: logging.Logger) -> bool: + return env_flag(environ, DROP_PARAMS_ENV_VAR, logger) + + def safe_divide( numerator: float, denominator: float, diff --git a/litellm/litellm_core_utils/health_check_helpers.py b/litellm/litellm_core_utils/health_check_helpers.py index 2c7d00552b4..03a10806f91 100644 --- a/litellm/litellm_core_utils/health_check_helpers.py +++ b/litellm/litellm_core_utils/health_check_helpers.py @@ -9,6 +9,8 @@ from collections.abc import Awaitable, Callable, Mapping from types import MappingProxyType from typing import TYPE_CHECKING, Final, Literal +from pydantic import TypeAdapter + from litellm.llms.base_llm.ocr.transformation import DocumentType from litellm.rust_bridge import runtime from litellm.rust_bridge.ocr.entrypoints import NATIVE_OCR_HEALTH_CHECK_DOCUMENT @@ -190,7 +192,10 @@ class HealthCheckHelpers: from litellm.types.proxy.auth.user_api_key_auth import UserAPIKeyAuth _metadata_variable_name: Final = "litellm_metadata" - litellm_metadata: Final = HealthCheckHelpers._get_metadata_for_health_check_call() + litellm_metadata: Final[Mapping[str, object]] = { + **HealthCheckHelpers._get_metadata_for_health_check_call(), + "model_info": TypeAdapter(dict[str, object]).validate_python(model_params).get("model_info") or {}, + } model_params[_metadata_variable_name] = litellm_metadata model_params = LiteLLMProxyRequestSetup.add_user_api_key_auth_to_request_metadata( data=model_params, diff --git a/litellm/litellm_core_utils/redact_messages.py b/litellm/litellm_core_utils/redact_messages.py index 3760d7f3059..530339f1db2 100644 --- a/litellm/litellm_core_utils/redact_messages.py +++ b/litellm/litellm_core_utils/redact_messages.py @@ -34,6 +34,7 @@ from litellm.llms.vertex_ai.common_utils import ( from litellm.secret_managers.main import str_to_bool from litellm.types.router import BaselineRouteStamp from litellm.types.utils import StandardCallbackDynamicParams +from litellm.types.vector_stores import RETRIEVAL_QUERY_PARAMS if TYPE_CHECKING: from litellm.litellm_core_utils.litellm_logging import ( @@ -86,8 +87,8 @@ def _redacted_entries_for_opted_out_logger(model_call_details: Mapping[str, obje "messages": [{"role": "user", "content": REDACTED_BY_LITELLM}], "prompt": "", "input": "", - **({"instructions": REDACTED_BY_LITELLM} if model_call_details.get("instructions") is not None else {}), - **({"optional_params": _with_redacted_instructions(optional_params)} if optional_params is not None else {}), + **_request_field_redactions(model_call_details), + **({"optional_params": _with_redacted_request_fields(optional_params)} if optional_params is not None else {}), **({"litellm_params": redacted_litellm_params(litellm_params)} if litellm_params is not None else {}), **( {"standard_logging_object": _redact_standard_logging_object(standard_logging_object)} @@ -464,8 +465,24 @@ def _redact_responses_api_output_dict(output_items: Sequence[object], redacted_s return [_redacted_responses_api_output_item(item, redacted_str) for item in output_items] -def _with_redacted_instructions(params: Mapping[str, object]) -> Mapping[str, object]: - return params if params.get("instructions") is None else {**params, "instructions": REDACTED_BY_LITELLM} +_REDACTED_REQUEST_FIELDS: Final = ("instructions", "query_image", *RETRIEVAL_QUERY_PARAMS) +_NESTED_REQUEST_FIELDS: Final = ("extra_body", "additional_args", "complete_input_dict") + + +def _request_field_redactions(params: Mapping[str, object]) -> Mapping[str, object]: + return { + **{field: REDACTED_BY_LITELLM for field in _REDACTED_REQUEST_FIELDS if params.get(field) is not None}, + **{ + field: _with_redacted_request_fields(nested) + for field in _NESTED_REQUEST_FIELDS + if (nested := _as_mapping(params.get(field))) is not None + }, + } + + +def _with_redacted_request_fields(params: Mapping[str, object]) -> Mapping[str, object]: + redactions: Final = _request_field_redactions(params) + return {**params, **redactions} if redactions else params def _redacted_responses_api_response( @@ -478,7 +495,7 @@ def _redacted_responses_api_response( if isinstance(output, list) else output, } - return _with_redacted_instructions(redacted) if redact_instructions else redacted + return _with_redacted_request_fields(redacted) if redact_instructions else redacted def redacted_standard_logging_payload(payload: Mapping[str, object]) -> Mapping[str, object]: @@ -502,7 +519,7 @@ def _redact_standard_logging_object( standard_logging_object["messages"] = [{"role": "user", "content": redacted_str}] model_parameters: Final = _as_mapping(standard_logging_object.get("model_parameters")) if model_parameters is not None and redact_instructions: - standard_logging_object["model_parameters"] = _with_redacted_instructions(model_parameters) + standard_logging_object["model_parameters"] = _with_redacted_request_fields(model_parameters) response: Final = standard_logging_object.get("response") if response is not None: @@ -599,7 +616,7 @@ def redacted_litellm_params(params: Mapping[str, object], *, redact_request_body """ request: Final = _as_mapping(params.get("proxy_server_request")) return { - **(_with_redacted_instructions(params) if redact_request_body else params), + **(_with_redacted_request_fields(params) if redact_request_body else params), **{ key: _redacted_baseline_metadata(value) for key, value in params.items() @@ -613,7 +630,7 @@ def redacted_litellm_params(params: Mapping[str, object], *, redact_request_body } -def perform_redaction(model_call_details: dict, result, redact_streaming_responses: bool = True): +def perform_redaction(model_call_details: dict[str, object], result, redact_streaming_responses: bool = True): """ Performs the actual redaction on the logging object and result. @@ -638,8 +655,8 @@ def perform_redaction(model_call_details: dict, result, redact_streaming_respons if redact_streaming_responses: model_call_details.update( { - **({"instructions": REDACTED_BY_LITELLM} if model_call_details.get("instructions") is not None else {}), - **({"optional_params": _with_redacted_instructions(optional_params)} if optional_params else {}), + **_request_field_redactions(model_call_details), + **({"optional_params": _with_redacted_request_fields(optional_params)} if optional_params else {}), } ) model_call_details.pop(SERVED_OUTPUT_TEXTS_KEY, None) diff --git a/litellm/llms/anthropic/messages/native/handler.py b/litellm/llms/anthropic/messages/native/handler.py index 08c3e0b48a8..16b03a711ac 100644 --- a/litellm/llms/anthropic/messages/native/handler.py +++ b/litellm/llms/anthropic/messages/native/handler.py @@ -467,6 +467,39 @@ def _short_circuit_safeguards_evaluator( return request_safeguards_evaluator(kwargs, messages) +def provider_after_pre_request_hooks( + model: str, custom_llm_provider: str | None, request_kwargs: Mapping[str, object] +) -> str | None: + if custom_llm_provider: + return custom_llm_provider + hook_params: Final = cast( # cast-ok: read as the hooks left it, so a non-mapping raises as Python's handler raises + Mapping[str, object], request_kwargs.get("litellm_params", {}) + ) + derived: Final = cast( # cast-ok: handed on unchecked, as Python's handler does + str | None, hook_params.get("custom_llm_provider") + ) + if derived: + return derived + try: + _, resolved, _, _ = litellm.get_llm_provider(model=model) + except Exception: # noqa: BLE001 # an unknown model keeps the provider the hooks left + return derived + return resolved + + +def tools_marked_for_cache_points( + tools: object, + request_kwargs: dict[str, object], # mutable-ok: pops the points and records the mark in the handler's kwargs +) -> Sequence[object] | None: + marked: Final = tools_marked_for_a_tool_config_point( + tools, request_kwargs.pop("cache_control_injection_points", None) + ) + if marked is None: + return None + AnthropicCacheControlHook.record_gateway_injection(request_kwargs, 1) + return list(marked) + + @client async def anthropic_messages( max_tokens: int, @@ -527,16 +560,7 @@ async def anthropic_messages( tool_choice = request_kwargs.pop("tool_choice", tool_choice) top_k = request_kwargs.pop("top_k", top_k) top_p = request_kwargs.pop("top_p", top_p) - # Propagate the provider derived inside pre-request hooks, if not already set. - # The litellm_params dict may have been overwritten by **kwargs in - # _execute_pre_request_hooks, so fall back to get_llm_provider() if needed. - if not custom_llm_provider: - custom_llm_provider = request_kwargs.get("litellm_params", {}).get("custom_llm_provider") - if not custom_llm_provider: - try: - _, custom_llm_provider, _, _ = litellm.get_llm_provider(model=model) - except Exception: - pass + custom_llm_provider = provider_after_pre_request_hooks(model, custom_llm_provider, request_kwargs) # Remove litellm_params from kwargs (only needed for hooks) request_kwargs.pop("litellm_params", None) # Merge back any other modifications @@ -869,12 +893,8 @@ def anthropic_messages_handler( ) request_kwargs: Final = cast(dict[str, object], kwargs) # cast-ok: **kwargs of the handler is untyped - marked_tools: Final = tools_marked_for_a_tool_config_point( - local_vars.get("tools"), request_kwargs.pop("cache_control_injection_points", None) - ) - if marked_tools is not None: - AnthropicCacheControlHook.record_gateway_injection(request_kwargs, 1) - local_vars.update({**request_kwargs, **({"tools": list(marked_tools)} if marked_tools is not None else {})}) + marked_tools: Final = tools_marked_for_cache_points(local_vars.get("tools"), request_kwargs) + local_vars.update({**request_kwargs, **({"tools": marked_tools} if marked_tools is not None else {})}) anthropic_messages_optional_request_params: Final = ( AnthropicMessagesRequestUtils.get_requested_anthropic_messages_optional_param( params=local_vars, diff --git a/litellm/llms/anthropic/messages/native/streaming_iterator.py b/litellm/llms/anthropic/messages/native/streaming_iterator.py index 5a7633698ec..b166b822b4f 100644 --- a/litellm/llms/anthropic/messages/native/streaming_iterator.py +++ b/litellm/llms/anthropic/messages/native/streaming_iterator.py @@ -1,17 +1,22 @@ import asyncio +import contextlib import json +import math import re from collections.abc import AsyncGenerator, AsyncIterator, Mapping, Sequence from contextvars import ContextVar from datetime import datetime from typing import TYPE_CHECKING, Any, Final, Protocol, runtime_checkable +import anyio import httpx from pydantic import TypeAdapter, ValidationError from typing_extensions import TypedDict from litellm.constants import ( + ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS, ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS, + ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS, ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE, ) from litellm.litellm_core_utils.core_helpers import process_response_headers @@ -43,6 +48,41 @@ _UPSTREAM_PUMP_TASKS: Final[set[asyncio.Task[None]]] = set() # mutable-ok: stdl _DETACHED_STREAM_DRAINS: Final[set[asyncio.Task[None]]] = set() # mutable-ok: bounded strong-ref set, detached drains +class _PumpExited: + pass + + +_PUMP_EXITED: Final = _PumpExited() + + +def _start_detached_drain_deadline(drain_deadline: anyio.CancelScope) -> None: + if drain_deadline.deadline == math.inf: + drain_deadline.deadline = ( # rebind-ok: anyio cancel scopes are armed by setting their deadline + anyio.current_time() + ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS + ) + + +async def _next_relay_item( + queue: "asyncio.Queue[bytes | None | BaseException]", pump_task: "asyncio.Task[None]" +) -> bytes | None | BaseException | _PumpExited: + """The next queued item, or ``_PUMP_EXITED`` once the pump is gone and will never send another.""" + with contextlib.suppress(asyncio.QueueEmpty): + return queue.get_nowait() + if pump_task.done(): + return _PUMP_EXITED + getter: Final = asyncio.ensure_future(queue.get()) + try: + await asyncio.wait(frozenset((getter, pump_task)), return_when=asyncio.FIRST_COMPLETED) + finally: + if not getter.done(): + getter.cancel() + if getter.done() and not getter.cancelled(): + return getter.result() + with contextlib.suppress(asyncio.QueueEmpty): + return queue.get_nowait() + return _PUMP_EXITED + + def is_message_stop_chunk(chunk: object) -> bool: if isinstance(chunk, dict): return chunk.get("type") == "message_stop" @@ -204,7 +244,11 @@ def _try_claim_detached_drain_slot() -> bool: def _exception_left_unconsumed(queue: "asyncio.Queue[bytes | None | BaseException]", exc: BaseException) -> bool: + """Drop ``exc`` from ``queue`` if the client never consumed it, keeping the chunks queued ahead of it.""" remaining: Final = tuple(queue.get_nowait() for _ in range(queue.qsize())) + for item in remaining: + if item is not exc: + queue.put_nowait(item) return any(item is exc for item in remaining) @@ -606,8 +650,12 @@ class BaseAnthropicMessagesStreamingIterator: keeps a single ``collected_chunks`` copy for billing, and the number of such post-disconnect drains running at once is capped so client behavior can't create unbounded worker state; over the cap the pump bills what it - has rather than draining further. Detached-drain lifetime is otherwise - bounded by the upstream stream/read timeout. + has rather than draining further. A drain still reading + ``ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS`` after the + client left, a stalled provider for one, bills what it has and closes the + provider stream too, so it cannot hold its buffered response forever. A + relay whose pump exited without an end-of-stream sentinel ends the stream + with an incomplete-stream error instead of waiting on an empty queue. An upstream failure (Bedrock read / decode / chunk-conversion error) that happens while the client is still connected is forwarded through @@ -622,23 +670,33 @@ class BaseAnthropicMessagesStreamingIterator: maxsize=ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE ) client_detached: Final = asyncio.Event() + drain_deadline: Final = anyio.CancelScope() - pump_task: Final = asyncio.create_task(self._pump_upstream_to_queue(completion_stream, queue, client_detached)) + pump_task: Final = asyncio.create_task( + self._pump_upstream_to_queue(completion_stream, queue, client_detached, drain_deadline) + ) _UPSTREAM_PUMP_TASKS.add(pump_task) pump_task.add_done_callback(_UPSTREAM_PUMP_TASKS.discard) reached_end = False # rebind-ok: flipped once the relay consumes the end-of-stream sentinel + relayed_terminal_event = False # rebind-ok: flipped once a message_stop or error event reaches the client try: while True: - item = await queue.get() + item = await _next_relay_item(queue, pump_task) + if isinstance(item, _PumpExited): + if not relayed_terminal_event: + yield _incomplete_stream_error_sse_event() + break if item is None: reached_end = True break if isinstance(item, BaseException): raise item + relayed_terminal_event = relayed_terminal_event or _is_terminal_stream_chunk(item) yield item finally: client_detached.set() + _start_detached_drain_deadline(drain_deadline) if not reached_end: self._dispatch_pending_deferred_logging() @@ -720,13 +778,18 @@ class BaseAnthropicMessagesStreamingIterator: put_task: Final = asyncio.ensure_future(queue.put(item)) detached_task: Final = asyncio.ensure_future(client_detached.wait()) try: - await asyncio.wait(frozenset((put_task, detached_task)), return_when=asyncio.FIRST_COMPLETED) + await asyncio.wait( + frozenset((put_task, detached_task)), + timeout=ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS, + return_when=asyncio.FIRST_COMPLETED, + ) finally: if not detached_task.done(): detached_task.cancel() if put_task.done() and not put_task.cancelled(): return True put_task.cancel() + client_detached.set() return False async def _pump_upstream_to_queue( @@ -734,6 +797,7 @@ class BaseAnthropicMessagesStreamingIterator: completion_stream: AsyncIterator[bytes | GenericStreamingChunk | ModelResponseStream | Mapping[str, object]], queue: "asyncio.Queue[bytes | None | BaseException]", client_detached: "asyncio.Event", + drain_deadline: anyio.CancelScope, ) -> None: """Drain the whole upstream into ``queue`` (backpressured) and bill once. @@ -750,32 +814,41 @@ class BaseAnthropicMessagesStreamingIterator: collected_chunks: Final[list[bytes]] = [] # mutable-ok: SSE billing buffer appended to across the drain saw_terminal_event = False # rebind-ok: accumulates across the upstream loop draining_detached = False # rebind-ok: set once this pump claims a detached-drain slot + over_drain_cap = False # rebind-ok: set when no detached-drain slot is free try: - async for chunk in completion_stream: - if self.completion_start_time is None: - self.completion_start_time = datetime.now() - saw_terminal_event = saw_terminal_event or _is_terminal_stream_chunk(chunk) - encoded_chunk = self._convert_chunk_to_sse_format(chunk) - collected_chunks.append(encoded_chunk) - if not client_detached.is_set(): - await self._enqueue_for_client(queue, client_detached, encoded_chunk) - continue - if not draining_detached: - if not _try_claim_detached_drain_slot(): - verbose_proxy_logger.warning( - "async_sse_wrapper: detached-drain cap (%d) reached; billing %d partial " - "chunks and aborting the upstream stream to stop provider billing", - ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS, - len(collected_chunks), - ) - await self._bill_collected_chunks(collected_chunks, stream_teardown=True) - await self._abort_upstream(completion_stream) - return - draining_detached = True + with drain_deadline: + async for chunk in completion_stream: + if self.completion_start_time is None: + self.completion_start_time = datetime.now() + saw_terminal_event = saw_terminal_event or _is_terminal_stream_chunk(chunk) + encoded_chunk = self._convert_chunk_to_sse_format(chunk) + collected_chunks.append(encoded_chunk) + if not client_detached.is_set(): + if not await self._enqueue_for_client(queue, client_detached, encoded_chunk): + _start_detached_drain_deadline(drain_deadline) + continue + if not draining_detached: + if not _try_claim_detached_drain_slot(): + over_drain_cap = True + break + draining_detached = True except Exception as exc: # noqa: BLE001 # upstream errors are handled/forwarded by _handle_pump_upstream_error await self._handle_pump_upstream_error(queue, client_detached, collected_chunks, exc) return + if over_drain_cap or drain_deadline.cancelled_caught: + verbose_proxy_logger.warning( + "async_sse_wrapper: %s; billing %d partial chunks and aborting the upstream stream to stop " + "provider billing", + f"detached-drain cap ({ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS}) reached" + if over_drain_cap + else f"detached drain still running {ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS}s " + "after the client left", + len(collected_chunks), + ) + await self._bill_collected_chunks(collected_chunks, stream_teardown=True) + await self._abort_upstream(completion_stream) + return if client_detached.is_set(): await self._bill_collected_chunks(collected_chunks, stream_teardown=True) return @@ -814,7 +887,10 @@ class BaseAnthropicMessagesStreamingIterator: exception=described, ) if not client_detached.is_set() and await self._enqueue_for_client(queue, client_detached, described): - await client_detached.wait() + with contextlib.suppress(asyncio.TimeoutError): + await asyncio.wait_for( + client_detached.wait(), timeout=ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS + ) if not _exception_left_unconsumed(queue, described): return await self._fire_detached_failure_hook(described) diff --git a/litellm/llms/anthropic/messages/native/transformation.py b/litellm/llms/anthropic/messages/native/transformation.py index b0558292271..c2c7244259b 100644 --- a/litellm/llms/anthropic/messages/native/transformation.py +++ b/litellm/llms/anthropic/messages/native/transformation.py @@ -105,7 +105,6 @@ _MESSAGES_ADAPTER: Final = TypeAdapter(list[dict[str, object]]) class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): - _workload_identity_eligible: ClassVar[bool] = True _report_reasoning_drops: ClassVar[bool] = True @property @@ -372,12 +371,7 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): self._apply_env_auth_header( headers, self._require_auth_header( - AnthropicModelInfo.get_auth_header( - api_key, - api_base=api_base, - litellm_params=litellm_params, - allow_workload_identity=self._allows_workload_identity, - ), + AnthropicModelInfo.get_auth_header(api_key, api_base=api_base), model=model, ), ) @@ -412,12 +406,7 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): self._apply_env_auth_header( oauth_headers, self._require_auth_header( - await AnthropicModelInfo.aget_auth_header( - oauth_api_key, - api_base=api_base, - litellm_params=litellm_params, - allow_workload_identity=self._allows_workload_identity, - ), + await AnthropicModelInfo.aget_auth_header(oauth_api_key, api_base=api_base), model=model, ), ) @@ -447,14 +436,6 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): if merged_beta: headers["anthropic-beta"] = merged_beta - @property - def _allows_workload_identity(self) -> bool: - """Subclasses reuse this validate step for their own /v1/messages-compatible providers, so - eligibility is declared per class and never inherited.""" - from litellm.llms.anthropic.common_utils import config_allows_workload_identity - - return config_allows_workload_identity(self) - def finalize_messages_headers( self, headers: dict, # mutable-ok: out-param diff --git a/litellm/llms/azure_ai/image_edit/__init__.py b/litellm/llms/azure_ai/image_edit/__init__.py index fda9335a5d6..1001edd2b9e 100644 --- a/litellm/llms/azure_ai/image_edit/__init__.py +++ b/litellm/llms/azure_ai/image_edit/__init__.py @@ -9,12 +9,14 @@ from litellm.llms.azure_ai.image_generation.mai_transformation import ( from litellm.llms.base_llm.image_edit.transformation import BaseImageEditConfig from .flux2_transformation import AzureFoundryFlux2ImageEditConfig +from .gpt_transformation import AzureFoundryGPTImageEditConfig from .mai_transformation import AzureFoundryMAIImageEditConfig from .transformation import AzureFoundryFluxImageEditConfig __all__ = [ "AzureFoundryFlux2ImageEditConfig", "AzureFoundryFluxImageEditConfig", + "AzureFoundryGPTImageEditConfig", "AzureFoundryMAIImageEditConfig", ] @@ -26,6 +28,7 @@ def get_azure_ai_image_edit_config(model: str) -> BaseImageEditConfig: - MAI models use /mai/v1/images/edits with multipart form data - FLUX 2 models use JSON with base64 image - FLUX 1 models use multipart/form-data + - Every other deployment, gpt-image or custom-named, uses /openai/deployments/{deployment}/images/edits """ if AzureFoundryMAIImageGenerationConfig.is_mai_model(model): return AzureFoundryMAIImageEditConfig() @@ -39,4 +42,4 @@ def get_azure_ai_image_edit_config(model: str) -> BaseImageEditConfig: if model_normalized == "" or "flux" in model_normalized: return AzureFoundryFluxImageEditConfig() - raise ValueError(f"Model {model} is not supported for Azure AI image editing.") + return AzureFoundryGPTImageEditConfig() diff --git a/litellm/llms/azure_ai/image_edit/gpt_transformation.py b/litellm/llms/azure_ai/image_edit/gpt_transformation.py new file mode 100644 index 00000000000..2fd120e2a56 --- /dev/null +++ b/litellm/llms/azure_ai/image_edit/gpt_transformation.py @@ -0,0 +1,65 @@ +from collections.abc import Mapping +from typing import Final + +import litellm +from litellm.llms.azure.image_edit.transformation import AzureImageEditConfig +from litellm.llms.azure_ai.common_utils import ( + AzureFoundryModelInfo, + get_azure_ai_auth_headers, +) +from litellm.secret_managers.main import get_secret_str +from litellm.types.router import GenericLiteLLMParams + +AZURE_AI_GPT_IMAGE_EDIT_DEFAULT_API_VERSION: Final = "2025-04-01-preview" + + +class AzureFoundryGPTImageEditConfig(AzureImageEditConfig): + """ + Azure AI Foundry gpt-image edit config. + + Foundry serves gpt-image deployments on the same + ``/openai/deployments/{deployment}/images/edits`` route as Azure OpenAI, so the + request and URL handling is shared with ``AzureImageEditConfig``. Only the + credential source and the default api-version are Foundry-specific. + """ + + def validate_environment( + self, + headers: Mapping[str, str], + model: str, + api_key: str | None = None, + litellm_params: Mapping[str, object] | None = None, + api_base: str | None = None, + ) -> dict[str, str]: # mutable-ok: llm_http_handler adds extra_headers to the returned dict in place + params: Final = GenericLiteLLMParams(**(litellm_params or {})) + return { + **headers, + **get_azure_ai_auth_headers( + api_key=AzureFoundryModelInfo.get_api_key(params.api_key or api_key), + litellm_params=litellm_params, + api_key_header="api-key", + ), + } + + def get_complete_url( + self, + model: str, + api_base: str | None, + litellm_params: Mapping[str, object], + ) -> str: + foundry_api_base: Final = AzureFoundryModelInfo.get_api_base(api_base) + if foundry_api_base is None: + raise ValueError( + "Azure AI API base is required. Set AZURE_AI_API_BASE environment variable or pass api_base parameter." + ) + api_version: Final = ( + litellm_params.get("api_version") + or get_secret_str("AZURE_AI_API_VERSION") + or litellm.api_version + or AZURE_AI_GPT_IMAGE_EDIT_DEFAULT_API_VERSION + ) + return super().get_complete_url( # pyright: ignore[reportUnknownMemberType] # bare dict in base + model=model, + api_base=foundry_api_base, + litellm_params={**litellm_params, "api_version": api_version}, + ) diff --git a/litellm/llms/bedrock/vector_stores/transformation.py b/litellm/llms/bedrock/vector_stores/transformation.py index afcbe61cd75..b4cac70fee2 100644 --- a/litellm/llms/bedrock/vector_stores/transformation.py +++ b/litellm/llms/bedrock/vector_stores/transformation.py @@ -1,20 +1,25 @@ +import re from collections.abc import Mapping from copy import deepcopy +from itertools import product +from types import MappingProxyType from typing import TYPE_CHECKING, Any, Final, Protocol, cast, runtime_checkable from urllib.parse import urlparse import httpx from pydantic import TypeAdapter -from typing_extensions import TypedDict +from typing_extensions import ReadOnly, TypedDict from litellm._logging import verbose_logger -from litellm.litellm_core_utils.core_helpers import decoded_json_object, keyword_arguments +from litellm.exceptions import BadRequestError +from litellm.litellm_core_utils.core_helpers import decoded_json_object, drops_unsupported_params, keyword_arguments from litellm.litellm_core_utils.url_utils import encode_url_path_segment, join_api_base from litellm.llms.base_llm.vector_store.transformation import BaseVectorStoreConfig from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM from litellm.llms.bedrock.common_utils import BedrockError from litellm.types.integrations.rag.bedrock_knowledgebase import ( BedrockKBContent, + BedrockKBImageFormat, BedrockKBResponse, BedrockKBRetrievalConfiguration, BedrockKBRetrievalQuery, @@ -22,11 +27,14 @@ from litellm.types.integrations.rag.bedrock_knowledgebase import ( ) from litellm.types.router import GenericLiteLLMParams from litellm.types.vector_stores import ( + RETRIEVAL_QUERY_PARAMS, VECTOR_STORE_OPENAI_PARAMS, BaseVectorStoreAuthCredentials, VectorStoreIndexEndpoints, VectorStoreResultContent, + VectorStoreSearchImageMediaType, VectorStoreSearchOptionalRequestParams, + VectorStoreSearchQueryImage, VectorStoreSearchResponse, VectorStoreSearchResult, ) @@ -70,6 +78,64 @@ class _KBResponseFields(TypedDict, total=False, extra_items=object): pass +_BEDROCK_IMAGE_FORMATS: Final[Mapping[VectorStoreSearchImageMediaType, BedrockKBImageFormat]] = MappingProxyType( + {"image/jpeg": "jpeg", "image/png": "png", "image/gif": "gif", "image/webp": "webp"} +) +_BASE64_DATA_URI: Final = re.compile(r"data:(?P[^;,]*)[^,]*;base64,(?P.*)", re.DOTALL) +_SOURCE_FILE_MIME_TYPE_KEY: Final = "x-amz-bedrock-kb-source-file-mime-type" +_UNKNOWN_MEDIA_TYPE: Final = "application/octet-stream" +_RETRIEVAL_QUERY_UNSUPPORTED: Final = ( + "bedrock vector stores do not take retrievalQuery. Send query, or query_image to search by image. To drop it, " + "set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n" +) + + +class _QueryImageParams(TypedDict, total=False): + query_image: ReadOnly[VectorStoreSearchQueryImage | None] + + +def _retrieval_query(query: str, params: _QueryImageParams) -> BedrockKBRetrievalQuery: + query_image: Final = params.get("query_image") + if query_image is None: + return BedrockKBRetrievalQuery(text=query) + return BedrockKBRetrievalQuery( + type="IMAGE", + image={"format": _BEDROCK_IMAGE_FORMATS[query_image["media_type"]], "inlineContent": query_image["data"]}, + ) + + +def _image_content(byte_content: str, metadata: Mapping[str, object]) -> VectorStoreResultContent: + data_uri: Final = _BASE64_DATA_URI.fullmatch(byte_content) + declared_media_type: Final = data_uri.group("media_type") if data_uri is not None else "" + source_file_media_type: Final = metadata.get(_SOURCE_FILE_MIME_TYPE_KEY) + return VectorStoreResultContent( + type="image", + source={ + "type": "base64", + "media_type": ( + source_file_media_type + if isinstance(source_file_media_type, str) and source_file_media_type.startswith("image/") + else declared_media_type or _UNKNOWN_MEDIA_TYPE + ), + "data": data_uri.group("data") if data_uri is not None else byte_content, + }, + ) + + +def _result_content( + content: BedrockKBContent | None, metadata: Mapping[str, object], include_images: bool +) -> VectorStoreResultContent | None: + if content is None: + return None + text: Final = content.get("text") + if text is not None: + return VectorStoreResultContent(text=text, type="text") + byte_content: Final = content.get("byteContent") + if not include_images or content.get("type") != "IMAGE" or not byte_content: + return None + return _image_content(byte_content, metadata) + + class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): """Vector store configuration for AWS Bedrock Knowledge Bases.""" @@ -95,7 +161,7 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): } def get_supported_openai_params(self, model: str) -> list[VECTOR_STORE_OPENAI_PARAMS]: - return ["filters", "max_num_results", "ranking_options"] + return ["filters", "max_num_results", "ranking_options", "query_image"] def _map_operator_to_aws(self, operator: str) -> str: """ @@ -250,8 +316,14 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): encoded_vector_store_id: Final = encode_url_path_segment(vector_store_id, field_name="vector_store_id") url: Final = join_api_base(api_base, f"{encoded_vector_store_id}/retrieve") + caller_params: Final = decoded_json_object(litellm_params) + caller_sources: Final = self._caller_sources(extra_body=extra_body, litellm_params=caller_params) + if self._caller_value(caller_sources, RETRIEVAL_QUERY_PARAMS) is not None and not drops_unsupported_params( + caller_params.get("drop_params") + ): + raise BadRequestError(message=_RETRIEVAL_QUERY_UNSUPPORTED, model="", llm_provider="bedrock") request_body: Final[dict[str, object]] = { - "retrievalQuery": BedrockKBRetrievalQuery(text=query), + "retrievalQuery": _retrieval_query(query, vector_store_search_optional_params), } retrieval_config: Final[object] = ( @@ -283,7 +355,7 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): ] = filters if retrieval_config: request_body["retrievalConfiguration"] = cast(BedrockKBRetrievalConfiguration, retrieval_config) - user_context: Final = self._user_context(extra_body=extra_body, litellm_params=litellm_params) + user_context: Final = self._user_context(caller_sources) if user_context is not None: request_body["userContext"] = user_context @@ -291,19 +363,18 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): return url, request_body @staticmethod - def _user_context( + def _caller_sources( extra_body: Mapping[str, object] | None, litellm_params: Mapping[str, object] - ) -> BedrockKBUserContext | None: - sources: Final = tuple(source for source in (extra_body, litellm_params) if isinstance(source, Mapping)) - found: Final = next( - ( - source[key] - for source in sources - for key in ("userContext", "user_context") - if source.get(key) is not None - ), - None, - ) + ) -> tuple[Mapping[str, object], ...]: + return tuple(source for source in (extra_body, litellm_params) if isinstance(source, Mapping)) + + @staticmethod + def _caller_value(sources: tuple[Mapping[str, object], ...], keys: tuple[str, ...]) -> object: + return next((source[key] for source, key in product(sources, keys) if source.get(key) is not None), None) + + @staticmethod + def _user_context(sources: tuple[Mapping[str, object], ...]) -> BedrockKBUserContext | None: + found: Final = BedrockVectorStoreConfig._caller_value(sources, ("userContext", "user_context")) return None if found is None else cast(BedrockKBUserContext, found) def sign_request( @@ -375,15 +446,14 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): **keyword_arguments(_DECODED_JSON.validate_python(response.json()), BedrockKBResponse) ) ) + include_images: Final = litellm_logging_obj.model_call_details.get("query_image") is not None results: Final[list[VectorStoreSearchResult]] = [] for item in response_data.get("retrievalResults", []) or []: - content: BedrockKBContent | None = item.get("content") - text = content.get("text") if content else None - if text is None: + metadata = item.get("metadata", {}) or {} + result_content = _result_content(item.get("content"), metadata, include_images) + if result_content is None: continue - # Extract metadata and use helper functions - metadata = item.get("metadata", {}) or {} file_id = self._get_file_id_from_metadata(metadata) filename = self._get_filename_from_metadata(metadata) attributes = self._get_attributes_from_metadata(metadata) @@ -391,7 +461,7 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM): results.append( VectorStoreSearchResult( score=item.get("score"), - content=[VectorStoreResultContent(text=text, type="text")], + content=[result_content], file_id=file_id, filename=filename, attributes=attributes, diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index a5b15a24a7f..b290a7abf3d 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -345,6 +345,10 @@ def _set_ciphers( ) +def rsa_key_exchange_and_chacha20_excluded() -> bool: + return _rsa_key_exchange_and_chacha20_excluded.is_set() + + def exclude_rsa_key_exchange_and_chacha20(excluded: bool) -> None: """ Turn RSA key exchange and TLS 1.2 ChaCha20 off or back on for new SSL contexts and every cached one, which clients diff --git a/litellm/llms/custom_httpx/llm_http_handler.py b/litellm/llms/custom_httpx/llm_http_handler.py index f65c4205944..68b13c6172f 100644 --- a/litellm/llms/custom_httpx/llm_http_handler.py +++ b/litellm/llms/custom_httpx/llm_http_handler.py @@ -41,7 +41,6 @@ from litellm._internal_context import internal_sub_call from litellm._logging import redact_string, verbose_logger from litellm.anthropic_beta_headers_manager import ( aload_beta_headers_config, - resolve_beta_provider, update_headers_with_filtered_beta, ) from litellm.constants import MAX_FILE_LIST_LIMIT, REALTIME_WEBSOCKET_MAX_MESSAGE_SIZE_BYTES @@ -82,7 +81,7 @@ from litellm.litellm_core_utils.realtime_errors import ( ) from litellm.litellm_core_utils.realtime_streaming import RealTimeStreaming from litellm.litellm_core_utils.url_utils import encode_url_path_segment, join_api_base -from litellm.llms.anthropic.common_utils import AnthropicModelInfo, merge_anthropic_beta_headers +from litellm.llms.anthropic.common_utils import merge_anthropic_beta_headers from litellm.llms.base_llm.anthropic_messages.transformation import ( BaseAnthropicMessagesConfig, ) @@ -2633,17 +2632,10 @@ class BaseLLMHTTPHandler: litellm_params.get("additional_drop_params") or (), anthropic_messages_optional_request_params, ) - affinity_api_base: Final = ( - AnthropicModelInfo.get_api_base(api_base) if custom_llm_provider == "anthropic" else api_base - ) - takes_another_beta_row: Final = ( - resolve_beta_provider(custom_llm_provider, affinity_api_base) != custom_llm_provider - ) - provider_filters_betas: Final = anthropic_messages_provider_config.should_filter_anthropic_beta_headers() - filters_beta_headers: Final = provider_filters_betas or takes_another_beta_row + filters_beta_headers: Final = anthropic_messages_provider_config.should_filter_anthropic_beta_headers() if request_params.get("safeguards") is not None and filters_beta_headers: await aload_beta_headers_config() - default_affinity_header: Final = get_provider_affinity_header(affinity_api_base) + default_affinity_header: Final = get_provider_affinity_header(api_base) ( headers, api_base, @@ -2666,8 +2658,6 @@ class BaseLLMHTTPHandler: headers = update_headers_with_filtered_beta( headers=headers, provider=custom_llm_provider, - api_base=affinity_api_base, - unlisted="drop" if provider_filters_betas else "forward", keep=anthropic_messages_provider_config.model_specific_anthropic_betas(model, litellm_params), ) diff --git a/litellm/llms/dashscope/messages/transformation.py b/litellm/llms/dashscope/messages/transformation.py index 9d0d1db91c8..81f93a32166 100644 --- a/litellm/llms/dashscope/messages/transformation.py +++ b/litellm/llms/dashscope/messages/transformation.py @@ -2,7 +2,7 @@ DashScope Anthropic-compatible Messages transformation config. """ -from typing import ClassVar, Final +from typing import Final import litellm from litellm.exceptions import AuthenticationError @@ -25,8 +25,6 @@ class DashScopeAnthropicMessagesConfig(AnthropicMessagesConfig): ``dashscope.aliyuncs.com`` and ``{workspace}.{region}.maas.aliyuncs.com``. """ - _workload_identity_eligible: ClassVar[bool] = False - @property def custom_llm_provider(self) -> str | None: return "dashscope" diff --git a/litellm/llms/oci/common_utils.py b/litellm/llms/oci/common_utils.py index fe8d0e1c1e7..a545fc26481 100644 --- a/litellm/llms/oci/common_utils.py +++ b/litellm/llms/oci/common_utils.py @@ -97,15 +97,11 @@ class OCIRequestWrapper: def sha256_base64(data: bytes) -> str: - # SHA-256 is used here to compute the x-content-sha256 header required by the - # OCI HTTP signing specification (RSA-SHA256 request signing), not for password - # or secret hashing. This is the correct and mandated algorithm for this purpose. + # Computes the x-content-sha256 header required by the OCI HTTP signing + # specification. The RSA-SHA256 request signature covers this header, so the + # digest is a security use of the hash. # See: https://docs.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm - # - # ``usedforsecurity=False`` declares non-security intent to static analyzers - # (CodeQL ``py/weak-sensitive-data-hashing``) — without it the request body - # gets flagged as "password-like data" via taint tracking. - digest: Final = hashlib.sha256(data, usedforsecurity=False).digest() # noqa: S324 + digest: Final = hashlib.sha256(data).digest() return base64.b64encode(digest).decode() diff --git a/litellm/main.py b/litellm/main.py index 239a85cef4c..e4110455e24 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -9512,6 +9512,7 @@ async def ahealth_check( from litellm.litellm_core_utils.cached_imports import get_litellm_logging_class from litellm.litellm_core_utils.health_check_helpers import HealthCheckHelpers, default_health_check_mode from litellm.litellm_core_utils.health_check_utils import OPTIONAL_STR + from litellm.types.utils import LIST_BATCHES_SUPPORTED_PROVIDERS # Use cached import helper to lazy-load Logging class (only loads when function is called) Logging: Final = get_litellm_logging_class() @@ -9556,6 +9557,24 @@ async def ahealth_check( mode = mode or default_health_check_mode( requested_model=requested_model, model=model, custom_llm_provider=custom_llm_provider ) + litellm_logging_obj.model = requested_model + litellm_logging_obj.call_type = { + "completion": "atext_completion", + "embedding": "aembedding", + "audio_speech": "aspeech", + "audio_transcription": "atranscription", + "image_generation": "aimage_generation", + "image_edit": "aimage_edit", + "video_generation": "avideo_generation", + "rerank": "arerank", + "realtime": "arealtime", + "responses": "aresponses", + "anthropic_messages": "anthropic_messages", + "ocr": "aocr", + "decisions": "asystemone", + "extraction": "aextraction", + "batch": ("alist_batches" if custom_llm_provider in LIST_BATCHES_SUPPORTED_PROVIDERS else "acompletion"), + }.get("decisions" if is_decisions_model_mode(mode) else mode, "acompletion") if "*" in model: return await HealthCheckHelpers.ahealth_check_wildcard_models( model=model, diff --git a/litellm/messages/dispatch.py b/litellm/messages/dispatch.py index faa604a25ce..b974e677386 100644 --- a/litellm/messages/dispatch.py +++ b/litellm/messages/dispatch.py @@ -3,14 +3,14 @@ from collections.abc import AsyncIterator, Awaitable, Callable, Coroutine, Itera from types import MappingProxyType from typing import Final, TypeAlias, cast # noqa: TID251 # native binding selects a sync result or an async awaitable -from litellm.exceptions import BadRequestError +from litellm.exceptions import BadRequestError, UnsupportedParamsError from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider from litellm.llms.anthropic.messages.native import handler as main from litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler -from litellm.rust_bridge import detectors +from litellm.rust_bridge import catalog, detectors from litellm.rust_bridge.catalog import Feature, Route, RouteContext, Target +from litellm.rust_bridge.configuration import Rollout from litellm.rust_bridge.dispatch import PublicDispatch -from litellm.rust_bridge.messages import detectors as route_detectors from litellm.rust_bridge.messages.entrypoints import ( NATIVE_AMESSAGES, NATIVE_MESSAGES, @@ -22,7 +22,6 @@ from litellm.rust_bridge.public_call import ( native_acall_hook, native_call, native_call_hook, - optional_sequence, optional_str, signature, ) @@ -66,7 +65,7 @@ def _native_kwargs(fields: Mapping[str, object], kwargs: Mapping[str, object]) - request_timeout=kwargs.get("request_timeout"), stream_timeout=kwargs.get("stream_timeout"), ), - stream=fields.get("stream") is True, + stream=bool(fields.get("stream")), custom_llm_provider=provider or "", ) if timeout is None: @@ -81,9 +80,7 @@ def _public_request( if fields is None: return None model: Final = fields.get("model") - messages: Final = optional_sequence(fields.get("messages")) - max_tokens: Final = fields.get("max_tokens") - if not isinstance(model, str) or messages is None or not isinstance(max_tokens, int): + if not isinstance(model, str): return None return native_call(legacy, args, _native_kwargs(fields, kwargs)) @@ -133,30 +130,20 @@ def messages_target(model: str, custom_llm_provider: str | None, model_info: obj return _route_target(model, resolved_model, resolved_provider, model_info, api_base, compacting=False) -_FEATURES: Final[detectors.Detectors] = MappingProxyType( +_NATIVE_COMMON_FEATURES: Final = frozenset( { - **{feature: detect for feature, detect in detectors.COMMON.items() if feature is not Feature.TIMEOUT_VARIANTS}, - Feature.PROVIDER_AFFINITY: route_detectors.provider_affinity, - Feature.SAFEGUARDS_CLASSIFIER: route_detectors.safeguards_classifier, - Feature.RESPONSE_CACHE: detectors.response_cache, - Feature.MODIFY_PARAMS: detectors.modify_params, - Feature.WORKLOAD_IDENTITY: route_detectors.anthropic_workload_identity, - Feature.CACHE_CONTROL_INJECTION: detectors.cache_control_injection, - Feature.STREAM_COST_INJECTION: route_detectors.stream_cost_injection, - Feature.THINKING_SIGNATURE_RETRY: route_detectors.thinking_signature_retry, - Feature.TOOL_CUSTOM_FIELD: route_detectors.tool_custom_field, + Feature.TIMEOUT_VARIANTS, + Feature.LATEST_ALIAS, + Feature.MOCK_RESPONSE, + Feature.CALLER_CLIENT, + Feature.TLS_POLICY, + Feature.AGENTIC_LOOP_HOOK, + Feature.PROXY_MCP_TOOLS, } ) -_ASYNC_FEATURES: Final[detectors.Detectors] = MappingProxyType( - { - **_FEATURES, - Feature.PRE_REQUEST_HOOK: route_detectors.pre_request_hook, - Feature.FOUNDRY_BETA_ROW: route_detectors.foundry_beta_row, - Feature.WEBSEARCH_INTERCEPTION: route_detectors.websearch_interception, - Feature.MESSAGES_INTERCEPTOR: route_detectors.intercepted, - Feature.STRICT_TOOLS_RETRY: route_detectors.strict_tools_retry, - } +_FEATURES: Final[detectors.Detectors] = MappingProxyType( + {feature: detect for feature, detect in detectors.COMMON.items() if feature not in _NATIVE_COMMON_FEATURES} ) @@ -181,32 +168,87 @@ _DISPATCH: Final = PublicDispatch( _ADISPATCH: Final = PublicDispatch( route=Route.MESSAGES, request=lambda args, kwargs: _public_request(_AMESSAGES, args, kwargs), - context=lambda request: _context(request, _ASYNC_FEATURES), + context=lambda request: _context(request, _FEATURES), ) +def _unsupported_features(features: detectors.Detectors, request: NativeCall) -> tuple[str, ...]: + try: + return tuple(sorted(feature.value for feature in detectors.detected(features, request))) + except Exception: # noqa: BLE001 # a failing detector names nothing, and the call is refused all the same + return () + + +def _checked_target(request: NativeCall, model: str, provider: str | None) -> Target | None: + try: + return _target(request, model, provider) + except Exception: # noqa: BLE001 # the provider alone still decides whether the call has a Python path + return None + + +def _rust_only_refusal( + legacy: inspect.Signature, features: detectors.Detectors, args: tuple[object, ...], kwargs: Mapping[str, object] +) -> UnsupportedParamsError | None: + if bind(legacy, args, kwargs) is None: + return None + request: Final = native_call(legacy, args, kwargs) + requested_model: Final = request.resolved.get("model") + if not isinstance(requested_model, str): + return None + model, provider = _resolved(request) + context: Final = RouteContext( + Route.MESSAGES, provider=provider, model=requested_model, target=_checked_target(request, model, provider) + ) + if catalog.rollout(context) is not Rollout.RUST_REQUIRED: + return None + unsupported: Final = _unsupported_features(features, request) + return UnsupportedParamsError( + message=( + f"provider {provider} on /v1/messages runs only on the Rust path, which does not support " + f"{', '.join(unsupported) if unsupported else 'this call'}" + ), + llm_provider=provider, + model=requested_model, + ) + + +def _python_messages_handler( + *args: object, + **kwargs: object, # kwargs-ok: forwards the public call shape +) -> MessagesResult | Coroutine[object, object, MessagesResult]: + refusal: Final = _rust_only_refusal(_MESSAGES, _FEATURES, args, kwargs) + if refusal is not None: + raise refusal + return _PYTHON_MESSAGES(*args, **kwargs) + + +async def _python_anthropic_messages(*args: object, **kwargs: object) -> MessagesResult: # kwargs-ok: public call shape + refusal: Final = _rust_only_refusal(_AMESSAGES, _FEATURES, args, kwargs) + if refusal is not None: + raise refusal + return await _PYTHON_AMESSAGES(*args, **kwargs) + + def anthropic_messages_handler( *args: object, **kwargs: object, # kwargs-ok: preserve the public Anthropic Messages call shape ) -> MessagesResult | Coroutine[object, object, MessagesResult]: - python: Final = _PYTHON_MESSAGES if _FLAG.requested(kwargs): return anthropic_messages(**_FLAG.keywords(args, kwargs)) return _DISPATCH.run( args, _FLAG.dropped(kwargs), - python=python, + python=_python_messages_handler, binding=NATIVE_MESSAGES, native=native_call_hook, ) async def anthropic_messages(*args: object, **kwargs: object) -> MessagesResult: # kwargs-ok: public call shape - python: Final = _PYTHON_AMESSAGES return await _ADISPATCH.arun( args, _FLAG.dropped(kwargs), - python=python, + python=_python_anthropic_messages, binding=NATIVE_AMESSAGES, native=native_acall_hook, ) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index b6eec1c9574..1472d10c12e 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -28593,6 +28593,7 @@ "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash": { "cache_read_input_token_cost": 2.8e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.4e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -28600,6 +28601,7 @@ "mode": "chat", "output_cost_per_token": 2.8e-07, "source": "https://docs.fireworks.ai/serverless/pricing", + "successor_model": "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_reasoning": true, "supports_response_schema": true, @@ -29065,6 +29067,7 @@ "fireworks_ai/deepseek-v4-flash": { "cache_read_input_token_cost": 2.8e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.4e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -29072,6 +29075,7 @@ "mode": "chat", "output_cost_per_token": 2.8e-07, "source": "https://docs.fireworks.ai/serverless/pricing", + "successor_model": "fireworks_ai/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_reasoning": true, "supports_response_schema": true, @@ -83589,6 +83593,7 @@ "fireworks_ai/accounts/fireworks/routers/spot-deepseek-v4-flash": { "cache_read_input_token_cost": 2.1e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.05e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -83596,6 +83601,7 @@ "mode": "chat", "output_cost_per_token": 2.1e-07, "source": "https://api.fireworks.ai/v1/serverless/models", + "successor_model": "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, @@ -99949,17 +99955,20 @@ ] }, "databricks/databricks-claude-fable-5-2": { - "cache_creation_input_token_cost": 8e-06, - "cache_read_input_token_cost": 8e-06, - "input_cost_per_token": 8e-06, + "cache_creation_input_token_cost": 9.99999e-06, + "cache_creation_input_token_cost_above_1hr": 1.599997e-05, + "cache_read_input_token_cost": 1.9999e-07, + "input_cost_per_token": 8.00002e-06, + "input_dbu_cost_per_token": 0.000114286, "litellm_provider": "databricks", "max_input_tokens": 1000000, "max_output_tokens": 128000, - "metadata": {"notes":"Claude Fable 5.2 on Databricks is available only through Unity Gateway with the model service name system.ai.claude-fable-5-2, and Databricks hosts it through Amazon Bedrock. The Databricks pricing page lists no row for it yet, so input and output are inherited from the catalog Bedrock row anthropic.claude-fable-5-2, no '*_dbu_cost_per_token' fields are published, and cache tokens bill at the input rate until Databricks publishes cache DBU rates."}, + "metadata": {"notes":"Costs per token are the published Global DBU rates times $0.070 per DBU. The '*_dbu_cost_per_token' fields are provided for reference; cost calculation reads the dollar '*_cost_per_token' fields."}, "mode": "chat", - "output_cost_per_token": 4e-05, + "output_cost_per_token": 4.000003e-05, + "output_dbu_cost_per_token": 0.000571429, "prompt_cache_min_tokens": 512.0, - "source": "https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/supported-models", + "source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving", "supports_adaptive_thinking": true, "supports_anthropic_thinking_payload": true, "supports_assistant_prefill": false, @@ -99974,17 +99983,20 @@ "thinking_always_on": true }, "databricks/system.ai.claude-fable-5-2": { - "cache_creation_input_token_cost": 8e-06, - "cache_read_input_token_cost": 8e-06, - "input_cost_per_token": 8e-06, + "cache_creation_input_token_cost": 9.99999e-06, + "cache_creation_input_token_cost_above_1hr": 1.599997e-05, + "cache_read_input_token_cost": 1.9999e-07, + "input_cost_per_token": 8.00002e-06, + "input_dbu_cost_per_token": 0.000114286, "litellm_provider": "databricks", "max_input_tokens": 1000000, "max_output_tokens": 128000, - "metadata": {"notes":"Claude Fable 5.2 on Databricks is available only through Unity Gateway with the model service name system.ai.claude-fable-5-2, and Databricks hosts it through Amazon Bedrock. The Databricks pricing page lists no row for it yet, so input and output are inherited from the catalog Bedrock row anthropic.claude-fable-5-2, no '*_dbu_cost_per_token' fields are published, and cache tokens bill at the input rate until Databricks publishes cache DBU rates."}, + "metadata": {"notes":"Claude Fable 5.2 on Databricks is served through Unity Gateway with the model service name system.ai.claude-fable-5-2, hosted through Amazon Bedrock. Costs per token are the published Global DBU rates times $0.070 per DBU. The '*_dbu_cost_per_token' fields are provided for reference; cost calculation reads the dollar '*_cost_per_token' fields."}, "mode": "chat", - "output_cost_per_token": 4e-05, + "output_cost_per_token": 4.000003e-05, + "output_dbu_cost_per_token": 0.000571429, "prompt_cache_min_tokens": 512.0, - "source": "https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/supported-models", + "source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving", "supports_adaptive_thinking": true, "supports_anthropic_thinking_payload": true, "supports_assistant_prefill": false, diff --git a/litellm/models/fallback.py b/litellm/models/fallback.py new file mode 100644 index 00000000000..b8532a7f3cb --- /dev/null +++ b/litellm/models/fallback.py @@ -0,0 +1,25 @@ +from collections.abc import Callable, Sequence +from dataclasses import dataclass +from typing import Annotated, Final, Protocol, TypeAlias + +from pydantic import Field, JsonValue, TypeAdapter + +FallbackRule = dict[str, list[str]] +StoredFallback = Annotated[FallbackRule | dict[str, object] | str, Field(union_mode="left_to_right")] +STORED_FALLBACKS: Final = TypeAdapter(list[StoredFallback]) +SavedFallbackRule: TypeAlias = JsonValue + + +@dataclass(frozen=True, slots=True) +class FallbackRulesEdit: + rules: Sequence[StoredFallback] + replaced: bool + + +FallbackRulesEditor: TypeAlias = Callable[[Sequence[StoredFallback]], FallbackRulesEdit] + + +class RouterFallbackStore(Protocol): + async def saved_rules(self, fallback_key: str) -> Sequence[SavedFallbackRule] | None: ... + + async def edit_rules(self, fallback_key: str, edit: FallbackRulesEditor) -> FallbackRulesEdit: ... diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index db4faa6d9f3..0c348255071 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -211,6 +211,7 @@ class LitellmTableNames(str, enum.Enum): SSO_CONFIG_TABLE_NAME = "LiteLLM_SSOConfig" UI_SETTINGS_TABLE_NAME = "LiteLLM_UISettings" AGENT_TABLE_NAME = "LiteLLM_AgentsTable" + GUARDRAILS_TABLE_NAME = "LiteLLM_GuardrailsTable" from litellm.types.integrations.slack_alerting import ( diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index fa331b37950..c7b698b7f18 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -1081,6 +1081,15 @@ BUDGET_ENFORCED_SIDE_EFFECT_ROUTES: Final = frozenset( } ) +VIDEO_RETRIEVAL_ROUTES: Final = frozenset( + { + "/videos/{video_id}", + "/v1/videos/{video_id}", + "/videos/{video_id}/content", + "/v1/videos/{video_id}/content", + } +) + MCP_DISCOVERY_ROUTES: Final = frozenset({"/mcp-rest/tools/list", "/v1/mcp/tools"}) MCP_ZERO_SPEND_JSONRPC_METHODS: Final = frozenset({"initialize", "notifications/initialized", "ping", "tools/list"}) @@ -1097,6 +1106,10 @@ def is_mcp_discovery_request(route: str, request_body: Mapping[str, object]) -> return isinstance(method, str) and method in MCP_ZERO_SPEND_JSONRPC_METHODS +def is_video_retrieval_request(route: str, http_method: str | None) -> bool: + return http_method == "GET" and RouteChecks.check_route_access(route=route, allowed_routes=VIDEO_RETRIEVAL_ROUTES) + + class ModelMaxBudgetHolder(Protocol): @property def model_max_budget(self) -> Mapping[str, object] | None: ... @@ -1126,8 +1139,9 @@ def request_skips_budget_checks( llm_router: Router | None, *, request_body: Mapping[str, object] | None = None, + http_method: str | None = None, ) -> bool: - if route_skips_budget_checks(route=route): + if route_skips_budget_checks(route=route) or is_video_retrieval_request(route=route, http_method=http_method): return True if request_body is not None and is_mcp_discovery_request(route=route, request_body=request_body): return True @@ -1189,6 +1203,7 @@ async def common_checks( model=_model, llm_router=llm_router, request_body=_typed_request_body(request_body), + http_method=RouteChecks.get_request_method(request), ) ) diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py index c388caf9620..37dba77ffde 100644 --- a/litellm/proxy/auth/auth_utils.py +++ b/litellm/proxy/auth/auth_utils.py @@ -23,6 +23,10 @@ from litellm.constants import ( MINIMUM_CUSTOM_KEY_LENGTH, STANDARD_CUSTOMER_ID_HEADERS, ) +from litellm.litellm_core_utils.clientside_credential_handler import ( + _ADMIN_CONFIG_FIELDS_TO_CLEAR_ON_BASE_OVERRIDE, # pyright: ignore[reportPrivateUsage] # one canonical list of deployment credential fields + clientside_credential_keys, +) from litellm.litellm_core_utils.cloud_storage_security import REQUEST_S3_BUCKET_PARAMS, STORED_S3_BUCKET_PARAM from litellm.litellm_core_utils.credential_accessor import CredentialAccessor, reject_api_key_secret_reference from litellm.litellm_core_utils.get_llm_provider_logic import inferred_provider @@ -54,7 +58,12 @@ from litellm.types.router import ( server_owned_wif_fields_present, ) from litellm.types.router import reject_server_owned_wif_params as _reject_server_owned_wif_params -from litellm.types.utils import CustomPricingLiteLLMParams, LlmProviders, oauth_token_exchange_litellm_params +from litellm.types.utils import ( + OIDC_SECRET_REFERENCE_PREFIX, + CustomPricingLiteLLMParams, + LlmProviders, + oauth_token_exchange_litellm_params, +) from litellm.types.videos.main import DecodedVideoId @@ -380,6 +389,37 @@ def _without_route_named_vertex_target(request_body: Mapping[str, object], route return MappingProxyType({key: value for key, value in request_body.items() if key not in VERTEX_TARGET_PARAMS}) +_AZURE_ENTRA_CREDENTIAL_PARAMS: Final[tuple[str, ...]] = ( + "tenant_id", + "client_id", + "client_secret", + "azure_username", + "azure_password", + "azure_scope", +) +_MCP_OAUTH_CLIENT_FORM_FIELDS: Final[frozenset[str]] = frozenset(("client_id", "client_secret")) +_TRANSCRIPTION_SESSION_ROUTES: Final[frozenset[str]] = frozenset( + ( + "/v1/realtime/transcription_sessions", + "/realtime/transcription_sessions", + "/openai/v1/realtime/transcription_sessions", + ) +) +_TRANSCRIPTION_SESSION_FIELDS: Final[frozenset[str]] = frozenset(("client_secret",)) +_TOKEN_INTROSPECTION_ROUTE: Final = "/introspect" +_BANNED_PARAMS_ALLOWED_IN_METADATA: Final[frozenset[str]] = VERTEX_TARGET_PARAMS | frozenset( + _AZURE_ENTRA_CREDENTIAL_PARAMS +) + + +def _entra_params_owned_by_route(route: str | None) -> frozenset[str]: + if route in _TRANSCRIPTION_SESSION_ROUTES: + return _TRANSCRIPTION_SESSION_FIELDS + if route_manages_mcp_servers(route) or route == _TOKEN_INTROSPECTION_ROUTE: + return _MCP_OAUTH_CLIENT_FORM_FIELDS + return frozenset() + + _NESTED_CONFIG_KEYS: Final[tuple[str, ...]] = ("litellm_embedding_config", "extra_body") # Metadata containers that carry per-request configuration consumed by the @@ -483,6 +523,7 @@ _BANNED_REQUEST_BODY_PARAMS: Final[tuple[str, ...]] = ( # caller-supplied value is the same exfil shape as # ``aws_web_identity_token`` on the Bedrock path. "azure_ad_token", + *_AZURE_ENTRA_CREDENTIAL_PARAMS, # Endpoint-targeting fields that retarget the outbound request or # an observability callback. An attacker-controlled value either # exfiltrates the request payload (incl. messages + admin-set @@ -548,8 +589,34 @@ _BANNED_REQUEST_BODY_PARAMS: Final[tuple[str, ...]] = ( *sorted(CustomPricingLiteLLMParams.model_fields.keys()), ) +_SECRET_REFERENCE_PREFIXES: Final[tuple[str, ...]] = ("os.environ/", OIDC_SECRET_REFERENCE_PREFIX) +_SECRET_RESOLVING_PARAMS: Final[frozenset[str]] = frozenset( + (*_BANNED_REQUEST_BODY_PARAMS, *_ADMIN_CONFIG_FIELDS_TO_CLEAR_ON_BASE_OVERRIDE, *clientside_credential_keys) +) + + +def _reject_secret_references(body: Mapping[str, object]) -> None: + _reject_secret_reference_in(MappingProxyType({k: v for k, v in body.items() if k in _SECRET_RESOLVING_PARAMS})) + + +def _reject_secret_reference_in(params: Mapping[str, object]) -> None: + referencing: Final = next( + ( + param + for param, value in params.items() + if isinstance(value, str) and value.startswith(_SECRET_REFERENCE_PREFIXES) + ), + None, + ) + if referencing is not None: + raise ValueError( + f"Rejected Request: {referencing} holds a secret reference, which only a deployment or credential a " + "proxy admin configures can carry." + ) + + _BANNED_METADATA_PARAMS: Final[tuple[str, ...]] = tuple( - param for param in _BANNED_REQUEST_BODY_PARAMS if param not in VERTEX_TARGET_PARAMS + param for param in _BANNED_REQUEST_BODY_PARAMS if param not in _BANNED_PARAMS_ALLOWED_IN_METADATA ) @@ -713,6 +780,8 @@ def _check_banned_params( *, manages_deployments: bool = False, mcp_server_fields_allowed: bool = False, + route_owned_params: frozenset[str] = frozenset(), + rejects_secret_references: bool = True, banned_params: tuple[str, ...] = _BANNED_REQUEST_BODY_PARAMS, opt_in_groups: Callable[[], _OptInGroups], defer_model_checks: bool = False, @@ -732,9 +801,13 @@ def _check_banned_params( reject_server_owned_wif_params(wif_body) if not manages_deployments: reject_federated_credential_reference(body) + if rejects_secret_references: + _reject_secret_references(body) for param in banned_params: if param not in body: continue + if param in route_owned_params: + continue if general_settings.get("allow_client_side_credentials") is True: # Proxy-wide opt-in: every banned param is permitted, exit # entirely so the rest of the loop doesn't waste work. @@ -957,6 +1030,7 @@ def is_request_body_safe( llm_router, manages_deployments=manages_deployments, mcp_server_fields_allowed=route_manages_mcp_servers(route), + route_owned_params=_entra_params_owned_by_route(route), opt_in_groups=opt_in_groups, defer_model_checks=defer_model_checks, defer_s3_buckets=defer_s3_buckets, @@ -982,6 +1056,7 @@ def is_request_body_safe( llm_router, manages_deployments=manages_deployments, banned_params=_BANNED_METADATA_PARAMS, + rejects_secret_references=False, opt_in_groups=opt_in_groups, defer_model_checks=defer_model_checks, defer_s3_buckets=defer_s3_buckets, @@ -993,6 +1068,7 @@ def is_request_body_safe( llm_router, manages_deployments=manages_deployments, banned_params=_BANNED_METADATA_PARAMS, + rejects_secret_references=False, opt_in_groups=opt_in_groups, defer_model_checks=defer_model_checks, defer_s3_buckets=defer_s3_buckets, @@ -1026,15 +1102,30 @@ def is_request_body_safe( llm_router, manages_deployments=manages_deployments, banned_params=_BANNED_METADATA_PARAMS, + rejects_secret_references=False, opt_in_groups=opt_in_groups, defer_model_checks=defer_model_checks, defer_s3_buckets=defer_s3_buckets, ) for user_config_params in _user_config_litellm_params(request_body): reject_api_key_secret_reference(user_config_params) + _reject_user_config_secret_references(user_config_params) return True +def _reject_user_config_secret_references(litellm_params: Mapping[str, object]) -> None: + for params in (litellm_params, *_nested_configs(litellm_params), *_data_source_parameters(litellm_params)): + _reject_secret_reference_in(params) + + +def _data_source_parameters(litellm_params: Mapping[str, object]) -> tuple[Mapping[str, object], ...]: + return tuple( + parameters + for source in _mappings_in(litellm_params.get("dataSources")) + if (parameters := _coerce_metadata_to_dict(source.get("parameters"))) is not None + ) + + def _reject_request_credential_params(litellm_params: Mapping[str, object], *, manages_deployments: bool) -> None: if manages_deployments: reject_server_owned_wif_fields( diff --git a/litellm/proxy/auth/user_api_key_auth.py b/litellm/proxy/auth/user_api_key_auth.py index 1b2e4e791e3..ff6e7f84bed 100644 --- a/litellm/proxy/auth/user_api_key_auth.py +++ b/litellm/proxy/auth/user_api_key_auth.py @@ -85,6 +85,7 @@ from litellm.proxy.auth.auth_checks import ( # noqa: F401 # legacy module expo is_model_cost_zero, is_user_proxy_admin, is_valid_fallback_model, + is_video_retrieval_request, jwt_key_mapping_cache_key, key_access_group_grants_model, key_model_aliases_for_auth_check, @@ -2680,7 +2681,11 @@ async def user_api_key_auth_builder( team_id=valid_token.team_id, ) skip_budget_checks = request_skips_budget_checks( - route=route, model=model, llm_router=llm_router, request_body=request_data + route=route, + model=model, + llm_router=llm_router, + request_body=request_data, + http_method=RouteChecks.get_request_method(request), ) # Fetch project object for JWT path if project_id is set @@ -3198,6 +3203,7 @@ async def validate_resolved_virtual_key( # noqa: C901 # Preserve ordering of e model=await budget_served_model(model, request_data, request, llm_router, valid_token), llm_router=llm_router, request_body=request_data, + http_method=RouteChecks.get_request_method(request), ) # Check 3. Check if user is in their team budget @@ -4299,6 +4305,7 @@ async def _should_skip_budget_checks( model=(model if sub_call else await budget_served_model(model, request_data, request, llm_router, valid_token)), llm_router=llm_router, request_body=request_data, + http_method=RouteChecks.get_request_method(request), ) @@ -4976,7 +4983,9 @@ async def _run_post_custom_auth_checks( # spend some other model accrued. The JWT and virtual-key paths already skip # every budget check for these; this path did not, so the same request could # be refused under custom auth and served under the other two. - skip_budget_checks: Final = ( + skip_budget_checks: Final = is_video_retrieval_request( + route=route, http_method=RouteChecks.get_request_method(request) + ) or ( is_model_cost_zero( model=await budget_served_model(current_model, request_data, request, llm_router, valid_token), llm_router=llm_router, diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py index 98aeced9088..f38676c9e5d 100644 --- a/litellm/proxy/common_request_processing.py +++ b/litellm/proxy/common_request_processing.py @@ -128,6 +128,7 @@ from litellm.proxy.auth.auth_checks import ( tag_max_budget_check_for_tags, ) from litellm.proxy.auth.auth_utils import check_response_size_is_safe, client_side_s3_bucket_check, get_request_route +from litellm.proxy.auth.route_checks import RouteChecks from litellm.proxy.bug_report_config import build_proxy_bug_report from litellm.proxy.common_utils.callback_utils import ( get_logging_caching_headers, @@ -1146,11 +1147,14 @@ async def _enforce_guardrail_added_tag_budgets( llm_router: Router | None, user_api_key_dict: UserAPIKeyAuth, proxy_logging_obj: ProxyLogging, + http_method: str | None = None, ) -> None: added_tags: Final = tuple( tag for tag in get_tags_from_request_body(request_body=data) if tag not in tags_before_guardrails ) - if not added_tags or request_skips_budget_checks(route=route, model=_request_model(data), llm_router=llm_router): + if not added_tags or request_skips_budget_checks( + route=route, model=_request_model(data), llm_router=llm_router, http_method=http_method + ): return from litellm.proxy.proxy_server import prisma_client, user_api_key_cache @@ -2970,6 +2974,7 @@ class ProxyBaseLLMRequestProcessing: llm_router=llm_router, user_api_key_dict=user_api_key_dict, proxy_logging_obj=proxy_logging_obj, + http_method=RouteChecks.get_request_method(request), ) if route_type == "aget_responses": attach_post_call_pipelines_to_retrieval( diff --git a/litellm/proxy/deps/repositories.py b/litellm/proxy/deps/repositories.py index 323cf57dfec..503314640c2 100644 --- a/litellm/proxy/deps/repositories.py +++ b/litellm/proxy/deps/repositories.py @@ -3,11 +3,13 @@ from typing import Annotated, TypeAlias from fastapi import Depends from litellm.models.deployment_warning import DeploymentWarningIgnoreStore +from litellm.models.fallback import RouterFallbackStore from litellm.models.gateway_activity import GatewayActivityStore from litellm.models.plugin_upload import PluginUploadStore from litellm.models.skill_submission import SkillSubmissionStore from litellm.models.user_banner import UserBannerStore from litellm.proxy.deps.database import DatabaseDep +from litellm.repositories.config_repository import ConfigRepository from litellm.repositories.deployment_warning_ignore_repository import DeploymentWarningIgnoreRepository from litellm.repositories.gateway_activity_repository import GatewayActivityRepository from litellm.repositories.plugin_upload_repository import PluginUploadRepository @@ -54,3 +56,10 @@ async def get_skill_submission_repository(database: DatabaseDep) -> SkillSubmiss SkillSubmissionRepositoryDep: TypeAlias = Annotated[ SkillSubmissionStore | None, Depends(get_skill_submission_repository) ] + + +async def get_router_fallback_repository(database: DatabaseDep) -> RouterFallbackStore | None: + return None if database is None else ConfigRepository(database.prisma, use_writer=True) + + +RouterFallbackRepositoryDep: TypeAlias = Annotated[RouterFallbackStore | None, Depends(get_router_fallback_repository)] diff --git a/cookbook/skill_scanner/README.md b/litellm/proxy/discovery_endpoints/skill_scanner_adapter/README.md similarity index 94% rename from cookbook/skill_scanner/README.md rename to litellm/proxy/discovery_endpoints/skill_scanner_adapter/README.md index 2a68e116002..0e3ad5a726f 100644 --- a/cookbook/skill_scanner/README.md +++ b/litellm/proxy/discovery_endpoints/skill_scanner_adapter/README.md @@ -2,11 +2,11 @@ This standalone adapter runs NVIDIA SkillSpector on a separate machine. It is not installed in the LiteLLM proxy and does not require a shared Helm or Compose deployment -Start it with Python 3.12 or newer and uv. The script pins SkillSpector and its HTTP dependencies +Start it from the repository root with Python 3.12 or newer and uv. The script pins SkillSpector and its HTTP dependencies. The adapter is not included in the wheel or sdist ```sh export SKILL_SCANNER_API_KEY="$(openssl rand -hex 32)" -uv run server.py +uv run litellm/proxy/discovery_endpoints/skill_scanner_adapter/server.py ``` For another host, place the loopback service behind an HTTPS reverse proxy that forwards the Authorization header and enforces a 65 MiB request limit. Run it under an unprivileged account with a writable temporary directory and no production files or credentials. The scanner host needs Git and network access to requested sources and optional model providers. Apply network egress restrictions suitable for those sources diff --git a/cookbook/skill_scanner/server.py b/litellm/proxy/discovery_endpoints/skill_scanner_adapter/server.py similarity index 100% rename from cookbook/skill_scanner/server.py rename to litellm/proxy/discovery_endpoints/skill_scanner_adapter/server.py diff --git a/litellm/proxy/guardrails/guardrail_endpoints.py b/litellm/proxy/guardrails/guardrail_endpoints.py index db4c30500a7..f6591ca00d5 100644 --- a/litellm/proxy/guardrails/guardrail_endpoints.py +++ b/litellm/proxy/guardrails/guardrail_endpoints.py @@ -3,6 +3,7 @@ CRUD ENDPOINTS FOR GUARDRAILS """ import asyncio +import copy import inspect import json import os @@ -17,9 +18,9 @@ from pydantic import BaseModel, TypeAdapter, ValidationError from litellm._logging import verbose_proxy_logger from litellm.constants import DEFAULT_MAX_RECURSE_DEPTH -from litellm.integrations.custom_guardrail import CustomGuardrail +from litellm.integrations.custom_guardrail import CustomGuardrail, GuardrailSetupError from litellm.litellm_core_utils.safe_json_dumps import safe_dumps -from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth +from litellm.proxy._types import AUDIT_ACTIONS, LitellmTableNames, LitellmUserRoles, UserAPIKeyAuth from litellm.proxy.auth.user_api_key_auth import user_api_key_auth from litellm.proxy.common_utils.callback_utils import CALLBACK_VAR_ENCRYPTED_PREFIX from litellm.proxy.common_utils.openai_error_payload import status_typed_proxy_exception @@ -53,6 +54,7 @@ from litellm.proxy.management_endpoints.common_utils import ( # noqa: F401 # l _user_has_admin_view, # pyright: ignore[reportPrivateUsage,reportUnusedImport] # backwards-compatible package export user_api_key_has_admin_view, ) +from litellm.proxy.management_helpers.audit_logs import create_object_audit_log, is_audit_logging_enabled from litellm.repositories.prisma_protocols import TableActions from litellm.repositories.table_repositories import GuardrailsRepository from litellm.types.guardrails import ( @@ -112,6 +114,84 @@ def _reject_encrypted_litellm_params(litellm_params: object) -> None: ) +_AUDIT_JSON_OBJECT: Final = TypeAdapter(dict[str, object]) +_AUDITED_GUARDRAIL_FIELDS: Final = ("guardrail_id", "guardrail_name", "guardrail_info", "status", "team_id") +_AUDITED_LITELLM_PARAMS: Final = ("guardrail", "mode", "default_on") +_NEW_GUARDRAIL_STATUS: Final = "active" + + +def _as_audit_mapping(value: object) -> Mapping[str, object]: + """Rows can hold JSON columns as strings, and an audit snapshot must never fail a change that is already saved.""" + candidate: Final = ( + value.model_dump(exclude_none=True) + if isinstance(value, BaseModel) + else _parse_json_field(value) + if isinstance(value, str) + else value + ) + try: + return _AUDIT_JSON_OBJECT.validate_python(candidate or {}) + except ValidationError: + return {} + + +def _litellm_params_of(guardrail: object) -> Mapping[str, object]: + return _as_audit_mapping(_as_audit_mapping(guardrail).get("litellm_params")) + + +def _guardrail_audit_snapshot(guardrail: object) -> Mapping[str, object]: + """A guardrail as written to the audit log. Provider settings can hold credentials under any name, so only the + provider, mode and default_on values are kept.""" + fields: Final = _as_audit_mapping(guardrail) + params: Final = _litellm_params_of(guardrail) + return { + **{key: fields[key] for key in _AUDITED_GUARDRAIL_FIELDS if fields.get(key) is not None}, + "litellm_params": {key: params[key] for key in _AUDITED_LITELLM_PARAMS if key in params}, + } + + +def _changed_litellm_param_names(before: object, after: object) -> tuple[str, ...]: + """Names, never values, of the provider settings an update changed beyond the ones the snapshot shows.""" + old: Final = _litellm_params_of(before) + new: Final = _litellm_params_of(after) + return tuple( + sorted( + key + for key in old.keys() | new.keys() + if key not in _AUDITED_LITELLM_PARAMS and old.get(key) != new.get(key) + ) + ) + + +async def _audit_guardrail_change( + *, + guardrail_id: str, + action: AUDIT_ACTIONS, + user_api_key_dict: UserAPIKeyAuth, + before: object = None, + after: object = None, +) -> None: + from litellm.proxy.proxy_server import litellm_proxy_admin_name + + if not is_audit_logging_enabled(): + return + changed: Final = _changed_litellm_param_names(before, after) if before is not None and after is not None else () + await create_object_audit_log( + object_id=guardrail_id, + action=action, + litellm_changed_by=None, + user_api_key_dict=user_api_key_dict, + litellm_proxy_admin_name=litellm_proxy_admin_name, + table_name=LitellmTableNames.GUARDRAILS_TABLE_NAME, + before_value=None if before is None else safe_dumps(_guardrail_audit_snapshot(before)), + after_value=None + if after is None + else safe_dumps( + {**_guardrail_audit_snapshot(after), **({"changed_litellm_params": list(changed)} if changed else {})} + ), + ) + + def _guardrails_table(prisma_client: "PrismaClient") -> "TableActions[LiteLLM_GuardrailsTable]": return GuardrailsRepository(prisma_client).table @@ -460,7 +540,7 @@ async def create_guardrail( verbose_proxy_logger.info( "Immediate sync: Successfully initialized guardrail '%s' (ID: %s)", guardrail_name, guardrail_id ) - except (ValueError, TypeError, CustomCodeCompilationError) as init_error: + except (ValueError, TypeError, CustomCodeCompilationError, GuardrailSetupError) as init_error: # Configuration error — roll back the DB write so the guardrail isn't orphaned if prisma_client is not None: try: @@ -479,6 +559,12 @@ async def create_guardrail( init_error, ) + await _audit_guardrail_change( + guardrail_id=str(guardrail_id), + action="created", + user_api_key_dict=user_api_key_dict, + after={**result, "status": _NEW_GUARDRAIL_STATUS}, + ) return result except HTTPException: raise @@ -579,6 +665,7 @@ async def update_guardrail( ) guardrail_name: Final = result.get("guardrail_name", "Unknown") + saved_guardrail: Final = copy.deepcopy(dict(result)) try: IN_MEMORY_GUARDRAIL_HANDLER.sync_guardrail_from_db( @@ -612,6 +699,13 @@ async def update_guardrail( update_error, ) + await _audit_guardrail_change( + guardrail_id=guardrail_id, + action="updated", + user_api_key_dict=user_api_key_dict, + before=existing_guardrail, + after=saved_guardrail, + ) return result except HTTPException as e: raise e @@ -687,6 +781,12 @@ async def delete_guardrail( delete_error, ) + await _audit_guardrail_change( + guardrail_id=guardrail_id, + action="deleted", + user_api_key_dict=user_api_key_dict, + before=existing_guardrail, + ) return result except HTTPException as e: raise e @@ -853,6 +953,12 @@ async def register_guardrail( "updated_at": now, }, ) + await _audit_guardrail_change( + guardrail_id=created.guardrail_id, + action="created", + user_api_key_dict=user_api_key_dict, + after=created, + ) return RegisterGuardrailResponse( guardrail_id=created.guardrail_id, guardrail_name=created.guardrail_name, @@ -1095,10 +1201,17 @@ async def approve_guardrail_submission( ) now: Final = datetime.now(timezone.utc) - await _guardrails_table(prisma_client).update( + approved: Final = await _guardrails_table(prisma_client).update( where={"guardrail_id": guardrail_id}, data={"status": "active", "reviewed_at": now, "updated_at": now}, ) + await _audit_guardrail_change( + guardrail_id=guardrail_id, + action="updated", + user_api_key_dict=user_api_key_dict, + before=row, + after=approved, + ) guardrail_info: Final = _parse_json_field(row.guardrail_info) if not litellm_params: @@ -1174,10 +1287,17 @@ async def reject_guardrail_submission( ) now: Final = datetime.now(timezone.utc) - await _guardrails_table(prisma_client).update( + rejected: Final = await _guardrails_table(prisma_client).update( where={"guardrail_id": guardrail_id}, data={"status": "rejected", "reviewed_at": now, "updated_at": now}, ) + await _audit_guardrail_change( + guardrail_id=guardrail_id, + action="updated", + user_api_key_dict=user_api_key_dict, + before=row, + after=rejected, + ) return { "guardrail_id": guardrail_id, "status": "rejected", @@ -1378,6 +1498,13 @@ async def patch_guardrail( update_error, ) + await _audit_guardrail_change( + guardrail_id=guardrail_id, + action="updated", + user_api_key_dict=user_api_key_dict, + before=existing_guardrail, + after=result, + ) return result except HTTPException as e: raise e diff --git a/litellm/proxy/guardrails/guardrail_hooks/collieai/__init__.py b/litellm/proxy/guardrails/guardrail_hooks/collieai/__init__.py new file mode 100644 index 00000000000..c0ea6335741 --- /dev/null +++ b/litellm/proxy/guardrails/guardrail_hooks/collieai/__init__.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from collections.abc import Callable, Mapping +from types import MappingProxyType +from typing import TYPE_CHECKING, Final + +from litellm.integrations.custom_guardrail import GuardrailSetupError +from litellm.types.guardrails import SupportedGuardrailIntegrations +from litellm.types.proxy.guardrails.guardrail_hooks.collieai import DEFAULT_API_BASE + +from .collieai import CollieAiGuardrail + +if TYPE_CHECKING: + from litellm.integrations.custom_guardrail import CustomGuardrail + from litellm.types.guardrails import Guardrail, LitellmParams + +_NO_EXTRAS: Final[Mapping[str, object]] = MappingProxyType({}) + + +def initialize_guardrail( + litellm_params: LitellmParams, + guardrail: Guardrail, + guardrail_cls: Callable[..., CustomGuardrail] = CollieAiGuardrail, +) -> CustomGuardrail: + import litellm + from litellm.secret_managers.main import get_secret_str + + extras: Final = MappingProxyType( + {key: value for key, value in (litellm_params.model_extra or _NO_EXTRAS).items() if value is not None} + ) + try: + _callback: Final = guardrail_cls( + **{ + **extras, + "api_base": litellm_params.api_base or DEFAULT_API_BASE, + "api_key": litellm_params.api_key or get_secret_str("COLLIEAI_API_KEY"), + "guardrail_name": guardrail["guardrail_name"], + "event_hook": litellm_params.mode, + "default_on": litellm_params.default_on, + "stream_scope": litellm_params.stream_scope, + } + ) + except Exception as setup_error: + raise GuardrailSetupError(str(setup_error)) from setup_error + litellm.logging_callback_manager.add_litellm_callback(_callback) + return _callback + + +guardrail_initializer_registry: Final = { + SupportedGuardrailIntegrations.COLLIEAI.value: initialize_guardrail, +} + +guardrail_class_registry: Final = { + SupportedGuardrailIntegrations.COLLIEAI.value: CollieAiGuardrail, +} diff --git a/litellm/proxy/guardrails/guardrail_hooks/collieai/collieai.py b/litellm/proxy/guardrails/guardrail_hooks/collieai/collieai.py new file mode 100644 index 00000000000..5ea1d147f91 --- /dev/null +++ b/litellm/proxy/guardrails/guardrail_hooks/collieai/collieai.py @@ -0,0 +1,94 @@ +"""CollieAi as a LiteLLM guardrail, backed by the ``collieai-litellm-guardrail`` PyPI package. + +Install: ``pip install "collieai-litellm-guardrail>=1.0.0"`` +Source: https://github.com/CollieAi/collieai-litellm-guardrail +""" + +from __future__ import annotations + +import importlib +from collections.abc import Callable +from typing import Final + +from litellm.integrations.custom_guardrail import CustomGuardrail +from litellm.types.guardrails import GuardrailEventHooks +from litellm.types.proxy.guardrails.guardrail_hooks.collieai import CollieAiGuardrailConfigModel + +PACKAGE_MODULE: Final = "collieai_guardrail.guardrail" +MISSING_PACKAGE_MESSAGE: Final = ( + "collieai-litellm-guardrail>=1.0.0 (Python 3.11 or newer) is required for the CollieAi guardrail. " + 'Install it with: pip install "collieai-litellm-guardrail>=1.0.0". ' + "The LiteLLM Docker image does not include it, " + "see https://docs.collieai.io/integrations/litellm to add it to an image." +) + + +def has_readiness_guard(package: object) -> bool: + return getattr(package, "require_guardrail", None) is not None + + +def package_guardrail(package: object) -> type[CustomGuardrail] | None: + guardrail: Final[object] = getattr(package, "CollieAIGuardrail", None) + if not has_readiness_guard(package) or not isinstance(guardrail, type): + return None + return guardrail if issubclass(guardrail, CustomGuardrail) else None + + +def unavailable_package(message: str, cause: BaseException | None) -> type[CustomGuardrail]: + class UnavailablePackage(CustomGuardrail): + def __init__(self, **kwargs: object) -> None: # kwargs-ok: mirrors the package constructor, only raises + raise ImportError(message) from cause + + return UnavailablePackage + + +def missing_package(import_error: ImportError | None) -> type[CustomGuardrail]: + return unavailable_package(MISSING_PACKAGE_MESSAGE, import_error) + + +def broken_package(load_error: Exception) -> type[CustomGuardrail]: + return unavailable_package( + "collieai-litellm-guardrail is installed but failed to load with this LiteLLM version " + f"({type(load_error).__name__}: {load_error}). " + 'Upgrade it with: pip install -U "collieai-litellm-guardrail>=1.0.0"', + load_error, + ) + + +def is_the_package_missing(import_error: ImportError) -> bool: + package_root: Final = PACKAGE_MODULE.partition(".")[0] + return isinstance(import_error, ModuleNotFoundError) and (import_error.name or "").partition(".")[0] == package_root + + +def load_base(import_module: Callable[[str], object] = importlib.import_module) -> type[CustomGuardrail]: + try: + package: Final = import_module(PACKAGE_MODULE) + except ImportError as import_error: + return missing_package(import_error) if is_the_package_missing(import_error) else broken_package(import_error) + except Exception as load_error: # noqa: BLE001 # a broken third-party install must not break the guardrail routes + return broken_package(load_error) + return package_guardrail(package) or missing_package(None) + + +_Base: Final = load_base() + + +class CollieAiGuardrail(_Base): + @staticmethod + def get_config_model() -> type[CollieAiGuardrailConfigModel]: + return CollieAiGuardrailConfigModel + + @classmethod + def get_supported_event_hooks(cls) -> list[GuardrailEventHooks]: # mutable-ok: CustomGuardrail's signature + return [GuardrailEventHooks.pre_call, GuardrailEventHooks.post_call] + + +__all__ = ( + "MISSING_PACKAGE_MESSAGE", + "PACKAGE_MODULE", + "CollieAiGuardrail", + "has_readiness_guard", + "load_base", + "missing_package", + "package_guardrail", +) diff --git a/litellm/proxy/guardrails/guardrail_registry.py b/litellm/proxy/guardrails/guardrail_registry.py index cafd79626ef..dd4d8f49010 100644 --- a/litellm/proxy/guardrails/guardrail_registry.py +++ b/litellm/proxy/guardrails/guardrail_registry.py @@ -685,6 +685,24 @@ def _configure_callback_scoping( _ParamsT = TypeVar("_ParamsT", bound=BaseModel) +SECRET_REFERENCE_PARAMS: Final = ("api_key", "api_base") + + +def resolve_secret_reference(value: str | None) -> str | None: + return str(get_secret(value)) if value and value.startswith("os.environ/") else value + + +def _with_resolved_secret_references(params: Mapping[str, object]) -> Mapping[str, object]: + return { + **params, + **{ + key: resolve_secret_reference(value) + for key in SECRET_REFERENCE_PARAMS + if isinstance(value := params.get(key), str) + }, + } + + def parse_tolerant_litellm_params( litellm_params_data: Mapping[str, object], guardrail_name: str, @@ -788,11 +806,8 @@ class InMemoryGuardrailHandler: ) litellm_params.category_thresholds = lakera_category_thresholds - if litellm_params.api_key and litellm_params.api_key.startswith("os.environ/"): - litellm_params.api_key = str(get_secret(litellm_params.api_key)) - - if litellm_params.api_base and litellm_params.api_base.startswith("os.environ/"): - litellm_params.api_base = str(get_secret(litellm_params.api_base)) + litellm_params.api_key = resolve_secret_reference(litellm_params.api_key) + litellm_params.api_base = resolve_secret_reference(litellm_params.api_base) guardrail_type: Final = litellm_params.guardrail @@ -1068,7 +1083,9 @@ class InMemoryGuardrailHandler: return params.model_dump() if isinstance(params, dict): try: - return parse_tolerant_litellm_params(with_tolerated_stream_scope(params), guardrail_name).model_dump() + return _with_resolved_secret_references( + parse_tolerant_litellm_params(with_tolerated_stream_scope(params), guardrail_name).model_dump() + ) except ValidationError as e: verbose_proxy_logger.warning( "Could not normalize guardrail litellm_params for comparison; treating the guardrail as changed. Error: %s", diff --git a/litellm/proxy/health_check.py b/litellm/proxy/health_check.py index de2ed4fd4ba..550a3f66f3b 100644 --- a/litellm/proxy/health_check.py +++ b/litellm/proxy/health_check.py @@ -26,6 +26,7 @@ from litellm.constants import ( DEFAULT_HEALTH_CHECK_PROMPT, HEALTH_CHECK_TIMEOUT_SECONDS, ) +from litellm.litellm_core_utils.get_llm_provider_logic import resolve_model_and_provider_for_metadata from litellm.litellm_core_utils.health_check_helpers import native_health_check_mode from litellm.litellm_core_utils.routing_common_utils import deployment_model_id_pin, is_model_capability_field from litellm.router_strategy.auto_router.auto_router_model_naming import ( @@ -831,6 +832,24 @@ _PROBE_PARAMS_ADAPTER: Final = TypeAdapter(dict[str, object]) _MODEL_INFO_ADAPTER: Final = TypeAdapter(Mapping[str, object]) +def _same_health_check_model(deployment_model: str | None, probe_params: Mapping[str, object]) -> bool: + model: Final = probe_params.get("model") + if model == deployment_model: + return True + if not isinstance(model, str) or deployment_model is None: + return False + provider_param: Final = probe_params.get("custom_llm_provider") + provider: Final = provider_param if isinstance(provider_param, str) else None + try: + deployment_name, deployment_provider = resolve_model_and_provider_for_metadata( + model=deployment_model, custom_llm_provider=provider + ) + probe_name, probe_provider = resolve_model_and_provider_for_metadata(model=model, custom_llm_provider=provider) + except litellm.exceptions.BadRequestError: + return False + return (deployment_name, deployment_provider) == (probe_name, probe_provider) + + def update_litellm_params_for_health_check( model_info: dict, litellm_params: dict, deployment_model: str | None = None ) -> dict: @@ -895,6 +914,15 @@ def update_litellm_params_for_health_check( if mode == "audio_speech": litellm_params["voice"] = model_info.get("health_check_voice", "alloy") + logging_model_info: Final = _MODEL_INFO_ADAPTER.validate_python( + _PROBE_PARAMS_ADAPTER.validate_python(litellm_params).get("model_info") or {} + ) + probe_logging_model_info: Final = ( + logging_model_info + if _same_health_check_model(base_model_owner, _PROBE_PARAMS_ADAPTER.validate_python(litellm_params)) + else {key: value for key, value in logging_model_info.items() if key == "id"} + ) + # Handle Bedrock region routing format: bedrock/region/model # This is needed because health checks bypass get_llm_provider() for the model param # Issue #15807: Without this, health checks send "region/model" as the model ID to AWS @@ -941,7 +969,12 @@ def update_litellm_params_for_health_check( model_id_params: Final = {} if model_id_pin is None else {"model_id": model_id_pin} return { key: value - for key, value in {**audio_output_params, **model_id_params, **probe_params}.items() + for key, value in { + **audio_output_params, + **model_id_params, + **probe_params, + **({"model_info": probe_logging_model_info} if "model_info" in probe_params else {}), + }.items() if not is_model_capability_field(key) } diff --git a/litellm/proxy/health_endpoints/_health_endpoints.py b/litellm/proxy/health_endpoints/_health_endpoints.py index 1211c56975b..7c7a1240c82 100644 --- a/litellm/proxy/health_endpoints/_health_endpoints.py +++ b/litellm/proxy/health_endpoints/_health_endpoints.py @@ -2695,7 +2695,10 @@ async def test_model_connection( stored_model: Final = _OBJECT_MAPPING.validate_python(config_litellm_params).get("model") litellm_params = update_litellm_params_for_health_check( model_info=dict(probe_model_info), - litellm_params=litellm_params, + litellm_params={ + **litellm_params, + "model_info": _OBJECT_MAPPING.validate_python(resolved_model_info or {}), + }, deployment_model=stored_model if isinstance(stored_model, str) else None, ) diff --git a/litellm/proxy/management_endpoints/cost_tracking_settings.py b/litellm/proxy/management_endpoints/cost_tracking_settings.py index 7e6aec84292..dcc6a614a54 100644 --- a/litellm/proxy/management_endpoints/cost_tracking_settings.py +++ b/litellm/proxy/management_endpoints/cost_tracking_settings.py @@ -253,6 +253,7 @@ async def update_cost_discount_config( ``` """ from litellm.proxy.proxy_server import ( + DB_RECONCILE_LOCK, prisma_client, proxy_config, store_model_in_db, @@ -301,21 +302,13 @@ async def update_cost_discount_config( ) try: - # Load existing config - config: Final = await proxy_config.get_config() - - # Ensure litellm_settings exists - if "litellm_settings" not in config: - config["litellm_settings"] = {} - - # Update cost_discount_config - config["litellm_settings"]["cost_discount_config"] = cost_discount_config - - # Save the updated config to DB - await proxy_config.save_config(new_config=config) - - # Update in-memory litellm.cost_discount_config - litellm.cost_discount_config = cost_discount_config + async with DB_RECONCILE_LOCK: + config: Final = await proxy_config.get_config() + if "litellm_settings" not in config: + config["litellm_settings"] = {} + config["litellm_settings"]["cost_discount_config"] = cost_discount_config + await proxy_config.save_config(new_config=config) + litellm.cost_discount_config = cost_discount_config verbose_proxy_logger.info("Updated cost_discount_config: %s", cost_discount_config) @@ -397,6 +390,7 @@ async def update_cost_margin_config( ``` """ from litellm.proxy.proxy_server import ( + DB_RECONCILE_LOCK, prisma_client, proxy_config, store_model_in_db, @@ -475,21 +469,13 @@ async def update_cost_margin_config( ) try: - # Load existing config - config: Final = await proxy_config.get_config() - - # Ensure litellm_settings exists - if "litellm_settings" not in config: - config["litellm_settings"] = {} - - # Update cost_margin_config - config["litellm_settings"]["cost_margin_config"] = cost_margin_config - - # Save the updated config to DB - await proxy_config.save_config(new_config=config) - - # Update in-memory litellm.cost_margin_config - litellm.cost_margin_config = cost_margin_config + async with DB_RECONCILE_LOCK: + config: Final = await proxy_config.get_config() + if "litellm_settings" not in config: + config["litellm_settings"] = {} + config["litellm_settings"]["cost_margin_config"] = cost_margin_config + await proxy_config.save_config(new_config=config) + litellm.cost_margin_config = cost_margin_config verbose_proxy_logger.info("Updated cost_margin_config: %s", cost_margin_config) @@ -534,6 +520,7 @@ async def update_block_requests_for_models_without_pricing( request: BlockUnpricedModelsRequest, ) -> BlockUnpricedModelsResponse: from litellm.proxy.proxy_server import ( + DB_RECONCILE_LOCK, prisma_client, proxy_config, store_model_in_db, @@ -552,13 +539,13 @@ async def update_block_requests_for_models_without_pricing( ) try: - config = await proxy_config.get_config() - if "litellm_settings" not in config: - config["litellm_settings"] = {} - config["litellm_settings"]["block_requests_for_models_without_pricing"] = request.enabled - await proxy_config.save_config(new_config=config) - - litellm.block_requests_for_models_without_pricing = request.enabled + async with DB_RECONCILE_LOCK: + config = await proxy_config.get_config() + if "litellm_settings" not in config: + config["litellm_settings"] = {} + config["litellm_settings"]["block_requests_for_models_without_pricing"] = request.enabled + await proxy_config.save_config(new_config=config) + litellm.block_requests_for_models_without_pricing = request.enabled verbose_proxy_logger.info("Updated block_requests_for_models_without_pricing: %s", request.enabled) return BlockUnpricedModelsResponse(enabled=request.enabled) diff --git a/litellm/proxy/management_endpoints/fallback_management_endpoints.py b/litellm/proxy/management_endpoints/fallback_management_endpoints.py index 477cf44073f..f736ac1306a 100644 --- a/litellm/proxy/management_endpoints/fallback_management_endpoints.py +++ b/litellm/proxy/management_endpoints/fallback_management_endpoints.py @@ -10,11 +10,11 @@ DELETE /fallback/{model} - Delete fallbacks for a specific model # pyright: reportMissingImports=false -import json from collections.abc import Mapping, Sequence -from typing import TYPE_CHECKING, Annotated, Final, Literal +from types import MappingProxyType +from typing import TYPE_CHECKING, Final, Literal -from pydantic import Field, JsonValue, TypeAdapter, ValidationError +from pydantic import JsonValue, TypeAdapter, ValidationError import litellm from litellm._logging import verbose_proxy_logger @@ -22,7 +22,7 @@ from litellm.proxy._types import UserAPIKeyAuth from litellm.proxy.auth.auth_utils import fallback_target_model_name from litellm.proxy.auth.model_checks import get_all_fallbacks from litellm.proxy.auth.user_api_key_auth import user_api_key_auth -from litellm.proxy.utils import PrismaClient, invalidate_config_param +from litellm.proxy.utils import invalidate_config_param if TYPE_CHECKING: from fastapi import APIRouter, Depends, HTTPException, status @@ -36,8 +36,16 @@ else: # fastapi is only required for proxy, not for SDK usage pass -from litellm.repositories.config_repository import ConfigRepository -from litellm.router_api import ChangeSet +from litellm.models.fallback import ( + STORED_FALLBACKS, + FallbackRulesEdit, + FallbackRulesEditor, + RouterFallbackStore, + StoredFallback, +) +from litellm.proxy.deps.repositories import RouterFallbackRepositoryDep +from litellm.repositories.config_repository import ROUTER_SETTINGS_PARAM +from litellm.router_api import ChangeSet, fallback_chain from litellm.types.management_endpoints.router_settings_endpoints import ( FallbackCreateRequest, FallbackDeleteResponse, @@ -48,12 +56,10 @@ from litellm.types.router import ContentPolicyFallbackRule, ContentPolicyFallbac router: Final = APIRouter() -ROUTER_SETTINGS_PARAM: Final = "router_settings" -FallbackRule = dict[str, list[str]] -StoredFallback = Annotated[FallbackRule | dict[str, object] | str, Field(union_mode="left_to_right")] -_STORED_FALLBACKS: Final = TypeAdapter(list[StoredFallback]) _JSON_RULES: Final = TypeAdapter(list[JsonValue]) -_STORED_ROUTER_SETTINGS: Final = TypeAdapter(dict[str, JsonValue]) +_FALLBACK_KEY_BY_TYPE: Final[Mapping[str, str]] = MappingProxyType( + {"general": "fallbacks", "context_window": "context_window_fallbacks", "content_policy": "content_policy_fallbacks"} +) _OPTIONAL_JSON_RULES: Final[TypeAdapter[Sequence[JsonValue] | None]] = TypeAdapter(Sequence[JsonValue] | None) _CONTENT_POLICY_FALLBACK_RULE: Final[TypeAdapter[ContentPolicyFallbackRule]] = TypeAdapter(ContentPolicyFallbackRule) _FALLBACK_TARGETS: Final[TypeAdapter[FallbackTargets]] = TypeAdapter(FallbackTargets) @@ -104,18 +110,20 @@ def _checked_content_policy_rules( return tuple((candidate, _checked_content_policy_rule(candidate)) for candidate in candidates) +def _layered_checked_rules( + checked_rules: Sequence[tuple[object, ContentPolicyFallbackRule | ValidationError]], +) -> Sequence[Mapping[str, object]]: + return _layered_over_config_rules( + tuple(result for _, result in checked_rules if not isinstance(result, ValidationError)), + _config_file_rules( + litellm.content_policy_fallbacks # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] # untyped module list + ), + ) + + def apply_content_policy_fallbacks(llm_router: "Router", rules: object, *, log_skipped_rules: bool) -> None: checked_rules: Final = _checked_content_policy_rules(rules) - runtime_rules: Final = tuple(result for _, result in checked_rules if not isinstance(result, ValidationError)) - layered_rules: Final = ( - _layered_over_config_rules( - runtime_rules, - _config_file_rules( - litellm.content_policy_fallbacks # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] # untyped module list - ), - ) - or None - ) + layered_rules: Final = _layered_checked_rules(checked_rules) or None for rule, result in checked_rules: if log_skipped_rules and isinstance(result, ValidationError): _log_ignored_content_policy_rules(rule, result) @@ -135,54 +143,52 @@ async def _reload_config_file_ownership(proxy_config: "ProxyConfig") -> None: await proxy_config.get_config() -async def _stored_router_settings(prisma_client: PrismaClient) -> Mapping[str, JsonValue]: - try: - row: Final = await ConfigRepository(prisma_client, use_writer=True).get_param(ROUTER_SETTINGS_PARAM) - except json.JSONDecodeError: - return {} - if row is None or not isinstance(row.param_value, Mapping): - return {} - return _STORED_ROUTER_SETTINGS.validate_python(row.param_value) +def _with_rule(rules: Sequence[StoredFallback], model: str, fallback_models: Sequence[str]) -> FallbackRulesEdit: + covering: Final = next((index for index, rule in enumerate(rules) if _rule_covers(rule, model)), None) + rule: Final[StoredFallback] = {model: list(fallback_models)} + if covering is None: + return FallbackRulesEdit(rules=[*rules, rule], replaced=False) + return FallbackRulesEdit(rules=[*rules[:covering], rule, *rules[covering + 1 :]], replaced=True) -def _editable_rules( - proxy_config: "ProxyConfig", stored_settings: Mapping[str, JsonValue], fallback_key: str -) -> list[StoredFallback]: - file_settings: Final = proxy_config.router_settings - if not file_settings.owned_by_config(fallback_key): - return _STORED_FALLBACKS.validate_python(stored_settings.get(fallback_key) or []) - file_rules: Final = file_settings.get(fallback_key) - return _STORED_FALLBACKS.validate_python(file_rules if isinstance(file_rules, list) else []) +def _without_rule(rules: Sequence[StoredFallback], model: str, fallback_type: str) -> FallbackRulesEdit: + kept: Final = [rule for rule in rules if not _rule_covers(rule, model)] + if len(kept) == len(rules): + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail={"error": f"No {fallback_type} fallbacks configured for model '{model}'"}, + ) + return FallbackRulesEdit(rules=kept, replaced=True) + + +def _edit_config_file_rules( + proxy_config: "ProxyConfig", + llm_router: "Router", + fallback_key: str, + edit: FallbackRulesEditor, +) -> FallbackRulesEdit: + file_rules: Final = proxy_config.router_settings.get(fallback_key) + edited: Final = edit(STORED_FALLBACKS.validate_python(file_rules if isinstance(file_rules, list) else [])) + proxy_config.reject_config_owned_writes( + section_name=ROUTER_SETTINGS_PARAM, changed_keys={fallback_key: _JSON_RULES.validate_python(edited.rules)} + ) + llm_router.apply(ChangeSet(assign={fallback_key: edited.rules})) + return edited async def _write_rules( - prisma_client: PrismaClient, + fallbacks: RouterFallbackStore, proxy_config: "ProxyConfig", llm_router: "Router", - stored_settings: Mapping[str, JsonValue], fallback_key: str, - rules: Sequence[StoredFallback], -) -> None: - proxy_config.reject_config_owned_writes( - section_name=ROUTER_SETTINGS_PARAM, changed_keys={fallback_key: _JSON_RULES.validate_python(rules)} - ) + edit: FallbackRulesEditor, +) -> FallbackRulesEdit: if proxy_config.router_settings.owned_by_config(fallback_key): - llm_router.apply(ChangeSet(assign={fallback_key: rules})) - return - await _persist_router_settings(prisma_client, {**stored_settings, fallback_key: rules}) - _apply_fallback_rules(llm_router, fallback_key, rules) - - -async def _persist_router_settings(prisma_client: PrismaClient, router_settings: Mapping[str, object]) -> None: - router_settings_json: Final = json.dumps(router_settings) - await ConfigRepository(prisma_client).table.upsert( - where={"param_name": ROUTER_SETTINGS_PARAM}, - data={ - "create": {"param_name": ROUTER_SETTINGS_PARAM, "param_value": router_settings_json}, - "update": {"param_value": router_settings_json}, - }, - ) + return _edit_config_file_rules(proxy_config, llm_router, fallback_key, edit) + edited: Final = await fallbacks.edit_rules(fallback_key, edit) await invalidate_config_param(ROUTER_SETTINGS_PARAM) + _apply_fallback_rules(llm_router, fallback_key, edited.rules) + return edited @router.post( @@ -195,6 +201,8 @@ async def _persist_router_settings(prisma_client: PrismaClient, router_settings: async def create_fallback( data: FallbackCreateRequest, user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), + *, + fallbacks: RouterFallbackRepositoryDep, ): """ Create or update fallbacks for a specific model. @@ -218,7 +226,6 @@ async def create_fallback( """ from litellm.proxy.proxy_server import ( llm_router, - prisma_client, proxy_config, store_model_in_db, ) @@ -262,7 +269,7 @@ async def create_fallback( ) # Check if we need to store in DB - if store_model_in_db is not True or prisma_client is None: + if store_model_in_db is not True or fallbacks is None: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail={ @@ -271,7 +278,6 @@ async def create_fallback( ) await _reload_config_file_ownership(proxy_config) - router_settings: Final = await _stored_router_settings(prisma_client) # Get the appropriate fallback list based on type fallback_key = "fallbacks" @@ -280,23 +286,13 @@ async def create_fallback( elif data.fallback_type == "content_policy": fallback_key = "content_policy_fallbacks" - # Get existing fallbacks - existing_fallbacks: Final = _editable_rules(proxy_config, router_settings, fallback_key) - - # Update or add the fallback configuration - fallback_updated = False - for i, rule in enumerate(existing_fallbacks): - if _rule_covers(rule, data.model): - # Update existing fallback - existing_fallbacks[i] = {data.model: data.fallback_models} - fallback_updated = True - break - - if not fallback_updated: - # Add new fallback - existing_fallbacks.append({data.model: data.fallback_models}) - - await _write_rules(prisma_client, proxy_config, llm_router, router_settings, fallback_key, existing_fallbacks) + edited: Final = await _write_rules( + fallbacks, + proxy_config, + llm_router, + fallback_key, + lambda rules: _with_rule(rules, data.model, data.fallback_models), + ) verbose_proxy_logger.info( "Fallback configured: %s -> %s (type: %s)", data.model, data.fallback_models, data.fallback_type @@ -306,7 +302,7 @@ async def create_fallback( model=data.model, fallback_models=data.fallback_models, fallback_type=data.fallback_type, - message=f"Fallback configuration {'updated' if fallback_updated else 'created'} successfully", + message=f"Fallback configuration {'updated' if edited.replaced else 'created'} successfully", ) except HTTPException: @@ -319,6 +315,26 @@ async def create_fallback( ) +async def _saved_rules_in_effect( + proxy_config: "ProxyConfig", fallbacks: RouterFallbackStore, fallback_key: str +) -> Sequence[object]: + if proxy_config.router_settings.owned_by_config(fallback_key): + file_rules: Final = proxy_config.router_settings.get(fallback_key) + return file_rules if isinstance(file_rules, list) else () + saved: Final = await fallbacks.saved_rules(fallback_key) + if fallback_key == "content_policy_fallbacks": + return _layered_checked_rules(_checked_content_policy_rules(saved)) + return saved or () + + +def _fallback_chain_for(rules: Sequence[object], model: str) -> object: + chain, _ = fallback_chain( + fallbacks=rules, # pyright: ignore[reportArgumentType] # the chain also resolves the string and rich-target rules the router accepts + model_group=model, + ) + return chain or [] + + @router.get( "/fallback/{model}", tags=["Fallback Management"], @@ -329,6 +345,8 @@ async def get_fallback( model: str, fallback_type: Literal["general", "context_window", "content_policy"] = "general", user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), + *, + fallbacks: RouterFallbackRepositoryDep, ): """ Get fallback configuration for a specific model. @@ -342,7 +360,7 @@ async def get_fallback( GET /fallback/gpt-3.5-turbo?fallback_type=general ``` """ - from litellm.proxy.proxy_server import llm_router + from litellm.proxy.proxy_server import llm_router, proxy_config, store_model_in_db try: if llm_router is None: @@ -351,9 +369,12 @@ async def get_fallback( detail={"error": "Router not initialized"}, ) - # Get fallbacks using the existing utility function fallback_targets: Final = _FALLBACK_TARGETS.validate_python( get_all_fallbacks(model=model, llm_router=llm_router, fallback_type=fallback_type) + if store_model_in_db is not True or fallbacks is None + else _fallback_chain_for( + await _saved_rules_in_effect(proxy_config, fallbacks, _FALLBACK_KEY_BY_TYPE[fallback_type]), model + ) ) fallback_models: Final = [fallback_target_model_name(target) or model for target in fallback_targets] @@ -389,6 +410,8 @@ async def delete_fallback( model: str, fallback_type: Literal["general", "context_window", "content_policy"] = "general", user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), + *, + fallbacks: RouterFallbackRepositoryDep, ): """ Delete fallback configuration for a specific model. @@ -404,7 +427,6 @@ async def delete_fallback( """ from litellm.proxy.proxy_server import ( llm_router, - prisma_client, proxy_config, store_model_in_db, ) @@ -416,7 +438,7 @@ async def delete_fallback( detail={"error": "Router not initialized"}, ) - if store_model_in_db is not True or prisma_client is None: + if store_model_in_db is not True or fallbacks is None: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail={ @@ -425,7 +447,6 @@ async def delete_fallback( ) await _reload_config_file_ownership(proxy_config) - router_settings: Final = await _stored_router_settings(prisma_client) # Get the appropriate fallback list based on type fallback_key = "fallbacks" @@ -434,18 +455,13 @@ async def delete_fallback( elif fallback_type == "content_policy": fallback_key = "content_policy_fallbacks" - # Get existing fallbacks - existing_fallbacks: Final = _editable_rules(proxy_config, router_settings, fallback_key) - - updated_fallbacks: Final = [rule for rule in existing_fallbacks if not _rule_covers(rule, model)] - - if len(updated_fallbacks) == len(existing_fallbacks): - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail={"error": f"No {fallback_type} fallbacks configured for model '{model}'"}, - ) - - await _write_rules(prisma_client, proxy_config, llm_router, router_settings, fallback_key, updated_fallbacks) + await _write_rules( + fallbacks, + proxy_config, + llm_router, + fallback_key, + lambda rules: _without_rule(rules, model, fallback_type), + ) verbose_proxy_logger.info("Fallback deleted: %s (type: %s)", model, fallback_type) diff --git a/litellm/proxy/mcp_server/db.py b/litellm/proxy/mcp_server/db.py index f29acc3b380..08e1ffd5333 100644 --- a/litellm/proxy/mcp_server/db.py +++ b/litellm/proxy/mcp_server/db.py @@ -35,6 +35,7 @@ from litellm.proxy.common_utils.encrypt_decrypt_utils import ( # noqa: F401 # encrypt_value_helper, get_salt_key, ) +from litellm.proxy.common_utils.fips import fips_mode_active from litellm.proxy.mcp_server.oauth_identity_binding import ( RefreshTokenPresented, credential_binding_matches, @@ -690,15 +691,22 @@ async def find_mcp_server_identifier_conflict( ) +def _advisory_lock_key(name: str) -> int: + """Signed 64-bit Postgres advisory-lock key for ``name``: BLAKE2b-64, or the + first 8 bytes of SHA-256 when general_settings.fips_mode is on.""" + digest: Final = ( + hashlib.sha256(name.encode()).digest()[:8] + if fips_mode_active() + else hashlib.blake2b(name.encode(), digest_size=8).digest() + ) + return int.from_bytes(digest, "big", signed=True) + + def _mcp_identifier_lock_keys(*identifiers: str | None) -> tuple[int, ...]: """Deterministic advisory-lock keys for the lowercased identifiers, sorted so concurrent requests for the same pair always lock in the same order.""" return tuple( - int.from_bytes( - hashlib.blake2b(f"mcp_identifier:{normalized}".encode(), digest_size=8).digest(), - "big", - signed=True, - ) + _advisory_lock_key(f"mcp_identifier:{normalized}") for normalized in sorted(frozenset(value.lower() for value in identifiers if value)) ) @@ -2515,11 +2523,7 @@ async def merge_user_env_vars( so an admin retiring a user-scoped variable also clears its stored value. """ allowed: Final = set(allowed_names) - lock_key: Final = int.from_bytes( - hashlib.blake2b(f"{user_id}:{server_id}".encode(), digest_size=8).digest(), - "big", - signed=True, - ) + lock_key: Final = _advisory_lock_key(f"{user_id}:{server_id}") async with _db_transaction_manager(prisma_client) as tx: await tx.execute_raw("SELECT pg_advisory_xact_lock($1::bigint)", lock_key) row: Final[prisma_db_models.LiteLLM_MCPUserEnvVars | None] = await tx.litellm_mcpuserenvvars.find_unique( diff --git a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py index 321c921b5bd..782b5698f3c 100644 --- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py @@ -177,7 +177,9 @@ from litellm.types.passthrough_endpoints.eu_jev import EuJevDecisionRequest, EuJ from litellm.types.passthrough_endpoints.pass_through_endpoints import ( LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY, LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY, + LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY, LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY, + DeploymentPricingResolver, WebSocketSessionMeter, ) from litellm.types.passthrough_endpoints.tinyfish import ( @@ -188,7 +190,12 @@ from litellm.types.passthrough_endpoints.tinyfish import ( ) from litellm.types.passthrough_endpoints.vertex_ai import VertexPassThroughCredentials from litellm.types.router import LiteLLMParamsTypedDict -from litellm.types.utils import CallTypes, LlmProviders +from litellm.types.utils import ( + DEPLOYMENT_SCOPED_PRICING_FIELDS, + SERVER_DERIVED_PRICING_FIELDS, + CallTypes, + LlmProviders, +) from litellm.types.vector_stores import LiteLLM_ManagedVectorStore, LiteLLM_ManagedVectorStoreIndex from litellm.utils import ProviderConfigManager, with_named_credential @@ -248,6 +255,58 @@ def _models_served_by_group(llm_router: litellm.Router, model_group: str) -> fro ) +_OBJECT_MAPPING: Final = TypeAdapter(Mapping[str, object]) +_DEPLOYMENT_PRICING_FIELDS: Final[frozenset[str]] = SERVER_DERIVED_PRICING_FIELDS | DEPLOYMENT_SCOPED_PRICING_FIELDS + + +def _object_mapping(value: object) -> Mapping[str, object]: + return _OBJECT_MAPPING.validate_python(value if isinstance(value, Mapping) else {}) + + +def _anthropic_deployment_model_info(deployment: object, model: str) -> Mapping[str, object] | None: + fields: Final = _object_mapping(deployment) + params: Final = _object_mapping(fields.get("litellm_params")) + backend: Final = params.get("model") + provider_override: Final = params.get("custom_llm_provider") + if not isinstance(backend, str): + return None + try: + backend_model, provider, _, _ = get_llm_provider( + model=backend, custom_llm_provider=provider_override if isinstance(provider_override, str) else None + ) + except litellm.BadRequestError: + return None + if provider != LlmProviders.ANTHROPIC.value or model not in (backend_model, backend.removeprefix(f"{provider}/")): + return None + return { + **_object_mapping(fields.get("model_info")), + **{field: value for field in _DEPLOYMENT_PRICING_FIELDS if (value := params.get(field)) is not None}, + } + + +def anthropic_deployment_pricing_model_info( + llm_router: litellm.Router | None, request_body: Mapping[str, object], team_id: str | None +) -> Mapping[str, object] | None: + """ + The pass-through selects no deployment, so ``request_body`` is the body it forwards. Only a single deployment in + that model's group serving that exact Anthropic model can say what it costs: with several, any pick could bill + another deployment's negotiated price. + """ + model: Final = request_body.get("model") + if llm_router is None or not isinstance(model, str) or not model: + return None + candidates: Final = tuple( + model_info + for deployment in llm_router.registry().deployments(model, team_id=team_id) or () + if llm_router.registry().includes(deployment, team_id=team_id) + and (model_info := _anthropic_deployment_model_info(deployment, model)) is not None + ) + if len(candidates) != 1: + return None + (only_match,) = candidates + return only_match if any(only_match.get(field) is not None for field in _DEPLOYMENT_PRICING_FIELDS) else None + + def is_passthrough_request_streaming(request_body: object) -> bool: """ Returns True if the request is streaming. @@ -1236,6 +1295,16 @@ async def anthropic_proxy_route( ## check for streaming is_streaming_request: Final = await is_streaming_request_fn(request) + from litellm.proxy.proxy_server import llm_router + + setattr( + request.state, + LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY, + DeploymentPricingResolver( + resolve=partial(anthropic_deployment_pricing_model_info, llm_router, team_id=user_api_key_dict.team_id) + ), + ) + ## CREATE PASS-THROUGH auth_header: Final = await AnthropicModelInfo.aget_auth_header( anthropic_api_key or None, allow_workload_identity=True diff --git a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/batch_attribution.py b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/batch_attribution.py index cc3b0c429ff..e936959a085 100644 --- a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/batch_attribution.py +++ b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/batch_attribution.py @@ -6,13 +6,36 @@ background poll that has no request to read them from. """ import asyncio -from collections.abc import Mapping, Sequence -from typing import Final +import base64 +from collections.abc import Coroutine, Mapping, Sequence +from functools import partial +from typing import TYPE_CHECKING, Final, Literal, Protocol, runtime_checkable from pydantic import TypeAdapter from litellm._logging import verbose_proxy_logger from litellm.litellm_core_utils.safe_json_dumps import strip_null_bytes +from litellm.types.utils import LiteLLMBatch, SpecialEnums + +if TYPE_CHECKING: + from litellm.proxy._types import UserAPIKeyAuth + + +@runtime_checkable +class BatchRegistry(Protocol): + """The managed-files hook's write path, the one method passthrough batch attribution needs from it.""" + + def store_unified_object_id( + self, + unified_object_id: str, + file_object: LiteLLMBatch, + litellm_parent_otel_span: None, + model_object_id: str, + file_purpose: Literal["batch"], + user_api_key_dict: "UserAPIKeyAuth", + request_tags: Sequence[str] | None, + persist_attribution: bool, + ) -> Coroutine[object, object, None]: ... def optional_str(value: object) -> str | None: @@ -88,3 +111,62 @@ def log_batch_registration_result( unified_object_id, model_object_id, ) + + +def unified_batch_object_id(model_id: str, batch_id: str) -> str: + """The managed object id CheckBatchCost decodes back into the deployment and the provider batch id.""" + unified: Final = SpecialEnums.LITELLM_MANAGED_BATCH_COMPLETE_STR.value.format(model_id, batch_id) + return base64.urlsafe_b64encode(unified.encode()).decode().rstrip("=") + + +def register_passthrough_batch( + provider: str, + unified_object_id: str, + batch_object: LiteLLMBatch, + model_object_id: str, + request_metadata: Mapping[str, object], +) -> None: + """Record a batch created through a passthrough create for the calling key, team and tags, so + CheckBatchCost prices it on completion. Fire and forget, the passthrough response is already on its way.""" + from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth + from litellm.proxy.proxy_server import proxy_logging_obj + + managed_files_hook: Final = proxy_logging_obj.get_proxy_hook("managed_files") + if not isinstance(managed_files_hook, BatchRegistry): + verbose_proxy_logger.warning( + "Managed files hook not available, cannot store %s batch %s for cost tracking", provider, model_object_id + ) + return + user_api_key_dict: Final = UserAPIKeyAuth( + user_id=optional_str(request_metadata.get("user_api_key_user_id")), + api_key=optional_str(request_metadata.get("user_api_key")), + team_id=optional_str(request_metadata.get("user_api_key_team_id")), + user_role=LitellmUserRoles.CUSTOMER, + spend=0.0, + models=[], + metadata={}, + permissions={}, + model_max_budget={}, + model_spend={}, + ) + task: Final[asyncio.Task[None]] = asyncio.create_task( + managed_files_hook.store_unified_object_id( + unified_object_id=unified_object_id, + file_object=batch_object, + litellm_parent_otel_span=None, + model_object_id=model_object_id, + file_purpose="batch", + user_api_key_dict=user_api_key_dict, + request_tags=request_tags_from_metadata(request_metadata), + persist_attribution=True, + ) + ) + task.add_done_callback( + partial( + log_batch_registration_result, + provider=provider, + unified_object_id=unified_object_id, + model_object_id=model_object_id, + is_batch_create=True, + ) + ) diff --git a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/gemini_passthrough_logging_handler.py b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/gemini_passthrough_logging_handler.py index d449f62af2c..24a11c653d7 100644 --- a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/gemini_passthrough_logging_handler.py +++ b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/gemini_passthrough_logging_handler.py @@ -1,8 +1,10 @@ -from collections.abc import Sequence +from collections.abc import Mapping, Sequence from datetime import datetime +from types import MappingProxyType from typing import TYPE_CHECKING, Any, Final import httpx +from pydantic import TypeAdapter import litellm from litellm._logging import verbose_proxy_logger @@ -10,11 +12,16 @@ from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLogging from litellm.llms.gemini.videos.transformation import GeminiVideoConfig from litellm.llms.vertex_ai.common_utils import get_vertex_model_id_from_url from litellm.proxy._types import PassThroughEndpointLoggingTypedDict +from litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution import ( + register_passthrough_batch, + unified_batch_object_id, +) from litellm.proxy.pass_through_endpoints.llm_provider_handlers.vertex_passthrough_logging_handler import ( GeminiSseChunkParser, VertexPassthroughLoggingHandler, ) from litellm.types.utils import ( + Choices, ModelResponse, TextCompletionResponse, ) @@ -28,6 +35,10 @@ else: EndpointType = Any +_JSON_OBJECT: Final = TypeAdapter(dict[str, object]) +_EMPTY: Final[Mapping[str, object]] = MappingProxyType({}) + + class GeminiPassthroughLoggingHandler: @staticmethod def gemini_passthrough_handler( @@ -53,6 +64,14 @@ class GeminiPassthroughLoggingHandler: custom_llm_provider="gemini", vertex_location=None, ) + if "batchGenerateContent" in url_route: + return GeminiPassthroughLoggingHandler._batch_create_handler( + httpx_response=httpx_response, + logging_obj=logging_obj, + url_route=url_route, + start_time=start_time, + kwargs=_JSON_OBJECT.validate_python(kwargs), + ) if "predictLongRunning" in url_route: model = GeminiPassthroughLoggingHandler.extract_model_from_url(url_route) @@ -127,6 +146,99 @@ class GeminiPassthroughLoggingHandler: "kwargs": kwargs, } + @staticmethod + def gemini_deployment_id(model: str) -> str | None: + """The configured ``gemini/`` deployment CheckBatchCost bills a pass-through batch through, or nothing.""" + from litellm.proxy.proxy_server import llm_router + + if llm_router is None: + return None + deployments: Final = tuple( + _JSON_OBJECT.validate_python(deployment) + for deployment in llm_router.registry().deployments(model_name=model) or () + ) + deployment_ids: Final = ( + _JSON_OBJECT.validate_python(deployment.get("model_info") or _EMPTY).get("id") + for deployment in deployments + if _JSON_OBJECT.validate_python(deployment.get("litellm_params") or _EMPTY).get("model") + == f"gemini/{model}" + ) + return next((deployment_id for deployment_id in deployment_ids if isinstance(deployment_id, str)), None) + + @staticmethod + def _batch_create_handler( + httpx_response: httpx.Response, + logging_obj: LiteLLMLoggingObj, + url_route: str, + start_time: datetime, + kwargs: Mapping[str, object], + ) -> PassThroughEndpointLoggingTypedDict: + """A 200 from ``models/{model}:batchGenerateContent`` registers the job for the calling key, so + CheckBatchCost prices its output file when it completes. Anything else is logged as the plain + $0 pass-through row it always was.""" + from litellm._uuid import uuid + from litellm.llms.gemini.batches.transformation import GeminiBatchesConfig + + model: Final = GeminiPassthroughLoggingHandler.extract_model_from_url(url_route) + if httpx_response.status_code != 200 or "name" not in _JSON_OBJECT.validate_json(httpx_response.content): + return {"result": None, "kwargs": dict(kwargs, model=model, custom_llm_provider="gemini")} + batch: Final = GeminiBatchesConfig().transform_create_batch_response( + model=model, raw_response=httpx_response, logging_obj=logging_obj, litellm_params=MappingProxyType({}) + ) + deployment_id: Final = GeminiPassthroughLoggingHandler.gemini_deployment_id(model) + if deployment_id is None: + verbose_proxy_logger.warning( + "No gemini/%s deployment is configured, so batch %s created through the pass-through cannot be billed", + model, + batch.id, + ) + return { + "result": None, + "kwargs": dict(kwargs, model=model, custom_llm_provider="gemini", batch_id=batch.id), + } + unified_object_id: Final = unified_batch_object_id(deployment_id, batch.id) + litellm_params: Final = _JSON_OBJECT.validate_python(kwargs.get("litellm_params") or _EMPTY) + request_metadata: Final = _JSON_OBJECT.validate_python(litellm_params.get("metadata") or _EMPTY) + register_passthrough_batch("Gemini", unified_object_id, batch, batch.id, request_metadata) + + litellm_model_response: Final = ModelResponse() + litellm_model_response.id = str(uuid.uuid4()) + litellm_model_response.model = model + litellm_model_response.object = "batch" + litellm_model_response.created = int(start_time.timestamp()) + litellm_model_response.choices = [ + Choices( + finish_reason="stop", + index=0, + message={ + "role": "assistant", + "content": f"Batch job {batch.id} created and is pending. Spend lands when the batch completes.", + "tool_calls": None, + "function_call": None, + "provider_specific_fields": { + "batch_job_id": batch.id, + "batch_job_state": batch.status, + "unified_object_id": unified_object_id, + }, + }, + ) + ] + logging_obj.model = model # rebind-ok: passthrough attribution records the resolved Gemini model + logging_obj.model_call_details.update( + {"model": model, "custom_llm_provider": "gemini", "response_cost": 0.0, "batch_id": batch.id} + ) + return { + "result": litellm_model_response, + "kwargs": dict( + kwargs, + response_cost=0.0, + model=model, + custom_llm_provider="gemini", + batch_id=batch.id, + unified_object_id=unified_object_id, + ), + } + @staticmethod def _handle_logging_gemini_collected_chunks( litellm_logging_obj: LiteLLMLoggingObj, diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index 6f2fb78200a..0fcaccd340e 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -168,8 +168,10 @@ from litellm.types.llms.custom_http import httpxSpecialProvider from litellm.types.passthrough_endpoints.pass_through_endpoints import ( LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY, LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY, + LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY, LITELLM_PASS_THROUGH_ENDPOINT_MARKER, LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY, + DeploymentPricingResolver, EndpointType, PassthroughStandardLoggingPayload, WebSocketSessionMeter, @@ -453,6 +455,20 @@ async def chat_completion_pass_through_endpoint( ) +_PASS_THROUGH_REQUEST_STATE_KEYS: Final = ( + LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY, + LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY, + LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY, + LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY, +) + + +def _clear_pass_through_request_state(state: object) -> None: + for key in _PASS_THROUGH_REQUEST_STATE_KEYS: + if hasattr(state, key): + delattr(state, key) + + def _is_provider_payload(request: Request) -> bool: return is_opaque_pass_through_request(get_request_route(request), request.headers.get("content-type", "")) @@ -803,6 +819,14 @@ class HttpPassThroughEndpointHelpers(BasePassthroughUtils): ) if isinstance(deployment_model_info, Mapping): _metadata["model_info"] = dict(deployment_model_info) + deployment_pricing: Final = getattr(_request_state, LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY, None) + priced_model_info: Final = ( + deployment_pricing.resolve(server_marker_free_body) + if isinstance(deployment_pricing, DeploymentPricingResolver) + else None + ) + if priced_model_info is not None: + _metadata["model_info"] = dict(priced_model_info) kwargs: Final = { "litellm_params": { @@ -2541,12 +2565,7 @@ def create_pass_through_route( keep_target_query=keep_target_query, ) finally: - if hasattr(request.state, LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY): - delattr(request.state, LITELLM_PASS_THROUGH_CUSTOM_BODY_STATE_KEY) - if hasattr(request.state, LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY): - delattr(request.state, LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY) - if hasattr(request.state, LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY): - delattr(request.state, LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY) + _clear_pass_through_request_state(request.state) # The upstream withholds its response headers until its first token, so # the whole time-to-first-token is spent inside _relay with nothing on diff --git a/litellm/proxy/pass_through_endpoints/success_handler.py b/litellm/proxy/pass_through_endpoints/success_handler.py index 4552ac98624..2375cd4dc69 100644 --- a/litellm/proxy/pass_through_endpoints/success_handler.py +++ b/litellm/proxy/pass_through_endpoints/success_handler.py @@ -159,6 +159,7 @@ class PassThroughEndpointLogging: self.TRACKED_GEMINI_ROUTES = [ "generateContent", "streamGenerateContent", + "batchGenerateContent", "predictLongRunning", ] diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index a4b67974cc1..be63d877243 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -5749,7 +5749,6 @@ def should_load_db_object(object_type: str | SupportedDBObjectType) -> bool: _CONFIG_PERSISTED_SECTIONS: Final = ("general_settings", "router_settings", "litellm_settings") _CONFIG_UNMANAGED_EXCLUSIONS: Final = frozenset(("environment_variables", "model_list")) _CONFIG_SECTION_VALUES: Final = TypeAdapter(Mapping[str, JsonValue]) -_CONFIG_SECTION_LOCK_SQL: Final = "SELECT 1 AS locked FROM pg_advisory_xact_lock(hashtext($1))" class _ConfigParamWhere(TypedDict): @@ -6302,7 +6301,7 @@ class ProxyConfig: prisma_client: PrismaClient, ) -> Mapping[str, JsonValue] | None: async with prisma_client.tx() as tx: - await tx.query_raw(_CONFIG_SECTION_LOCK_SQL, section_name) + await tx.query_raw(CONFIG_PARAM_LOCK_SQL, section_name) config_table: Final = cast("TableActions[_ConfigParamRow]", tx.litellm_config) config_where: Final[_ConfigParamWhere] = {"param_name": section_name} existing_row: Final[_ConfigParamRow | None] = await config_table.find_first(where=config_where) @@ -15288,7 +15287,7 @@ from litellm.llms.anthropic.count_tokens.token_counter import AnthropicTokenCoun from litellm.llms.base_llm.base_utils import BaseTokenCounter from litellm.llms.openai.responses.count_tokens.token_counter import OpenAITokenCounter from litellm.proxy.db.routing_prisma_wrapper import WriterPinnedClient -from litellm.repositories.config_repository import ConfigRepository +from litellm.repositories.config_repository import CONFIG_PARAM_LOCK_SQL, ConfigRepository from litellm.repositories.model_repository import ModelRepository from litellm.repositories.table_repositories import ( AccessGroupRepository, diff --git a/litellm/proxy/route_llm_request.py b/litellm/proxy/route_llm_request.py index b1ebd042f3d..5810a2f71ab 100644 --- a/litellm/proxy/route_llm_request.py +++ b/litellm/proxy/route_llm_request.py @@ -280,7 +280,10 @@ REQUIRED_ONE_OF_BODY_PARAMS_BY_ROUTE: Final[Mapping[str, tuple[str, str]]] = Map ) BODY_PARAM_ALTERNATIVES_BY_ROUTE: Final[Mapping[str, Mapping[str, tuple[str, ...]]]] = MappingProxyType( - {"acreate_interaction": MappingProxyType({"input": ("continuation_token",)})} + { + "acreate_interaction": MappingProxyType({"input": ("continuation_token",)}), + "avector_store_search": MappingProxyType({"query": ("query_image",)}), + } ) JSON_OBJECT_ADAPTER: Final[TypeAdapter[dict[str, object]]] = TypeAdapter(dict[str, object]) diff --git a/litellm/proxy/rust_forward/platform/__init__.py b/litellm/proxy/rust_forward/platform/__init__.py index 4043adacdfb..b5a53d6efb0 100644 --- a/litellm/proxy/rust_forward/platform/__init__.py +++ b/litellm/proxy/rust_forward/platform/__init__.py @@ -24,6 +24,18 @@ class SpawnOptions: creationflags: int +class ChildProcess(Protocol): + @property + def pid(self) -> int: ... + + @property + def stdin(self) -> asyncio.StreamWriter | None: ... + + def send_signal(self, signum: int, /) -> None: ... + + async def wait(self) -> int: ... + + class Platform(Protocol): @property def name(self) -> str: ... @@ -46,9 +58,9 @@ class Platform(Protocol): def catch(self, loop: asyncio.AbstractEventLoop, on_signal: Callable[[signal.Signals], None]) -> None: ... - def signal_child(self, process: asyncio.subprocess.Process, signum: signal.Signals) -> None: ... + def signal_child(self, process: ChildProcess, signum: signal.Signals) -> None: ... - def stop_group(self, process: asyncio.subprocess.Process) -> None: ... + def stop_group(self, process: ChildProcess) -> None: ... def current_platform() -> Platform: diff --git a/litellm/proxy/rust_forward/platform/posix.py b/litellm/proxy/rust_forward/platform/posix.py index 0d0c6c96649..0cb71b01ae2 100644 --- a/litellm/proxy/rust_forward/platform/posix.py +++ b/litellm/proxy/rust_forward/platform/posix.py @@ -10,7 +10,7 @@ from typing import Final from pydantic import TypeAdapter from litellm.proxy.rust_forward.mode import RUST_HOP -from litellm.proxy.rust_forward.platform import PlatformListener, SpawnOptions +from litellm.proxy.rust_forward.platform import ChildProcess, PlatformListener, SpawnOptions from litellm.proxy.rust_forward.server import Server from litellm.proxy.server_listener import InheritedFd @@ -55,10 +55,10 @@ class PosixPlatform: for signum in self.relayed_signals: loop.add_signal_handler(signum, on_signal, signum) - def signal_child(self, process: asyncio.subprocess.Process, signum: signal.Signals) -> None: + def signal_child(self, process: ChildProcess, signum: signal.Signals) -> None: with contextlib.suppress(ProcessLookupError): process.send_signal(signum) - def stop_group(self, process: asyncio.subprocess.Process) -> None: + def stop_group(self, process: ChildProcess) -> None: with contextlib.suppress(ProcessLookupError): os.killpg(process.pid, signal.SIGTERM) diff --git a/litellm/proxy/rust_forward/platform/windows.py b/litellm/proxy/rust_forward/platform/windows.py index 163b96b9b20..841c9cbfd59 100644 --- a/litellm/proxy/rust_forward/platform/windows.py +++ b/litellm/proxy/rust_forward/platform/windows.py @@ -10,7 +10,7 @@ from typing import Final from pydantic import TypeAdapter from litellm.proxy.rust_forward.mode import RUST_HOP -from litellm.proxy.rust_forward.platform import PlatformListener, SpawnOptions +from litellm.proxy.rust_forward.platform import ChildProcess, PlatformListener, SpawnOptions from litellm.proxy.rust_forward.server import Server from litellm.proxy.server_listener import AssignedPort @@ -60,9 +60,9 @@ class WindowsPlatform: # A child in its own process group can only be sent CTRL_BREAK_EVENT, since Windows never delivers CTRL_C_EVENT # to a new group. Both children shut down on it as on Ctrl-C, but uvicorn force-exits only on a repeated SIGINT, # so a second Ctrl-C does not cut a Windows shutdown short the way it does on POSIX. - def signal_child(self, process: asyncio.subprocess.Process, signum: signal.Signals) -> None: + def signal_child(self, process: ChildProcess, signum: signal.Signals) -> None: self.stop_group(process) - def stop_group(self, process: asyncio.subprocess.Process) -> None: + def stop_group(self, process: ChildProcess) -> None: with contextlib.suppress(ProcessLookupError): process.send_signal(CTRL_BREAK_EVENT) diff --git a/litellm/proxy/rust_forward/supervisor/runtime.py b/litellm/proxy/rust_forward/supervisor/runtime.py index 7b727fc0d80..8a8bda6f7f2 100644 --- a/litellm/proxy/rust_forward/supervisor/runtime.py +++ b/litellm/proxy/rust_forward/supervisor/runtime.py @@ -14,7 +14,7 @@ from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStre from typing_extensions import assert_never from litellm.proxy.rust_forward.mode import RUST_HOP -from litellm.proxy.rust_forward.platform import Platform +from litellm.proxy.rust_forward.platform import ChildProcess, Platform from litellm.proxy.rust_forward.server import PythonServer from litellm.proxy.rust_forward.supervisor.children import ChildSpec, python_spec, rust_spec from litellm.proxy.rust_forward.supervisor.lifecycle import ( @@ -46,6 +46,27 @@ class Executor(Protocol): async def next_event(self) -> Event: ... +class ChildControl(Protocol): + def signal_child(self, process: ChildProcess, signum: signal.Signals) -> None: ... + + def stop_group(self, process: ChildProcess) -> None: ... + + +class Spawner(Protocol): + async def __call__(self, spec: ChildSpec, /) -> ChildProcess: ... + + +async def spawn_subprocess(spec: ChildSpec) -> asyncio.subprocess.Process: + return await asyncio.create_subprocess_exec( + *spec.argv, + stdin=asyncio.subprocess.PIPE, + env={**os.environ, **spec.env_overrides}, + pass_fds=spec.spawn.pass_fds, + start_new_session=spec.spawn.start_new_session, + creationflags=spec.spawn.creationflags, + ) + + async def run(platform: Platform, binary: str, command: Sequence[str], server: PythonServer) -> int | SpawnFailed: with platform.private_listener() as private: specs: Final = MappingProxyType( @@ -54,7 +75,7 @@ async def run(platform: Platform, binary: str, command: Sequence[str], server: P Child.RUST: rust_spec(platform, binary, private.port, server), } ) - async with open_children(platform, specs, private.port) as children: + async with open_children(platform, spawn_subprocess, specs, private.port) as children: platform.catch(asyncio.get_running_loop(), children.caught) return await drive(children, platform.stop_signals) @@ -100,14 +121,15 @@ def exit_like( @dataclass(frozen=True, slots=True) class Children: - platform: Platform + platform: ChildControl + spawner: Spawner specs: Mapping[Child, ChildSpec] private_port: int stack: contextlib.AsyncExitStack tasks: TaskGroup events_in: MemoryObjectSendStream[Event] events_out: MemoryObjectReceiveStream[Event] - processes: dict[Child, asyncio.subprocess.Process] # mutable-ok: the running children the stack owns + processes: dict[Child, ChildProcess] # mutable-ok: the running children the stack owns def caught(self, signum: signal.Signals) -> None: with contextlib.suppress(anyio.ClosedResourceError): @@ -115,7 +137,9 @@ class Children: async def spawn(self, child: Child) -> SpawnFailed | None: try: - process: Final = await self.stack.enter_async_context(_process(self.platform, self.specs[child])) + process: Final = await self.stack.enter_async_context( + _process(self.platform, self.spawner, self.specs[child]) + ) except OSError as error: return SpawnFailed(error) self.processes[child] = process @@ -137,28 +161,21 @@ class Children: # unbounded event buffer. @contextlib.asynccontextmanager async def open_children( - platform: Platform, specs: Mapping[Child, ChildSpec], private_port: int + platform: ChildControl, spawner: Spawner, specs: Mapping[Child, ChildSpec], private_port: int ) -> AsyncGenerator[Children]: events_in, events_out = anyio.create_memory_object_stream[Event](math.inf) with events_in, events_out: async with contextlib.AsyncExitStack() as stack: tasks: Final = await stack.enter_async_context(anyio.create_task_group()) - yield Children(platform, specs, private_port, stack, tasks, events_in, events_out, {}) + yield Children(platform, spawner, specs, private_port, stack, tasks, events_in, events_out, {}) # A child's stdin is a pipe only the supervisor holds open, so the child sees EOF as soon as the supervisor is gone, # however it went, and shuts down instead of outliving it. Stopping is shielded so a cancelled supervisor still waits # for the child it is stopping. @contextlib.asynccontextmanager -async def _process(platform: Platform, spec: ChildSpec) -> AsyncGenerator[asyncio.subprocess.Process]: - process: Final = await asyncio.create_subprocess_exec( - *spec.argv, - stdin=asyncio.subprocess.PIPE, - env={**os.environ, **spec.env_overrides}, - pass_fds=spec.spawn.pass_fds, - start_new_session=spec.spawn.start_new_session, - creationflags=spec.spawn.creationflags, - ) +async def _process(platform: ChildControl, spawner: Spawner, spec: ChildSpec) -> AsyncGenerator[ChildProcess]: + process: Final = await spawner(spec) try: yield process finally: @@ -169,9 +186,7 @@ async def _process(platform: Platform, spec: ChildSpec) -> AsyncGenerator[asynci process.stdin.close() -async def _report_exit( - child: Child, process: asyncio.subprocess.Process, events: MemoryObjectSendStream[Event] -) -> None: +async def _report_exit(child: Child, process: ChildProcess, events: MemoryObjectSendStream[Event]) -> None: with events: events.send_nowait(ChildExited(child, await process.wait())) diff --git a/litellm/proxy/vector_store_endpoints/endpoints.py b/litellm/proxy/vector_store_endpoints/endpoints.py index a6f9ba2ef14..0065f8e4002 100644 --- a/litellm/proxy/vector_store_endpoints/endpoints.py +++ b/litellm/proxy/vector_store_endpoints/endpoints.py @@ -36,6 +36,7 @@ from litellm.proxy.vector_store_endpoints.utils import ( from litellm.repositories.table_repositories import ManagedVectorStoreIndexRepository from litellm.types.utils import LlmProviders from litellm.types.vector_stores import IndexCreateRequest, IndexListResponse +from litellm.vector_stores.search_query import store_search_params, with_caller_query_params from litellm.vector_stores.utils import VectorStoreWriteBody, callers_metadata_snapshot from litellm.vector_stores.vector_store_registry import VectorStoreIndexRegistry @@ -113,8 +114,8 @@ def build_request_data_from_managed_vector_store( if key in vector_store } ) - litellm_params: Final = vector_store.get("litellm_params") or MappingProxyType({}) - return MappingProxyType({**top_level, **litellm_params}) + litellm_params: Final[Mapping[str, object]] = vector_store.get("litellm_params") or MappingProxyType({}) + return MappingProxyType({**top_level, **store_search_params(litellm_params)}) async def _update_request_data_with_litellm_managed_vector_store_registry( @@ -187,8 +188,13 @@ async def vector_store_search( caller_body: Final = JSON_OBJECT_ADAPTER.validate_python(data) # Check for legacy vector store registry (non-managed vector stores) - data = await _update_request_data_with_litellm_managed_vector_store_registry( - data=data, vector_store_id=vector_store_id, user_api_key_dict=user_api_key_dict + data = dict( # rebind-ok: pre-existing rebinding of the request body + with_caller_query_params( + await _update_request_data_with_litellm_managed_vector_store_registry( + data=data, vector_store_id=vector_store_id, user_api_key_dict=user_api_key_dict + ), + caller_body.get("extra_body"), + ) ) reject_caller_opensearch_index_name( caller_body=caller_body, diff --git a/litellm/repositories/config_repository.py b/litellm/repositories/config_repository.py index 36c6ab7f711..e9973e1f674 100644 --- a/litellm/repositories/config_repository.py +++ b/litellm/repositories/config_repository.py @@ -4,9 +4,14 @@ from __future__ import annotations import json from collections.abc import Mapping, Sequence +from contextlib import AbstractAsyncContextManager from datetime import datetime from typing import TYPE_CHECKING, Final, Protocol, cast +from pydantic import JsonValue, TypeAdapter, ValidationError + +from litellm.models.fallback import STORED_FALLBACKS, FallbackRulesEdit, FallbackRulesEditor, SavedFallbackRule + if TYPE_CHECKING: from litellm.proxy.utils import PrismaClient @@ -39,10 +44,42 @@ class _ConfigTable(Protocol): async def delete_many(self, *, where: Mapping[str, object]) -> int: ... -class _ConfigDatabase(Protocol): +class _ConfigTransaction(Protocol): + @property + def litellm_config(self) -> _ConfigTable: ... + async def query_raw(self, query: str, *args: object) -> object: ... +class _ConfigWriter(_ConfigTransaction, Protocol): + def tx(self) -> AbstractAsyncContextManager[_ConfigTransaction]: ... + + +CONFIG_PARAM_LOCK_SQL: Final = "SELECT 1 AS locked FROM pg_advisory_xact_lock(hashtext($1))" +ROUTER_SETTINGS_PARAM: Final = "router_settings" +_JSON_VALUE: Final[TypeAdapter[JsonValue]] = TypeAdapter(JsonValue) +_JSON_RULES: Final = TypeAdapter(list[JsonValue]) +_ROUTER_SETTINGS: Final = TypeAdapter(dict[str, JsonValue]) + + +def _stored_router_settings(param_value: object) -> Mapping[str, JsonValue]: + try: + decoded: Final[object] = _JSON_VALUE.validate_json(param_value) if isinstance(param_value, str) else param_value + except ValidationError: + return {} + if not isinstance(decoded, Mapping): + return {} + return _ROUTER_SETTINGS.validate_python(decoded) + + +def _edited_router_settings( + param_value: object, fallback_key: str, edit: FallbackRulesEditor +) -> tuple[Mapping[str, JsonValue], FallbackRulesEdit]: + router_settings: Final = _stored_router_settings(param_value) + edited: Final = edit(STORED_FALLBACKS.validate_python(router_settings.get(fallback_key) or [])) + return {**router_settings, fallback_key: _JSON_RULES.validate_python(edited.rules)}, edited + + class ConfigParam: """Simple wrapper for config parameter from DB.""" @@ -73,6 +110,12 @@ class ConfigRepository: def table(self) -> _ConfigTable: return self._config_table + @property + def _writer(self) -> _ConfigWriter: + return cast( # cast-ok: Prisma delegates database methods and transactions dynamically + _ConfigWriter, self.prisma_client.writer_db + ) + async def get_param(self, param_name: str) -> ConfigParam | None: """Get a config parameter from the database.""" record: Final = await self._config_table.find_unique(where={"param_name": param_name}) @@ -96,9 +139,7 @@ class ConfigRepository: return ConfigParam(param_name=param_name, param_value=param_value) async def set_param_if_revision(self, param_name: str, param_value: object, revision: int) -> bool: - delegate: Final = self.prisma_client.writer_db - database: Final = cast(_ConfigDatabase, delegate) # cast-ok: Prisma delegates database methods dynamically - rows: Final = await database.query_raw( + rows: Final = await self._writer.query_raw( """INSERT INTO "LiteLLM_Config" (param_name, param_value, last_run_at) SELECT $1, $2::jsonb, NOW() WHERE $3::int = 0 ON CONFLICT (param_name) DO UPDATE @@ -115,6 +156,31 @@ class ConfigRepository: ) return bool(rows) + async def saved_rules(self, fallback_key: str) -> Sequence[SavedFallbackRule] | None: + row: Final = await self._config_table.find_unique(where={"param_name": ROUTER_SETTINGS_PARAM}) + if row is None: + return None + rules: Final = _stored_router_settings(row.param_value).get(fallback_key) + if rules is None: + return None + return rules if isinstance(rules, list) else () + + async def edit_rules(self, fallback_key: str, edit: FallbackRulesEditor) -> FallbackRulesEdit: + param_name: Final = ROUTER_SETTINGS_PARAM + async with self._writer.tx() as transaction: + await transaction.query_raw(CONFIG_PARAM_LOCK_SQL, param_name) + row: Final = await transaction.litellm_config.find_unique(where={"param_name": param_name}) + value, result = _edited_router_settings(None if row is None else row.param_value, fallback_key, edit) + value_json: Final = json.dumps(dict(value)) + await transaction.litellm_config.upsert( + where={"param_name": param_name}, + data={ + "create": {"param_name": param_name, "param_value": value_json}, + "update": {"param_value": value_json}, + }, + ) + return result + async def delete_param(self, param_name: str) -> bool: """Delete a config parameter from the database.""" try: diff --git a/litellm/responses/litellm_completion_transformation/streaming_iterator.py b/litellm/responses/litellm_completion_transformation/streaming_iterator.py index 489ab8a317d..ea02e4830d2 100644 --- a/litellm/responses/litellm_completion_transformation/streaming_iterator.py +++ b/litellm/responses/litellm_completion_transformation/streaming_iterator.py @@ -187,7 +187,7 @@ class LiteLLMCompletionStreamingIterator(ResponsesAPIStreamingIterator): self.request_input: str | ResponseInputParam = request_input self.responses_api_request: ResponsesAPIOptionalRequestParams = responses_api_request self.custom_llm_provider: str | None = custom_llm_provider - self.litellm_metadata: dict | None = litellm_metadata or {} + self.litellm_metadata: dict[str, object] | None = litellm_metadata or {} self.tool_call_provider_fields: Final = tool_call_provider_fields # Store lightweight dict snapshots for stream_chunk_builder to reduce # repeated Pydantic attribute access in end-of-stream assembly. @@ -1331,7 +1331,12 @@ class LiteLLMCompletionStreamingIterator(ResponsesAPIStreamingIterator): def _stamp_sequence_number(self, event: BaseLiteLLMOpenAIResponseObject) -> BaseLiteLLMOpenAIResponseObject: stamped: Final = event.model_copy(update={"sequence_number": self._sequence_number}) self._sequence_number += 1 - return stamped + affinity_model_id: Final = ResponsesAPIRequestUtils.affinity_model_id(self.litellm_metadata) + return ( + stamped + if affinity_model_id is None + else ResponsesAPIRequestUtils.encode_stream_event_for_affinity(stamped, affinity_model_id) + ) async def __anext__( self, diff --git a/litellm/responses/streaming_iterator.py b/litellm/responses/streaming_iterator.py index 347537277df..dca93436efa 100644 --- a/litellm/responses/streaming_iterator.py +++ b/litellm/responses/streaming_iterator.py @@ -498,11 +498,17 @@ class BaseResponsesAPIStreamingIterator: "type": ResponsesAPIStreamEvents.ERROR.value, } ) - openai_responses_api_chunk: Final = self.responses_api_provider_config.transform_streaming_response( + transformed_chunk: Final = self.responses_api_provider_config.transform_streaming_response( model=self.model, parsed_chunk=typed_chunk, logging_obj=self.logging_obj, ) + affinity_model_id: Final = ResponsesAPIRequestUtils.affinity_model_id(self.litellm_metadata) + openai_responses_api_chunk: Final = ( + transformed_chunk + if affinity_model_id is None + else ResponsesAPIRequestUtils.encode_stream_event_for_affinity(transformed_chunk, affinity_model_id) + ) # Only when the SSE JSON carries a response body (delta events do not). # Using getattr(..., "response") alone is unsafe with Mocks: they synthesize a @@ -571,27 +577,6 @@ class BaseResponsesAPIStreamingIterator: _stream_model_id, ) - # Wrap encrypted_content in streaming events (output_item.added, output_item.done) - if self.litellm_metadata and self.litellm_metadata.get("encrypted_content_affinity_enabled"): - openai_types = get_openai_response_types() - event_type: Final = getattr(openai_responses_api_chunk, "type", None) - if event_type in ( - openai_types.ResponsesAPIStreamEvents.OUTPUT_ITEM_ADDED, - openai_types.ResponsesAPIStreamEvents.OUTPUT_ITEM_DONE, - ): - item: Final[object | None] = getattr(openai_responses_api_chunk, "item", None) - if item: - encrypted_content: Final = getattr(item, "encrypted_content", None) - if encrypted_content and isinstance(encrypted_content, str): - model_id: Final = _model_id_from_metadata(self.litellm_metadata) - if model_id: - wrapped_content: Final = ( - ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id( - encrypted_content, model_id - ) - ) - setattr(item, "encrypted_content", wrapped_content) - # Store the completed response (also for incomplete/failed so logging still fires) _chunk_type: Final = getattr(openai_responses_api_chunk, "type", None) openai_types = get_openai_response_types() @@ -2493,9 +2478,6 @@ class _ResponsesWsTurn: ) -_RESPONSES_WS_OUTPUT_ITEM_EVENT_TYPES: Final = frozenset({"response.output_item.added", "response.output_item.done"}) - - def _ws_event_error(event: Mapping[str, object]) -> object: if event.get("type") == "error": return _error_event_error_object(event) @@ -2535,24 +2517,6 @@ def _restore_wrapped_ids_in_response_create(msg_obj: Mapping[str, object]) -> di return {**msg_obj, **top_fields, **restored_nested} -def _wrap_output_item_encrypted_content( - event_obj: Mapping[str, object], litellm_metadata: Mapping[str, object] -) -> dict[str, object] | None: - if not litellm_metadata.get("encrypted_content_affinity_enabled"): - return None - model_id: Final = _model_id_from_metadata(litellm_metadata) - item: Final = event_obj.get("item") - if model_id is None or not _is_json_object(item): - return None - encrypted_content: Final = item.get("encrypted_content") - if not isinstance(encrypted_content, str) or not encrypted_content: - return None - wrapped_content: Final = ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id( - encrypted_content=encrypted_content, model_id=model_id - ) - return {**event_obj, "item": {**item, "encrypted_content": wrapped_content}} - - class ResponsesWebSocketStreaming: """ Manages bidirectional WebSocket forwarding for the Responses API @@ -2758,9 +2722,12 @@ class ResponsesWebSocketStreaming: litellm_metadata=self.litellm_metadata, ) return json.dumps({**event_obj, "response": wrapped_response}) - if event_obj.get("type") not in _RESPONSES_WS_OUTPUT_ITEM_EVENT_TYPES: - return response_str - wrapped_event: Final = _wrap_output_item_encrypted_content(event_obj, self.litellm_metadata) + affinity_model_id: Final = ResponsesAPIRequestUtils.affinity_model_id(self.litellm_metadata) + wrapped_event: Final = ( + None + if affinity_model_id is None + else ResponsesAPIRequestUtils.affinity_encoded_stream_event(event_obj, affinity_model_id) + ) return response_str if wrapped_event is None else json.dumps(wrapped_event) async def backend_to_client(self) -> None: diff --git a/litellm/responses/utils.py b/litellm/responses/utils.py index 991cf6213c6..dd3bd1c7e35 100644 --- a/litellm/responses/utils.py +++ b/litellm/responses/utils.py @@ -13,7 +13,13 @@ from typing_extensions import TypeIs # noqa: TID251 # narrows untyped wire pay import litellm from litellm._logging import verbose_logger -from litellm.litellm_core_utils.core_helpers import as_str_mapping, attribute_or_none, decoded_json_object, iter_items +from litellm.litellm_core_utils.core_helpers import ( + as_object_list, + as_str_mapping, + attribute_or_none, + decoded_json_object, + iter_items, +) from litellm.litellm_core_utils.dot_notation_indexing import delete_nested_value, is_nested_path from litellm.litellm_core_utils.get_provider_specific_headers import ProviderSpecificHeaderUtils from litellm.llms.base_llm.responses.transformation import ( @@ -51,6 +57,19 @@ _PROVIDER_SPECIFIC_HEADER_ADAPTER: Final[ TypeAdapter[ProviderSpecificHeader | Sequence[ProviderSpecificHeader] | None] ] = TypeAdapter(ProviderSpecificHeader | Sequence[ProviderSpecificHeader] | None) _REASONING_FIELDS_ONLY_ITS_ORIGIN_RESOLVES: Final = frozenset({"encrypted_content", "id", "status"}) +_ENCRYPTED_OUTPUT_ITEM_TYPES: Final = frozenset({"reasoning", "compaction"}) +_OUTPUT_ITEM_EVENT_TYPES: Final = frozenset({"response.output_item.added", "response.output_item.done"}) +_REASONING_ITEM_EVENT_TYPES: Final = frozenset( + { + "response.reasoning_summary_part.added", + "response.reasoning_summary_part.done", + "response.reasoning_summary_text.delta", + "response.reasoning_summary_text.done", + "response.reasoning_text.delta", + "response.reasoning_text.done", + } +) +_CONTENT_PART_EVENT_TYPES: Final = frozenset({"response.content_part.added", "response.content_part.done"}) class _UsageExtraFields(ExtraItemsTypedDict, total=False, extra_items=object): @@ -133,6 +152,7 @@ def _as_input_text_part(part: object) -> object: _RequestInputT: Final = TypeVar("_RequestInputT") +_StreamEventT: Final = TypeVar("_StreamEventT", bound=BaseModel) def _provider_mapped_params( @@ -521,6 +541,95 @@ class ResponsesAPIRequestUtils: _decode_encrypted_item_id = decode_encrypted_item_id + @staticmethod + def affinity_model_id(litellm_metadata: Mapping[str, object] | None) -> str | None: + if not litellm_metadata or not litellm_metadata.get("encrypted_content_affinity_enabled"): + return None + model_info: Final = litellm_metadata.get("model_info") + model_id: Final = model_info.get("id") if _is_object_dict(model_info) else None + return model_id if isinstance(model_id, str) and model_id else None + + @staticmethod + def affinity_item_id(item_type: object, item_id: object, encrypted_content: object, model_id: str) -> str | None: + """The ``encitem_`` id an output item carries under encrypted-content affinity, or ``None`` to keep its id. + + Reasoning and compaction items qualify by type, so a stream encodes them before their + ``encrypted_content`` arrives and every event agrees with the final response. + """ + if not isinstance(item_id, str) or not item_id: + return None + if ResponsesAPIRequestUtils.decode_encrypted_item_id(item_id) is not None: + return None + encrypted_type: Final = isinstance(item_type, str) and item_type in _ENCRYPTED_OUTPUT_ITEM_TYPES + if not encrypted_type and not (isinstance(encrypted_content, str) and encrypted_content): + return None + return ResponsesAPIRequestUtils._build_encrypted_item_id(model_id, item_id) + + @staticmethod + def _reasoning_event_item_id(event_type: object, part_type: object, item_id: object, model_id: str) -> str | None: + if not isinstance(event_type, str): + return None + scoped_to_reasoning: Final = event_type in _REASONING_ITEM_EVENT_TYPES or ( + event_type in _CONTENT_PART_EVENT_TYPES and part_type == "reasoning_text" + ) + if not scoped_to_reasoning: + return None + return ResponsesAPIRequestUtils.affinity_item_id("reasoning", item_id, None, model_id) + + @staticmethod + def _affinity_item_updates( + item_type: object, item_id: object, encrypted_content: object, model_id: str + ) -> Mapping[str, str]: + encoded_id: Final = ResponsesAPIRequestUtils.affinity_item_id(item_type, item_id, encrypted_content, model_id) + wrapped: Final = ( + ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id(encrypted_content, model_id) + if isinstance(encrypted_content, str) and encrypted_content + else None + ) + return MappingProxyType( + {key: value for key, value in (("id", encoded_id), ("encrypted_content", wrapped)) if value is not None} + ) + + @staticmethod + def encode_stream_event_for_affinity(event: _StreamEventT, model_id: str) -> _StreamEventT: + """The stream event with the item id and wrapped ``encrypted_content`` the final response carries.""" + event_type: Final = attribute_or_none(event, "type") + if isinstance(event_type, str) and event_type in _OUTPUT_ITEM_EVENT_TYPES: + item: Final = attribute_or_none(event, "item") + if not isinstance(item, BaseModel): + return event + item_updates: Final = ResponsesAPIRequestUtils._affinity_item_updates( + attribute_or_none(item, "type"), + attribute_or_none(item, "id"), + attribute_or_none(item, "encrypted_content"), + model_id, + ) + return event.model_copy(update={"item": item.model_copy(update=item_updates)}) if item_updates else event + part: Final = attribute_or_none(event, "part") + encoded_item_id: Final = ResponsesAPIRequestUtils._reasoning_event_item_id( + event_type, + part.get("type") if _is_object_dict(part) else attribute_or_none(part, "type"), + attribute_or_none(event, "item_id"), + model_id, + ) + return event if encoded_item_id is None else event.model_copy(update={"item_id": encoded_item_id}) + + @staticmethod + def affinity_encoded_stream_event(event: Mapping[str, object], model_id: str) -> dict[str, object] | None: + """The JSON stream event with the ids and wrapped content the final response carries, or ``None``.""" + event_type: Final = event.get("type") + item: Final = event.get("item") + if isinstance(event_type, str) and event_type in _OUTPUT_ITEM_EVENT_TYPES and _is_object_dict(item): + item_updates: Final = ResponsesAPIRequestUtils._affinity_item_updates( + item.get("type"), item.get("id"), item.get("encrypted_content"), model_id + ) + return {**event, "item": {**item, **item_updates}} if item_updates else None + part: Final = event.get("part") + encoded_item_id: Final = ResponsesAPIRequestUtils._reasoning_event_item_id( + event_type, part.get("type") if _is_object_dict(part) else None, event.get("item_id"), model_id + ) + return None if encoded_item_id is None else {**event, "item_id": encoded_item_id} + @staticmethod def wrap_encrypted_content_with_model_id(encrypted_content: str, model_id: str) -> str: """Wrap encrypted_content with model_id metadata for affinity routing. @@ -576,7 +685,7 @@ class ResponsesAPIRequestUtils: response: Union["ResponsesAPIResponse", dict[str, object]], model_id: str | None, ) -> Union["ResponsesAPIResponse", dict[str, object]]: - """Rewrite item IDs for output items that contain ``encrypted_content``. + """Rewrite item IDs for reasoning, compaction and other output items that contain ``encrypted_content``. Encodes ``model_id`` into the item ID so that follow-up requests can be routed back to the originating deployment without any cache lookup. @@ -593,40 +702,28 @@ class ResponsesAPIRequestUtils: else: output = getattr(response, "output", None) - if not isinstance(output, list): + items: Final = as_object_list(output) + if items is None: return response - for item in output: - if isinstance(item, dict): - item_id = item.get("id") - encrypted_content = item.get("encrypted_content") - - if encrypted_content and isinstance(encrypted_content, str): - # Always wrap encrypted_content with model_id for redundancy - item["encrypted_content"] = ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id( - encrypted_content, model_id + for item in items: + if _is_object_dict(item): + item.update( + ResponsesAPIRequestUtils._affinity_item_updates( + item.get("type"), item.get("id"), item.get("encrypted_content"), model_id ) - # Also encode the ID if present - if item_id and isinstance(item_id, str): - item["id"] = ResponsesAPIRequestUtils._build_encrypted_item_id(model_id, item_id) - else: - item_id = getattr(item, "id", None) - encrypted_content = getattr(item, "encrypted_content", None) - - if encrypted_content and isinstance(encrypted_content, str): - # Always wrap encrypted_content with model_id for redundancy - try: - item.encrypted_content = ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id( - encrypted_content, model_id - ) - except AttributeError: - pass - # Also encode the ID if present - if item_id and isinstance(item_id, str): - try: - item.id = ResponsesAPIRequestUtils._build_encrypted_item_id(model_id, item_id) - except AttributeError: - pass + ) + continue + for key, value in ResponsesAPIRequestUtils._affinity_item_updates( + attribute_or_none(item, "type"), + attribute_or_none(item, "id"), + attribute_or_none(item, "encrypted_content"), + model_id, + ).items(): + try: + setattr(item, key, value) + except AttributeError: + pass return response diff --git a/litellm/router_rust/core.py b/litellm/router_rust/core.py index 69724f0b9fe..3d8627cd2b7 100644 --- a/litellm/router_rust/core.py +++ b/litellm/router_rust/core.py @@ -1351,6 +1351,9 @@ class _EndpointPort: def group_deployments(self, model_name: str) -> Sequence[Mapping[str, object]] | None: return self._core._hosted._core_get_model_list(model_name=model_name) # pyright: ignore[reportPrivateUsage] # see the class docstring + def group_members(self, model_name: str) -> Sequence[tuple[object, object]] | None: + return self._core._hosted._group_members(model_name) # pyright: ignore[reportPrivateUsage] # see the class docstring + def routed_name(self, model: object) -> str: return self._core.routed_name(model) @@ -1683,7 +1686,11 @@ class RustCore( try: selector: Final = self._prefetch_usage_selector(model, request) - deployments: Final = self._hosted._core_get_model_list(model_name=model) or [] # pyright: ignore[reportPrivateUsage] # see __init__ + deployments: Final = ( + self._hosted._core_get_model_list(model_name=model) or [] # pyright: ignore[reportPrivateUsage] # see __init__ + if isinstance(selector, LowestTPMLoggingHandler_v2) + else [] + ) except Exception: # noqa: BLE001 # the batched read is an optimisation: the reads stay apart yield return diff --git a/litellm/router_rust/invoke/endpoints.py b/litellm/router_rust/invoke/endpoints.py index fd3d055f707..5c1205c70ca 100644 --- a/litellm/router_rust/invoke/endpoints.py +++ b/litellm/router_rust/invoke/endpoints.py @@ -53,6 +53,7 @@ from litellm.router_strategy.complexity_router.context_compaction import ( surface_for_call, ) from litellm.router_utils.endpoint_eligibility import endpoint_for_call, endpoint_selection +from litellm.vector_stores.search_query import store_search_params if TYPE_CHECKING: from litellm.caching.dual_cache import DualCache @@ -121,6 +122,8 @@ class EndpointCore(Protocol): """``_core_get_model_list(model_name=...)`` on the host registry.""" ... + def group_members(self, model_name: str) -> Sequence[tuple[object, object]] | None: ... + def routed_name(self, model: object) -> str: """``RustCore.routed_name``: what a ``model`` that is no string raises, or the name it routes under.""" ... @@ -854,6 +857,16 @@ async def compacted_attempt( return await compact_to_fit(ctx, deployment, call.kwargs, _compaction_surface(core, plan)) +_VECTOR_STORE_SEARCH_OPS: Final = frozenset({"vector_stores.main.asearch", "vector_stores.main.search"}) + + +def _deployment_params( + plan: Plan, deployment: Mapping[str, object] +) -> dict[str, object]: # mutable-ok: the attempt's own copy of the deployment params + params: Final = as_dict(deployment.get("litellm_params")) + return as_dict(store_search_params(params)) if plan.host_op in _VECTOR_STORE_SEARCH_OPS else params + + def attempt_call( core: EndpointCore, plan: Plan, @@ -869,7 +882,7 @@ def attempt_call( shaping: Final = core.shaping kwargs: Final = without(request, *ROUTING_KEYS) named: Final = {name: kwargs.pop(name) for name in plan.named if name in kwargs} - data: Final = as_dict(deployment.get("litellm_params")) + data: Final = _deployment_params(plan, deployment) model_name: Final = str(data.get("model")) cache: Final = core.routing_cache caching: Final = shaping.cache_responses diff --git a/litellm/router_rust/invoke/prompt_management.py b/litellm/router_rust/invoke/prompt_management.py index 62bd77e1b48..74a7991b06c 100644 --- a/litellm/router_rust/invoke/prompt_management.py +++ b/litellm/router_rust/invoke/prompt_management.py @@ -21,10 +21,10 @@ _PROMPT_MANAGEMENT_PARAMS: Final = frozenset( def is_prompt_management_model(core: EndpointCore, model: str) -> bool: """`_is_prompt_management_model`: one deployment, whose model's provider prefix is a known custom-logger-compatible callback.""" - model_list: Final = core.group_deployments(model_name=model) - if model_list is None or len(model_list) != 1: + members: Final = core.group_members(model) + if members is None or len(members) != 1: return False - litellm_model: Final = as_dict(model_list[0].get("litellm_params")).get("model") + litellm_model: Final = members[0][1] if not isinstance(litellm_model, str) or "/" not in litellm_model: return False known: Final = core.host.dynamic().known_custom_logger_compatible_callbacks diff --git a/litellm/router_rust/surface/model_info.py b/litellm/router_rust/surface/model_info.py index 508d2bb1145..dd67e252370 100644 --- a/litellm/router_rust/surface/model_info.py +++ b/litellm/router_rust/surface/model_info.py @@ -35,6 +35,7 @@ from typing_extensions import overload import litellm from litellm._internal_context import service_target from litellm._logging import verbose_router_logger +from litellm.constants import DEFAULT_MAX_LRU_CACHE_SIZE from litellm.litellm_core_utils.add_retry_fallback_headers import ( apply_quality_router_decision_headers, apply_remaining_usage_headers, @@ -74,6 +75,7 @@ from litellm.types.utils import ModelInfo as ModelMapInfo from litellm.utils import get_utc_datetime, is_generalized_model_info if TYPE_CHECKING: + from litellm.router_rust.surface.registry import GroupCounters from litellm.rust_bridge._native import ( RouterCall, RouterCoreHandle, @@ -255,9 +257,12 @@ class HostModelInfo: """Mixed into ``HostRegistry``, which holds the model list, the indexes and the host.""" _core_usage_store: RouterUsage + _group_counters_cache: dict[str, "GroupCounters"] # mutable-ok: by model group def _live_handle(self) -> "RouterCoreHandle | None": ... # the registry's: the handle ``RustCore`` set + def _group_members(self, model_group: str) -> tuple[tuple[object, object], ...] | None: ... # the registry's + def _core_handle(self) -> "RouterCoreHandle": handle: Final = self._live_handle() if handle is None: @@ -798,17 +803,21 @@ class HostModelInfo: """This minute's tpm and rpm counters of every deployment in ``model_group`` (can be a wildcard route), under the model sent to ``litellm.completion()``, as the usage writes name them.""" current_minute: Final = get_utc_datetime().strftime("%H-%M") # use the same timezone regardless of system clock - model_list: Final = self._core_get_model_list(model_name=model_group) - if model_list is None: # no matching deployments + members: Final = self._group_members(model_group) + if members is None: # no matching deployments return None - named: Final = tuple( - (model.get("model_info", {}).get("id"), model["litellm_params"].get("model")) for model in model_list - ) - deployments: Final = tuple(pair for pair in named if pair[0] is not None and pair[1] is not None) - return tuple( - tuple(UsageCounter(id, litellm_model, current_minute, kind) for id, litellm_model in deployments) + cached: Final = self._group_counters_cache.get(model_group) + if cached is not None and cached[0] is members and cached[1] == current_minute: + return cached[2] + deployments: Final = tuple(pair for pair in members if pair[0] is not None and pair[1] is not None) + counters: Final = tuple( + tuple(UsageCounter(id, litellm_model, current_minute, kind) for id, litellm_model in deployments) # pyright: ignore[reportArgumentType] # what the listing names, as the Python core passed it for kind in ("tpm", "rpm") ) + if len(self._group_counters_cache) >= DEFAULT_MAX_LRU_CACHE_SIZE: + self._group_counters_cache.clear() + self._group_counters_cache[model_group] = (members, current_minute, counters) + return counters async def _core_get_model_group_usage(self, model_group: str) -> tuple[int | None, int | None]: """Current (tpm, rpm) usage of ``model_group``.""" diff --git a/litellm/router_rust/surface/registry.py b/litellm/router_rust/surface/registry.py index 59d3d7389be..18bc493b878 100644 --- a/litellm/router_rust/surface/registry.py +++ b/litellm/router_rust/surface/registry.py @@ -96,7 +96,7 @@ from litellm.litellm_core_utils.routing_groups import apply_routing_group_priori from litellm.llms.openai_like.json_loader import JSONProviderRegistry from litellm.llms.openai_like.model_info import MODEL_INFO_REFRESH_SECONDS from litellm.redis.stores.connection import connect -from litellm.redis.stores.router_usage import RouterUsage, RouterUsageStore +from litellm.redis.stores.router_usage import RouterUsage, RouterUsageStore, UsageCounter from litellm.responses.bridge_check import keep_registered_mode from litellm.router_api import RouterRegistry, deployment_id from litellm.router_rust.invoke.shaping import ROUTER_CLIENTS_TARGET @@ -697,6 +697,21 @@ def _index_key(value: object) -> str | None: return value if isinstance(value, str) else None +GroupMembers: TypeAlias = tuple[tuple[object, object], ...] +GroupCounters: TypeAlias = tuple[object, str, tuple[tuple[UsageCounter, ...], ...]] + + +def _members_of(model_list: Sequence[Mapping[str, object]] | None) -> GroupMembers | None: + if model_list is None: + return None + return tuple((_field(entry, "model_info", "id"), _field(entry, "litellm_params", "model")) for entry in model_list) + + +def _field(entry: Mapping[str, object], section: str, key: str) -> object: + held: Final = entry.get(section) + return held.get(key) if isinstance(held, Mapping) else None + + def _round_trips(value: object) -> bool: """Whether JSON reads ``value`` back equal to itself.""" try: @@ -787,6 +802,8 @@ class HostRegistry(HostModelInfo): # `zero_cost()`: the per-deployment zero-cost lookup the auth checks fill, emptied with the # group info caches. self._zero_cost_cache: dict[str, bool] = {} # mutable-ok: the auth checks write into it + self._group_members_cache: dict[str, tuple[object, GroupMembers | None]] = {} # mutable-ok: by model group + self._group_counters_cache = {} # The routing cache usage reads come from; RustCore sets it to the one its Rust core writes. self._core_cache: DualCache = DualCache() # The tpm/rpm store usage reads come from; RustCore sets it to the one its Rust core writes. @@ -939,6 +956,7 @@ class HostRegistry(HostModelInfo): self._core_cached_deployment_model_info.cache_clear() # pyright: ignore[reportFunctionMemberAccess] # an lru_cache self.cached_deployment_tracks_usage.cache_clear() # pyright: ignore[reportFunctionMemberAccess] # an lru_cache self._zero_cost_cache.clear() + self._group_members_cache.clear() self._routing_group_rows = None def set_routing_groups(self, groups: Sequence[RoutingGroup]) -> None: @@ -1887,6 +1905,21 @@ class HostRegistry(HostModelInfo): return sum(len(held(member)) for member in group.models) > 1 + def _group_members(self, model_group: str) -> GroupMembers | None: + # An alias or a wildcard name reads state the registry version does not cover: those list every time. + handle: Final = self._live_handle() + if handle is None or _index_key(model_group) is None or model_group in (self._core_model_group_alias or {}): + return _members_of(self._core_get_model_list(model_name=model_group)) + stamp: Final = (handle, handle.registry_version(), self._registry_version) + cached: Final = self._group_members_cache.get(model_group) + if cached is not None and cached[0] == stamp: + return cached[1] + members: Final = _members_of(self._core_get_model_list(model_name=model_group)) + if len(self._group_members_cache) >= DEFAULT_MAX_LRU_CACHE_SIZE: + self._group_members_cache.clear() + self._group_members_cache[model_group] = (stamp, members) + return members + def _core_get_model_list_from_model_alias( self, model_name: str | None = None ) -> list[UntypedEntry]: # mutable-ok: a fresh list diff --git a/litellm/rust_bridge/AGENTS.md b/litellm/rust_bridge/AGENTS.md index a13f57fae4b..ca71fc59c28 100644 --- a/litellm/rust_bridge/AGENTS.md +++ b/litellm/rust_bridge/AGENTS.md @@ -21,8 +21,11 @@ - `tests/test_litellm_rust/test_public_entries.py` marks such a route `python=None`, so dropping a route's Python changes its entries, its rules and that field together - A detector reads the same inputs the legacy Python path reads, so the catalog and the fallback agree on which requests need Python - A route's context, its target as well as its features, reads `NativeCall.resolved`, so an argument counts the same whether it came by position, by keyword or as a signature default - - A route's sync and async dispatches read different detector maps when the legacy handlers differ: Messages runs pre-request hooks, web search interception and interceptors only on async calls, and the sync Responses handler runs the deployment hook itself + - A route's sync and async dispatches read different detector maps when the legacy handlers differ, as the sync Responses handler runs the deployment hook itself. Messages reads one map for both, since Rust serves its async-only pre-request hooks, web search short-circuit and interceptors through host calls - A detector that raises keeps the call on Python. `PublicDispatch` logs it and never fails the call over routing +- Messages for provider `anthropic` is `RUST_REQUIRED` and has no Python path + - a call the rules would send to Python (a `MESSAGES_PYTHON_FEATURES` feature or a raising detector) raises `UnsupportedParamsError` from the Python fallback in `litellm/messages/dispatch.py`, which names the detected features + - other Messages providers keep the Python fallback - `catalog.RULES` is rollout policy with no tests of its own. Tests pass the rules they need, so check these invariants by review whenever `RULES` changes # Public entries diff --git a/litellm/rust_bridge/_native.pyi b/litellm/rust_bridge/_native.pyi index ebbd45c7382..bde79aeac48 100644 --- a/litellm/rust_bridge/_native.pyi +++ b/litellm/rust_bridge/_native.pyi @@ -21,6 +21,7 @@ class NativeRedisStoreError(Exception): ... def trace_encode_error(message: str) -> bytes: ... def bundled_model_cost_map() -> bytes: ... def native_redis_breaker_states() -> list[str]: ... +def unsupported_tls_settings(ssl_security_level: str | None = None, ssl_ecdh_curve: str | None = None) -> list[str]: ... @final class NativeCostMapSource: def __new__(cls, url: str, *, use_http_settings: bool) -> NativeCostMapSource: ... @@ -732,6 +733,7 @@ __all__ = [ "responses", "trace_encode_error", "transcription", + "unsupported_tls_settings", ] @final diff --git a/litellm/rust_bridge/catalog.py b/litellm/rust_bridge/catalog.py index c493617003d..87f4c855561 100644 --- a/litellm/rust_bridge/catalog.py +++ b/litellm/rust_bridge/catalog.py @@ -32,8 +32,6 @@ class Target(str, Enum): class Feature(str, Enum): - SAFEGUARDS_CLASSIFIER = "safeguards_classifier" - """A non-Claude model with dangerous_tool_use safeguards, which the proxy classifier answers.""" MOCK_RESPONSE = "mock_response" """mock_response short-circuits before any provider call.""" PROXY_MCP_TOOLS = "proxy_mcp_tools" @@ -66,14 +64,6 @@ class Feature(str, Enum): """Extra body fields that Python transforms and merges into the provider request.""" PROVIDER_AFFINITY = "provider_affinity" """A provider affinity header that Python validates and populates from the session id.""" - FOUNDRY_BETA_ROW = "foundry_beta_row" - """A Foundry api_base, where Python drops the anthropic-beta values Foundry rejects.""" - PRE_REQUEST_HOOK = "pre_request_hook" - """A logger overriding async_pre_request_hook, which may rewrite the request.""" - WEBSEARCH_INTERCEPTION = "websearch_interception" - """A WebSearchInterceptionLogger that may answer without calling the provider.""" - MESSAGES_INTERCEPTOR = "messages_interceptor" - """A registered MessagesInterceptor that takes over the call.""" AGENTIC_LOOP_HOOK = "agentic_loop_hook" """A logger overriding async_should_run_agentic_loop, which may run follow-up calls.""" RESPONSE_CACHE = "response_cache" @@ -94,14 +84,6 @@ class Feature(str, Enum): """No static key, so Python mints a workload identity federation token.""" CACHE_CONTROL_INJECTION = "cache_control_injection" """Prompt caching injection that Python applies to messages and system.""" - STREAM_COST_INJECTION = "stream_cost_injection" - """litellm.include_cost_in_streaming_usage or the x-litellm-include-cost-in-streaming-usage header, where Python adds cost to streamed usage.""" - THINKING_SIGNATURE_RETRY = "thinking_signature_retry" - """Replayed thinking blocks, which Python strips and retries once if Anthropic rejects their signature.""" - TOOL_CUSTOM_FIELD = "tool_custom_field" - """Tools carrying a non-spec custom object, which Python drops or hoists for the provider.""" - STRICT_TOOLS_RETRY = "strict_tools_retry" - """Strict tools under drop_params, which Python sends again without strict if Claude rejects their limits.""" CLIENT_HEADERS = "client_headers" """Proxy-forwarded headers that Python merges into extra_headers.""" DEPLOYMENT_HOOK = "deployment_hook" @@ -172,21 +154,14 @@ CHAT_PYTHON_FEATURES: Final = COMMON_PYTHON_FEATURES | { Feature.MODEL_ALIAS_MAP, } -MESSAGES_PYTHON_FEATURES: Final = (COMMON_PYTHON_FEATURES - {Feature.TIMEOUT_VARIANTS}) | { - Feature.PROVIDER_AFFINITY, - Feature.FOUNDRY_BETA_ROW, - Feature.SAFEGUARDS_CLASSIFIER, - Feature.PRE_REQUEST_HOOK, - Feature.WEBSEARCH_INTERCEPTION, - Feature.MESSAGES_INTERCEPTOR, - Feature.RESPONSE_CACHE, - Feature.MODIFY_PARAMS, - Feature.WORKLOAD_IDENTITY, - Feature.CACHE_CONTROL_INJECTION, - Feature.STREAM_COST_INJECTION, - Feature.THINKING_SIGNATURE_RETRY, - Feature.TOOL_CUSTOM_FIELD, - Feature.STRICT_TOOLS_RETRY, +MESSAGES_PYTHON_FEATURES: Final = COMMON_PYTHON_FEATURES - { + Feature.TIMEOUT_VARIANTS, + Feature.LATEST_ALIAS, + Feature.MOCK_RESPONSE, + Feature.CALLER_CLIENT, + Feature.TLS_POLICY, + Feature.AGENTIC_LOOP_HOOK, + Feature.PROXY_MCP_TOOLS, } RESPONSES_PYTHON_FEATURES: Final = COMMON_PYTHON_FEATURES | { @@ -220,7 +195,7 @@ RULES: Final[Rules] = ( RouteRule(Route.OCR, Rollout.RUST_REQUIRED), RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, targets=frozenset({Target.CHAT_COMPLETIONS, Target.RESPONSES})), RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=MESSAGES_PYTHON_FEATURES), - RouteRule(Route.MESSAGES, Rollout.RUST_OPT_IN, providers=frozenset({"anthropic"})), + RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED, providers=frozenset({"anthropic"})), RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY), RouteRule(Route.RESPONSES, Rollout.PYTHON_ONLY, features=RESPONSES_PYTHON_FEATURES), RouteRule(Route.RESPONSES, Rollout.PYTHON_ONLY), diff --git a/litellm/rust_bridge/detectors.py b/litellm/rust_bridge/detectors.py index c38c3ea7135..1dd3dc6b35c 100644 --- a/litellm/rust_bridge/detectors.py +++ b/litellm/rust_bridge/detectors.py @@ -2,10 +2,11 @@ from __future__ import annotations +import functools import os from collections.abc import Callable, Iterable, Mapping from types import MappingProxyType -from typing import TYPE_CHECKING, Final, TypeAlias, cast # noqa: TID251 # tool lists stay caller-owned +from typing import Final, TypeAlias import httpx @@ -16,9 +17,6 @@ from litellm.litellm_core_utils.model_latest_aliases import is_model_latest_alia from litellm.rust_bridge.catalog import Feature from litellm.rust_bridge.public_call import NativeCall, optional_mapping, optional_sequence, optional_str -if TYPE_CHECKING: - from litellm.responses.mcp.litellm_proxy_mcp_handler import ToolParam - Detector: TypeAlias = Callable[[NativeCall], bool] Detectors: TypeAlias = Mapping[Feature, Detector] @@ -69,12 +67,10 @@ def timeout_variants(request: NativeCall) -> bool: def proxy_mcp_tools(request: NativeCall) -> bool: """Python expands proxy MCP tools and may execute their tool calls.""" - from litellm.responses.mcp.litellm_proxy_mcp_handler import LiteLLM_Proxy_MCP_Handler + from litellm.responses.mcp.tool_precheck import may_name_litellm_mcp_gateway tools: Final = optional_sequence(request.resolved.get("tools")) - return tools is not None and LiteLLM_Proxy_MCP_Handler.should_use_litellm_mcp_gateway( - cast("Iterable[ToolParam]", tools) # cast-ok: the predicate skips entries that are not MCP tool dicts - ) + return tools is not None and may_name_litellm_mcp_gateway(tools) def prompt_management(request: NativeCall) -> bool: @@ -168,15 +164,27 @@ def response_cache(request: NativeCall) -> bool: return litellm.cache is not None and cache.get("no-cache") is not True -_NATIVE_ECDH_CURVES: Final = frozenset({"x25519", "prime256v1", "secp256r1", "p-256", "secp384r1", "p-384"}) +@functools.lru_cache(maxsize=32) +def _tls_unsupported(security_level: str | None, ecdh_curve: str | None) -> bool: + from litellm.rust_bridge import _native + + return bool(_native.unsupported_tls_settings(security_level, ecdh_curve)) def tls_policy(_request: NativeCall) -> bool: """Python applies TLS settings or ECDH curves the native client cannot configure.""" - curve: Final = os.getenv("SSL_ECDH_CURVE", litellm.ssl_ecdh_curve) - return bool(os.getenv("SSL_SECURITY_LEVEL", litellm.ssl_security_level)) or ( - bool(curve) and str(curve).strip().lower() not in _NATIVE_ECDH_CURVES + return unsupported_tls() + + +def unsupported_tls() -> bool: + configured: Final[tuple[object, object]] = ( + os.environ.get("SSL_SECURITY_LEVEL", litellm.ssl_security_level), + os.environ.get("SSL_ECDH_CURVE", litellm.ssl_ecdh_curve), ) + if any(value and not isinstance(value, str) for value in configured): # pyright: ignore[reportUnnecessaryIsInstance] # callers assign the ssl settings untyped + return True + security_level, ecdh_curve = (value if isinstance(value, str) else None for value in configured) + return _tls_unsupported(security_level, ecdh_curve) COMMON: Final[Detectors] = MappingProxyType( diff --git a/litellm/rust_bridge/execution.py b/litellm/rust_bridge/execution.py index 430de8d1ad6..a77fd162bf4 100644 --- a/litellm/rust_bridge/execution.py +++ b/litellm/rust_bridge/execution.py @@ -101,8 +101,10 @@ def synchronous(native: Callable[[_Call], object]) -> Callable[[_Call], object]: return lambda call: run(_execution(native(call)), SyncStream) -def asynchronous(native: Callable[[_Call], object]) -> Callable[[_Call], Awaitable[object]]: - return lambda call: drive(_execution(native(call)), AsyncStream) +def asynchronous( + native: Callable[[_Call], object], open_stream: Callable[[Execution, object], object] | None = None +) -> Callable[[_Call], Awaitable[object]]: + return lambda call: drive(_execution(native(call)), open_stream or AsyncStream) def _execution(value: object) -> Execution: diff --git a/litellm/rust_bridge/host/AGENTS.md b/litellm/rust_bridge/host/AGENTS.md index c249eb82ee0..da933f3b467 100644 --- a/litellm/rust_bridge/host/AGENTS.md +++ b/litellm/rust_bridge/host/AGENTS.md @@ -25,7 +25,7 @@ Python behavior Rust needs but does not own, behind one module per question. Rus - `logger`: where native diagnostics are emitted - `preflight`: the SDK globals the native preflight borrows - `secret_manager`: the configured secret manager, its native config and the error text Python's managers produce - - `http_transport`: which async transport is in use + - `http_transport`: which async transport is in use, and whether a call must send through Python's `AsyncHTTPHandler` - `timeouts`: timeout to seconds - `tokenizers`: bundled tiktoken files and Hugging Face tokenizer downloads - `randomness`: the process `random` generator the Python router draws from diff --git a/litellm/rust_bridge/host/cache.py b/litellm/rust_bridge/host/cache.py index bf2655f9f62..38a18b9be57 100644 --- a/litellm/rust_bridge/host/cache.py +++ b/litellm/rust_bridge/host/cache.py @@ -1,7 +1,8 @@ from __future__ import annotations -from collections.abc import Mapping -from typing import TYPE_CHECKING, Final +import weakref +from collections.abc import Callable, Mapping +from typing import TYPE_CHECKING, Final, cast # noqa: TID251 # bounded cast of the served response from pydantic import TypeAdapter @@ -9,9 +10,13 @@ from litellm.litellm_core_utils.add_retry_fallback_headers import get_hidden_par if TYPE_CHECKING: from litellm.caching.caching import Cache + from litellm.litellm_core_utils.litellm_logging import Logging _RUST_RESPONSE_HEADER: Final = "x-litellm-rust" _HEADERS: Final = TypeAdapter(dict[str, object]) +_EVENTS: Final = TypeAdapter(list[str]) +_HITS: Final[weakref.WeakKeyDictionary[Logging, Mapping[str, object]]] = weakref.WeakKeyDictionary() +_UNCLAMPED: Final[weakref.WeakKeyDictionary[Logging, object]] = weakref.WeakKeyDictionary() def configured_cache() -> Cache | None: @@ -25,17 +30,14 @@ def _python_entry(response: Mapping[str, object]) -> Mapping[str, object]: headers: Final = hidden.get("additional_headers") if not isinstance(headers, Mapping) or _RUST_RESPONSE_HEADER not in headers: return response - return { - **response, - "_hidden_params": { - **hidden, - "additional_headers": { - name: value - for name, value in _HEADERS.validate_python(headers).items() - if name != _RUST_RESPONSE_HEADER - }, - }, + kept: Final = { + name: value for name, value in _HEADERS.validate_python(headers).items() if name != _RUST_RESPONSE_HEADER } + stored: Final = {name: value for name, value in hidden.items() if name != "additional_headers" or kept} | ( + {"additional_headers": kept} if kept else {} + ) + entry: Final = {name: value for name, value in response.items() if name != "_hidden_params"} + return {**entry, "_hidden_params": stored} if stored else entry def store_response( @@ -44,11 +46,183 @@ def store_response( /, **kwargs: object, # kwargs-ok: the cache call's own arguments ) -> None: - from litellm.caching.caching_handler import create_cache_write_task + from litellm.caching.caching_handler import create_cache_write_task, is_response_without_output + if is_response_without_output(response): + return create_cache_write_task( lambda: cache.async_add_cache( # pyright: ignore[reportUnknownMemberType] # Cache.async_add_cache leaves its result untyped _python_entry(response), **kwargs, # pyright: ignore[reportArgumentType] # the cache call's own keyword arguments, as Python passes them ) ) + + +def store_verbatim( + cache: Cache, + response: Mapping[str, object], + /, + **kwargs: object, # kwargs-ok: the cache call's own arguments +) -> None: + from litellm.caching.caching_handler import create_cache_write_task, is_response_without_output + + if is_response_without_output(response): + return + create_cache_write_task( + lambda: cache.async_add_cache( # pyright: ignore[reportUnknownMemberType] # Cache.async_add_cache leaves its result untyped + response, + **kwargs, # pyright: ignore[reportArgumentType] # the cache call's own keyword arguments, as Python passes them + ) + ) + + +async def store_stream( + cache: Cache, + entry: Mapping[str, object], + /, + **kwargs: object, # kwargs-ok: the cache call's own arguments +) -> None: + from litellm._logging import verbose_logger + from litellm.caching.caching_handler import LLMCachingHandler, create_cache_write_task + from litellm.types.caching import CACHED_STREAM_EVENTS_KEY + + events: Final = entry.get(CACHED_STREAM_EVENTS_KEY) + handler: Final = getattr(kwargs.get("litellm_logging_obj"), "llm_caching_handler", None) + preset_cache_key: Final = handler.preset_cache_key if isinstance(handler, LLMCachingHandler) else None + cache_key_override: Final[Mapping[str, object]] = ( + {"cache_key": preset_cache_key} if preset_cache_key is not None else {} + ) + + async def write() -> None: + try: + await cache.async_add_cache( # pyright: ignore[reportUnknownMemberType] # Cache.async_add_cache leaves its result untyped + {**entry, CACHED_STREAM_EVENTS_KEY: tuple(_EVENTS.validate_python(events))} + if isinstance(events, list) + else entry, + dynamic_cache_object=handler.dual_cache if isinstance(handler, LLMCachingHandler) else None, + **{**kwargs, **cache_key_override}, # pyright: ignore[reportArgumentType] # the cache call's own keyword arguments, as Python passes them + ) + except Exception as e: # noqa: BLE001 # a cache write must never surface as a client-visible stream error + verbose_logger.exception("Anthropic Messages stream cache write failed: %s", e) + + create_cache_write_task(write) + + +def caching_handler( + **kwargs: object, # kwargs-ok: the cache call's own arguments +) -> object | None: + from litellm.caching.caching_handler import LLMCachingHandler + from litellm.litellm_core_utils.litellm_logging import Logging + + logging_obj: Final = kwargs.get("litellm_logging_obj") + if not isinstance(logging_obj, Logging) or not isinstance(logging_obj.llm_caching_handler, LLMCachingHandler): + return None + return logging_obj.llm_caching_handler + + +def wrap_stream( + _cache: Cache, + original_function: Callable[..., object], + stream: object, + read_handler: object | None, + /, + **kwargs: object, # kwargs-ok: the cache call's own arguments +) -> object: + from litellm.caching.caching_handler import LLMCachingHandler + from litellm.litellm_core_utils.litellm_logging import Logging + + logging_obj: Final = kwargs.get("litellm_logging_obj") + if not isinstance(logging_obj, Logging): + return stream + handler: Final = ( + read_handler + if isinstance(read_handler, LLMCachingHandler) + else LLMCachingHandler( + original_function=original_function, request_kwargs=dict(kwargs), start_time=logging_obj.start_time + ) + ) + return handler.wrap_streaming_result_for_cache(result=stream, call_type=original_function.__name__) + + +def remember_unclamped(logging_obj: object, max_tokens: object) -> None: + from litellm.litellm_core_utils.litellm_logging import Logging + + if isinstance(logging_obj, Logging): + _UNCLAMPED[logging_obj] = max_tokens + + +async def lookup( + _cache: Cache, + original_function: Callable[..., object], + /, + **kwargs: object, # kwargs-ok: the cache call's own arguments +) -> object | None: + from litellm.litellm_core_utils.litellm_logging import Logging + + logging_obj: Final = kwargs.get("litellm_logging_obj") + if not isinstance(logging_obj, Logging): + return None + return await _read( + original_function, + logging_obj, + {**kwargs, "max_tokens": _UNCLAMPED.pop(logging_obj)} if logging_obj in _UNCLAMPED else kwargs, + ) + + +async def _read( + original_function: Callable[..., object], + logging_obj: Logging, + kwargs: dict[str, object], # mutable-ok: the read call's own keyword arguments, handed on as the handler takes them +) -> object | None: + from litellm.caching.caching_handler import LLMCachingHandler + + handler: Final = LLMCachingHandler( + original_function=original_function, request_kwargs=dict(kwargs), start_time=logging_obj.start_time + ) + logging_obj.llm_caching_handler = handler + model: Final = kwargs.get("model") + model_name: Final = model if isinstance(model, str) else "" + if not handler.reads_cache(model=model_name, kwargs=kwargs): + return None + read: Final = await handler.async_read_cache( + model=model_name, + original_function=original_function, + logging_obj=logging_obj, + call_type=original_function.__name__, + kwargs=kwargs, + args=(), + ) + if not read.hit: + return None + _remember(logging_obj, read.cached_result) + return read.cached_result + + +def _remember(logging_obj: Logging, cached: object) -> None: + if isinstance(cached, Mapping): + _HITS[logging_obj] = _HEADERS.validate_python(cached) + + +def _replace(response: object, cached: Mapping[str, object] | None) -> None: + if isinstance(response, dict) and cached is not None: + served: Final = cast( # cast-ok: a Messages response is the str-keyed dict the route serves + "dict[str, object]", response + ) + served.clear() + served.update(cached) + + +def restore_hit(response: object, logger: Logging) -> None: + from litellm.caching.caching_handler import ( + _set_cached_hidden_param, # pyright: ignore[reportPrivateUsage] # the @client cache hit's own hidden params + ) + + _replace(response, _HITS.pop(logger, None)) + _set_cached_hidden_param(response, "cache_hit", True) + + +def hit_cache_key(logger: Logging) -> object: + from litellm.caching.caching_handler import LLMCachingHandler + + handler: Final = logger.llm_caching_handler + return handler.hit_cache_key() if isinstance(handler, LLMCachingHandler) else None diff --git a/litellm/rust_bridge/host/callbacks_legacy_python.py b/litellm/rust_bridge/host/callbacks_legacy_python.py index ba557f769eb..19124fcffc0 100644 --- a/litellm/rust_bridge/host/callbacks_legacy_python.py +++ b/litellm/rust_bridge/host/callbacks_legacy_python.py @@ -15,7 +15,7 @@ import sys import traceback import uuid import weakref -from collections.abc import Awaitable, Callable, Coroutine, Mapping, Sequence +from collections.abc import AsyncIterator, Awaitable, Callable, Coroutine, Iterator, Mapping, Sequence from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -27,6 +27,7 @@ from typing import ( import httpx from pydantic import TypeAdapter +from typing_extensions import ReadOnly, TypedDict if TYPE_CHECKING: from litellm.litellm_core_utils.litellm_logging import Logging @@ -41,6 +42,7 @@ class MetadataUpdater(Protocol): kwargs: dict[str, object], start_time: datetime.datetime, end_time: datetime.datetime, + cache_hit: bool | None = None, ) -> None: ... @@ -97,6 +99,7 @@ def finalize( kwargs: dict[str, object], start_time: datetime.datetime, end_time: datetime.datetime, + cache_hit: bool, ) -> None: from litellm.litellm_core_utils.llm_response_utils import response_metadata @@ -104,6 +107,16 @@ def finalize( update: Final = cast( # cast-ok: legacy metadata function accepts concrete kwargs MetadataUpdater, response_metadata.update_response_metadata ) + if cache_hit: + from litellm.caching.caching_handler import ( + _set_cached_hidden_param, # pyright: ignore[reportPrivateUsage] # the @client cache hit's own hidden params + ) + from litellm.rust_bridge.host.cache import hit_cache_key, restore_hit + + restore_hit(response, logger) + update(response, logger, logger.model, kwargs, start_time, end_time, cache_hit=True) + _set_cached_hidden_param(response, "cache_key", hit_cache_key(logger)) + return update(response, logger, model if isinstance(model, str) else None, kwargs, start_time, end_time) cache_key: Final = logger.model_call_details.get("cache_key") if logger.model_call_details.get("cache_hit") is True and isinstance(cache_key, str): @@ -277,14 +290,76 @@ def post_call( logger.post_call(original_response=original_response, api_key=api_key, additional_args=additional_args) -def record_response(logger: Logging, status: int, headers: Sequence[tuple[str, str]], body: str) -> None: +class _UnreadBody(httpx.SyncByteStream, httpx.AsyncByteStream): + def __iter__(self) -> Iterator[bytes]: + return iter(()) + + async def __aiter__(self) -> AsyncIterator[bytes]: + for chunk in (): + yield chunk + + +def wire_headers(headers: Sequence[tuple[str, str]]) -> httpx.Headers: + return httpx.Headers([(name.encode(), value.encode()) for name, value in headers]) + + +def _sent_request(sent: tuple[str, Mapping[str, str], Mapping[str, object]]) -> httpx.Request: + url, headers, body = sent + return httpx.Request("POST", url, headers=list(headers.items()), content=json.dumps(body, default=str).encode()) + + +def record_response( + logger: Logging, + status: int, + headers: Sequence[tuple[str, str]], + body: str, + sent: tuple[str, Mapping[str, str], Mapping[str, object]] | None, +) -> None: """Stores the provider response the way Python's Messages handler does, for logging to replay.""" - response: Final = httpx.Response(status_code=status, headers=list(headers), content=body.encode()) + request: Final = None if sent is None else _sent_request(sent) + streamed: Final = sent is not None and sent[2].get("stream") is True + response: Final = ( + httpx.Response(status_code=status, stream=_UnreadBody(), request=request) + if streamed + else httpx.Response(status_code=status, content=body.encode(), request=request) + ) + response.headers = wire_headers(headers) details: Final = logger.model_call_details # the call's own logger: recording on it is the point details["httpx_response"] = response details["response_headers"] = dict(response.headers) +class _ThinkingSignatureRetry(TypedDict): + kind: ReadOnly[Literal["thinking_signature"]] + + +class _StrictToolsRetry(TypedDict): + kind: ReadOnly[Literal["strict_tools"]] + dropped: ReadOnly[int] + + +_RETRY_REASONS: Final = TypeAdapter(tuple[_ThinkingSignatureRetry | _StrictToolsRetry, ...]) + + +async def retried_request( + logger: Logging, + logged_body: dict[str, object], # mutable-ok: the retry rewrites the body pre_call logged, as Python's loop does + body: Mapping[str, object], + reasons: Sequence[Mapping[str, object]], +) -> None: + from litellm.llms.anthropic.common_utils import warn_claude_strict_tools_dropped + + if logger.baseline_cache_context is not None: + await logger.invalidate_baseline_cache_estimate("retried_request") + for reason in _RETRY_REASONS.validate_python(reasons): + if reason["kind"] == "strict_tools": + warn_claude_strict_tools_dropped(reason["dropped"]) + for name in logged_body.keys() - body.keys(): + del logged_body[name] # rebind-ok: the logged body is the one logging already holds + logged_body.update({name: value for name, value in body.items() if logged_body.get(name) != value}) + logger.model_call_details.update(logged_body) + + def record_api_window(logger: Logging, start: float, end: float) -> None: """Records the provider exchange's window the way Python's timed `AsyncHTTPHandler.post` does.""" from litellm.litellm_core_utils.logging_utils import ( @@ -296,6 +371,38 @@ def record_api_window(logger: Logging, start: float, end: float) -> None: start_time=datetime.datetime.fromtimestamp(start), # noqa: DTZ006 # the timed post records naive local times end_time=datetime.datetime.fromtimestamp(end), # noqa: DTZ006 # the timed post records naive local times ) + _log_api_window(logger, start, end) + + +def _log_api_window(logger: Logging, start: float, end: float) -> None: + from litellm._logging import verbose_logger + from litellm.litellm_core_utils.logging_utils import ( + _get_parent_otel_span_from_logging_obj, # pyright: ignore[reportPrivateUsage] # the timed post's own span lookup + _get_service_logger, # pyright: ignore[reportPrivateUsage] # the timed post's own service logger + ) + from litellm.types.services import ServiceTypes + + parent_otel_span: Final = _get_parent_otel_span_from_logging_obj(logger) + try: + service_logger: Final = _get_service_logger() + _ = asyncio.create_task( + service_logger.async_service_success_hook( # pyright: ignore[reportUnknownMemberType] # the hook's untyped event_metadata dict + service=ServiceTypes.LITELLM, + duration=end - start, + call_type="post <- track_llm_api_timing", + start_time=start, + end_time=end, + parent_otel_span=parent_otel_span, + ) + ) + except Exception as e: # noqa: BLE001 # the timed post logs and drops a service logging failure + verbose_logger.debug("Error in service logging: %s", e) + + +def times_provider_exchange(client: object, timeout: object) -> bool: + from litellm.rust_bridge.host import http_transport + + return not http_transport.sends_through_python(client, timeout) def defers_async_logging(logger: LoggingSurface) -> bool: @@ -369,6 +476,16 @@ def async_success_handler( return logger.async_success_handler(response, start, end, cache_hit=_cache_hit(logger)) +def cache_hit_success(logger: Logging, response: object, start: datetime.datetime, end: datetime.datetime) -> None: + from litellm.caching.caching_handler import LLMCachingHandler + + handler: Final = logger.llm_caching_handler + if isinstance(handler, LLMCachingHandler): + handler.async_log_cache_hit_on_callbacks( + logging_obj=logger, cached_result=response, start_time=start, end_time=end, cache_hit=True + ) + + def enqueue_logging(coroutine: Coroutine[object, object, None]) -> None: from litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKER @@ -414,7 +531,29 @@ def after_deployment_success(kwargs: dict[str, object], response: object, call_t hook: Final = cast( # cast-ok: bounded adapter for the untyped deployment hook DeploymentSuccessHook, utils.async_post_call_success_deployment_hook ) - return hook(kwargs, response, CallTypes(call_type)) + typed: Final = CallTypes(call_type) + return hook(kwargs, _messages_stream(response) if typed == CallTypes.anthropic_messages else response, typed) + + +def _messages_stream(response: object) -> object: + from litellm.rust_bridge.execution import AsyncStream + + if not isinstance(response, AsyncStream): + return response + from litellm.llms.anthropic.messages.native.streaming_iterator import ( + AnthropicMessagesStreamHiddenParams, + AnthropicMessagesStreamingResponse, + ) + + return AnthropicMessagesStreamingResponse( + completion_stream=cast( # cast-ok: the native stream yields the provider's SSE bytes + AsyncIterator[bytes], response + ), + hidden_params=cast( # cast-ok: the stream's stamped hidden params, shared as Python's handler shares them + AnthropicMessagesStreamHiddenParams, + response._hidden_params, # pyright: ignore[reportPrivateUsage] # the native stream's own hidden params + ), + ) def after_deployment_failure(kwargs: dict[str, object], error: Exception, call_type: str) -> Awaitable[None]: @@ -442,17 +581,25 @@ def stamp_stream_head( kwargs: dict[str, object], # mutable-ok: `finalize` takes the call kwargs as a dict start_time: datetime.datetime, end_time: datetime.datetime, + cache_hit: bool, ) -> None: + if kwargs.get("stream") is True: + logger.stream = True + logger.model_call_details["stream"] = True carrier: Final = _HiddenParamsCarrier(head) - finalize(carrier, logger, kwargs, start_time, end_time) + finalize(carrier, logger, kwargs, start_time, end_time, cache_hit) stamped: Final = carrier._hidden_params # pyright: ignore[reportPrivateUsage] # the carrier's own field if stamped is not head and isinstance(stamped, dict): head.update(cast("dict[str, object]", stamped)) # cast-ok: update_response_metadata writes a str-keyed dict -def stream_opened(logger: Logging, head: Mapping[str, object]) -> None: - logger.stream = True - logger.model_call_details["stream"] = True +def stream_opened(logger: Logging, head: Mapping[str, object], keeps_requested: bool = False) -> None: + requested: Final = logger.model_call_details.get("stream") + streamed: Final = requested if keeps_requested and requested else True + logger.stream = cast(bool, streamed) # cast-ok: Python's Messages handler logs the stream flag it sent + logger.model_call_details["stream"] = streamed + if "httpx_response" in logger.model_call_details: + return logger.model_call_details["response_headers"] = _STREAM_HEADERS.validate_python( head.get("additional_headers") or {} ) @@ -486,6 +633,12 @@ def stream_success( if first_chunk is not None: logger.completion_start_time = first_chunk logger.model_call_details["completion_start_time"] = first_chunk + superseded_error_event: Final = PassThroughStreamingHandler._error_frame_closed_at( # pyright: ignore[reportPrivateUsage] # the Messages stream's own close-at-frame check + EndpointType(endpoint_type), chunks + ) + if superseded_error_event is not None: + _log_superseded_stream_failure(logger, endpoint_type, request_body, chunks, superseded_error_event) + return build: Final = cast( # cast-ok: bounded adapter for the untyped pass-through logging builder StreamingLogBuilder, PassThroughStreamingHandler._route_streaming_logging_to_handler, # pyright: ignore[reportPrivateUsage] # the Messages stream iterator bills through the same builder @@ -518,6 +671,37 @@ def stream_success( enqueue_logging(coroutine) +def _log_superseded_stream_failure( + logger: Logging, + endpoint_type: str, + request_body: Mapping[str, object], + chunks: Sequence[bytes], + error_event: tuple[str, str, int], +) -> None: + from litellm._logging import verbose_proxy_logger + from litellm.llms.anthropic.common_utils import anthropic_error_frame_exception + from litellm.proxy.pass_through_endpoints.streaming_handler import PassThroughStreamingHandler + from litellm.types.passthrough_endpoints.pass_through_endpoints import EndpointType + + error_type, message, status_code = error_event + PassThroughStreamingHandler._record_partial_usage_for_failure( # pyright: ignore[reportPrivateUsage] # the superseded stream's own partial usage record + litellm_logging_obj=logger, + endpoint_type=EndpointType(endpoint_type), + request_body=dict(request_body), + raw_bytes=tuple(chunks), + stream_context=None, + ) + try: + enqueue_logging( + logger.dispatch_attempt_failure_handlers( # pyright: ignore[reportArgumentType] # the dispatch snapshots now, its coroutine never receives a sent value + anthropic_error_frame_exception(error_type, message, status_code, str(logger.model)), + traceback.format_exc(), + ) + ) + except Exception as e: # noqa: BLE001 # the stream's failure scheduling logs and drops its own failure + verbose_proxy_logger.error("Error scheduling stream failure logging: %s", e) + + def stream_failure( logger: Logging, endpoint_type: str, diff --git a/litellm/rust_bridge/host/http_transport.py b/litellm/rust_bridge/host/http_transport.py index 1bf0f890924..6155cfce2ea 100644 --- a/litellm/rust_bridge/host/http_transport.py +++ b/litellm/rust_bridge/host/http_transport.py @@ -1,7 +1,32 @@ from __future__ import annotations +from typing import Final + def uses_aiohttp_transport() -> bool: from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler return AsyncHTTPHandler.should_use_aiohttp_transport() + + +def _non_positive_timeout(timeout: object) -> bool: + import httpx + + seconds: Final = ( + (timeout.connect, timeout.read, timeout.write, timeout.pool) + if isinstance(timeout, httpx.Timeout) + else (timeout,) + ) + return any(isinstance(value, int | float) and value <= 0 for value in seconds) + + +def sends_through_python(client: object, timeout: object = None) -> bool: + from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, rsa_key_exchange_and_chacha20_excluded + from litellm.rust_bridge import detectors + + return ( + isinstance(client, AsyncHTTPHandler) + or detectors.unsupported_tls() + or rsa_key_exchange_and_chacha20_excluded() + or _non_positive_timeout(timeout) + ) diff --git a/litellm/rust_bridge/host/routes/messages.py b/litellm/rust_bridge/host/routes/messages.py index c6568264edb..48de9b0ac03 100644 --- a/litellm/rust_bridge/host/routes/messages.py +++ b/litellm/rust_bridge/host/routes/messages.py @@ -1,39 +1,99 @@ from __future__ import annotations +import asyncio import datetime import errno +import functools +import inspect import ipaddress +import json import os import socket -from collections.abc import Callable, Mapping, Sequence -from dataclasses import asdict, dataclass +from collections.abc import AsyncIterator, Awaitable, Callable, Coroutine, Iterable, Iterator, Mapping, Sequence +from dataclasses import asdict, dataclass, replace from typing import Final, TypeAlias, cast # noqa: TID251 # narrows native payloads to public TypedDicts import httpx from aiohttp.http_exceptions import ContentLengthError, TransferEncodingError -from pydantic import TypeAdapter, ValidationError +from pydantic import JsonValue, TypeAdapter, ValidationError import litellm +from litellm.caching.caching_handler import LLMCachingHandler +from litellm.integrations.custom_logger import CustomLogger from litellm.litellm_core_utils import exception_mapping_utils -from litellm.litellm_core_utils.core_helpers import normalize_drop_params +from litellm.litellm_core_utils.core_helpers import ( + as_str_mapping, + drops_unsupported_params, + normalize_drop_params, + proxy_request_headers, + stream_cost_injection_requested, +) +from litellm.litellm_core_utils.get_llm_provider_logic import get_provider_affinity_header +from litellm.litellm_core_utils.get_provider_specific_headers import ProviderSpecificHeaderUtils from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj +from litellm.litellm_core_utils.model_latest_aliases import is_model_latest_alias +from litellm.litellm_core_utils.provider_affinity import add_provider_affinity_header from litellm.litellm_core_utils.reasoning_effort_capability import deployment_reasoning_effort_levels from litellm.litellm_core_utils.request_timeout_resolver import get_configured_request_timeout -from litellm.llms.anthropic.common_utils import AnthropicError, anthropic_pass_through_api_base +from litellm.litellm_core_utils.url_utils import ensure_api_route +from litellm.llms.anthropic.common_utils import ( + AnthropicError, + AnthropicModelInfo, + anthropic_pass_through_api_base, + strip_provider_specific_fields_from_anthropic_messages, +) from litellm.llms.anthropic.messages.native import handler +from litellm.llms.anthropic.messages.native import utils as native_utils +from litellm.llms.anthropic.messages.native.handler import ( + _bridge_target as _bridged, # pyright: ignore[reportPrivateUsage] # the handler's own bridge target +) +from litellm.llms.anthropic.messages.native.handler import ( + _BridgeTarget, # pyright: ignore[reportPrivateUsage] # the handler's own bridge target +) from litellm.llms.anthropic.messages.native.handler import ( _native_messages_config as native_messages_config, # pyright: ignore[reportPrivateUsage] # the handler's own config lookup ) +from litellm.llms.anthropic.messages.native.handler import ( + _resolve_requested_provider as _requested_provider, # pyright: ignore[reportPrivateUsage] # the handler's own provider resolution +) +from litellm.llms.anthropic.messages.native.handler import ( + _sets_own_entra_credential as _own_entra_credential, # pyright: ignore[reportPrivateUsage] # the handler's own credential check +) from litellm.llms.anthropic.messages.native.handler import ( _with_deployment_output_effort as _deployment_output_effort, # pyright: ignore[reportPrivateUsage] # the handler's own effort rounding ) +from litellm.llms.anthropic.messages.native.interceptors import MessagesInterceptor, get_messages_interceptors +from litellm.llms.anthropic.messages.native.utils import normalize_native_messages, prepare_native_messages +from litellm.llms.anthropic.messages.safeguards import ( + SafeguardsEvaluator, + StreamedSafeguardResults, + native_route_classifies, + with_safeguard_results, +) from litellm.llms.anthropic.messages.utils import is_reasoning_auto_summary_enabled +from litellm.llms.anthropic.wif import get_anthropic_wif_token +from litellm.llms.base_llm.anthropic_messages.transformation import BaseAnthropicMessagesConfig from litellm.llms.base_llm.chat.transformation import BaseLLMException -from litellm.llms.custom_httpx.http_handler import get_ssl_configuration -from litellm.rust_bridge import failures -from litellm.rust_bridge.host import callbacks_legacy_python, http_transport -from litellm.rust_bridge.public_call import known_params, optional_str +from litellm.llms.custom_httpx.http_handler import ( + AsyncHTTPHandler, + get_async_httpx_client, # pyright: ignore[reportUnknownVariableType] # its params dict is untyped + get_ssl_configuration, +) +from litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler +from litellm.llms.custom_httpx.llm_http_handler import ( + _merge_messages_header_sources as _merged_headers, # pyright: ignore[reportPrivateUsage] # the handler's own header merge +) +from litellm.responses.mcp.tool_precheck import may_name_litellm_mcp_gateway +from litellm.rust_bridge import detectors, execution, failures +from litellm.rust_bridge.execution import AsyncStream +from litellm.rust_bridge.host import cache, callbacks_legacy_python, http_transport +from litellm.rust_bridge.messages.entrypoints import MessagesStreamHead +from litellm.rust_bridge.public_call import NativeCall, known_params, optional_sequence, optional_str +from litellm.types.integrations.custom_logger import WEBSEARCH_CONVERTED_STREAM_KEY from litellm.types.llms.anthropic_messages.anthropic_response import AnthropicMessagesResponse +from litellm.types.router import GenericLiteLLMParams +from litellm.types.utils import CallTypes, ProviderSpecificHeader, anthropic_wif_litellm_params +from litellm.utils import clamp_max_tokens _METADATA: Final = TypeAdapter(dict[str, object]) _BODY_FIELDS: Final = frozenset( @@ -61,9 +121,12 @@ _BODY_FIELDS: Final = frozenset( "reasoning_effort", "safeguards", "service_tier", + "thread", } ) +WORKLOAD_IDENTITY_FIELDS: Final = anthropic_wif_litellm_params + @dataclass(frozen=True, slots=True) class MessagesSettings: @@ -71,6 +134,15 @@ class MessagesSettings: reasoning_auto_summary: bool additional_drop_params: Sequence[str] request_timeout: float | None + drops_unsupported_params: bool + model: str | None = None + mock_response: Mapping[str, object] | None = None + stream_cost_model: str | None = None + extra_headers: Mapping[str, object] | None = None + mcp_gateway: bool = False + ascii_response_headers: bool = False + joined_reads: bool = False + ascii_request_headers: bool = True def response(value: Mapping[str, object]) -> AnthropicMessagesResponse: @@ -90,13 +162,37 @@ def inferred_provider(model: str, api_base: str | None) -> str | None: return provider -def body_params(request: Mapping[str, object]) -> Mapping[str, object]: +def modify_max_tokens( + model: object, + args: tuple[object, ...], + kwargs: dict[str, object], # mutable-ok: the call's keyword view, rewritten in place as `@client` does +) -> None: + unclamped: Final = kwargs.get("max_tokens") + clamp_max_tokens(model, args, kwargs, CallTypes.anthropic_messages.value) + if kwargs.get("max_tokens") != unclamped: + cache.remember_unclamped(kwargs.get("litellm_logging_obj"), unclamped) + + +def _body_fields(request: Mapping[str, object]) -> Mapping[str, object]: params: Final = known_params(_BODY_FIELDS.difference(handler.additional_drop_paths(request)), request) if deployment_reasoning_effort_levels(request.get("model_info")) is None: return params return _with_deployment_effort(params, request) +def body_params(request: Mapping[str, object], asynchronous: bool, hooked: bool = False) -> Mapping[str, object]: + fields: Final = _body_fields(request) + if not detectors.cache_control_injection(NativeCall(args=(), kwargs=request, base={})): + return {**fields, "messages": request["messages"]} if hooked else fields + messages, system, tools = _prompt_cached(request, asynchronous, hooked) + return { + **fields, + "messages": messages, + **({"system": system} if "system" in fields else {}), + **({"tools": tools} if tools is not None and "tools" in fields else {}), + } + + def _with_deployment_effort(params: Mapping[str, object], request: Mapping[str, object]) -> Mapping[str, object]: """Python's handler rounds the requested effort to the levels the deployment declares in `model_info.reasoning_effort_levels`, the one place a deployment, not the model, decides.""" @@ -116,12 +212,309 @@ def _with_deployment_effort(params: Mapping[str, object], request: Mapping[str, ) +def cached_function() -> Callable[..., object]: + return cast( # cast-ok: the @client cache read names and checks the legacy handler it wraps + "Callable[..., object]", + handler.anthropic_messages, # noqa: TID251 # the @client cache read names and checks the legacy handler it wraps + ) + + +_ENTRY: Final = cast( # cast-ok: only the untyped handler's signature is read + Callable[..., object], + handler.anthropic_messages, # noqa: TID251 # reads the handler's signature, never calls it +) +_HANDLER: Final = cast( # cast-ok: only the untyped handler's signature is read + Callable[..., object], + handler.anthropic_messages_handler, # noqa: TID251 # reads the handler's signature, never calls it +) +_ENTRY_PARAMS: Final = frozenset(inspect.signature(_ENTRY).parameters) - {"kwargs"} +_HANDLER_PARAMS: Final = frozenset(inspect.signature(_HANDLER).parameters) - {"kwargs"} +_JsonBlocks: TypeAlias = list[dict[str, JsonValue]] +_Prepared: TypeAlias = tuple[_JsonBlocks, str | _JsonBlocks | None, Sequence[object] | None] + + +def _prompt_cached(request: Mapping[str, object], asynchronous: bool, hooked: bool) -> _Prepared: + model: Final = str(request["model"]) + provider: Final = optional_str(request.get("custom_llm_provider")) + api_base: Final = optional_str(request.get("api_base")) + tools: Final = cast(_JsonBlocks | None, request.get("tools")) # cast-ok: handed on unchecked, as the handler does + messages: Final = cast(_JsonBlocks, request["messages"]) # cast-ok: handed on unchecked, as the handler does + system: Final = cast( # cast-ok: handed on unchecked, as the handler does + str | _JsonBlocks | None, request.get("system") + ) + if not asynchronous: + return _handler_prepared( + request, + messages, + system, + model=model, + provider=provider, + tools=tools, + api_base=api_base, + presanitized=False, + ) + entry_kwargs: Final = {name: value for name, value in request.items() if name not in _ENTRY_PARAMS} + if hooked: + return _handler_prepared( + entry_kwargs, + messages, + system, + model=model, + provider=handler.provider_after_pre_request_hooks(model, provider, entry_kwargs), + tools=tools, + api_base=api_base, + presanitized=True, + ) + entry_messages, entry_system = prepare_native_messages( + messages, system, entry_kwargs, model=model, custom_llm_provider=provider, tools=tools, api_base=api_base + ) + return _handler_prepared( + entry_kwargs, + entry_messages, + entry_system, + model=model, + provider=handler.provider_after_pre_request_hooks(model, provider, entry_kwargs), + tools=tools, + api_base=api_base, + presanitized=True, + ) + + +def _handler_prepared( + call: Mapping[str, object], + messages: _JsonBlocks, + system: str | _JsonBlocks | None, + *, + model: str, + provider: str | None, + tools: _JsonBlocks | None, + api_base: str | None, + presanitized: bool, +) -> _Prepared: + handler_kwargs: Final = {name: value for name, value in call.items() if name not in _HANDLER_PARAMS} + prepared_messages, prepared_system = prepare_native_messages( + messages, + system, + handler_kwargs, + model=model, + custom_llm_provider=provider, + tools=tools, + api_base=api_base, + presanitized=presanitized, + ) + return prepared_messages, prepared_system, handler.tools_marked_for_cache_points(tools, handler_kwargs) + + +_execute_pre_request_hooks: Final = cast( # cast-ok: the handler's untyped pre-request hook loop + Callable[..., Awaitable[dict[str, object]]], + handler._execute_pre_request_hooks, # pyright: ignore[reportPrivateUsage] # the handler's own pre-request hook loop +) +_HOOKED_PARAMS: Final = ( + "tools", + "stream", + "metadata", + "stop_sequences", + "system", + "temperature", + "thinking", + "tool_choice", + "top_k", + "top_p", +) + + +def runs_pre_request_hooks() -> bool: + return detectors.overridden("async_pre_request_hook", litellm.callbacks) or any( + isinstance(callback, CustomLogger) and "async_pre_request_hook" in vars(callback) + for callback in litellm.callbacks + ) + + +def _unsupported(provider: str | None, model: str, unsupported: str) -> litellm.UnsupportedParamsError: + return litellm.UnsupportedParamsError( + message=( + f"provider {provider} on /v1/messages runs only on the Rust path, which does not support {unsupported}" + ), + llm_provider=provider, + model=model, + ) + + +async def pre_request_hooks(request: Mapping[str, object]) -> Mapping[str, object]: + model: Final = str(request["model"]) + provider: Final = optional_str(request.get("custom_llm_provider")) + tools: Final = cast(_JsonBlocks | None, request.get("tools")) # cast-ok: handed on unchecked, as the handler does + kwargs: Final = {name: value for name, value in request.items() if name not in _ENTRY_PARAMS} + messages, system = prepare_native_messages( + cast(_JsonBlocks, request["messages"]), # cast-ok: handed on unchecked, as the handler does + cast(str | _JsonBlocks | None, request.get("system")), # cast-ok: handed on unchecked, as the handler does + kwargs, + model=model, + custom_llm_provider=provider, + tools=tools, + api_base=optional_str(request.get("api_base")), + ) + named: Final = {**{name: request.get(name) for name in _ENTRY_PARAMS}, "messages": messages, "system": system} + hooked: Final = await _execute_pre_request_hooks( + model=model, + messages=messages, + tools=tools, + stream=cast(bool | None, named["stream"]), # cast-ok: handed on unchecked, as the handler does + custom_llm_provider=provider, + tool_choice=named["tool_choice"], + **kwargs, + ) + for name in _HOOKED_PARAMS: + named[name] = hooked.pop(name, named[name]) + hooked_provider: Final = handler.provider_after_pre_request_hooks(model, provider, hooked) + hooked.pop("litellm_params", None) + kwargs.update(hooked) + requested_provider: Final = handler.provider_after_pre_request_hooks(model, provider, {}) + functools.partial( + _HANDLER, + **{name: value for name, value in named.items() if name in _HANDLER_PARAMS - {"custom_llm_provider"}}, + custom_llm_provider=hooked_provider, + _litellm_messages_presanitized=True, + **kwargs, + ) + _python_handler_params({**named, **kwargs}, hooked_provider) + if hooked_provider != requested_provider: + raise _unsupported(requested_provider, model, f"a pre-request hook routing the call to {hooked_provider}") + return {**named, **kwargs} + + +def _intercepted_provider(request: Mapping[str, object]) -> str | None: + return handler.provider_after_pre_request_hooks( + str(request["model"]), optional_str(request.get("custom_llm_provider")), {} + ) + + +def has_interceptors() -> bool: + return bool(get_messages_interceptors()) + + +def short_circuits() -> bool: + from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger + + stock: Final[object] = WebSearchInterceptionLogger.try_short_circuit_search # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # the logger annotates bare dicts + return any( + isinstance(callback, WebSearchInterceptionLogger) and type(callback).try_short_circuit_search is not stock # pyright: ignore[reportUnknownMemberType] # the logger annotates bare dicts + for callback in litellm.callbacks + ) + + +def interceptor(request: Mapping[str, object]) -> MessagesInterceptor | None: + tools: Final = cast(_JsonBlocks | None, request.get("tools")) # cast-ok: handed on unchecked, as the handler does + provider: Final = _intercepted_provider(request) + return next((owner for owner in get_messages_interceptors() if owner.can_handle(tools, provider)), None) + + +def _entry_messages( + request: Mapping[str, object], + kwargs: dict[str, object], # mutable-ok: the call's own kwargs, rewritten in place by the handler's normalizers + hooked: bool, +) -> tuple[_JsonBlocks, str | _JsonBlocks | None]: + messages: Final = cast(_JsonBlocks, request["messages"]) # cast-ok: handed on unchecked, as the handler does + system: Final = cast( # cast-ok: handed on unchecked, as the handler does + str | _JsonBlocks | None, request.get("system") + ) + if hooked: + return messages, system + return prepare_native_messages( + messages, + system, + kwargs, + model=str(request["model"]), + custom_llm_provider=optional_str(request.get("custom_llm_provider")), + tools=cast(_JsonBlocks | None, request.get("tools")), # cast-ok: handed on unchecked, as the handler does + api_base=optional_str(request.get("api_base")), + ) + + +def short_circuit(request: Mapping[str, object], stream: bool, hooked: bool) -> Awaitable[object]: + kwargs: Final = {name: value for name, value in request.items() if name not in _ENTRY_PARAMS} + messages, _ = _entry_messages(request, kwargs, hooked) + return handler._try_websearch_short_circuit( # pyright: ignore[reportPrivateUsage, reportUnknownMemberType, reportUnknownVariableType] # the handler's own short-circuit, which annotates bare dicts + model=str(request["model"]), + messages=messages, + tools=cast(_JsonBlocks | None, request.get("tools")), # cast-ok: handed on unchecked, as the handler does + custom_llm_provider=_intercepted_provider(request), + stream=stream or bool(kwargs.get(WEBSEARCH_CONVERTED_STREAM_KEY, False)), + kwargs={**kwargs, "metadata": request.get("metadata")}, + ) + + +def answer(owner: MessagesInterceptor, request: Mapping[str, object], stream: bool, hooked: bool) -> Awaitable[object]: + model: Final = str(request["model"]) + tools: Final = cast(_JsonBlocks | None, request.get("tools")) # cast-ok: handed on unchecked, as the handler does + kwargs: Final = {name: value for name, value in request.items() if name not in _ENTRY_PARAMS} + messages, system = _entry_messages(request, kwargs, hooked) + handle: Final = cast( # cast-ok: the interceptor answers with whatever the caller receives + Callable[..., Awaitable[object]], owner.handle + ) + return handle( + model=model, + messages=messages, + tools=tools, + stream=stream or kwargs.get("_websearch_interception_converted_stream", False), + max_tokens=cast(int, request["max_tokens"]), # cast-ok: admission requires an int max_tokens + custom_llm_provider=_intercepted_provider(request), + api_key=request.get("api_key"), + api_base=request.get("api_base"), + metadata=request.get("metadata"), + stop_sequences=request.get("stop_sequences"), + system=system, + temperature=request.get("temperature"), + thinking=request.get("thinking"), + tool_choice=request.get("tool_choice"), + top_k=request.get("top_k"), + top_p=request.get("top_p"), + **kwargs, + ) + + def stream_hidden_params(headers: Sequence[tuple[str, str]]) -> Mapping[str, object]: from litellm.llms.anthropic.messages.native.streaming_iterator import ( anthropic_messages_stream_hidden_params, ) - return anthropic_messages_stream_hidden_params(httpx.Headers(list(headers))) + return MessagesStreamHead(anthropic_messages_stream_hidden_params(callbacks_legacy_python.wire_headers(headers))) + + +async def _unrequested_stream_delivered( + stream: object, + kwargs: dict[str, object], # mutable-ok: the call's own kwargs, as `@client` hands them on +) -> object: + try: + delivered: Final = await callbacks_legacy_python.after_deployment_success( + kwargs, stream, CallTypes.anthropic_messages.value + ) + function: Final = cached_function() + caching: Final = LLMCachingHandler( + original_function=function, + request_kwargs=kwargs, + start_time=datetime.datetime.now(), # noqa: DTZ005 # @client's naive start time + ) + store: Final = cast( # cast-ok: the handler leaves its original_function untyped + Callable[..., Awaitable[None]], caching.async_set_cache + ) + await store(result=delivered, original_function=function, kwargs=kwargs) + except BaseException: + from litellm.llms.anthropic.messages.native.streaming_iterator import aclose_if_supported + + await aclose_if_supported(stream) + raise + return delivered + + +def unrequested_stream( + head: object, + kwargs: dict[str, object], # mutable-ok: the call's own kwargs, as `@client` hands them on +) -> None: + if not isinstance(head, MessagesStreamHead): + return + deliver: Final = functools.partial(_unrequested_stream_delivered, kwargs=kwargs) + head.deliver = deliver # rebind-ok: the head carries the delivery back _UPSTREAM_ARGS: Final = TypeAdapter(tuple[int, str]) @@ -129,13 +522,17 @@ _UPSTREAM_HEADERS: Final = TypeAdapter(list[tuple[str, str]]) _BODY_CUT: Final = TypeAdapter(tuple[int, int | None, bool]) _ERROR_CLASS: TypeAlias = Callable[..., Exception] _validate_metadata: Final = cast( # cast-ok: the handler's untyped metadata validator - Callable[[dict[str, object]], object], handler.validate_anthropic_api_metadata + Callable[[object], object], handler.validate_anthropic_api_metadata +) +_mock_response: Final = cast( # cast-ok: the handler's mock builder takes untyped messages + Callable[..., Mapping[str, object]], native_utils.mock_response ) _exception_type: Final = cast( # cast-ok: the legacy public exception mapper is untyped Callable[..., Exception], exception_mapping_utils.exception_type ) _BODY_READ_TIMEOUT: Final = "Timeout on reading data from socket" # aiohttp's SocketTimeoutError text _UNREACHABLE: Final = "could not reach the provider: " +_TOO_MANY_REDIRECTS: Final = "upstream network error: error following redirect: too many redirects" _SEND_FAILED: Final = "upstream network error: error sending request: client error (SendRequest): " _DNS_FAILURE: Final = "failed to lookup address information: " _HTTPX_DNS_ERRNO: Final = { @@ -161,6 +558,12 @@ def _rejection(error: Exception, request: Mapping[str, object], request_provider _validate_metadata(_METADATA.validate_python(metadata)) except ValidationError as invalid: return invalid + provider_rejection: Final = getattr(error, "messages_provider_rejection", None) + if isinstance(provider_rejection, str): + _log_resolved_call(request, request_provider) + return _public_provider_error( + _config_error(400, provider_rejection, (), request, request_provider), error, request, request_provider + ) if getattr(error, "messages_unsupported_param", False): return litellm.UnsupportedParamsError(message=str(error)) return litellm.BadRequestError( @@ -251,7 +654,12 @@ def _aiohttp_connect_failure(url: httpx.URL, port: int, request: Mapping[str, ob def _transport_failure(error: Exception, request: Mapping[str, object], request_provider: str) -> str | None: """The text Python's HTTP client raises for a call that failed before any response arrived.""" + body_cut: Final = getattr(error, "messages_body_cut", None) + if body_cut is not None: + return str(_body_cut(*_BODY_CUT.validate_python(body_cut))) native: Final = str(error) + if native == _TOO_MANY_REDIRECTS: + return "Exceeded maximum allowed redirects." if native.startswith(_SEND_FAILED): reset: Final = native.endswith(f"Connection reset by peer (os error {errno.ECONNRESET})") closed: Final = native.endswith("connection closed before message completed") @@ -301,6 +709,20 @@ def _provider_error(error: Exception, request: Mapping[str, object], request_pro if failure is None: return None status, text, headers = failure + provider_error: Final = _config_error(status, text, headers, request, request_provider) + if transport is not None and isinstance(provider_error, BaseLLMException): + # Python's `_handle_error` gives a failure without a response the status 500. + provider_error.status_code_is_synthesized = True + return provider_error + + +def _config_error( + status: int, + text: str, + headers: Sequence[tuple[str, str]], + request: Mapping[str, object], + request_provider: str, +) -> Exception: api_base: Final = request.get("api_base") config: Final = native_messages_config( str(request["model"]).removeprefix(f"{request_provider}/"), @@ -308,17 +730,26 @@ def _provider_error(error: Exception, request: Mapping[str, object], request_pro request.get("model_info"), api_base if isinstance(api_base, str) else None, ) - provider_error: Final = ( - cast(_ERROR_CLASS, config.get_error_class)( # cast-ok: the config's untyped headers parameter - error_message=text, status_code=status, headers=dict(headers) - ) - if config is not None - else AnthropicError(status_code=status, message=text, headers=httpx.Headers(headers)) + if config is None: + return AnthropicError(status_code=status, message=text, headers=httpx.Headers(headers)) + return cast(_ERROR_CLASS, config.get_error_class)( # cast-ok: the config's untyped headers parameter + error_message=text, status_code=status, headers=dict(headers) ) - if transport is not None and isinstance(provider_error, BaseLLMException): - # Python's `_handle_error` gives a failure without a response the status 500. - provider_error.status_code_is_synthesized = True - return provider_error + + +def _public_provider_error( + provider_error: Exception, error: Exception, request: Mapping[str, object], request_provider: str +) -> Exception: + try: + return _exception_type( + model=str(request["model"]), + custom_llm_provider=request_provider, + original_exception=provider_error, + extra_kwargs=dict(request), + ) + except Exception as mapped: # noqa: BLE001 # exception_type raises the mapped public error + mapped.__context__ = error + return mapped def _log_resolved_call(request: Mapping[str, object], request_provider: str) -> None: @@ -331,20 +762,22 @@ def _log_resolved_call(request: Mapping[str, object], request_provider: str) -> logger, kwargs={name: value for name, value in request.items() if name != "metadata"}, model=str(request["model"]).removeprefix(f"{request_provider}/"), - optional_params=dict(body_params(request)), - litellm_params={"model_info": request.get("model_info"), **body_params(request)}, + optional_params=dict(_body_fields(request)), + litellm_params={"model_info": request.get("model_info"), **_body_fields(request)}, custom_llm_provider=request_provider, ) -def map_failure(error: Exception, request: Mapping[str, object], request_provider: str) -> Exception: +def map_failure( + error: Exception, request: Mapping[str, object], request_provider: str, asynchronous: bool = False +) -> Exception: """Raises what Python's Messages handler raises for the same failure.""" if getattr(error, "messages_timeout", None) == "Body": # Python reads a stream's body outside its HTTP client's error mapping, so the transport's # own timeout reaches the caller unmapped. - return httpx.ReadTimeout(_BODY_READ_TIMEOUT) + return httpx.ReadTimeout(_BODY_READ_TIMEOUT if http_transport.uses_aiohttp_transport() else "") body_cut: Final = getattr(error, "messages_body_cut", None) - if body_cut is not None: + if body_cut is not None and request.get("stream") is True: # Python reads a stream's body outside its HTTP client's error mapping, so a body the # connection cut short reaches the caller as its transport raised it. return _body_cut(*_BODY_CUT.validate_python(body_cut)) @@ -356,6 +789,11 @@ def map_failure(error: Exception, request: Mapping[str, object], request_provide error.__context__ = chained # rebind-ok: Python chains the transport timeout as the exception context if getattr(error, "messages_late_rejection", False): _log_resolved_call(request, request_provider) + if getattr(error, "messages_python_raised", False): + # Python's request transform raises this builtin exception unmapped, e.g. the TypeError + # of comparing a string max_tokens while capping the thinking budget. + _flag_messages_call(request.get("litellm_logging_obj"), asynchronous) + return error if getattr(error, "messages_request_error", False): return _rejection(error, request, request_provider) if getattr(error, "messages_missing_credential", False): @@ -369,28 +807,759 @@ def map_failure(error: Exception, request: Mapping[str, object], request_provide return failures.map_native_failure( error, str(request["model"]), request_provider, request, optional_str(request.get("api_base")) ) - try: - return _exception_type( - model=str(request["model"]), - custom_llm_provider=request_provider, - original_exception=provider_error, - extra_kwargs=dict(request), - ) - except Exception as mapped: # noqa: BLE001 # exception_type raises the mapped public error - mapped.__context__ = error - return mapped + return _public_provider_error(provider_error, error, request, request_provider) def _drop_params(kwargs: Mapping[str, object]) -> bool: return bool(litellm.drop_params) or normalize_drop_params(kwargs.get("drop_params")) is True -def settings(kwargs: Mapping[str, object]) -> dict[str, object]: +def _python_handler_params(request: Mapping[str, object], custom_llm_provider: object) -> GenericLiteLLMParams: + return GenericLiteLLMParams( + **{name: value for name, value in request.items() if name not in _HANDLER_PARAMS}, + api_key=request.get("api_key"), + api_base=request.get("api_base"), + custom_llm_provider=custom_llm_provider, + ) + + +def _resolved_provider(request: Mapping[str, object]) -> str | None: + return optional_str(request.get("custom_llm_provider")) or inferred_provider( + str(request["model"]), optional_str(request.get("api_base")) + ) + + +def _scope_provider_specific_header(request: Mapping[str, object]) -> None: + scoped: Final = request.get("provider_specific_header") + if scoped is None: + return + ProviderSpecificHeaderUtils.get_provider_specific_headers( + provider_specific_header=cast( # cast-ok: the handler hands the caller's value on unvalidated + ProviderSpecificHeader | None, scoped + ), + custom_llm_provider=_resolved_provider(request), + native_anthropic_messages=True, + ) + + +def _python_messages_url(api_base: str | None) -> str: + """`AnthropicMessagesConfig.get_complete_url`, untrimmed, whose `urlsplit` raises a bare + ValueError for a base it cannot split (``Invalid IPv6 URL``).""" + return ensure_api_route(AnthropicModelInfo.get_api_base(api_base) or "https://api.anthropic.com", "v1/messages") + + +def _raise_as_python_does(request: Mapping[str, object], asynchronous: bool) -> None: + iter(cast(Iterable[object], request.get("messages"))) # cast-ok: iterated unchecked, as Python's handler does + tools: Final = request.get("tools") + if tools is not None and not isinstance(tools, list | tuple) and has_interceptors(): + interceptor(request) + _python_handler_params(request, request.get("custom_llm_provider")) + # Python's handler scopes the caller's provider_specific_header before it builds any header, so + # a value of the wrong shape raises its own error (a str: "'str' object has no attribute 'get'"), + # and then builds the URL, unmapped. + logger: Final = request.get("litellm_logging_obj") + try: + _scope_provider_specific_header(request) + except Exception: + _flag_messages_call(logger, asynchronous) + raise + api_base: Final = request.get("api_base") + if not isinstance(api_base, str) or _resolved_provider(request) != "anthropic": + return + try: + _python_messages_url(api_base) + except ValueError: + _log_resolved_call(request, "anthropic") + _flag_messages_call(logger, asynchronous) + raise + + +def settings( + kwargs: Mapping[str, object], request: Mapping[str, object] | None = None, asynchronous: bool = False +) -> dict[str, object]: + if request is not None: + _raise_as_python_does(request, asynchronous) + aiohttp: Final = http_transport.uses_aiohttp_transport() + configured: Final = MessagesSettings( + drop_params=_drop_params(kwargs), + reasoning_auto_summary=is_reasoning_auto_summary_enabled(), + additional_drop_params=handler.additional_drop_paths(kwargs), + request_timeout=get_configured_request_timeout(), + drops_unsupported_params=drops_unsupported_params(kwargs.get("drop_params")), + ascii_response_headers=aiohttp, + joined_reads=aiohttp, + ) return asdict( - MessagesSettings( - drop_params=_drop_params(kwargs), - reasoning_auto_summary=is_reasoning_auto_summary_enabled(), - additional_drop_params=handler.additional_drop_paths(kwargs), - request_timeout=get_configured_request_timeout(), + configured if request is None else _with_call_settings(configured, request, kwargs.get("litellm_logging_obj")) + ) + + +def _flag_messages_call(logger: object, asynchronous: bool) -> None: + if not isinstance(logger, LiteLLMLoggingObj): + return + logger.model_call_details.setdefault("litellm_params", {})[CallTypes.aanthropic_messages.value] = asynchronous + + +@dataclass(frozen=True, slots=True) +class _Answered: + value: object + + def send(self, _value: object) -> execution.Complete: + return execution.Complete(self.value) + + def throw(self, error: BaseException) -> execution.Step: + raise error + + def close(self) -> None: + return None + + +def sync_answer(request: Mapping[str, object]) -> _Answered | None: + logger: Final = request.get("litellm_logging_obj") + mock: Final = _mock(request, logger, asynchronous=False) + if mock is not None: + _flag_messages_call(logger, asynchronous=False) + return _Answered(response(mock)) + served: Final = gateway(request, asynchronous=False) + return None if served is None else _Answered(served) + + +def _handler_params(request: Mapping[str, object]) -> GenericLiteLLMParams: + return GenericLiteLLMParams( + **{name: value for name, value in request.items() if name not in _HANDLER_PARAMS}, + api_key=optional_str(request.get("api_key")), + api_base=optional_str(request.get("api_base")), + custom_llm_provider=optional_str(request.get("custom_llm_provider")), + ) + + +def _requested_model(request: Mapping[str, object]) -> str: + model, _, _, _ = _requested_provider( + str(request["model"]), optional_str(request.get("custom_llm_provider")), _handler_params(request) + ) + return model + + +def _model_without_latest_alias(request: Mapping[str, object], model: str, custom_llm_provider: str | None) -> str: + if not is_model_latest_alias(model, custom_llm_provider): + return model + resolved, provider, _, _ = _requested_provider(model, custom_llm_provider, _handler_params(request)) + prefix, separator, _ = model.partition("/") + return f"{prefix}/{resolved}" if separator and prefix == provider else resolved + + +def _mock(request: Mapping[str, object], logger: object, asynchronous: bool) -> Mapping[str, object] | None: + mock: Final = request.get("mock_response") + if not mock or not isinstance(mock, str): + return None + _validate_metadata(request.get("metadata")) + messages: Final = request.get("messages") + max_tokens: Final = request.get("max_tokens") + model: Final = _requested_model(request) + try: + return dict( + _mock_response( + model=model, + messages=messages if isinstance(messages, list) else [], + max_tokens=max_tokens if isinstance(max_tokens, int) else 0, + mock_response=mock, + ) + ) + except Exception: + _flag_messages_call(logger, asynchronous) + raise + + +def _stream_cost_model(request: Mapping[str, object]) -> str | None: + if request.get("stream") is not True or not stream_cost_injection_requested(proxy_request_headers(request)): + return None + return _requested_model(request) + + +def _affinity_extra_headers( + request: Mapping[str, object], model: str, explicit_provider: str | None +) -> Mapping[str, object] | None: + api_base: Final = optional_str(request.get("api_base")) + anthropic_header: Final = get_provider_affinity_header(AnthropicModelInfo.get_api_base(api_base)) + other_header: Final = get_provider_affinity_header(api_base) + if anthropic_header is None and other_header is None: + return None + provider: Final = explicit_provider or inferred_provider(model, api_base) + default_header: Final = anthropic_header if provider == "anthropic" else other_header + if default_header is None: + return None + headers: Final = as_str_mapping(request.get("headers")) + extra_headers: Final = as_str_mapping(request.get("extra_headers")) + merged: Final = _merged_headers( + headers, + extra_headers, + ProviderSpecificHeaderUtils.get_provider_specific_headers( + provider_specific_header=cast( # cast-ok: the handler hands the caller's value on unvalidated + ProviderSpecificHeader | None, request.get("provider_specific_header") + ), + custom_llm_provider=provider, + native_anthropic_messages=True, + ), + ) + added: Final = add_provider_affinity_header(merged, _handler_params(request), default_header) + affinity: Final = {name: value for name, value in added.items() if name not in merged} + if not affinity: + return None + return dict(_merged_headers(headers, extra_headers, affinity)) + + +def _with_call_settings( + configured: MessagesSettings, request: Mapping[str, object], logger: object +) -> MessagesSettings: + explicit_provider: Final = optional_str(request.get("custom_llm_provider")) + model: Final = _model_without_latest_alias(request, str(request["model"]), explicit_provider) + mock: Final = _mock(request, logger, asynchronous=True) + if mock is not None: + return replace(configured, model=model, mock_response=mock) + return replace( + configured, + model=model, + stream_cost_model=_stream_cost_model(request), + extra_headers=_affinity_extra_headers(request, model, explicit_provider), + mcp_gateway=_takes_mcp_gateway(request), + ) + + +def _takes_mcp_gateway(request: Mapping[str, object]) -> bool: + tools: Final = optional_sequence(request.get("tools")) + return not request.get("_skip_mcp_handler", False) and bool(tools) and may_name_litellm_mcp_gateway(tools) + + +MessagesResult: TypeAlias = AnthropicMessagesResponse | Iterator[bytes] | AsyncIterator[object] + + +def gateway( + request: Mapping[str, object], asynchronous: bool, hooked: bool = False +) -> Coroutine[object, object, MessagesResult] | None: + if not _takes_mcp_gateway(request): + return None + model: Final = str(request["model"]) + provider: Final = optional_str(request.get("custom_llm_provider")) + api_base: Final = optional_str(request.get("api_base")) + tools: Final = cast(_JsonBlocks, request.get("tools")) # cast-ok: handed on unchecked, as the handler does + messages: Final = cast(_JsonBlocks, request["messages"]) # cast-ok: handed on unchecked, as the handler does + system: Final = cast( # cast-ok: handed on unchecked, as the handler does + str | _JsonBlocks | None, request.get("system") + ) + if not asynchronous: + return _gateway(request, messages, system, model=model, provider=provider, tools=tools, presanitized=False) + entry_kwargs: Final = {name: value for name, value in request.items() if name not in _ENTRY_PARAMS} + entry_messages, entry_system = ( + (messages, system) + if hooked + else prepare_native_messages( + messages, system, entry_kwargs, model=model, custom_llm_provider=provider, tools=tools, api_base=api_base ) ) + return _gateway( + {**request, **entry_kwargs, "is_async": True}, + entry_messages, + entry_system, + model=model, + provider=handler.provider_after_pre_request_hooks(model, provider, entry_kwargs), + tools=tools, + presanitized=True, + ) + + +def _gateway( + call: Mapping[str, object], + messages: _JsonBlocks, + system: str | _JsonBlocks | None, + *, + model: str, + provider: str | None, + tools: _JsonBlocks, + presanitized: bool, +) -> Coroutine[object, object, MessagesResult]: + kwargs: Final = {name: value for name, value in call.items() if name not in _HANDLER_PARAMS} + api_key: Final = optional_str(call.get("api_key")) + api_base: Final = optional_str(call.get("api_base")) + prepared_messages, prepared_system = prepare_native_messages( + messages, + system, + kwargs, + model=model, + custom_llm_provider=provider, + tools=tools, + api_base=api_base, + presanitized=presanitized, + ) + metadata: Final = _validate_metadata(call.get("metadata")) + is_async: Final = kwargs.pop("is_async", False) + logging_obj: Final = kwargs.get("litellm_logging_obj") + litellm_params: Final = GenericLiteLLMParams( + **kwargs, api_key=api_key, api_base=api_base, custom_llm_provider=provider + ) + resolved_model, resolved_provider, dynamic_api_key, dynamic_api_base = _requested_provider( + model, provider, litellm_params + ) + if isinstance(logging_obj, LiteLLMLoggingObj): + logging_obj.model_call_details["agentic_loop_params"] = { + "model": model, + "custom_llm_provider": resolved_provider, + } + logging_obj.model_call_details.setdefault("litellm_params", {})[CallTypes.aanthropic_messages.value] = is_async + if kwargs.get("_websearch_interception_converted_stream", False): + logging_obj.model_call_details["websearch_interception_converted_stream"] = True + bridge: Final = _bridged( + _BridgeTarget(model=model, api_key=api_key, api_base=api_base), + _BridgeTarget( + model=resolved_model, + api_key=None if _own_entra_credential(litellm_params) else dynamic_api_key, + api_base=dynamic_api_base, + ), + resolved_provider, + ) + kwargs.pop("_skip_mcp_handler", False) + from litellm.llms.anthropic.messages.native.mcp_handler import anthropic_messages_with_mcp + + return anthropic_messages_with_mcp( + max_tokens=cast(int, call["max_tokens"]), # cast-ok: handed on unchecked, as the handler does + messages=prepared_messages, + model=resolved_model, + metadata=metadata, + stop_sequences=call.get("stop_sequences"), + stream=call.get("stream", False), + system=prepared_system, + temperature=call.get("temperature"), + thinking=call.get("thinking"), + tool_choice=call.get("tool_choice"), + tools=tools, + top_k=call.get("top_k"), + top_p=call.get("top_p"), + container=call.get("container"), + api_key=bridge.api_key, + api_base=bridge.api_base, + client=call.get("client"), + custom_llm_provider=resolved_provider, + **kwargs, + ) + + +def inject_stream_cost(frames: bytes, model: str, request: Mapping[str, object]) -> object: + from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing + + logger: Final = request.get("litellm_logging_obj") + logging_obj: Final = logger if isinstance(logger, LiteLLMLoggingObj) else None + return ProxyBaseLLMRequestProcessing.process_chunk_with_cost_injection( + frames, + model, + logging_obj, + request_headers=proxy_request_headers( + as_str_mapping(logging_obj.model_call_details.get("litellm_params")) if logging_obj else None + ), + ) + + +def workload_identity_token(params: Mapping[str, object], api_base: str | None) -> str | None: + litellm_params: Final = GenericLiteLLMParams(**params) + return get_anthropic_wif_token(dict(litellm_params), api_base, "") + + +class RawTransportFailure(Exception): + def __init__(self, error: Exception) -> None: + super().__init__(str(error)) + self.error = error + + +@dataclass(frozen=True, slots=True) +class Sent: + status: int + headers: Sequence[tuple[str, str]] + text: str | None = None + chunks: AsyncIterator[bytes] | None = None + rejection: httpx.HTTPStatusError | None = None + + +def _unsendable_api_base(api_base: object) -> bool: + """A caller api_base the native URL parser rejects or reads otherwise than httpx and aiohttp + (no http(s) scheme, whitespace, control or non-ASCII characters): Python's client decides what + such a URL does, from a relative-URL error to a request on the host it finds.""" + if not isinstance(api_base, str) or not api_base: + return False + return not ( + api_base.isascii() + and api_base.isprintable() + and " " not in api_base + and api_base.lower().startswith(("http://", "https://")) + ) + + +def transport_handler(request: Mapping[str, object]) -> AsyncHTTPHandler | None: + client: Final = request.get("client") + if isinstance(client, AsyncHTTPHandler): + return client + if not http_transport.sends_through_python(client, request.get("timeout")) and not _unsendable_api_base( + request.get("api_base") + ): + return None + return get_async_httpx_client(llm_provider=litellm.LlmProviders.ANTHROPIC) + + +def decoding_failure(message: str, request: Mapping[str, object], request_provider: str) -> Exception: + error: Final = httpx.DecodingError(message) + if request.get("stream") is True: + return error + return map_transport_failure(error, request, request_provider) + + +def unencodable_header(value: bytes, received: bool) -> Exception: + text: Final = value.decode("utf-8", "surrogateescape" if received else "surrogatepass") + try: + text.encode("ascii") + except UnicodeEncodeError as unencodable: + return unencodable + return ValueError(text) + + +def _sent_url(request: Mapping[str, object], url: str) -> str: + """The native URL builder trims the caller's api_base; Python sends it as given.""" + api_base: Final = request.get("api_base") + if not isinstance(api_base, str) or api_base == api_base.strip() or not _unsendable_api_base(api_base): + return url + try: + return _python_messages_url(api_base) if url == _python_messages_url(api_base.strip()) else url + except ValueError: # a base urlsplit cannot split keeps the URL the native builder made + return url + + +async def transport_send( + handler: AsyncHTTPHandler, + request: Mapping[str, object], + url: str, + headers: Sequence[tuple[str, str]], + body: object, + stream: bool, +) -> Sent: + try: + response: Final = await handler.post( # pyright: ignore[reportUnknownMemberType] # the handler's untyped dict params + url=_sent_url(request, url), + headers=dict(headers), + data=body if isinstance(body, bytes) else json.dumps(body), + stream=stream, + logging_obj=cast( # cast-ok: the call's logger, handed on as Python's handler hands it + "LiteLLMLoggingObj | None", request.get("litellm_logging_obj") + ), + timeout=cast( # cast-ok: the call's timeout as the handler resolved it for the post + "float | httpx.Timeout | None", request.get("timeout") + ), + ) + response.raise_for_status() + except httpx.HTTPStatusError as rejection: + try: + text: Final = rejection.response.text + except Exception as unreadable: # noqa: BLE001 # Python's retry check raises it from its except block, unmapped + raise RawTransportFailure(unreadable) from None + return Sent(rejection.response.status_code, rejection.response.headers.multi_items(), text, None, rejection) + if stream: + return Sent(response.status_code, response.headers.multi_items(), chunks=response.aiter_bytes()) + return Sent(response.status_code, response.headers.multi_items(), text=response.text) + + +def map_transport_failure(error: Exception, request: Mapping[str, object], request_provider: str) -> Exception: + api_base: Final = request.get("api_base") + config: Final = native_messages_config( + str(request["model"]).removeprefix(f"{request_provider}/"), + request_provider, + request.get("model_info"), + api_base if isinstance(api_base, str) else None, + ) + try: + handler.base_llm_http_handler._handle_error(e=error, provider_config=config) # pyright: ignore[reportPrivateUsage, reportArgumentType] # the handler's own error mapping, which always raises + except Exception as provider_error: # noqa: BLE001 # _handle_error raises the provider exception it builds + provider_error.__context__ = error + if not isinstance(provider_error, BaseLLMException): + return provider_error + try: + return _exception_type( + model=str(request["model"]), + custom_llm_provider=request_provider, + original_exception=provider_error, + extra_kwargs=dict(request), + ) + except Exception as mapped: # noqa: BLE001 # exception_type raises the mapped public error + mapped.__context__ = provider_error + return mapped + return error + + +_AGENTIC_UNSENT_PARAMS: Final = frozenset({"model", "messages", "max_tokens"}) +_HANDLER_POPPED: Final = frozenset( + {"is_async", "_litellm_messages_presanitized", "_skip_mcp_handler", "cache_control_injection_points"} +) + + +def _logger(request: Mapping[str, object]) -> LiteLLMLoggingObj | None: + logger: Final = request.get("litellm_logging_obj") + return logger if isinstance(logger, LiteLLMLoggingObj) else None + + +def runs_agentic_hooks(request: Mapping[str, object]) -> bool: + logger: Final = _logger(request) + if logger is None: + return False + return BaseLLMHTTPHandler._has_agentic_completion_hook(logger) or bool( # pyright: ignore[reportPrivateUsage] # the handler's own agentic gate + request.get(WEBSEARCH_CONVERTED_STREAM_KEY, False) + ) + + +def record_agentic_loop(request: Mapping[str, object], custom_llm_provider: str) -> None: + logger: Final = _logger(request) + if logger is None: + return + logger.model_call_details["agentic_loop_params"] = { + "model": request["model"], + "custom_llm_provider": custom_llm_provider, + } + if request.get(WEBSEARCH_CONVERTED_STREAM_KEY, False): + logger.model_call_details["websearch_interception_converted_stream"] = True + + +@dataclass(frozen=True, slots=True) +class _AgenticCall: + model: str + messages: list[dict[str, object]] # mutable-ok: the handler's agentic hooks take a message list + config: BaseAnthropicMessagesConfig + params: dict[str, object] # mutable-ok: the handler's agentic hooks take a params dict + logger: LiteLLMLoggingObj + provider: str + kwargs: dict[str, object] # mutable-ok: the handler's agentic hooks take a kwargs dict + + +def _agentic_params( + sent: Mapping[str, object], requested: Mapping[str, object], request: Mapping[str, object] +) -> dict[str, object]: # mutable-ok: the handler's agentic hooks take a params dict + params: Final = {name: value for name, value in sent.items() if name not in _AGENTIC_UNSENT_PARAMS} + if "tools" not in params: + return params + caller_tools: Final = request.get("tools") + requested_tools: Final = requested.get("tools") + return {**params, "tools": caller_tools if caller_tools == requested_tools else requested_tools} + + +def _agentic_call( + request: Mapping[str, object], + sent: Mapping[str, object], + model: str, + custom_llm_provider: str, + requested: Mapping[str, object], + hooked: bool, +) -> _AgenticCall: + logger: Final = _logger(request) + api_base: Final = optional_str(request.get("api_base")) + config: Final = native_messages_config(model, custom_llm_provider, request.get("model_info"), api_base) + if logger is None or config is None: + raise ValueError("an agentic Messages call needs its logger and provider config") + kwargs: Final = { + name: value for name, value in request.items() if name not in _HANDLER_PARAMS and name not in _HANDLER_POPPED + } + messages, _, _ = _prompt_cached(request, asynchronous=True, hooked=hooked) + return _AgenticCall( + model=model, + messages=cast( # cast-ok: the handler hands its prepared messages to the hooks as dicts + list[dict[str, object]], strip_provider_specific_fields_from_anthropic_messages(messages) + ), + config=config, + params=_agentic_params(sent, requested, request), + logger=logger, + provider=custom_llm_provider, + kwargs=BaseLLMHTTPHandler._agentic_hook_kwargs( # pyright: ignore[reportPrivateUsage] # the handler's own follow-up kwargs + kwargs=kwargs, api_key=optional_str(request.get("api_key")), api_base=api_base + ), + ) + + +async def _failed_deployment(request: Mapping[str, object], error: Exception) -> None: + from litellm.utils import async_post_call_failure_deployment_hook + + try: + await async_post_call_failure_deployment_hook( + request_data=request, exception=error, call_type=CallTypes.anthropic_messages.value + ) + except asyncio.CancelledError: + raise + except BaseException: # noqa: BLE001, S110 # a failing hook never replaces the agentic loop's own failure, as in `@client` + pass + + +async def agentic_response( + response: object, + request: Mapping[str, object], + sent: Mapping[str, object], + model: str, + custom_llm_provider: str, + requested: Mapping[str, object], + hooked: bool, +) -> object: + try: + call: Final = _agentic_call(request, sent, model, custom_llm_provider, requested, hooked) + initial: Final = cast(AnthropicMessagesResponse, response) # cast-ok: the public response the handler finishes + return await handler.base_llm_http_handler._finalize_anthropic_messages_response( # pyright: ignore[reportPrivateUsage, reportUnknownMemberType, reportUnknownVariableType] # the handler's own agentic finish, typed with bare dicts + initial_response=initial, + model=call.model, + messages=call.messages, + anthropic_messages_provider_config=call.config, + anthropic_messages_optional_request_params=call.params, + logging_obj=call.logger, + custom_llm_provider=call.provider, + kwargs=call.kwargs, + ) + except Exception as error: + await _failed_deployment(request, error) + raise + + +def _agentic_stream(stream: AsyncStream, call: _AgenticCall, held: frozenset[str]) -> object: + from litellm.llms.anthropic.messages.native.agentic_streaming_iterator import AgenticAnthropicStreamingIterator + from litellm.llms.anthropic.messages.native.streaming_iterator import ( + AnthropicMessagesStreamHiddenParams, + AnthropicMessagesStreamingResponse, + ) + + return AnthropicMessagesStreamingResponse( + completion_stream=AgenticAnthropicStreamingIterator( + completion_stream=stream, + http_handler=handler.base_llm_http_handler, + model=call.model, + messages=call.messages, + anthropic_messages_provider_config=call.config, + anthropic_messages_optional_request_params=call.params, + logging_obj=call.logger, + custom_llm_provider=call.provider, + kwargs=call.kwargs, + hold_back=bool(held), + server_fulfilled_tool_names=held, + ), + hidden_params=cast( # cast-ok: the stream's stamped hidden params, shared as Python's handler shares them + AnthropicMessagesStreamHiddenParams, + stream._hidden_params, # pyright: ignore[reportPrivateUsage] # the native stream's own hidden params + ), + ) + + +def agentic_stream( + head: object, + request: Mapping[str, object], + sent: Mapping[str, object], + model: str, + custom_llm_provider: str, + requested: Mapping[str, object], + hooked: bool, +) -> None: + logger: Final = _logger(request) + if ( + not isinstance(head, MessagesStreamHead) + or logger is None + or not BaseLLMHTTPHandler._has_agentic_completion_hook(logger) # pyright: ignore[reportPrivateUsage] # the handler's own agentic gate + ): + return + call: Final = _agentic_call(request, sent, model, custom_llm_provider, requested, hooked) + held: Final = BaseLLMHTTPHandler._server_fulfilled_tools_in_request( # pyright: ignore[reportPrivateUsage] # the handler's own hold-back gate + logging_obj=logger, tools=call.params.get("tools") + ) + wrap: Final = functools.partial(_agentic_stream, call=call, held=held) + head.agentic = wrap # rebind-ok: the head carries the stream wrapper back + + +class MessagesSafeguards: + def __init__(self, request: Mapping[str, object]) -> None: + self._request: Final = request + self._frames: _StampedFrames | None = None + self._results: object = None + + async def _evaluator(self) -> SafeguardsEvaluator | None: + model, provider = _handler_model(self._request) + if not await handler.proxy_classifies_tool_uses(model, provider, self._request): + return None + messages: Final = normalize_native_messages(optional_sequence(self._request.get("messages")) or ()) + return await asyncio.to_thread( + handler._native_safeguards_evaluator, # pyright: ignore[reportPrivateUsage] # the handler's own evaluator build + self._request, + messages, + ) + + async def results(self, value: Mapping[str, object]) -> object: + evaluator: Final = await self._evaluator() + if evaluator is None: + return None + unstamped: Final = response(value) + stamped: Final = await with_safeguard_results(unstamped, evaluator) + if stamped is unstamped: + return None + self._results = stamped.get("safeguard_results") + return self._results + + def published(self, public: Mapping[str, object]) -> Mapping[str, object]: + return public if self._results is None else {**public, "safeguard_results": self._results} + + async def open_stream(self) -> bool: + evaluator: Final = await self._evaluator() + if evaluator is None: + return False + self._frames = _StampedFrames(StreamedSafeguardResults(evaluator)) + return True + + async def frames(self, chunk: bytes) -> Sequence[bytes]: + return await self._open_frames().feed(chunk) + + async def flush(self) -> Sequence[bytes]: + return await self._open_frames().flush() + + def _open_frames(self) -> _StampedFrames: + if self._frames is None: + raise RuntimeError("safeguards stream frames before the stream opened") + return self._frames + + +class _StampedFrames: + def __init__(self, safeguard_results: StreamedSafeguardResults) -> None: + self._safeguard_results: Final = safeguard_results + self._open_frame: Final = bytearray() + + async def feed(self, chunk: bytes) -> Sequence[bytes]: + from litellm.llms.anthropic.messages.native.streaming_iterator import ( + _SSE_FRAME_END, # pyright: ignore[reportPrivateUsage] # the handler's own SSE framing + _SSE_TERMINATOR_OVERLAP, # pyright: ignore[reportPrivateUsage] # the handler's own SSE framing + _ends_a_frame, # pyright: ignore[reportPrivateUsage] # the handler's own SSE framing + _stamped_sse_frame, # pyright: ignore[reportPrivateUsage] # the handler's own SSE framing + ) + + scan_from: Final = max(len(self._open_frame) - _SSE_TERMINATOR_OVERLAP, 0) + self._open_frame.extend(chunk) + if not _ends_a_frame(self._open_frame, scan_from): + return () + *frames, unterminated = _SSE_FRAME_END.split(self._open_frame) + self._open_frame[:] = unterminated + return tuple([bytes(await _stamped_sse_frame(frame, self._safeguard_results)) for frame in frames]) + + async def flush(self) -> Sequence[bytes]: + if not self._open_frame: + return () + from litellm.llms.anthropic.messages.native.streaming_iterator import ( + _stamped_sse_frame, # pyright: ignore[reportPrivateUsage] # the handler's own SSE framing + ) + + return (bytes(await _stamped_sse_frame(bytes(self._open_frame), self._safeguard_results)),) + + +def _handler_model(request: Mapping[str, object]) -> tuple[str, str | None]: + explicit_provider: Final = optional_str(request.get("custom_llm_provider")) + try: + model, provider, _, _ = litellm.get_llm_provider( + model=str(request["model"]), custom_llm_provider=explicit_provider + ) + except litellm.BadRequestError: + return str(request["model"]), explicit_provider + return model, provider + + +def safeguards(request: Mapping[str, object]) -> MessagesSafeguards | None: + if "safeguards" not in request or not native_route_classifies(str(request["model"]), request["safeguards"]): + return None + return MessagesSafeguards(request) diff --git a/litellm/rust_bridge/messages/detectors.py b/litellm/rust_bridge/messages/detectors.py deleted file mode 100644 index 99555bb4852..00000000000 --- a/litellm/rust_bridge/messages/detectors.py +++ /dev/null @@ -1,114 +0,0 @@ -"""Detectors for Python-only Anthropic Messages behavior.""" - -from __future__ import annotations - -from typing import Final - -import litellm -from litellm.anthropic_beta_headers_manager import is_foundry_api_base -from litellm.litellm_core_utils.core_helpers import ( - drops_unsupported_params, - proxy_request_headers, - stream_cost_injection_requested, -) -from litellm.llms.opencode.common_utils import is_opencode_api_base -from litellm.rust_bridge.detectors import api_base, overridden, present, streaming -from litellm.rust_bridge.public_call import NativeCall, optional_mapping, optional_sequence, optional_str - - -def provider_affinity(request: NativeCall) -> bool: - return is_opencode_api_base(api_base(request)) - - -def foundry_beta_row(request: NativeCall) -> bool: - from litellm.llms.anthropic.common_utils import AnthropicModelInfo - - return is_foundry_api_base(AnthropicModelInfo.get_api_base(api_base(request))) - - -def anthropic_workload_identity(request: NativeCall) -> bool: - """Python mints an Anthropic federation token when no static credential is configured.""" - from litellm.llms.anthropic.common_utils import AnthropicModelInfo - from litellm.secret_managers.main import get_secret_str - - def configured(param: str, env: str) -> bool: - return present(request, param) or get_secret_str(env) is not None - - return ( - AnthropicModelInfo.get_api_key(optional_str(request.resolved.get("api_key"))) is None - and AnthropicModelInfo.get_auth_token() is None - and configured("anthropic_federation_rule_id", "ANTHROPIC_FEDERATION_RULE_ID") - and configured("anthropic_organization_id", "ANTHROPIC_ORGANIZATION_ID") - ) - - -_THINKING_BLOCKS: Final = frozenset({"thinking", "redacted_thinking"}) - - -def _replays_thinking(message: object) -> bool: - content: Final = optional_sequence((optional_mapping(message) or {}).get("content")) or () - return any((optional_mapping(block) or {}).get("type") in _THINKING_BLOCKS for block in content) - - -def thinking_signature_retry(request: NativeCall) -> bool: - """Python may strip replayed thinking blocks and retry after a rejected signature.""" - return any(_replays_thinking(message) for message in optional_sequence(request.resolved.get("messages")) or ()) - - -def tool_custom_field(request: NativeCall) -> bool: - tools: Final = optional_sequence(request.resolved.get("tools")) or () - return any("custom" in (optional_mapping(tool) or {}) for tool in tools) - - -def strict_tools_retry(request: NativeCall) -> bool: - tools: Final = optional_sequence(request.resolved.get("tools")) or () - return drops_unsupported_params(request.resolved.get("drop_params")) and any( - (optional_mapping(tool) or {}).get("strict") is True for tool in tools - ) - - -def stream_cost_injection(request: NativeCall) -> bool: - """Python adds response cost to streaming usage when the global setting or the request header asks for it.""" - return streaming(request) and stream_cost_injection_requested(proxy_request_headers(request.resolved)) - - -def pre_request_hook(_request: NativeCall) -> bool: - """The async Messages handler runs callbacks that can rewrite the request.""" - return overridden("async_pre_request_hook", litellm.callbacks) - - -def websearch_interception(_request: NativeCall) -> bool: - """The async Messages handler can answer a web-search request without an LLM call.""" - from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger - - return any(isinstance(callback, WebSearchInterceptionLogger) for callback in litellm.callbacks) - - -def _resolved_provider(request: NativeCall) -> str | None: - from litellm.exceptions import BadRequestError - from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider - - provider: Final = optional_str(request.resolved.get("custom_llm_provider")) - try: - return get_llm_provider(str(request.resolved["model"]), provider)[1] - except BadRequestError: - return provider - - -def intercepted(request: NativeCall) -> bool: - """The async Messages handler delegates matching tools to a registered interceptor.""" - from litellm.llms.anthropic.messages.native.interceptors import get_messages_interceptors - - tools: Final = optional_sequence(request.resolved.get("tools")) - if not tools: - return False - mappings: Final = tuple(mapping for mapping in map(optional_mapping, tools) if mapping is not None) - provider: Final = _resolved_provider(request) - return any(interceptor.can_handle(mappings, provider) for interceptor in get_messages_interceptors()) - - -def safeguards_classifier(request: NativeCall) -> bool: - """Python's proxy classifier evaluates dangerous tool use for non-Claude models.""" - from litellm.llms.anthropic.messages.safeguards import native_route_classifies - - return native_route_classifies(str(request.resolved["model"]), request.resolved.get("safeguards")) diff --git a/litellm/rust_bridge/messages/entrypoints.py b/litellm/rust_bridge/messages/entrypoints.py index 756d62b747a..ca195d99c62 100644 --- a/litellm/rust_bridge/messages/entrypoints.py +++ b/litellm/rust_bridge/messages/entrypoints.py @@ -1,6 +1,7 @@ from __future__ import annotations -from collections.abc import AsyncIterator, Awaitable, Iterator +from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from dataclasses import dataclass from typing import Final, Protocol, cast # noqa: TID251 # validates dynamically loaded native callables from litellm.rust_bridge import execution @@ -9,6 +10,30 @@ from litellm.rust_bridge.public_call import NativeCall from litellm.types.llms.anthropic_messages.anthropic_response import AnthropicMessagesResponse +class MessagesStreamHead(dict[str, object]): + agentic: Callable[[execution.AsyncStream], object] | None = None + deliver: Callable[[object], Awaitable[object]] | None = None + + +@dataclass(frozen=True, slots=True) +class _Undelivered: + stream: object + deliver: Callable[[object], Awaitable[object]] + + +def _open_stream(native: execution.Execution, head: object) -> object: + stream: Final = execution.AsyncStream(native, head) + agentic: Final = head.agentic if isinstance(head, MessagesStreamHead) else None + opened: Final = stream if agentic is None else agentic(stream) + deliver: Final = head.deliver if isinstance(head, MessagesStreamHead) else None + return opened if deliver is None else _Undelivered(opened, deliver) + + +async def _delivered(opened: Awaitable[object]) -> object: + result: Final = await opened + return await result.deliver(result.stream) if isinstance(result, _Undelivered) else result + + class NativeMessages(Protocol): def __call__( self, @@ -33,8 +58,12 @@ def _messages_binding(value: object) -> NativeMessages | None: def _amessages_binding(value: object) -> NativeAmessages | None: if not callable(value): return None - native: Final = execution.asynchronous(value) - return cast("NativeAmessages", native) # cast-ok: the execution adapter returns the route's result + native: Final = execution.asynchronous(value, _open_stream) + + def amessages(request: NativeCall) -> Awaitable[object]: + return _delivered(native(request)) + + return cast("NativeAmessages", amessages) # cast-ok: the execution adapter returns the route's result NATIVE_MESSAGES: Final = NativeBinding("messages", validate=_messages_binding) diff --git a/litellm/rust_bridge/response_metadata.py b/litellm/rust_bridge/response_metadata.py index d2ddf61f7db..b5293bbe291 100644 --- a/litellm/rust_bridge/response_metadata.py +++ b/litellm/rust_bridge/response_metadata.py @@ -4,12 +4,15 @@ from litellm.litellm_core_utils.add_retry_fallback_headers import ( _add_headers_to_response, # pyright: ignore[reportPrivateUsage] # reuse the proxy's identity-preserving response metadata writer get_hidden_params_dict, ) +from litellm.rust_bridge.catalog import Route ResultT: Final = TypeVar("ResultT") -def mark_rust_response(response: ResultT) -> ResultT: - cache_key: Final = get_hidden_params_dict(response).get("cache_key") +def mark_rust_response(response: ResultT, route: Route) -> ResultT: + if isinstance(response, dict): + return response # pyright: ignore[reportUnknownVariableType] # the caller's own dict, returned untouched + cache_key: Final = None if route is Route.MESSAGES else get_hidden_params_dict(response).get("cache_key") _add_headers_to_response( response, {"x-litellm-rust": "true", **({"x-litellm-cache-key": cache_key} if isinstance(cache_key, str) else {})}, diff --git a/litellm/rust_bridge/runtime.py b/litellm/rust_bridge/runtime.py index e22ebe73b08..6159d8de551 100644 --- a/litellm/rust_bridge/runtime.py +++ b/litellm/rust_bridge/runtime.py @@ -134,7 +134,7 @@ async def _aattempt_native( def _required(result: RustAttempt[ResultT], context: RouteContext) -> ResultT: if isinstance(result, RustHandled): - return mark_rust_response(result.value) + return mark_rust_response(result.value, context.route) _raise_required(result, _error_context(context)) diff --git a/litellm/types/guardrails.py b/litellm/types/guardrails.py index e311f2ee5f9..8765db30ed5 100644 --- a/litellm/types/guardrails.py +++ b/litellm/types/guardrails.py @@ -163,6 +163,7 @@ class SupportedGuardrailIntegrations(Enum): AIRIA = "airia" WINGBACK = "wingback" DECISION_MODEL = "decision_model" + COLLIEAI = "collieai" class Role(Enum): diff --git a/litellm/types/integrations/rag/bedrock_knowledgebase.py b/litellm/types/integrations/rag/bedrock_knowledgebase.py index 7288eca03b4..f472cdc078f 100644 --- a/litellm/types/integrations/rag/bedrock_knowledgebase.py +++ b/litellm/types/integrations/rag/bedrock_knowledgebase.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Literal, TypeAlias from typing_extensions import ReadOnly, TypedDict @@ -114,10 +114,20 @@ class BedrockKBRetrievalConfiguration(TypedDict, total=False): vectorSearchConfiguration: BedrockKBVectorSearchConfiguration | None +BedrockKBImageFormat: TypeAlias = Literal["png", "jpeg", "gif", "webp"] + + +class BedrockKBInputImage(TypedDict): + format: ReadOnly[BedrockKBImageFormat] + inlineContent: ReadOnly[str] + + class BedrockKBRetrievalQuery(TypedDict, total=False): """Query structure for retrieval.""" text: str | None + type: ReadOnly[Literal["TEXT", "IMAGE"]] + image: ReadOnly[BedrockKBInputImage] class BedrockKBGuardrailConfiguration(TypedDict, total=False): diff --git a/litellm/types/passthrough_endpoints/pass_through_endpoints.py b/litellm/types/passthrough_endpoints/pass_through_endpoints.py index b6bab77ab33..8a2b2a8f99c 100644 --- a/litellm/types/passthrough_endpoints/pass_through_endpoints.py +++ b/litellm/types/passthrough_endpoints/pass_through_endpoints.py @@ -1,4 +1,4 @@ -from collections.abc import Mapping, Sequence +from collections.abc import Callable, Mapping, Sequence from dataclasses import dataclass from datetime import datetime from enum import Enum @@ -20,6 +20,15 @@ LITELLM_PASS_THROUGH_RAW_BODY_STATE_KEY: Final = "litellm_pass_through_raw_body" # `model_info` of the router deployment a provider route (e.g. Vertex) resolved for this request. LITELLM_PASS_THROUGH_DEPLOYMENT_MODEL_INFO_STATE_KEY: Final = "litellm_pass_through_deployment_model_info" +# Resolves that `model_info` from the body actually forwarded, after the `custom_body` envelope and pre-call hooks. +LITELLM_PASS_THROUGH_DEPLOYMENT_PRICING_STATE_KEY: Final = "litellm_pass_through_deployment_pricing" + + +@dataclass(frozen=True, slots=True) +class DeploymentPricingResolver: + resolve: Callable[[Mapping[str, object]], Mapping[str, object] | None] + + # Attribute set on the FastAPI endpoint function of every user-defined pass-through # route. Auth reads it off the dispatched endpoint (``request.scope["endpoint"]``) to # decide whether a request body ``model`` names an upstream model rather than a diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/collieai.py b/litellm/types/proxy/guardrails/guardrail_hooks/collieai.py new file mode 100644 index 00000000000..784bbfc9d0d --- /dev/null +++ b/litellm/types/proxy/guardrails/guardrail_hooks/collieai.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import Final + +from pydantic import ConfigDict, Field + +from litellm.types.llms.base import LiteLLMBaseModel + +from .base import GuardrailConfigModel + +DEFAULT_API_BASE: Final = "https://app.collieai.io/v1/integrations/litellm" + + +class CollieAiGuardrailConfigModelOptionalParams(LiteLLMBaseModel): + model_config = ConfigDict(frozen=True) + + deadline_ms: int | None = Field( + default=None, + gt=0, + description=( + "Each phase's whole deadline in milliseconds: connection, send, reply and parse. " + "Leave empty for the package default." + ), + ) + forward_conversation_id: bool | None = Field( + default=None, + description=( + "Forward the caller's x-collieai-conversation-id header, and only that header. Leave empty to keep it off." + ), + ) + + +class CollieAiGuardrailConfigModel(GuardrailConfigModel[CollieAiGuardrailConfigModelOptionalParams]): + model_config = ConfigDict(frozen=True) + + api_key: str | None = Field( + default=None, + description="CollieAi project API key, starting with clai_. Leave empty to use COLLIEAI_API_KEY.", + ) + api_base: str | None = Field( + default=None, + description="CollieAi's LiteLLM integration base URL. Leave empty for CollieAi's hosted service.", + ) + + @staticmethod + def ui_friendly_name() -> str: + return "CollieAi" diff --git a/litellm/types/vector_stores.py b/litellm/types/vector_stores.py index 2259339e479..b154d161e13 100644 --- a/litellm/types/vector_stores.py +++ b/litellm/types/vector_stores.py @@ -2,12 +2,14 @@ from collections.abc import Mapping, Sequence from dataclasses import dataclass from datetime import datetime from enum import Enum -from typing import Any, Literal +from typing import Any, Final, Literal, TypeAlias from typing_extensions import ReadOnly, TypedDict from litellm.types.llms.base import LiteLLMBaseModel +RETRIEVAL_QUERY_PARAMS: Final = ("retrievalQuery", "retrieval_query") + class SupportedVectorStoreIntegrations(str, Enum): """Supported vector store integrations.""" @@ -74,11 +76,29 @@ class VectorStoreInfoRequest(LiteLLMBaseModel): vector_store_id: str +VectorStoreSearchImageMediaType: TypeAlias = Literal["image/jpeg", "image/png", "image/gif", "image/webp"] + + +class VectorStoreSearchQueryImage(TypedDict): + """Base64 image to search a multimodal vector store with, in place of a text query""" + + type: ReadOnly[Literal["base64"]] + media_type: ReadOnly[VectorStoreSearchImageMediaType] + data: ReadOnly[str] + + +class VectorStoreResultImageSource(TypedDict): + type: ReadOnly[Literal["base64"]] + media_type: ReadOnly[str] + data: ReadOnly[str] + + class VectorStoreResultContent(TypedDict, total=False): """Content of a vector store result""" text: str | None type: str | None + source: ReadOnly[VectorStoreResultImageSource] class VectorStoreSearchResult(TypedDict, total=False): @@ -117,6 +137,7 @@ class VectorStoreSearchOptionalRequestParams(TypedDict, total=False): max_num_results: int | None ranking_options: dict | None rewrite_query: bool | None + query_image: ReadOnly[VectorStoreSearchQueryImage | None] class VectorStoreSearchRequest(VectorStoreSearchOptionalRequestParams, total=False): @@ -320,6 +341,7 @@ VECTOR_STORE_OPENAI_PARAMS = Literal[ "max_num_results", "ranking_options", "rewrite_query", + "query_image", ] @@ -330,6 +352,7 @@ class VectorStoreToolParams: filters: dict | None = None max_num_results: int | None = None ranking_options: dict | None = None + rewrite_query: bool | None = None def to_dict(self) -> dict: """Convert to dict, excluding None values""" @@ -339,6 +362,7 @@ class VectorStoreToolParams: "filters": self.filters, "max_num_results": self.max_num_results, "ranking_options": self.ranking_options, + "rewrite_query": self.rewrite_query or None, }.items() if v is not None } diff --git a/litellm/utils.py b/litellm/utils.py index 2820638cd28..1d035215ca5 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2087,6 +2087,39 @@ def _is_litellm_router_call(kwargs: Mapping[str, object]) -> bool: return any(isinstance(bucket, Mapping) and "model_group" in bucket for bucket in metadata_buckets) +def clamp_max_tokens( + model: object, + args: tuple[object, ...], + kwargs: dict[str, object], # mutable-ok: the @client wrapper rewrites the call's own kwargs + call_type: str, +) -> None: + if ( + kwargs.get("max_tokens", None) is not None + and model is not None + and litellm.modify_params is True + and call_type in (CallTypes.acompletion.value, CallTypes.completion.value, CallTypes.anthropic_messages.value) + ): + try: + base_model = model + if kwargs.get("hf_model_name", None) is not None: + base_model = f"huggingface/{kwargs.get('hf_model_name')}" + messages = None + if len(args) > 1: + messages = args[1] + elif kwargs.get("messages", None): + messages = kwargs["messages"] + kwargs["max_tokens"] = _get_modified_max_tokens()( + model=model, + base_model=base_model, + messages=messages, + user_max_tokens=kwargs.get("max_tokens"), + buffer_num=None, + buffer_perc=None, + ) + except Exception as e: + print_verbose(f"Error while checking max token limit: {e}") + + def client(original_function): from litellm.litellm_core_utils.core_helpers import max_retries_per_request_hit @@ -2203,38 +2236,7 @@ def client(original_function): verbose_logger.debug("Cache hit!") return caching_handler_response.cached_result - # CHECK MAX TOKENS - if ( - kwargs.get("max_tokens", None) is not None - and model is not None - and litellm.modify_params is True # user is okay with params being modified - and ( - call_type == CallTypes.acompletion.value - or call_type == CallTypes.completion.value - or call_type == CallTypes.anthropic_messages.value - ) - ): - try: - base_model = model - if kwargs.get("hf_model_name", None) is not None: - base_model = f"huggingface/{kwargs.get('hf_model_name')}" - messages = None - if len(args) > 1: - messages = args[1] - elif kwargs.get("messages", None): - messages = kwargs["messages"] - user_max_tokens: Final = kwargs.get("max_tokens") - modified_max_tokens: Final = _get_modified_max_tokens()( - model=model, - base_model=base_model, - messages=messages, - user_max_tokens=user_max_tokens, - buffer_num=None, - buffer_perc=None, - ) - kwargs["max_tokens"] = modified_max_tokens - except Exception as e: - print_verbose(f"Error while checking max token limit: {e}") + clamp_max_tokens(model, args, kwargs, call_type) # MODEL CALL result = original_function(*args, **kwargs) end_time = datetime.datetime.now() @@ -2499,38 +2501,7 @@ def client(original_function): if _llm_caching_handler.preset_cache_key is not None: logging_obj.litellm_params["preset_cache_key"] = _llm_caching_handler.preset_cache_key - # CHECK MAX TOKENS - if ( - kwargs.get("max_tokens", None) is not None - and model is not None - and litellm.modify_params is True # user is okay with params being modified - and ( - call_type == CallTypes.acompletion.value - or call_type == CallTypes.completion.value - or call_type == CallTypes.anthropic_messages.value - ) - ): - try: - base_model = model - if kwargs.get("hf_model_name", None) is not None: - base_model = f"huggingface/{kwargs.get('hf_model_name')}" - messages = None - if len(args) > 1: - messages = args[1] - elif kwargs.get("messages", None): - messages = kwargs["messages"] - user_max_tokens: Final = kwargs.get("max_tokens") - modified_max_tokens: Final = _get_modified_max_tokens()( - model=model, - base_model=base_model, - messages=messages, - user_max_tokens=user_max_tokens, - buffer_num=None, - buffer_perc=None, - ) - kwargs["max_tokens"] = modified_max_tokens - except Exception as e: - print_verbose(f"Error while checking max token limit: {e}") + clamp_max_tokens(model, args, kwargs, call_type) # MODEL CALL call_kwargs: Final = ( diff --git a/litellm/vector_stores/main.py b/litellm/vector_stores/main.py index 9f53accfa0b..88bc477249b 100644 --- a/litellm/vector_stores/main.py +++ b/litellm/vector_stores/main.py @@ -13,6 +13,7 @@ import httpx import litellm from litellm.constants import request_timeout +from litellm.litellm_core_utils.core_helpers import as_str_mapping, drops_unsupported_params from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.llms.base_llm.vector_store.transformation import ( @@ -28,10 +29,12 @@ from litellm.types.vector_stores import ( VectorStoreFileCounts, VectorStoreResultContent, VectorStoreSearchOptionalRequestParams, + VectorStoreSearchQueryImage, VectorStoreSearchResponse, VectorStoreSearchResult, ) from litellm.utils import ProviderConfigManager, client, load_credentials_from_list +from litellm.vector_stores.search_query import searched_query, sent_query_image from litellm.vector_stores.utils import VectorStoreRequestUtils if TYPE_CHECKING: @@ -289,7 +292,7 @@ def create( @client async def asearch( vector_store_id: str, - query: str | builtins.list[str], + query: str | builtins.list[str] | None = None, filters: dict | None = None, max_num_results: int | None = None, ranking_options: dict | None = None, @@ -303,6 +306,8 @@ async def asearch( # LiteLLM specific params, custom_llm_provider: str | None = None, router: "Router | None" = None, + *, + query_image: VectorStoreSearchQueryImage | None = None, **kwargs, ) -> VectorStoreSearchResponse: """ @@ -329,6 +334,7 @@ async def asearch( max_num_results=max_num_results, ranking_options=ranking_options, rewrite_query=rewrite_query, + query_image=query_image, extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, @@ -362,7 +368,7 @@ async def asearch( @client def search( vector_store_id: str, - query: str | builtins.list[str], + query: str | builtins.list[str] | None = None, filters: dict | None = None, max_num_results: int | None = None, ranking_options: dict | None = None, @@ -376,6 +382,8 @@ def search( # LiteLLM specific params, custom_llm_provider: str | None = None, router: "Router | None" = None, + *, + query_image: VectorStoreSearchQueryImage | None = None, **kwargs, ) -> VectorStoreSearchResponse | Coroutine[object, object, VectorStoreSearchResponse]: """ @@ -383,11 +391,12 @@ def search( Args: vector_store_id: The ID of the vector store to search. - query: A query string or array for the search. + query: A query string or array for the search. Optional when query_image is sent. filters: Optional filter to apply based on file attributes. max_num_results: Maximum number of results to return (1-50, default 10). ranking_options: Optional ranking options for search. rewrite_query: Whether to rewrite the natural language query for vector search. + query_image: A base64 image to search with in place of query, on providers that support it. Returns: VectorStoreSearchResponse containing the search results. @@ -444,21 +453,31 @@ def search( local_vars.update(kwargs) + search_query: Final = searched_query( + query=query, + query_image=sent_query_image(query_image, extra_body), + custom_llm_provider=custom_llm_provider, + supports_query_image="query_image" in vector_store_provider_config.get_supported_openai_params(model=""), + drop_params=drops_unsupported_params(local_vars.get("drop_params")), + ) + # Get VectorStoreSearchOptionalRequestParams with only valid parameters vector_store_search_optional_params: Final[VectorStoreSearchOptionalRequestParams] = ( VectorStoreRequestUtils.get_requested_vector_store_search_optional_param( - local_vars, + {**local_vars, "query_image": search_query.image}, vector_store_provider_config=vector_store_provider_config, ) ) + sent_extra_body: Final = as_str_mapping(extra_body) + # Pre Call logging litellm_logging_obj.update_from_kwargs( kwargs=kwargs, model=api_type, optional_params={ "vector_store_id": vector_store_id, - "query": query, + "query": search_query.query, **vector_store_search_optional_params, }, litellm_params={ @@ -471,7 +490,7 @@ def search( response: Final = base_llm_http_handler.vector_store_search_handler( vector_store_id=vector_store_id, - query=query, + query=search_query.query, vector_store_search_optional_params=vector_store_search_optional_params, vector_store_provider_config=vector_store_provider_config, custom_llm_provider=custom_llm_provider, @@ -479,7 +498,9 @@ def search( logging_obj=litellm_logging_obj, embedding_executor=embedding_executor, extra_headers=extra_headers, - extra_body=extra_body, + extra_body=extra_body + if sent_extra_body is None + else dict(_items_without_key(sent_extra_body, "query_image")), timeout=timeout or request_timeout, _is_async=_is_async, client=kwargs.get("client"), diff --git a/litellm/vector_stores/search_query.py b/litellm/vector_stores/search_query.py new file mode 100644 index 00000000000..b4ec0b6707b --- /dev/null +++ b/litellm/vector_stores/search_query.py @@ -0,0 +1,205 @@ +import base64 +from collections.abc import Mapping, Sequence +from dataclasses import dataclass +from types import MappingProxyType +from typing import Final, Generic, Literal, TypeAlias, TypeVar + +from pydantic import TypeAdapter, ValidationError +from pydantic_core import ErrorDetails +from typing_extensions import assert_never + +import litellm +from litellm.litellm_core_utils.core_helpers import as_object_list, as_str_mapping +from litellm.types.vector_stores import RETRIEVAL_QUERY_PARAMS, VectorStoreSearchQueryImage + +_QUERY_IMAGE: Final = TypeAdapter(VectorStoreSearchQueryImage) +_Query: Final = TypeVar("_Query", bound=str | Sequence[str]) +_CALLER_QUERY_PARAMS: Final = ("query_image", *RETRIEVAL_QUERY_PARAMS) +_BASE64_LINE_BREAKS: Final = str.maketrans("", "", "\r\n") + + +@dataclass(frozen=True, slots=True) +class TextSearchQuery(Generic[_Query]): + query: _Query + image: None = None + + +@dataclass(frozen=True, slots=True) +class ImageSearchQuery: + image: VectorStoreSearchQueryImage + query: Literal[""] = "" + + +@dataclass(frozen=True, slots=True) +class QueryAndImageBothSent: + pass + + +@dataclass(frozen=True, slots=True) +class NoQuerySent: + pass + + +@dataclass(frozen=True, slots=True) +class InvalidQueryImage: + problems: tuple[str, ...] + + +@dataclass(frozen=True, slots=True) +class QueryImageUnsupported: + custom_llm_provider: str + + +@dataclass(frozen=True, slots=True) +class QueryImageDroppedWithoutQuery: + custom_llm_provider: str + + +SearchQuery: TypeAlias = TextSearchQuery[_Query] | ImageSearchQuery +SearchQueryError: TypeAlias = ( + QueryAndImageBothSent | NoQuerySent | InvalidQueryImage | QueryImageUnsupported | QueryImageDroppedWithoutQuery +) + + +def _has_text(query: object) -> bool: + if isinstance(query, str): + return bool(query.strip()) + items: Final = as_object_list(query) + if items is None: + return True + return any(not isinstance(item, str) or item.strip() for item in items) + + +def _problem(detail: ErrorDetails) -> str: + location: Final = ".".join(("query_image", *(str(part) for part in detail["loc"]))) + return f"{location}: {detail['msg']}" + + +def _is_base64(data: str) -> bool: + try: + base64.b64decode(data.translate(_BASE64_LINE_BREAKS), validate=True) + except ValueError: + return False + return True + + +def _validated_query_image(query_image: object) -> ImageSearchQuery | InvalidQueryImage: + try: + image: Final = _QUERY_IMAGE.validate_python(query_image) + except ValidationError as error: + return InvalidQueryImage( + problems=tuple(_problem(detail) for detail in error.errors(include_url=False, include_input=False)) + ) + if not _is_base64(image["data"]): + return InvalidQueryImage(problems=("query_image.data: not valid base64",)) + return ImageSearchQuery(image=image) + + +def sent_query_image(query_image: object, extra_body: object) -> object: + if query_image is not None: + return query_image + body: Final = as_str_mapping(extra_body) + return None if body is None else body.get("query_image") + + +def _without_retrieval_query(params: Mapping[str, object]) -> Mapping[str, object]: + return {key: value for key, value in params.items() if key not in RETRIEVAL_QUERY_PARAMS} + + +def store_search_params(litellm_params: Mapping[str, object]) -> Mapping[str, object]: + extra_body: Final = as_str_mapping(litellm_params.get("extra_body")) + return MappingProxyType( + { + **_without_retrieval_query(litellm_params), + **({} if extra_body is None else {"extra_body": _without_retrieval_query(extra_body)}), + } + ) + + +def with_caller_query_params(request: Mapping[str, object], caller_extra_body: object) -> Mapping[str, object]: + caller: Final = as_str_mapping(caller_extra_body) + store: Final = as_str_mapping(request.get("extra_body")) + if caller is None or store is None: + return request + query_params: Final = {key: caller[key] for key in _CALLER_QUERY_PARAMS if key in caller} + return {**request, "extra_body": {**store, **query_params}} + + +def resolve_search_query( + query: _Query | None, + query_image: object, + custom_llm_provider: str, + supports_query_image: bool, + drop_params: bool, +) -> SearchQuery[_Query] | SearchQueryError: + if query_image is None: + return NoQuerySent() if query is None else TextSearchQuery(query=query) + text_query: Final = query if query is not None and _has_text(query) else None + if not supports_query_image and not drop_params: + return QueryImageUnsupported(custom_llm_provider=custom_llm_provider) + if not supports_query_image: + return ( + QueryImageDroppedWithoutQuery(custom_llm_provider=custom_llm_provider) + if text_query is None + else TextSearchQuery(query=text_query) + ) + if text_query is not None: + return QueryAndImageBothSent() + return _validated_query_image(query_image) + + +def _error_message(error: SearchQueryError) -> str: + match error: + case QueryAndImageBothSent(): + return "Send either query or query_image, not both. Leave query empty when you send query_image." + case NoQuerySent(): + return "query or query_image is required." + case InvalidQueryImage(problems=problems): + return ( + f"Invalid query_image: {'; '.join(problems)}. Expected " + '{"type": "base64", "media_type": "image/jpeg" | "image/png" | "image/gif" | "image/webp", ' + '"data": ""}.' + ) + case QueryImageUnsupported(custom_llm_provider=provider): + return ( + f"{provider} vector stores do not support query_image. To drop it, set `litellm.drop_params=True` " + "or for proxy:\n\n`litellm_settings:\n drop_params: true`\n" + ) + case QueryImageDroppedWithoutQuery(custom_llm_provider=provider): + return ( + f"{provider} vector stores do not support query_image and drop_params dropped it, " + "which leaves no query to search with. Send query." + ) + case _: + assert_never(error) + + +def searched_query( + query: _Query | None, + query_image: object, + custom_llm_provider: str, + supports_query_image: bool, + drop_params: bool, +) -> SearchQuery[_Query]: + resolved: Final = resolve_search_query( + query=query, + query_image=query_image, + custom_llm_provider=custom_llm_provider, + supports_query_image=supports_query_image, + drop_params=drop_params, + ) + match resolved: + case TextSearchQuery() | ImageSearchQuery(): + return resolved + case ( + QueryAndImageBothSent() + | NoQuerySent() + | InvalidQueryImage() + | QueryImageUnsupported() + | QueryImageDroppedWithoutQuery() + ): + raise litellm.BadRequestError( + message=_error_message(resolved), model=None, llm_provider=custom_llm_provider + ) + case _: + assert_never(resolved) diff --git a/litellm/vector_stores/vector_store_registry.py b/litellm/vector_stores/vector_store_registry.py index 2adaf17ac44..31fc111edab 100644 --- a/litellm/vector_stores/vector_store_registry.py +++ b/litellm/vector_stores/vector_store_registry.py @@ -1,6 +1,7 @@ # litellm/proxy/vector_stores/vector_store_registry.py import json from collections.abc import Iterable, Mapping, Sequence +from dataclasses import fields, replace from datetime import datetime, timezone from itertools import chain from typing import ( @@ -8,20 +9,18 @@ from typing import ( Any, # noqa: TID251 # untyped non_default_params dict is the only source of the unknown key type Final, cast, # noqa: TID251 # untyped non_default_params dict is the only source of the unknown key type - get_args, ) from pydantic import ConfigDict, TypeAdapter, ValidationError from typing_extensions import TypedDict from litellm._logging import verbose_logger -from litellm.litellm_core_utils.core_helpers import remove_items_at_indices +from litellm.litellm_core_utils.core_helpers import decoded_json_object, remove_items_at_indices from litellm.repositories.table_repositories import ( ManagedVectorStoreIndexRepository, ManagedVectorStoresRepository, ) from litellm.types.vector_stores import ( - VECTOR_STORE_OPENAI_PARAMS, LiteLLM_ManagedVectorStore, LiteLLM_ManagedVectorStoreIndex, LiteLLM_ManagedVectorStoreListResponse, @@ -150,19 +149,15 @@ class VectorStoreRegistry: self.vector_store_ids_to_vector_store_map: dict[str, LiteLLM_ManagedVectorStore] = {} def _extract_tool_params(self, tool: dict) -> VectorStoreToolParams: - """ - Extract supported parameters from a tool definition. - - Dynamically extracts all parameters defined in VECTOR_STORE_OPENAI_PARAMS. - """ - # Get the list of supported param names from the Literal type - declared_params: Final[tuple[object, ...]] = get_args(VECTOR_STORE_OPENAI_PARAMS) - supported_params: Final = tuple(param for param in declared_params if isinstance(param, str)) - - # Extract only the params that exist in the tool - kwargs: Final = {param: tool.get(param) for param in supported_params if param in tool} - - return VectorStoreToolParams(**kwargs) + tool_fields: Final = decoded_json_object(tool) + return replace( + VectorStoreToolParams(), + **{ + field.name: tool_fields[field.name] + for field in fields(VectorStoreToolParams) + if field.name in tool_fields + }, + ) def get_vector_store_ids_to_run(self, non_default_params: dict, tools: object = None) -> list[str]: """ diff --git a/mcp_servers.json b/mcp_servers.json deleted file mode 100644 index 3dd21c0d65f..00000000000 --- a/mcp_servers.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "zapier": { - "sse_url": "https://mcp.zapier.com/api/mcp" - }, - "deepwiki": { - "http_url": "https://mcp.deepwiki.com/mcp", - "sse_url": "https://mcp.deepwiki.com/sse", - "description": "The DeepWiki MCP server provides programmatic access to DeepWiki's repository documentation (Devin Wiki) and search capabilities (Devin Search)." - }, - "jira": { - "sse_url": "https://mcp.atlassian.com/v1/sse", - "description": "The Jira MCP server provides programmatic access to Jira's issue tracking capabilities." - }, - "linear": { - "sse_url": "https://mcp.linear.app/sse", - "description": "The Linear MCP server provides programmatic access to Linear's issue tracking capabilities." - }, - "scrapegraph": { - "http_url": "https://smithery.ai/api/mcp/scrapegraph-mcp", - "sse_url": "https://smithery.ai/api/mcp/scrapegraph-mcp/sse", - "description": "The ScrapeGraph MCP server provides programmatic access to ScrapeGraph AI's web scraping capabilities, including smart scraping, web crawling, search scraping, and agentic scraping workflows." - } -} diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index b6eec1c9574..1472d10c12e 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -28593,6 +28593,7 @@ "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash": { "cache_read_input_token_cost": 2.8e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.4e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -28600,6 +28601,7 @@ "mode": "chat", "output_cost_per_token": 2.8e-07, "source": "https://docs.fireworks.ai/serverless/pricing", + "successor_model": "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_reasoning": true, "supports_response_schema": true, @@ -29065,6 +29067,7 @@ "fireworks_ai/deepseek-v4-flash": { "cache_read_input_token_cost": 2.8e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.4e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -29072,6 +29075,7 @@ "mode": "chat", "output_cost_per_token": 2.8e-07, "source": "https://docs.fireworks.ai/serverless/pricing", + "successor_model": "fireworks_ai/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_reasoning": true, "supports_response_schema": true, @@ -83589,6 +83593,7 @@ "fireworks_ai/accounts/fireworks/routers/spot-deepseek-v4-flash": { "cache_read_input_token_cost": 2.1e-08, "deprecation_date": "2026-08-14", + "deprecation_source": "https://docs.fireworks.ai/api-reference/list-models.md", "input_cost_per_token": 1.05e-07, "litellm_provider": "fireworks_ai", "max_input_tokens": 1048576, @@ -83596,6 +83601,7 @@ "mode": "chat", "output_cost_per_token": 2.1e-07, "source": "https://api.fireworks.ai/v1/serverless/models", + "successor_model": "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-0731", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, @@ -99949,17 +99955,20 @@ ] }, "databricks/databricks-claude-fable-5-2": { - "cache_creation_input_token_cost": 8e-06, - "cache_read_input_token_cost": 8e-06, - "input_cost_per_token": 8e-06, + "cache_creation_input_token_cost": 9.99999e-06, + "cache_creation_input_token_cost_above_1hr": 1.599997e-05, + "cache_read_input_token_cost": 1.9999e-07, + "input_cost_per_token": 8.00002e-06, + "input_dbu_cost_per_token": 0.000114286, "litellm_provider": "databricks", "max_input_tokens": 1000000, "max_output_tokens": 128000, - "metadata": {"notes":"Claude Fable 5.2 on Databricks is available only through Unity Gateway with the model service name system.ai.claude-fable-5-2, and Databricks hosts it through Amazon Bedrock. The Databricks pricing page lists no row for it yet, so input and output are inherited from the catalog Bedrock row anthropic.claude-fable-5-2, no '*_dbu_cost_per_token' fields are published, and cache tokens bill at the input rate until Databricks publishes cache DBU rates."}, + "metadata": {"notes":"Costs per token are the published Global DBU rates times $0.070 per DBU. The '*_dbu_cost_per_token' fields are provided for reference; cost calculation reads the dollar '*_cost_per_token' fields."}, "mode": "chat", - "output_cost_per_token": 4e-05, + "output_cost_per_token": 4.000003e-05, + "output_dbu_cost_per_token": 0.000571429, "prompt_cache_min_tokens": 512.0, - "source": "https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/supported-models", + "source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving", "supports_adaptive_thinking": true, "supports_anthropic_thinking_payload": true, "supports_assistant_prefill": false, @@ -99974,17 +99983,20 @@ "thinking_always_on": true }, "databricks/system.ai.claude-fable-5-2": { - "cache_creation_input_token_cost": 8e-06, - "cache_read_input_token_cost": 8e-06, - "input_cost_per_token": 8e-06, + "cache_creation_input_token_cost": 9.99999e-06, + "cache_creation_input_token_cost_above_1hr": 1.599997e-05, + "cache_read_input_token_cost": 1.9999e-07, + "input_cost_per_token": 8.00002e-06, + "input_dbu_cost_per_token": 0.000114286, "litellm_provider": "databricks", "max_input_tokens": 1000000, "max_output_tokens": 128000, - "metadata": {"notes":"Claude Fable 5.2 on Databricks is available only through Unity Gateway with the model service name system.ai.claude-fable-5-2, and Databricks hosts it through Amazon Bedrock. The Databricks pricing page lists no row for it yet, so input and output are inherited from the catalog Bedrock row anthropic.claude-fable-5-2, no '*_dbu_cost_per_token' fields are published, and cache tokens bill at the input rate until Databricks publishes cache DBU rates."}, + "metadata": {"notes":"Claude Fable 5.2 on Databricks is served through Unity Gateway with the model service name system.ai.claude-fable-5-2, hosted through Amazon Bedrock. Costs per token are the published Global DBU rates times $0.070 per DBU. The '*_dbu_cost_per_token' fields are provided for reference; cost calculation reads the dollar '*_cost_per_token' fields."}, "mode": "chat", - "output_cost_per_token": 4e-05, + "output_cost_per_token": 4.000003e-05, + "output_dbu_cost_per_token": 0.000571429, "prompt_cache_min_tokens": 512.0, - "source": "https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/supported-models", + "source": "https://www.databricks.com/product/pricing/proprietary-foundation-model-serving", "supports_adaptive_thinking": true, "supports_anthropic_thinking_payload": true, "supports_assistant_prefill": false, diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index c1c90370ddf..00000000000 --- a/package-lock.json +++ /dev/null @@ -1,5325 +0,0 @@ -{ - "name": "litellm-dependency-refresh", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "prism-react-renderer": "2.4.1", - "prisma": "5.17.0", - "react-copy-to-clipboard": "5.1.1" - }, - "devDependencies": { - "@testing-library/jest-dom": "6.8.0", - "@testing-library/react": "14.3.1", - "@types/react-copy-to-clipboard": "5.0.7", - "jest": "29.7.0" - } - }, - "node_modules/@adobe/css-tools": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz", - "integrity": "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/code-frame": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", - "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.27.1", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", - "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", - "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.5", - "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.28.3", - "@babel/helpers": "^7.28.4", - "@babel/parser": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/traverse": "^7.28.5", - "@babel/types": "^7.28.5", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", - "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.28.5", - "@babel/types": "^7.28.5", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", - "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.27.2", - "@babel/helper-validator-option": "^7.27.1", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", - "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", - "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.28.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", - "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", - "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.5" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", - "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", - "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", - "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/runtime": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", - "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", - "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", - "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.5", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.5", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", - "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/core/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^6.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@prisma/debug": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.17.0.tgz", - "integrity": "sha512-l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GTxm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg==", - "license": "Apache-2.0" - }, - "node_modules/@prisma/engines": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.17.0.tgz", - "integrity": "sha512-+r+Nf+JP210Jur+/X8SIPLtz+uW9YA4QO5IXA+KcSOBe/shT47bCcRMTYCbOESw3FFYFTwe7vU6KTWHKPiwvtg==", - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.17.0", - "@prisma/engines-version": "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053", - "@prisma/fetch-engine": "5.17.0", - "@prisma/get-platform": "5.17.0" - } - }, - "node_modules/@prisma/engines-version": { - "version": "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053.tgz", - "integrity": "sha512-tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg==", - "license": "Apache-2.0" - }, - "node_modules/@prisma/fetch-engine": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.17.0.tgz", - "integrity": "sha512-ESxiOaHuC488ilLPnrv/tM2KrPhQB5TRris/IeIV4ZvUuKeaicCl4Xj/JCQeG9IlxqOgf1cCg5h5vAzlewN91Q==", - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.17.0", - "@prisma/engines-version": "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053", - "@prisma/get-platform": "5.17.0" - } - }, - "node_modules/@prisma/get-platform": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.17.0.tgz", - "integrity": "sha512-UlDgbRozCP1rfJ5Tlkf3Cnftb6srGrEQ4Nm3og+1Se2gWmCZ0hmPIi+tQikGDUVLlvOWx3Gyi9LzgRP+HTXV9w==", - "license": "Apache-2.0", - "dependencies": { - "@prisma/debug": "5.17.0" - } - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, - "node_modules/@testing-library/dom": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", - "integrity": "sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.1.3", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@testing-library/dom/node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "deep-equal": "^2.0.5" - } - }, - "node_modules/@testing-library/dom/node_modules/dom-accessibility-api": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", - "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@testing-library/jest-dom": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.8.0.tgz", - "integrity": "sha512-WgXcWzVM6idy5JaftTVC8Vs83NKRmGJz4Hqs4oyOuO2J4r/y79vvKZsb+CaGyCSEbUPI6OsewfPd0G1A0/TUZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@adobe/css-tools": "^4.4.0", - "aria-query": "^5.0.0", - "css.escape": "^1.5.1", - "dom-accessibility-api": "^0.6.3", - "picocolors": "^1.1.1", - "redent": "^3.0.0" - }, - "engines": { - "node": ">=14", - "npm": ">=6", - "yarn": ">=1" - } - }, - "node_modules/@testing-library/react": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.3.1.tgz", - "integrity": "sha512-H99XjUhWQw0lTgyMN05W3xQG1Nh4lq574D8keFf1dDoNTJgp66VbJozRaczoF+wsiaPJNt/TcnfpLGufGxSrZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.12.5", - "@testing-library/dom": "^9.0.0", - "@types/react-dom": "^18.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0" - } - }, - "node_modules/@types/aria-query": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", - "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/node": { - "version": "24.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", - "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~7.16.0" - } - }, - "node_modules/@types/prismjs": { - "version": "1.26.5", - "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.5.tgz", - "integrity": "sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==", - "license": "MIT" - }, - "node_modules/@types/prop-types": { - "version": "15.7.15", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", - "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/react": { - "version": "18.3.27", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz", - "integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/prop-types": "*", - "csstype": "^3.2.2" - } - }, - "node_modules/@types/react-copy-to-clipboard": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.7.tgz", - "integrity": "sha512-Gft19D+as4M+9Whq1oglhmK49vqPhcLzk8WfvfLvaYMIPYanyfLy0+CwFucMJfdKoSFyySPmkkWn8/E6voQXjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*" - } - }, - "node_modules/@types/react-dom": { - "version": "18.3.7", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", - "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@types/react": "^18.0.0" - } - }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/yargs": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", - "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/aria-query": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", - "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", - "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-import-attributes": "^7.24.7", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5" - }, - "peerDependencies": { - "@babel/core": "^7.0.0 || ^8.0.0-0" - } - }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.8.30", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.30.tgz", - "integrity": "sha512-aTUKW4ptQhS64+v2d6IkPzymEzzhw+G0bA1g3uBRV3+ntkH+svttKseW5IOR4Ed6NUVKqnY7qT3dKvzQ7io4AA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.js" - } - }, - "node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", - "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "baseline-browser-mapping": "^2.8.25", - "caniuse-lite": "^1.0.30001754", - "electron-to-chromium": "^1.5.249", - "node-releases": "^2.0.27", - "update-browserslist-db": "^1.1.4" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "node-int64": "^0.4.0" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001756", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001756.tgz", - "integrity": "sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cjs-module-lexer": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/collect-v8-coverage": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", - "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", - "dev": true, - "license": "MIT" - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "license": "MIT" - }, - "node_modules/copy-to-clipboard": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", - "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", - "license": "MIT", - "dependencies": { - "toggle-selection": "^1.0.6" - } - }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/css.escape": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", - "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", - "dev": true, - "license": "MIT" - }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/dedent": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", - "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "babel-plugin-macros": "^3.1.0" - }, - "peerDependenciesMeta": { - "babel-plugin-macros": { - "optional": true - } - } - }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/dom-accessibility-api": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", - "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", - "dev": true, - "license": "MIT" - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.259", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.259.tgz", - "integrity": "sha512-I+oLXgpEJzD6Cwuwt1gYjxsDmu/S/Kd41mmLA3O+/uH2pFRO/DvOjUyGozL8j3KeLV6WyZ7ssPwELMsXCcsJAQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/error-ex": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", - "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "bser": "2.1.1" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz", - "integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "minimatch": "^10.1.1", - "minipass": "^7.1.2", - "path-scurry": "^2.0.0" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/import-local": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", - "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-arguments": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", - "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" - }, - "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", - "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.23.9", - "@babel/parser": "^7.23.9", - "@istanbuljs/schema": "^0.1.3", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-reports": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-circus/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } - } - }, - "node_modules/jest-config/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-config/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-diff/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-diff/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-leak-detector/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-leak-detector/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-leak-detector/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } - } - }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-validate/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "license": "MIT" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" - }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/lz-string": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", - "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", - "dev": true, - "license": "MIT", - "bin": { - "lz-string": "bin/bin.js" - } - }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tmpl": "1.0.5" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "license": "MIT" - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-scurry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", - "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", - "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/prism-react-renderer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-2.4.1.tgz", - "integrity": "sha512-ey8Ls/+Di31eqzUxC46h8MksNuGx/n0AAC8uKpwFau4RPDYLuE3EXTp8N8G2vX2N7UC/+IXeNUnlWBGGcAG+Ig==", - "license": "MIT", - "dependencies": { - "@types/prismjs": "^1.26.0", - "clsx": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.0.0" - } - }, - "node_modules/prisma": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.17.0.tgz", - "integrity": "sha512-m4UWkN5lBE6yevqeOxEvmepnL5cNPEjzMw2IqDB59AcEV6w7D8vGljDLd1gPFH+W6gUxw9x7/RmN5dCS/WTPxA==", - "hasInstallScript": true, - "license": "Apache-2.0", - "dependencies": { - "@prisma/engines": "5.17.0" - }, - "bin": { - "prisma": "build/index.js" - }, - "engines": { - "node": ">=16.13" - } - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, - "node_modules/pure-rand": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" - } - ], - "license": "MIT" - }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-copy-to-clipboard": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.1.tgz", - "integrity": "sha512-s+HrzLyJBxrpGTYXF15dTgMjAJpEPZT/Yp6NytAtZMRngejxt6Pt5WrfFxLAcsqUDU6sY1Jz6tyHwIicE1U2Xg==", - "license": "MIT", - "dependencies": { - "copy-to-clipboard": "^3.3.3", - "prop-types": "^15.8.1" - }, - "peerDependencies": { - "react": ">=15.3.0" - } - }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true, - "license": "MIT" - }, - "node_modules/redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true, - "license": "MIT" - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "license": "ISC", - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toggle-selection": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", - "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==", - "license": "MIT" - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "dev": true, - "license": "MIT" - }, - "node_modules/update-browserslist-db": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", - "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/v8-to-istanbul": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", - "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", - "dev": true, - "license": "ISC", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "makeerror": "1.0.12" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", - "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", - "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index be91e4170ab..00000000000 --- a/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "dependencies": { - "prism-react-renderer": "2.4.1", - "prisma": "5.17.0", - "react-copy-to-clipboard": "5.1.1" - }, - "devDependencies": { - "@testing-library/jest-dom": "6.8.0", - "@testing-library/react": "14.3.1", - "@types/react-copy-to-clipboard": "5.0.7", - "jest": "29.7.0" - }, - "overrides": { - "glob": "13.0.0", - "minimatch": "10.2.5", - "picomatch": "2.3.2", - "@isaacs/brace-expansion": "5.0.0", - "@babel/traverse": "7.28.5", - "braces": "3.0.3" - } -} diff --git a/pyproject.toml b/pyproject.toml index 76bb3a54223..bf4e9e52445 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -341,6 +341,7 @@ features = ["extension-module"] profile = "release" editable-profile = "dev" include = [ + "litellm/integrations/prometheus_helpers/grafana_dashboards/**", "litellm/proxy/_experimental/out/**", "litellm/router_strategy/complexity_router/artifacts/*.json", "litellm/router_strategy/complexity_router/fuse_presets.json", @@ -353,6 +354,8 @@ include = [ { path = "model_prices_and_context_window.json", format = "sdist" }, ] exclude = [ + "litellm/proxy/discovery_endpoints/skill_scanner_adapter", + "litellm/proxy/discovery_endpoints/skill_scanner_adapter/**", "litellm/proxy/enterprise", "litellm/proxy/enterprise/**", "litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks", diff --git a/pyrightconfig.json b/pyrightconfig.json index 3a0812413c3..820c4758b46 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -1,7 +1,7 @@ { "include": ["litellm", "litellm_cli"], "ignore": [], - "exclude": ["**/node_modules", "**/__pycache__", "tests/e2e/claude_code", "tests/e2e_harness/claude_code", "tests/e2e/ui", "litellm/types/utils.py", "litellm/proxy/_types.py"], + "exclude": ["**/node_modules", "**/__pycache__", "tests/e2e/claude_code", "tests/e2e_harness/claude_code", "tests/e2e/ui", "litellm/types/utils.py", "litellm/proxy/_types.py", "litellm/proxy/discovery_endpoints/skill_scanner_adapter"], "executionEnvironments": [ { "root": "tests/e2e_harness", diff --git a/qa_sticky_session.sh b/qa_sticky_session.sh deleted file mode 100755 index 2c5a1a66c4c..00000000000 --- a/qa_sticky_session.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# QA: code interpreter sandbox stickiness via metadata.session_id -# bash qa_sticky_session.sh -# LITELLM_BASE_URL=http://localhost:4000 LITELLM_KEY="$LITELLM_MASTER_KEY" bash qa_sticky_session.sh - -set -euo pipefail - -BASE="${LITELLM_BASE_URL:-http://localhost:4000}" -KEY="${LITELLM_KEY:-${LITELLM_MASTER_KEY:?set LITELLM_KEY or LITELLM_MASTER_KEY}}" -MODEL="${LITELLM_MODEL:-gpt-4o-mini}" -# proxy running at http://localhost:4000 -SESSION_A="qa-session-$(date +%s)-A" -SESSION_B="qa-session-$(date +%s)-B" - -content() { - echo "$1" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('choices',[{}])[0].get('message',{}).get('content',''))" -} - -call() { - local session="${1:-}" code="$2" meta="" - [[ -n "$session" ]] && meta=", \"metadata\": {\"session_id\": \"$session\"}" - curl -s -X POST "$BASE/chat/completions" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $KEY" \ - -d "{\"model\":\"$MODEL\"$meta,\"tools\":[{\"type\":\"code_interpreter\"}],\"messages\":[{\"role\":\"user\",\"content\":\"Run this Python code and tell me the result: $code\"}]}" -} - -assert_match() { - local label="$1" body="$2" pattern="$3" - if echo "$body" | grep -qiE "$pattern"; then - echo "PASS $label" - else - echo "FAIL $label (expected /$pattern/)" - echo " $(content "$body")" - exit 1 - fi -} - -echo "=== Sticky Session Sandbox QA ===" -echo "base: $BASE session A: $SESSION_A session B: $SESSION_B" -echo - -R=$(call "$SESSION_A" "x = 42; print(x)") -assert_match "same session_id reuses sandbox (set x=42)" "$R" "42" - -R=$(call "$SESSION_A" "print(x)") -assert_match "same session_id keeps state (x still 42)" "$R" "42" - -R=$(call "$SESSION_B" "print(x)") -assert_match "different session_id is isolated" "$R" "not defined|NameError|undefined|error" - -R=$(call "" "y = 99; print(y)") -assert_match "no session_id runs code" "$R" "99" - -R=$(call "" "print(y)") -assert_match "no session_id gets fresh sandbox each request" "$R" "not defined|NameError|undefined|error" - -echo -echo "All checks passed." diff --git a/router_plugins.json b/router_plugins.json deleted file mode 100644 index ffcddf89fd1..00000000000 --- a/router_plugins.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "name": "TEMPLATE: copy this block for a new plugin, then delete this entry", - "description": "One line on what the plugin does and the routing signal it publishes.", - "author": "Plugin author's name.", - "repo": "https://github.com// (public source repository).", - "commit": "Full 40-char git SHA to pin when the plugin is not yet on PyPI; omit once 'pypi' is set.", - "version": "Plugin release version, e.g. 1.0.0.", - "pypi": "PyPI spec pinned to a version, e.g. my-plugin==1.0.0, or null if unpublished.", - "litellm_version": "Minimum compatible litellm version, e.g. >=1.94.0.", - "entrypoint": "Dotted import path to the plugin instance, e.g. my_plugin.plugin.instance.", - "license": "SPDX license id, e.g. MIT.", - "tags": ["searchable", "keywords"] - }, - { - "name": "language-detector", - "description": "Detects the user's language and publishes a routing signal.", - "author": "Jean Nuñez", - "repo": "https://github.com/jeann2013/language-detector", - "commit": "9e712819269173fc25a16f59ca3e9890f7864ac1", - "version": "1.0.0", - "pypi": null, - "litellm_version": ">=1.94.0", - "entrypoint": "litellm_plugin_language_detector.plugin.language_detector_plugin", - "license": "MIT", - "tags": ["language", "classification", "routing"] - } -] diff --git a/ruff.toml b/ruff.toml index 037b15dbfe9..f7624f07f51 100644 --- a/ruff.toml +++ b/ruff.toml @@ -28,6 +28,8 @@ lint.external = [ ] line-length = 120 +extend-exclude = ["litellm/proxy/discovery_endpoints/skill_scanner_adapter"] + format.exclude = ["**/enterprise/**"] # Was the top-level `exclude`. Scoped to lint so `ruff format` still formats these paths diff --git a/scripts/check_type_discipline.py b/scripts/check_type_discipline.py index cafec8d249b..52992281c99 100644 --- a/scripts/check_type_discipline.py +++ b/scripts/check_type_discipline.py @@ -1158,8 +1158,12 @@ def collect_paths(raw: Iterable[str]) -> Iterator[Path]: for item in raw: p = Path(item) if p.is_dir(): - yield from sorted(p.rglob("*.py")) - elif p.suffix == ".py": + yield from ( + path + for path in sorted(p.rglob("*.py")) + if "litellm/proxy/discovery_endpoints/skill_scanner_adapter/" not in path.as_posix() + ) + elif p.suffix == ".py" and "litellm/proxy/discovery_endpoints/skill_scanner_adapter/" not in p.as_posix(): yield p diff --git a/taplo.toml b/taplo.toml deleted file mode 100644 index e5065a69616..00000000000 --- a/taplo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[formatting] - -# Keep your table/key order as written (project, project.scripts, dependency-groups, tool.uv, ...) -reorder_keys = false - -# Force arrays to stay multiline once expanded -array_auto_expand = true -array_auto_collapse = false - -# Keep nice spacing inside arrays and inline tables -compact_arrays = false -compact_inline_tables = true - -# Don’t align `=` vertically (matches your example) -align_entries = true - -# Reasonable defaults -align_comments = true -trailing_newline = true -reorder_arrays = true -reorder_inline_tables = false -allowed_blank_lines = 2 -crlf = false diff --git a/tests/_vcr_conftest_common.py b/tests/_vcr_conftest_common.py index 1774442cddc..138e203aba9 100644 --- a/tests/_vcr_conftest_common.py +++ b/tests/_vcr_conftest_common.py @@ -102,7 +102,7 @@ def reset_vcr_diag_dir() -> None: pass -# CircleCI truncates a step's retrievable output to the last ~400 KB. The +# CI truncates a step's retrievable output to the last ~400 KB. The # diagnostic log is emitted right *before* the final pytest summary line but # *after* the VCR CLASSIFICATION SUMMARY, so an unbounded dump (the body/key # matchers log one block per *episode comparison*, even on an eventual HIT) diff --git a/tests/code_coverage_tests/router_surface_check.py b/tests/code_coverage_tests/router_surface_check.py index 8eb7651f51c..672fa2dcaa4 100644 --- a/tests/code_coverage_tests/router_surface_check.py +++ b/tests/code_coverage_tests/router_surface_check.py @@ -67,7 +67,6 @@ SKIP_DIRS = { "litellm-rust", "ui", "docs", - "cookbook", "tests", "test", } diff --git a/tests/documentation_tests/test_env_keys.py b/tests/documentation_tests/test_env_keys.py index 2a7da58f39c..72386877704 100644 --- a/tests/documentation_tests/test_env_keys.py +++ b/tests/documentation_tests/test_env_keys.py @@ -38,6 +38,8 @@ EXCLUDED_ROLLOUT_FLAGS = { # These are advanced settings with sensible defaults that most users should not modify EXCLUDED_INTERNAL_TUNING_VARS = { "ANTHROPIC_MESSAGES_MAX_DETACHED_STREAM_DRAINS", + "ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS", + "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", "DEFAULT_S3_MAX_ADAPTIVE_CONCURRENCY", } diff --git a/tests/e2e/AGENTS.md b/tests/e2e/AGENTS.md index 008a8f80cf0..ccdc616c243 100644 --- a/tests/e2e/AGENTS.md +++ b/tests/e2e/AGENTS.md @@ -30,7 +30,7 @@ deferred. It needs credentials Each subdirectory under `tests/e2e/` is one suite, scoped to an endpoint family or behavior area. If you add a new folder, you must add a line here describing what kind of tests belong in it, so the layout stays self-describing. `gateway/` is the exception: it holds proxy configuration only and never tests -- `migrations/` - isolated Docker startup, concurrent migration, crash recovery, and legacy database compatibility. The CircleCI migration workflow enables `LITELLM_MIGRATION_TESTS=1`. These tests own their proxy containers and databases, so they do not use the shared proxy preflight or shared database cleanup +- `migrations/` - isolated Docker startup, concurrent migration, crash recovery, and legacy database compatibility. Set `LITELLM_MIGRATION_TESTS=1` to run this suite manually. No CI workflow invokes it. These tests own their proxy containers and databases, so they do not use the shared proxy preflight or shared database cleanup - `llm_translation/` - Azure realtime translation is explicitly skipped pending investigation of intermittent missing transcripts and remains unqualified. OpenAI translation and other Azure realtime cases remain enabled. LLM endpoint and provider-translation behavior: passthrough, custom pricing, OCR, and the non-chat inference endpoints (`/v1/responses`, `/v1/messages`, `/embeddings`, `/v1/rerank`, `/v1/audio/speech`, `/v1/images/generations`), each against a deployment the test creates via `/model/new` and deletes on teardown - `access_control/` - the gateway's authorization and error-shape contract: per-key model allow-lists, route-group permissions (`allowed_routes`), and unknown-model validation diff --git a/tests/e2e/ui/fixtures/mock_llm_server/server.py b/tests/e2e/ui/fixtures/mock_llm_server/server.py index 1e3dcecaff3..c2390abce34 100644 --- a/tests/e2e/ui/fixtures/mock_llm_server/server.py +++ b/tests/e2e/ui/fixtures/mock_llm_server/server.py @@ -130,8 +130,7 @@ async def systemone(request: Request): if __name__ == "__main__": # The port is overridable so two checkouts can run the harness at the same - # time; the default keeps every existing caller (run_e2e.sh, the CircleCI - # job, the e2e chart's sidecar) working untouched. + # time; the default keeps run_e2e.sh and the e2e chart's sidecar working untouched. # # The HOST is deliberately NOT configurable. Binding loopback is what makes # this reachable at 127.0.0.1:8090 from inside the proxy's own pod, which is diff --git a/tests/e2e/ui/integration.config.ts b/tests/e2e/ui/integration.config.ts index 55ccb860512..f40cd1d3b85 100644 --- a/tests/e2e/ui/integration.config.ts +++ b/tests/e2e/ui/integration.config.ts @@ -2,9 +2,6 @@ import { defineConfig, devices } from "@playwright/test"; import * as path from "path"; import { ARTIFACT_DIR, UI_BASE_URL } from "./constants"; -if (process.env.GITHUB_ACTIONS === "true") - throw new Error("Integration contracts are owned by CircleCI"); - export default defineConfig({ testDir: "./tests/integrationCritical", testMatch: "*.spec.ts", diff --git a/tests/e2e/ui/run_e2e.sh b/tests/e2e/ui/run_e2e.sh index 97cbe5fcf59..183b1e3dbc6 100755 --- a/tests/e2e/ui/run_e2e.sh +++ b/tests/e2e/ui/run_e2e.sh @@ -36,7 +36,7 @@ PROXY_LOG="" # Ports, overridable so two checkouts can run this harness at the same time -- # otherwise a second run aborts on "port 4000 is in use" and the only way out is # to stop someone else's stack. Defaults are the historical values, so an unset -# environment behaves exactly as before (CI, the CircleCI job and the docs all +# environment behaves exactly as before (CI and the docs # assume 4000/5432/8090). PROXY_PORT="${PROXY_PORT:-4000}" POSTGRES_PORT="${POSTGRES_PORT:-5432}" diff --git a/tests/e2e/ui/tests/auth/proxyLogoutUrl.spec.ts b/tests/e2e/ui/tests/auth/proxyLogoutUrl.spec.ts index 3a79ce82717..2fd8972b021 100644 --- a/tests/e2e/ui/tests/auth/proxyLogoutUrl.spec.ts +++ b/tests/e2e/ui/tests/auth/proxyLogoutUrl.spec.ts @@ -3,9 +3,9 @@ import { Role, users } from "../../fixtures/users"; import { logInThroughLoginPage } from "../../helpers/userOnboarding"; /** - * Runs as part of the standard e2e suite: both `run_e2e.sh` and the CircleCI - * `e2e_ui_testing` job boot the proxy with PROXY_LOGOUT_URL=https://www.example.com - * and export the same value to this Playwright process. The spec reads it to + * Runs as part of the standard e2e suite. `run_e2e.sh` boots the proxy with + * PROXY_LOGOUT_URL=https://www.example.com and exports the same value to + * this Playwright process. The spec reads it to * know where the browser is expected to land. * * The skip guard below is a safety net for environments that launch the proxy diff --git a/tests/e2e/ui/tests/proxy-admin/license.spec.ts b/tests/e2e/ui/tests/proxy-admin/license.spec.ts index 37a0e324f27..cfc098b56e4 100644 --- a/tests/e2e/ui/tests/proxy-admin/license.spec.ts +++ b/tests/e2e/ui/tests/proxy-admin/license.spec.ts @@ -4,11 +4,11 @@ import { ADMIN_STORAGE_PATH } from "../../constants"; /** * Sanity check that LITELLM_LICENSE is being forwarded to the proxy when set - * in the environment (e.g. CircleCI's `e2e_ui_testing` job). The login JWT's + * in the environment (e.g. `run_e2e.sh`). The login JWT's * `premium_user` claim is the same value the dashboard reads to enable * premium-gated UI surfaces (Team-BYOK switch, etc.), so asserting it here * catches any future regression where the env var stops being plumbed - * through `run_e2e.sh` / `.circleci/config.yml`. + * through `run_e2e.sh`. * * Skips locally when no license is configured. */ diff --git a/tests/integration/AGENTS.md b/tests/integration/AGENTS.md index e5068d24e88..b430ab553a5 100644 --- a/tests/integration/AGENTS.md +++ b/tests/integration/AGENTS.md @@ -26,20 +26,20 @@ directory that a `GROUPS` entry in `run.py` selects. There is no manifest and no tests. A product bug the test exposes is `pytest.skip("BUG: ")` at the top of the body, not a fix in the test and not a deletion. Needs no network, proxy, DB or Redis: `tests/unit` -CircleCI's integration groups run every file here except the OCI and sandbox tests, which no CI runs, and +GitHub Actions integration groups run every file here except the OCI and sandbox tests, which no CI runs, and the files in `GITHUB_FILES` in `run.py`. `test-integration.yml` runs the same groups through the same `run_integration.sh` on GitHub Actions, on main every three hours from 8am to 8pm Pacific Monday to Saturday, -and on a pull request when someone adds the `run-ci` label. Neither runs every pull request, so a new file here +and on a pull request when someone adds the `run-ci` label. These jobs do not run every pull request, so a new file here first runs on main after its PR merges, or earlier if the PR gets `run-ci`. Wanting a file to run before merge is no reason to change CI, and a new dedicated workflow for it is the same mistake as a shared shard. Write the file, leave `GITHUB_FILES` and every workflow alone, and tell the user it first runs on main. `GITHUB_FILES` is only for a file that -needs what CircleCI's groups cannot give it, like the images `image-scan.yml` builds or the plain pytest -run CircleCI's `roi-database` job gives `test_roi_observed.py`. Add a file there only in that case, +needs what GitHub Actions groups cannot give it, like the images `image-scan.yml` builds. `test_roi_observed.py` previously needed a dedicated plain pytest +job and now has no CI owner. It is listed explicitly in the coverage allowlist. Add a file to `GITHUB_FILES` only when needed, together with its dedicated job, and list a new dedicated GitHub workflow with the directory it owns in `DEDICATED_INTEGRATION_WORKFLOWS` in `.github/scripts/assert_ci_coverage.py`. The `ci-coverage` check -fails a file here that a GitHub workflow runs unless it is in `GITHUB_FILES` and that workflow owns its -directory (#46780) +fails a file here that another workflow selects unless that workflow owns its path in +`DEDICATED_INTEGRATION_WORKFLOWS` (#46780). ## Fixtures that boot a proxy @@ -50,4 +50,4 @@ on one xdist worker, so the proxy they share boots there once and stops when tha file. A test that requests one more of those fixtures than its neighbors gets its own group and can boot the proxy again on another worker, so keep that set the same across the tests that share a proxy. An unpinned session fixture boots a copy on every worker that runs one of its tests and keeps them all until -the node ends, and those copies ran CircleCI integration-extensions nodes out of memory +the node ends, and those copies ran GitHub Actions integration-extensions nodes out of memory diff --git a/tests/integration/README.md b/tests/integration/README.md index a1d224749b3..1f9399c8b22 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -1,24 +1,24 @@ # Integration contracts -These tests exercise a running gateway, PostgreSQL and Redis with an owned local upstream. CircleCI owns this suite, and `.github/workflows/test-integration.yml` runs the same groups through `run_integration.sh` on GitHub Actions for `run-ci` pull requests and scheduled main runs. Tests are grouped by behavior, with no automatic test retries or fallback to paid provider calls +These tests exercise a running gateway, PostgreSQL and Redis with an owned local upstream. `.github/workflows/test-integration.yml` runs the groups through `.github/scripts/ci/run_integration.sh` for `run-ci` pull requests and scheduled main runs. Tests are grouped by behavior, with no automatic test retries or fallback to paid provider calls -The ROI database contracts in `database/test_roi_observed.py` run as plain pytest outside `run_integration.sh` in CircleCI's `roi-database` Postgres job. The job uploads coverage with the `roi-postgres` flag. These contracts own temporary databases and script only the external provider transport +The ROI database contracts in `database/test_roi_observed.py` run as plain pytest outside `run_integration.sh`. They own temporary databases and script only the external provider transport. No remaining CI job invokes them. They are listed explicitly in `.github/ci-coverage-allowlist.yml`. -The Redis cluster IAM contracts in `sdk/test_redis_cluster_iam_auth.py` start their own `redis-server` and mock the cloud credential clients, so CircleCI's `sdk` group installs `redis-server` before it runs them +The Redis cluster IAM contracts in `sdk/test_redis_cluster_iam_auth.py` start their own `redis-server` and mock the cloud credential clients, so the GitHub Actions `sdk` group installs `redis-server` before it runs them The `cost` group is driven by the `CostTrackingTestCase` literals under `cost_calculation/cases/.py` (gathered by `cost_calculation/catalog.py`), with the scripted cost map in `cost_calculation/cost_map.py`. Each case has a name, contract ID, cost-map model, optional deployment overrides, request body, tagged response and exact or recount expectations. Request bodies use `$MODEL` for the registered proxy model, while responses use `$REQUEST_ID` for the per-run scenario ID. To add a case, add a cost-map entry when the model is new, add the request body and exact provider response data, and add hand-computed expected values. The upstream serves each stored response for any path under `/`, while the test-owned cost map is served over loopback through `LITELLM_MODEL_COST_MAP_URL` -Use `tests/integration/run.py management`, `accounting`, `database`, `providers`, `extensions`, `mcp`, `sdk` or `cost` to run a selected group. The group to directory mapping is the `GROUPS` literal at the top of `run.py`; a new directory needs a `GROUPS` entry and an `OWNED_DIRECTORIES` entry in `_support/manifest.py`. Set `INTEGRATION_WORKERS` above 1 to run a group under pytest-xdist. Every group run by more than one worker gives each worker a private database, Redis, scripted upstream process, fake provider and proxy, with a peer and read-only database role where required. There is no opt-in list and no shared proxy, upstream, database or Redis in that mode: `run_integration.sh` does not start them and does not hand their addresses to the run, so a test can only reach its own worker's services. The pytest controller owns these services and closes them after worker failures. Their cases use pytest-xdist load groups inside the files selected by CircleCI timing splits. Module and class fixtures are grouped automatically, so authors do not need scheduling markers. Function fixtures remain independently schedulable. Tests that own an independent mutable sink for every case should use function fixtures, so a shared module fixture does not serialize them or share pending observations. Nested harness probes discard the parent run's shard, worker and result settings, then supply their own selections. MCP keeps its explicit load groups. Automatic group suffixes are removed from JUnit and execution records to preserve case identities. Owned proxy helpers wait for a healthy response from every configured, live worker before yielding. Serial runs keep the supplied deployment, including routing parity runs. Set `INTEGRATION_PROXY_URL`, `INTEGRATION_UPSTREAM_URL`, `INTEGRATION_MASTER_KEY` and `DATABASE_URL` to an isolated test deployment. When that deployment runs more than one proxy worker, set `INTEGRATION_PROXY_WORKERS` to the count so a test that writes a model and then calls it waits out the config reload interval, the only cross-worker convergence bound the wire exposes. The runner selects the new domain directories explicitly; the legacy OCI and sandbox selections remain separate +Use `tests/integration/run.py management`, `accounting`, `database`, `providers`, `extensions`, `mcp`, `sdk` or `cost` to run a selected group. The group to directory mapping is the `GROUPS` literal at the top of `run.py`; a new directory needs a `GROUPS` entry and an `OWNED_DIRECTORIES` entry in `_support/manifest.py`. Set `INTEGRATION_WORKERS` above 1 to run a group under pytest-xdist. Every group run by more than one worker gives each worker a private database, Redis, scripted upstream process, fake provider and proxy, with a peer and read-only database role where required. There is no opt-in list and no shared proxy, upstream, database or Redis in that mode: `run_integration.sh` does not start them and does not hand their addresses to the run, so a test can only reach its own worker's services. The pytest controller owns these services and closes them after worker failures. Their cases use pytest-xdist load groups within each group's selected files. Module and class fixtures are grouped automatically, so authors do not need scheduling markers. Function fixtures remain independently schedulable. Tests that own an independent mutable sink for every case should use function fixtures, so a shared module fixture does not serialize them or share pending observations. Nested harness probes discard the parent run's shard, worker and result settings, then supply their own selections. MCP keeps its explicit load groups. Automatic group suffixes are removed from JUnit and execution records to preserve case identities. Owned proxy helpers wait for a healthy response from every configured, live worker before yielding. Serial runs keep the supplied deployment, including routing parity runs. Set `INTEGRATION_PROXY_URL`, `INTEGRATION_UPSTREAM_URL`, `INTEGRATION_MASTER_KEY` and `DATABASE_URL` to an isolated test deployment. When that deployment runs more than one proxy worker, set `INTEGRATION_PROXY_WORKERS` to the count so a test that writes a model and then calls it waits out the config reload interval, the only cross-worker convergence bound the wire exposes. The runner selects the new domain directories explicitly; the legacy OCI and sandbox selections remain separate Management, MCP and accounting also require `INTEGRATION_PEER_URL`, `REDIS_HOST` and `REDIS_PORT`. Under several workers each worker gets a second directly addressed proxy sharing only that worker's stores, and a single-worker run uses the two proxies `run_integration.sh` starts. The test-only CLI wrapper supplies enterprise route entitlement, following the existing behavior suite's convention. It does not qualify license validation; run it with one worker and no reload -The generated lifecycle models use 20 examples, eight steps, generation and shrinking, with isolated resources per example. HTTP operation caps include generation and shrinking and exempt cleanup. Local qualification defaults to seed 4106601 and canonical order; CircleCI derives exploration and ordering seeds from the checked-out revision and workflow ID. The ordering seed shuffles files, scoped fixture configurations and cases within each configuration. Ordering keeps shared module and class configurations together where their dependencies permit it. Dependent fixtures with their own module parameters can still rebuild an outer configuration, with every case retained +The generated lifecycle models use 20 examples, eight steps, generation and shrinking, with isolated resources per example. HTTP operation caps include generation and shrinking and exempt cleanup. Local qualification defaults to seed 4106601 and canonical order; GitHub Actions derives exploration and ordering seeds from the checked-out revision and workflow ID. The ordering seed shuffles files, scoped fixture configurations and cases within each configuration. Ordering keeps shared module and class configurations together where their dependencies permit it. Dependent fixtures with their own module parameters can still rebuild an outer configuration, with every case retained -CircleCI uses its built-in `circleci tests split --split-by=timings --timings-type=filename` to assign test files using the uploaded JUnit timings. Each file stays on one node, preserving its module and parametrized fixtures. Jobs default to one node. Parallelism should use the smallest node count that keeps the complete job, including setup and cleanup, within twenty minutes. A group that already finishes within that target on one node stays on one node. Management, accounting, providers and management replica currently use four nodes. Extensions uses eight nodes; database and MCP use two, and fast suites use one. No job is configured above eight nodes. A single slow file can still determine a suite's runtime; split such a file along independent fixture boundaries rather than adding more nodes +GitHub Actions runs one job per suite and uses pytest-xdist workers inside that job. `INTEGRATION_WORKERS` controls the worker count, with defaults in `test-integration.yml`. Each worker owns its services. A slow file can still determine a suite's runtime, so split it along independent fixture boundaries rather than adding more workers -Every node collects the same candidate files before applying CircleCI's assigned file list. Its execution record retains the candidate inventory and the selected, passed and skipped cases. An empty assigned file list produces an empty shard, not a full-suite fallback. Every parallel group has a dependent census job that rejects an empty candidate inventory, missing shards, omitted cases and duplicate execution. Standard and replica runs keep separate workspace records +Every group records its candidate inventory and the selected, passed and skipped cases. A census step rejects an empty candidate inventory, omitted cases and duplicate execution. Standard and replica runs keep separate records -Future change-based selection belongs before timing splitting. Pass the selected group files or node IDs to `run.py --list` to list their files, then give those filenames to CircleCI. Run the same candidate selection on every node with `--shard-files --shards --shard-index `. The census compares execution with the candidate inventory, while full-suite runs remain the default. CircleCI determines scheduling from timing history; timing data never selects or omits candidates. Use `--seed` and `--order-seed` to reproduce test generation and order. The installed Hypothesis version, settings, seeds and collected order are recorded beside the execution manifest +Future change-based selection belongs before worker scheduling. Pass the selected group files or node IDs to `run.py --list` to list their files. An external shard assignment can use `INTEGRATION_SHARD_FILES` with `INTEGRATION_CASE_SHARDS` and `INTEGRATION_CASE_SHARD_INDEX`. An empty assigned file list produces an empty shard, not a full-suite fallback. The current GitHub Actions jobs use one shard with index zero and use pytest-xdist within it. Use `--seed` and `--order-seed` to reproduce test generation and order. The installed Hypothesis version, settings, seeds and collected order are recorded beside the execution manifest A future selector must explicitly skip a group when no candidates apply; omitting positional candidates means the full group. Keep full runs on the default branch and scheduled workflows, and select the full affected groups when shared fixtures, CI configuration or an unknown dependency changes @@ -30,9 +30,9 @@ Owned proxy workers configure a 32-thread executor before application startup, p Every owned listener's default port comes from `allocate_port()` in `_support/ports.py`. That covers owned proxies, scripted upstreams, fake providers, OTLP sinks, database relays and Redis, including peers such as `wire_server` that bind and keep their own sockets. Keeping those listeners out of the ephemeral range prevents them from taking a port Prisma selected with a bind-and-close probe before its query engine starts. Each pytest process claims a block of 200 ports between 10000 and 32767 by holding an exclusive lock file per block in the system temp directory, so two runs on one machine, such as parallel worktrees, never share a block, and the OS drops the lock when the process exits. The range sits above the fixed service ports and below the Linux and macOS ephemeral ranges, so a port-0 bind or an outbound connection never lands in a block. Ports inside a block go out in order and are never handed out twice in a run, a port that something outside the harness already holds is skipped, and a process that uses up its block claims the next free one. A test that restarts a server on the same port allocates that port up front instead of reading it back from the first server. TQ012 in `scripts/check_test_quality.py` rejects reading a port back from a port-0 bind anywhere under `tests/integration` -The CircleCI workflow starts its own database and Redis, restricts test-phase egress to its owned services and writes JUnit plus an executed-node manifest. Missing setup, failed cleanup or a selected test with neither a passed call nor a skip fail qualification. Skipped nodes are listed under `skipped` in `execution.json`, so the skip reasons double as the open bug list. `GITHUB_FILES` in `run.py` lists the files excluded from the `run_integration.sh` selection +The GitHub Actions workflow starts its own database and Redis, restricts test-phase egress to its owned services and writes JUnit plus an executed-node manifest. Missing setup, failed cleanup or a selected test with neither a passed call nor a skip fail qualification. Skipped nodes are listed under `skipped` in `execution.json`, so the skip reasons double as the open bug list. `GITHUB_FILES` in `run.py` lists the files excluded from the `run_integration.sh` selection -There is no hand-maintained list of test cases. A positional argument is a file of the group or a pytest node id inside one (`path::test[param]`), so one cell of a parametrized file can run alone. The runner fails only when pytest fails, when collection errors, or when a selected file collects zero tests. Older tests still carry `@pytest.mark.covers(...)` decorators; the marker stays registered so they collect, but the IDs are not checked against anything and new tests should not use it. The GitHub Actions coverage census reads the `GROUPS` literal in `run.py` and treats every `tests/integration//test_*.py` file in a scheduled group as owned by CircleCI +There is no hand-maintained list of test cases. A positional argument is a file of the group or a pytest node id inside one (`path::test[param]`), so one cell of a parametrized file can run alone. The runner fails only when pytest fails, when collection errors, or when a selected file collects zero tests. Older tests still carry `@pytest.mark.covers(...)` decorators; the marker stays registered so they collect, but the IDs are not checked against anything and new tests should not use it. The GitHub Actions coverage census reads the `GROUPS` literal in `run.py` and treats every `tests/integration//test_*.py` file in a scheduled group as owned by GitHub Actions Provider sentinels currently use the controlled server, not live recordings. The provider shard also runs the existing strict replay controls for changed requests, exhausted interactions, leftover interactions and no provider connection. Future recorded scenarios must use that replay-only implementation; missing recordings cannot fall back to a real provider. `GET /__observations` returns every request the upstream recorded since the last `DELETE /__observations`, and reading it never clears it. An autouse fixture resets it before each test, so a test that needs a clean slate between phases sends the DELETE itself. A check that a request never reached the upstream asserts on the same read that shows a request sent after it did reach the upstream, so the absence cannot pass on an empty or reset log @@ -46,20 +46,20 @@ Accounting cases compare persisted input and output cost components against lite Provider contracts exercise actual TCP requests with synthetic credentials and local protocol peers. The S3 verifier uses independently implemented equations, a published known-answer vector, a fixed signing clock and deliberately invalid signed requests. Bedrock cases clear ambient AWS credential sources and check the literal model path, loaded role references, STS requests and bearer-only behavior -CircleCI runs providers on four isolated nodes using its file timing splitter. Each node owns its services. The dependent providers coverage job verifies all four execution records against the candidate case inventory and rejects missing, duplicate, failed or incomplete execution. The node's assigned filenames are saved in `node-files.txt` beside its execution record +GitHub Actions runs the providers group with 32 pytest workers, each with its own services. The census step verifies the execution record against the candidate inventory and rejects missing, duplicate, failed or incomplete execution -Streaming checks send real HTTP transfer chunks, including one-byte partitions, fragmented tools, incomplete transfers and a cancellation barrier. They assert meaningful text, tool arguments, final usage and persisted cost. The Redis recovery case owns a separate database and Redis process, uses the supported one-second circuit-breaker recovery setting, waits for the real subscriber and verifies response data in Redis after restart. CircleCI reuses its existing Redis image for that extra process; it never pulls an image during tests +Streaming checks send real HTTP transfer chunks, including one-byte partitions, fragmented tools, incomplete transfers and a cancellation barrier. They assert meaningful text, tool arguments, final usage and persisted cost. The Redis recovery case owns a separate database and Redis process, uses the supported one-second circuit-breaker recovery setting, waits for the real subscriber and verifies response data in Redis after restart. GitHub Actions reuses its existing Redis image for that extra process; it never pulls an image during tests The `messages_endpoint/` directory holds `/v1/messages` endpoint contracts: native-provider backends under `providers/` (`anthropic`, `bedrock`, `gemini`) and the translation bridges (`responses_bridge`, `chat_bridge`) at the top level. It runs in the providers shard; `run.py` selects test files recursively under each scheduled directory -The sdk shard exercises the SDK's own HTTP clients against local protocol peers with no gateway in the path, so a case here fails only when the client library or its wire behavior changes. The HTTP/2 case runs a hypercorn TLS peer offering h2 and http/1.1 over ALPN, drives the sync and async httpx handlers at it with `LITELLM_HTTP2` off and on, and asserts the version both the client and the peer observed on the wire. Put a test here only when it needs no proxy or database. CircleCI starts a local Redis for this shard like the others, so SDK-side caching cases that need a real Redis server belong here too; a case that reaches the gateway belongs in one of the other shards +The sdk shard exercises the SDK's own HTTP clients against local protocol peers with no gateway in the path, so a case here fails only when the client library or its wire behavior changes. The HTTP/2 case runs a hypercorn TLS peer offering h2 and http/1.1 over ALPN, drives the sync and async httpx handlers at it with `LITELLM_HTTP2` off and on, and asserts the version both the client and the peer observed on the wire. Put a test here only when it needs no proxy or database. GitHub Actions starts a local Redis for this shard like the others, so SDK-side caching cases that need a real Redis server belong here too; a case that reaches the gateway belongs in one of the other shards -The extensions shard uses the built-in generic callback and guardrail transports. It checks callback correlation and credential exclusion, guardrail rewriting and denial, retained OpenAI consumers and A2A wire versions. CircleCI runs it on eight xlarge nodes using its file timing splitter. Each node runs its assigned files with four pytest workers, each owning its database, Redis, upstream and proxy. The dependent coverage job verifies all eight execution records against the candidate case inventory. Tests must not assume a particular set of sibling files +The extensions shard uses the built-in generic callback and guardrail transports. It checks callback correlation and credential exclusion, guardrail rewriting and denial, retained OpenAI consumers and A2A wire versions. GitHub Actions runs it with 48 pytest workers, each owning its database, Redis, upstream and proxy. The census step verifies execution against the candidate inventory. Tests must not assume a particular set of sibling files The security shard uses four pytest workers on an xlarge machine, each with its own isolated services like every other multi-worker group. Route sweeps use a new HTTP client for every call and share only the TLS verification context, so authentication and response cookies cannot cross callers. The canary rig supplies owned OpenAI and Anthropic endpoints and synthetic credentials and rejects attempted external egress The two mcp nodes own separate services and use the same case census as providers and extensions. Their coverage data is combined into one MCP report after both nodes finish. Each node runs the MCP gateway against SDK peers owned by each test (`_support/mcp.py`): streamable HTTP, SSE and stdio peers, an OpenAPI-spec app, and an OAuth 2.1 authorization-server double. Every peer records the requests it receives so a test can assert what reached the peer, not only what the proxy answered. The shard runs with `INTEGRATION_WORKERS` set and with `INTEGRATION_COVERAGE=1`, which starts every worker's proxy and peer under `coverage run --parallel-mode` limited to the MCP modules and stores `coverage.txt` plus an HTML report with the job artifacts. `mcp_coverage.toml` measures lines through `sys.monitoring`, because the CPython 3.12 trace function that branch measurement needs made a covered proxy take about four times as long to become ready. A test that fails because the product is wrong is skipped with `pytest.skip("BUG: ")` so the skip list in `execution.json` is the open MCP bug list -Browser contracts live in `tests/e2e/ui/tests/integrationCritical` and run only through `tests/e2e/ui/integration.config.ts`. The expected browser results are listed in `expected.json` in that directory and checked by `.circleci/scripts/verify_integration_browser.py`. The CircleCI browser shard builds the checked-out dashboard, starts the owned proxy with that build, and verifies one exact browser result without retries or skips. The default Playwright selection excludes this directory. The focused project flow asserts the submitted create and clear values, fresh SQL state and actual blocked/restored serving while preserving model restrictions +Browser contracts live in `tests/e2e/ui/tests/integrationCritical` and run only through `tests/e2e/ui/integration.config.ts`. The expected browser results are listed in `expected.json` in that directory and checked by `.github/scripts/ci/verify_integration_browser.py`. The GitHub Actions browser shard builds the checked-out dashboard, starts the owned proxy with that build, and verifies one exact browser result without retries or skips. The default Playwright selection excludes this directory. The focused project flow asserts the submitted create and clear values, fresh SQL state and actual blocked/restored serving while preserving model restrictions -Two always-on `-replica` CircleCI jobs (management, database) run their groups in replica mode, where every proxy connects through a real `litellm_writer` role and a real read-only `litellm_reader` role against the same PostgreSQL. Nothing is captured there: the job passes when the tests pass, and a write routed to the read-only reader fails the test that issued it. A deeper check runs on demand as the `routing_parity` workflow, triggered through the CircleCI API v2 pipeline endpoint on the PR branch with `{"parameters": {"routing_parity_base": "<40-hex merge-base sha>"}}`. The workflow fans out over the seven groups, and each `routing-parity-` job runs its own group twice against the same test harness, once with `litellm/`, `enterprise/`, and `litellm-proxy-extras/` checked out from the base revision and once from the head, with a pytest plugin snapshotting `pg_stat_statements` into `routing-observed.json` per side. The `check` step then compares the two observations and writes `routing-diff.txt`: a statement seen on both sides fails when its role set changed, globally or for the same test (per-test capture is skipped under xdist), unless it is listed in `tests/integration/routing/either_role.json`, where each entry names the statement and a one-line reason it legitimately runs on whichever role asks for it, printed under `== either role ==`. Queries seen on only one side are listed, never failed, `pg_stat_statements` evictions and a role that never ran a statement are failures +Two `-replica` GitHub Actions suites (management, database) run their groups in replica mode, where every proxy connects through a real `litellm_writer` role and a real read-only `litellm_reader` role against the same PostgreSQL. Nothing is captured there: the job passes when the tests pass, and a write routed to the read-only reader fails the test that issued it. Routing parity support remains in the local harness, but no CI workflow runs it. diff --git a/tests/integration/_support/redis_process.py b/tests/integration/_support/redis_process.py index 1a325d73659..494d13c750e 100644 --- a/tests/integration/_support/redis_process.py +++ b/tests/integration/_support/redis_process.py @@ -152,7 +152,7 @@ def owned_redis( ], text=True, ).strip() - assert host, "CircleCI owned Redis container has no address" + assert host, "CI-owned Redis container has no address" prefix: Final = ("docker", "exec", "redis-cache", "redis-server") output: Final = Path(inherited.get("INTEGRATION_RESULTS_DIR", str(directory))) output.mkdir(parents=True, exist_ok=True) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index d605bd3d7d7..8c0c463c217 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -28,7 +28,6 @@ from tests.integration._support.provider import SharedProvider, shared_provider from tests.integration._support.routing import RoutingPlugin from tests.integration._support.sdk_models import build_sdk_models from tests.integration._support.workers import gateway_profile, start_worker_stacks, worker_stack -from tests.integration.run import GITHUB_FILES if TYPE_CHECKING: from tests.integration._support.actors import ActorSet, GatewayClient, ManagementDatabase, ScratchResources @@ -216,11 +215,6 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item for item in items if item.path.is_relative_to(root) and item.path.relative_to(root).parts[0] in OWNED_DIRECTORIES ) - circleci_only: Final = tuple( - item for item in owned if item.path.relative_to(root.parents[1]).as_posix() not in GITHUB_FILES - ) - if circleci_only and os.environ.get("GITHUB_ACTIONS") == "true": - raise pytest.UsageError("Integration contracts are owned by CircleCI") for item in owned: item.add_marker(pytest.mark.integration) config.stash[INVENTORY] = tuple(_case_identity(item.nodeid) for item in owned) @@ -230,7 +224,7 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item raise pytest.UsageError("Integration shard index must be within the positive shard count") files: Final = config.stash[SHARD_FILES] if count > 1 and files is None: - raise pytest.UsageError("Parallel integration runs require CircleCI's shard file selection") + raise pytest.UsageError("Parallel integration runs require a shard file selection") if files is not None: available: Final = frozenset(item.nodeid.split("::", 1)[0] for item in owned) for file in sorted(files - available - config.stash.get(FAILED_COLLECTIONS, frozenset())): diff --git a/tests/integration/database/test_harness_lifecycle.py b/tests/integration/database/test_harness_lifecycle.py index 4cb01dfeef6..724ba5412d2 100644 --- a/tests/integration/database/test_harness_lifecycle.py +++ b/tests/integration/database/test_harness_lifecycle.py @@ -79,8 +79,7 @@ def _nested_pytest_environment(environment: Mapping[str, str]) -> dict[str, str] "INTEGRATION_COVERAGE_FILE", "INTEGRATION_CASE_SHARDS", "INTEGRATION_CASE_SHARD_INDEX", - "CIRCLE_NODE_TOTAL", - "CIRCLE_NODE_INDEX", + "INTEGRATION_SHARD_FILES", "PYTEST_XDIST_WORKER", "PYTEST_XDIST_WORKER_COUNT", "PYTEST_XDIST_TESTRUNUID", @@ -750,8 +749,6 @@ def test_direct_and_dependent_consumers_reuse_the_same_module_parameter(tmp_path **os.environ, "INTEGRATION_CASE_SHARDS": "2", "INTEGRATION_CASE_SHARD_INDEX": "1", - "CIRCLE_NODE_TOTAL": "2", - "CIRCLE_NODE_INDEX": "1", } ), capture_output=True, diff --git a/tests/integration/management/test_fallback_management_public_names.py b/tests/integration/management/test_fallback_management_public_names.py index 6f97165fb3c..56f8309d6f4 100644 --- a/tests/integration/management/test_fallback_management_public_names.py +++ b/tests/integration/management/test_fallback_management_public_names.py @@ -238,6 +238,70 @@ def test_consecutive_creates_within_the_cache_window_keep_every_rule(gateway: Ga assert frozenset(primaries) <= covered, (primaries, covered) +def _create_over_a_fresh_connection(instance: Gateway, model: str, target: str) -> httpx.Response: + with httpx.Client(base_url=instance.client.base_url, timeout=30, trust_env=False) as client: + return Gateway(client, instance.key, instance.upstream_url).request( + "POST", "/fallback", _fallback_body(model, [target]) + ) + + +def _delete_over_a_fresh_connection(instance: Gateway, model: str) -> httpx.Response: + with httpx.Client(base_url=instance.client.base_url, timeout=30, trust_env=False) as client: + return Gateway(client, instance.key, instance.upstream_url).request( + "DELETE", f"/fallback/{model}", params={"fallback_type": "general"} + ) + + +def test_concurrent_writes_through_both_instances_keep_every_rule(gateway: Gateway, peer: Gateway) -> None: + with gateway.scenario() as scenario: + target: Final = scenario.model(model=f"openai/n7t-{uuid.uuid4().hex}") + primaries: Final = tuple(scenario.model(model=f"openai/n7{tag}-{uuid.uuid4().hex}") for tag in "abcdefgh") + for instance in (gateway, peer): + for model in (target, *primaries): + _wait_until_served(instance, model) + for primary in primaries: + scenario.cleanups.callback(_forget_fallback, gateway, primary, "general") + instances: Final = tuple(gateway if index % 2 == 0 else peer for index in range(len(primaries))) + with ThreadPoolExecutor(max_workers=len(primaries)) as pool: + created: Final = tuple( + pool.map(partial(_create_over_a_fresh_connection, target=target), instances, primaries) + ) + assert all(response.status_code == 200 for response in created), [response.text for response in created] + assert frozenset(primaries) <= _covered_models(_stored_fallbacks()) + + dropped: Final = primaries[::2] + with ThreadPoolExecutor(max_workers=len(dropped)) as pool: + removed: Final = tuple(pool.map(_delete_over_a_fresh_connection, instances[1::2], dropped)) + assert all(response.status_code == 200 for response in removed), [response.text for response in removed] + covered: Final = _covered_models(_stored_fallbacks()) & frozenset(primaries) + assert covered == frozenset(primaries[1::2]), covered + + +def _read_fallback(instance: Gateway, model: str) -> httpx.Response: + return instance.request("GET", f"/fallback/{model}", params={"fallback_type": "general"}) + + +def test_the_other_instance_reads_each_write_immediately(gateway: Gateway, peer: Gateway) -> None: + with gateway.scenario() as scenario: + primary: Final = scenario.model(model=f"openai/n8p-{uuid.uuid4().hex}") + first: Final = scenario.model(model=f"openai/n8a-{uuid.uuid4().hex}") + second: Final = scenario.model(model=f"openai/n8b-{uuid.uuid4().hex}") + for model in (primary, first, second): + _wait_until_served(gateway, model) + scenario.cleanups.callback(_forget_fallback, gateway, primary, "general") + + assert gateway.request("POST", "/fallback", _fallback_body(primary, [first])).status_code == 200 + created: Final = _read_fallback(peer, primary) + assert gateway.request("POST", "/fallback", _fallback_body(primary, [second, first])).status_code == 200 + updated: Final = _read_fallback(peer, primary) + assert gateway.request("DELETE", f"/fallback/{primary}", params={"fallback_type": "general"}).status_code == 200 + deleted: Final = _read_fallback(peer, primary) + + assert created.status_code == 200 and _fallback_models(created) == [first], created.text + assert updated.status_code == 200 and _fallback_models(updated) == [second, first], updated.text + assert deleted.status_code == 404, deleted.text + + def test_unknown_model_404_lists_team_public_and_internal_names(gateway: Gateway) -> None: with gateway.scenario() as scenario: team: Final = scenario.team() diff --git a/tests/integration/observability/test_guardrail_effects.py b/tests/integration/observability/test_guardrail_effects.py index 5d3ab4474ad..4f1ab570d29 100644 --- a/tests/integration/observability/test_guardrail_effects.py +++ b/tests/integration/observability/test_guardrail_effects.py @@ -1637,7 +1637,7 @@ def test_chat_pre_call_denial_streams_content_filter(gateway: Gateway, tmp_path: assert lines[-1] == "data: [DONE]", response.text chunks: Final = tuple(json.loads(line.removeprefix("data: ")) for line in lines[:-1]) assert chunks[0]["choices"][0]["delta"]["content"] == _RESPONSES_DENIAL, chunks - assert chunks[-1]["choices"][0]["finish_reason"] == "stop", chunks + assert chunks[-1]["choices"][0]["finish_reason"] == "content_filter", chunks @pytest.mark.covers("other.observability.guardrails.chat_pre_call_denial_returns_content_filter") diff --git a/tests/integration/providers/test_gemini_passthrough_batch_wire.py b/tests/integration/providers/test_gemini_passthrough_batch_wire.py new file mode 100644 index 00000000000..f3b7344c514 --- /dev/null +++ b/tests/integration/providers/test_gemini_passthrough_batch_wire.py @@ -0,0 +1,124 @@ +"""A file-based batch created through the /gemini pass-through is registered for the calling key, so +CheckBatchCost can price it, and its spend row names the model instead of ``unknown``.""" + +import json +from collections.abc import Iterator +from pathlib import Path +from typing import Final + +import httpx +import pytest +from integration._support.client import Gateway, eventually, gateway_from_environment +from integration._support.process import owned_proxy +from integration._support.wire import Reply, Request, Wire, wire_server +from pydantic import JsonValue, TypeAdapter + +from litellm.proxy.utils import hash_token + +pytestmark = pytest.mark.timeout(240) + +_API_KEY: Final = "scripted-gemini-key" +_MODEL: Final = "gemini-3.8-flash" +_BATCH_ID: Final = "wire7h3x9batch" +_INPUT_FILE: Final = "files/wireinput123" +_JSON_OBJECT: Final = TypeAdapter(dict[str, JsonValue]) +_OPERATION: Final[dict[str, JsonValue]] = { + "name": f"batches/{_BATCH_ID}", + "metadata": { + "@type": "type.googleapis.com/google.ai.generativelanguage.v1main.GenerateContentBatch", + "model": f"models/{_MODEL}", + "displayName": "wire-batch", + "inputConfig": {"fileName": _INPUT_FILE}, + "createTime": "2026-11-11T23:15:29.000000Z", + "updateTime": "2026-11-11T23:15:29.000000Z", + "state": "BATCH_STATE_PENDING", + }, +} + + +def _respond(request: Request) -> Reply: + assert request.target.split("?")[0].endswith(f"/v1beta/models/{_MODEL}:batchGenerateContent"), request.target + return Reply(body=json.dumps(_OPERATION).encode()) + + +@pytest.fixture(scope="module") +def rig() -> Iterator[Gateway]: + with gateway_from_environment() as gateway: + yield gateway + + +@pytest.fixture(scope="module") +def wire() -> Iterator[Wire]: + with wire_server(_respond) as served: + yield served + + +def _config(directory: Path) -> Path: + path: Final = directory / "gemini-passthrough-batch.yaml" + path.write_text( + "model_list:\n" + f" - model_name: {_MODEL}\n" + " litellm_params:\n" + f" model: gemini/{_MODEL}\n" + " api_key: os.environ/GEMINI_API_KEY\n" + "general_settings:\n" + " master_key: os.environ/LITELLM_MASTER_KEY\n" + " database_url: os.environ/DATABASE_URL\n" + "router_settings:\n" + " disable_cooldowns: true\n" + ) + return path + + +@pytest.fixture(scope="module") +def proxy(rig: Gateway, wire: Wire, tmp_path_factory: pytest.TempPathFactory) -> Iterator[Gateway]: + directory: Final = tmp_path_factory.mktemp("gemini-passthrough-batch") + overrides: Final = {"GEMINI_API_BASE": wire.url, "GEMINI_API_KEY": _API_KEY} + with owned_proxy(rig, directory, overrides, config=_config(directory), workers=2) as owned: + yield owned + + +def test_file_batch_created_through_gemini_passthrough_is_registered_for_the_calling_key( + proxy: Gateway, wire: Wire +) -> None: + wire.drain() + with proxy.scenario() as scenario: + key: Final = scenario.key() + body: Final = {"batch": {"displayName": "wire-batch", "inputConfig": {"fileName": _INPUT_FILE}}} + response: Final = httpx.post( + f"{str(proxy.client.base_url).rstrip('/')}/gemini/v1beta/models/{_MODEL}:batchGenerateContent", + headers={"x-goog-api-key": key}, + json=body, + timeout=30, + ) + assert response.status_code == 200, response.text + assert _JSON_OBJECT.validate_json(response.content) == _OPERATION, response.text + upstream: Final = wire.drain() + assert [(request.method, request.target.split("?")[0]) for request in upstream] == [ + ("POST", f"/v1beta/models/{_MODEL}:batchGenerateContent") + ], upstream + assert f"key={_API_KEY}" in upstream[0].target, upstream[0].target + assert key not in upstream[0].target and key.encode() not in upstream[0].body, upstream[0] + assert key not in upstream[0].headers.values(), upstream[0].headers + + registered: Final = eventually( + lambda: proxy.rows( + 'SELECT api_key, file_purpose, status FROM "LiteLLM_ManagedObjectTable" WHERE model_object_id = %s', + (_BATCH_ID,), + ), + lambda rows: len(rows) == 1, + seconds=30, + ) + assert registered[0]["api_key"] == hash_token(key), registered + assert registered[0]["file_purpose"] == "batch", registered + + spend_rows: Final = eventually( + lambda: proxy.rows( + 'SELECT model, spend FROM "LiteLLM_SpendLogs" WHERE api_key = %s AND call_type = %s', + (hash_token(key), "pass_through_endpoint"), + ), + lambda rows: len(rows) == 1, + seconds=70, + ) + assert str(spend_rows[0]["model"]).endswith(_MODEL), spend_rows + assert float(spend_rows[0]["spend"]) == 0.0, spend_rows diff --git a/tests/integration/security/test_skill_scanner.py b/tests/integration/security/test_skill_scanner.py index e18378463ee..d4e4c6763ae 100644 --- a/tests/integration/security/test_skill_scanner.py +++ b/tests/integration/security/test_skill_scanner.py @@ -8,7 +8,7 @@ import psutil import pytest from fastapi import HTTPException -from cookbook.skill_scanner import server +from litellm.proxy.discovery_endpoints.skill_scanner_adapter import server from tests.integration._support.process import _wait_until_gone, group_members, stop_processes diff --git a/tests/rust-python-harness/strategies/e2e_parity/sdk/messages/test_native_parity.py b/tests/rust-python-harness/strategies/e2e_parity/sdk/messages/test_native_parity.py index 41008f0d57f..224af4d5613 100644 --- a/tests/rust-python-harness/strategies/e2e_parity/sdk/messages/test_native_parity.py +++ b/tests/rust-python-harness/strategies/e2e_parity/sdk/messages/test_native_parity.py @@ -20,25 +20,68 @@ R request, S response, C callbacks, F covered by a fallback detector today) """ import asyncio +import contextlib import copy +import datetime +import gzip import json +import logging +import math import os import re -from collections.abc import AsyncIterator, Awaitable, Callable, Generator, Iterable, Iterator, Mapping +import time +import uuid +from collections.abc import ( + AsyncGenerator, + AsyncIterator, + Awaitable, + Callable, + Generator, + Iterable, + Iterator, + Mapping, + Sequence, +) from contextlib import contextmanager from dataclasses import asdict, dataclass, field, replace from types import MappingProxyType -from typing import Final, cast +from typing import ClassVar, Final, cast +import httpx import pytest from pydantic import JsonValue, TypeAdapter import litellm +from litellm._logging import verbose_logger +from litellm.anthropic_interface.exceptions.exception_mapping_utils import AnthropicExceptionMapping +from litellm.caching.caching import Cache, CacheMode +from litellm.caching.caching_handler import ( + _PENDING_CACHE_WRITES, # pyright: ignore[reportPrivateUsage] # a primed entry must land before the measured call reads it +) +from litellm.caching.dual_cache import DualCache +from litellm.caching.in_memory_cache import InMemoryCache +from litellm.caching.llm_caching_handler import LLMClientCache +from litellm.integrations.custom_logger import CustomLogger +from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger +from litellm.litellm_core_utils import logging_utils from litellm.litellm_core_utils.add_retry_fallback_headers import get_hidden_params_dict +from litellm.litellm_core_utils.litellm_logging import Logging +from litellm.llms.anthropic.messages.native import interceptors as messages_interceptors +from litellm.llms.anthropic.messages.native.fake_stream_iterator import FakeAnthropicMessagesStreamIterator +from litellm.llms.anthropic.messages.native.interceptors import MessagesInterceptor +from litellm.llms.base_llm.search.transformation import SearchResponse +from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler from litellm.messages import dispatch +from litellm.proxy import proxy_server +from litellm.proxy._types import UserAPIKeyAuth +from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing +from litellm.proxy.hooks.message_thread_ownership import MessageThreadOwnership +from litellm.proxy.utils import InternalUsageCache +from litellm.router_utils.cooldown_handlers import is_message_thread_not_found from litellm.rust_bridge import catalog -from litellm.rust_bridge.catalog import Route, RouteRule from litellm.rust_bridge.configuration import Rollout +from litellm.types.integrations.custom_logger import AgenticLoopPlan, AgenticLoopRequestPatch +from litellm.types.llms.anthropic_messages.anthropic_response import AnthropicMessagesResponse from tests.test_litellm_rust.support.callback_recorder import RecordingLogger, drain_logging from tests.test_litellm_rust.support.isolation import isolated_callback_registries, rebound from tests.test_litellm_rust.support.recording_server import RecordingServer, ResponseSpec @@ -51,8 +94,8 @@ OPUS_FAST: Final = "anthropic/claude-opus-5-5" API_KEY: Final = "sk-ant-parity-test" USER: Final[Mapping[str, JsonValue]] = MappingProxyType({"role": "user", "content": "What is the capital of France?"}) -_OBJECT: Final = TypeAdapter(dict[str, JsonValue]) _LOGGED: Final = TypeAdapter(dict[str, object]) +_OBJECT: Final = TypeAdapter(dict[str, JsonValue]) _TRANSPORT_HEADERS: Final = frozenset( {"accept", "accept-encoding", "connection", "content-length", "host", "user-agent"} ) @@ -82,6 +125,7 @@ _VOLATILE: Final = ( (re.compile(r"Timeout passed=[0-9.]+"), "Timeout passed="), (re.compile(r"127\.0\.0\.1:[0-9]+"), "127.0.0.1:"), ) +_SERVER_TOOL_ID: Final = re.compile(r"srvtoolu_[0-9a-f]{32}") TEXT_RESPONSE: Final[Mapping[str, JsonValue]] = MappingProxyType( { @@ -161,6 +205,7 @@ THINKING_REPLAY: Final[tuple[JsonValue, ...]] = ( {"role": "user", "content": "And Germany?"}, ) +_MODIFY_PARAMS: Final[Mapping[str, object]] = MappingProxyType({"modify_params": True}) NO_INPUT: Final[Mapping[str, JsonValue]] = MappingProxyType({}) PNG_PIXEL: Final = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==" @@ -283,6 +328,60 @@ SLOW_STREAM: Final = _events( ) +WIDE_NUMBERS_REPLY: Final = ( + b'{"id":"msg_01ParityWide","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929",' + b'"content":[{"type":"tool_use","id":"toolu_01ParityWide","name":"get_ids","input":{"big":18446744073709551616,' + b'"huge":12345678901234567890123,"negative":-12345678901234567890123,"neg_zero":-0.0,"overflow":1e400,' + b'"underflow":-1E+400,"exp":1E2,"tiny":5e-324,"precise":0.30000000000000004,"text":"1e400 18446744073709551616"}}],' + b'"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":12,"output_tokens":9}}' +) +WIDE_INTEGER_REPLY: Final = ( + b'{"id":"msg_01ParityWideCached","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929",' + b'"content":[{"type":"tool_use","id":"toolu_01ParityWideCached","name":"get_ids","input":{"huge":12345678901234567890123}}],' + b'"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":12,"output_tokens":9}}' +) + +MARKED_TEXTS_REPLY: Final = ( + '{"id":"msg_01ParityMarked","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929",' + '"content":[{"type":"text","text":"\\uf8fflitellm-raw-json:42"},{"type":"tool_use","id":"toolu_01ParityMarked",' + '"name":"get_ids","input":{"n":"\uf8fflitellm-raw-json:NaN","s":"\\uF8FFlitellm-raw-json:\\"x\\"",' + '"\\uf8fflitellm-raw-json:1":true,"big":18446744073709551616}}],' + '"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":12,"output_tokens":9}}' +).encode() + + +def _non_string_tool_result_texts( + *texts: object, +) -> list[dict[str, object]]: # mutable-ok: the messages kwarg is a list of dicts + return [ + dict(USER), + {"role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01Texts", "name": "get_ids", "input": {}}]}, + { + "role": "user", + "content": [ + { + "type": "tool_result", + "tool_use_id": "toolu_01Texts", + "content": [{"type": "text", "text": text} for text in texts], + }, + {"type": "text", "text": "go on"}, + ], + }, + ] + + +_BAD_TRAILER_GZIP: Final = gzip.compress(json.dumps(dict(TEXT_RESPONSE)).encode(), mtime=0)[:-8] + bytes(8) +_NOT_GZIP: Final = b"\x1f\x8b\x08\x00not really gzip data at allnot really gzip data at all" + + +def _framed_bytes(events: tuple[tuple[str, object], ...]) -> tuple[bytes, ...]: + return tuple(f"event: {event}\ndata: {json.dumps(data)}\n\n".encode() for event, data in events) + + +def _encoded(body: bytes, encoding: str) -> ResponseSpec: + return ResponseSpec(body=body, headers={"content-encoding": encoding}) + + def _upstream_error(kind: str, message: str) -> Mapping[str, JsonValue]: return MappingProxyType({"type": "error", "error": {"type": kind, "message": message}}) @@ -295,6 +394,45 @@ def _stream(events: tuple[tuple[str, object], ...], chunk_delay: float = 0) -> R return ResponseSpec(body={}, events=events, chunk_delay=chunk_delay) +def _burst(events: tuple[tuple[str, object], ...], chunked: bool = True) -> ResponseSpec: + return ResponseSpec(body={}, events=events, burst=True, chunked=chunked) + + +def _chunked(events: tuple[tuple[str, object], ...], chunk_delay: float) -> ResponseSpec: + return ResponseSpec(body={}, events=events, chunk_delay=chunk_delay, chunked=True) + + +_PING: Final[tuple[str, JsonValue]] = ("ping", {"type": "ping"}) + +PINGED_STREAM: Final = _events( + _message_start("msg_01ParityPinged"), + *((_PING,) * 50), + *_text_block(0, "Pa", "ris"), + *_message_end("end_turn", 4), +) + +HEAVILY_PINGED_STREAM: Final = _events( + _message_start("msg_01ParityHeavilyPinged"), + *((_PING,) * 1000), + *_text_block(0, "Pa", "ris"), + *_message_end("end_turn", 4), +) + +LARGE_STREAM: Final = _events( + _message_start("msg_01ParityLarge"), + *_text_block(0, "a" * 15000, "b" * 15000, "c" * 15000), + *_message_end("end_turn", 4), +) + + +def _raw_stream(*frames: str) -> ResponseSpec: + return ResponseSpec(body="".join(f"{frame}\n\n" for frame in frames).encode()) + + +def _framed(events: tuple[tuple[str, object], ...], event_line: str = "event: ") -> tuple[str, ...]: + return tuple(f"{event_line}{event}\ndata: {json.dumps(data)}" for event, data in events) + + def _failure(status: int, kind: str, message: str, **headers: str) -> ResponseSpec: return ResponseSpec(body=dict(_upstream_error(kind, message)), status=status, headers=dict(headers)) @@ -305,6 +443,10 @@ CALLBACK_ASPECTS: Final = ( "logged_response_headers", "logged_api_key", "logged_call", + "logged_request", + "logged_sent_request", + "logged_model_parameters", + "logged_error", ) ASPECTS: Final = ("dispatch", "request", "outcome", "hidden_params", "logged", *CALLBACK_ASPECTS) @@ -319,12 +461,38 @@ class Case: env: Mapping[str, str] = field(default_factory=lambda: MappingProxyType({})) settings: Mapping[str, object] = field(default_factory=lambda: MappingProxyType({})) private_keys: bool = False + cache: Callable[[], Cache] | None = None + callbacks: tuple[Callable[[], CustomLogger], ...] = () + classifier: str | None = None + interceptor: Callable[[], MessagesInterceptor] | None = None gaps: Mapping[str, str | None] = field(default_factory=lambda: MappingProxyType({})) + loggers: Callable[[], Sequence[CustomLogger]] | None = None + gateway: bool = False + racy: Mapping[str, str] = field(default_factory=lambda: MappingProxyType({})) + partitioned: bool = False + nones: tuple[str, ...] = () + busy_before_reading: float = 0 + warned: bool = False + + def aspects(self) -> tuple[str, ...]: + return ( + *ASPECTS, + *(("cached",) if self.cache is not None else ()), + *(("warnings",) if self.warned else ()), + *(("hook_inputs",) if self.loggers else ()), + *(("classified",) if self.classifier is not None else ()), + *(("tool_runs",) if self.gateway else ()), + ) def params(self) -> Iterator[object]: - for aspect in ASPECTS: + for aspect in self.aspects(): gap = {**KNOWN_GAPS.get(self.name, {}), **self.gaps}.get(aspect) - marks = () if not gap else (pytest.mark.xfail(reason=gap, strict=True),) + race = self.racy.get(aspect) + marks = ( + (pytest.mark.skip(reason=race),) + if race + else (() if not gap else (pytest.mark.xfail(reason=gap, strict=True),)) + ) yield pytest.param(self, aspect, id=f"{self.name}-{aspect}", marks=marks) @@ -336,54 +504,48 @@ def _kw(**kwargs: object) -> Mapping[str, object]: return MappingProxyType(kwargs) +def _tls(**settings: object) -> Mapping[str, object]: + return MappingProxyType({**settings, "in_memory_llm_clients_cache": LLMClientCache()}) + + +E04_HTTPX_CHUNK_READS: Final = "E04: httpx yields each HTTP chunk whole from a 64 KiB socket read; hyper hands a large chunk over in pieces of its smaller read buffer" A10_NO_MAX_TOKENS: Final = "A10: native admission hands a call without an int max_tokens to Python, whose signature raises the TypeError; only dispatch differs" -S6_PRIVATE_KEYS: Final = "S6: native writes _hidden_params into the response dict" -S15_COMPLETE_DEADLINE: Final = ( - "S15: by design, native bounds a complete response by one overall deadline where Python bounds each read, " - "so a body trickling in slower than the timeout succeeds in Python and times out natively" +C_UNSENT_CALL_FLAG: Final = ( + "C: a call that fails natively before its provider request logs no aanthropic_messages flag, " + "which Python's handler sets before it shapes the request" ) -F_MOCK: Final = "F: mock_response is Python-only (detector mock_response)" -F_THINKING_RETRY: Final = ( - "F: retry without thinking after a rejected signature is Python-only (detector thinking_signature_retry)" + +F46_SEE_OTHER_CONTENT_TYPE: Final = ( + "F46: httpx keeps content-type on the GET that follows a 303; reqwest's redirect follower drops it with the body" +) +REDIRECTED_SENT_REQUEST: Final = ( + "a followed provider redirect: Python logs the redirected request (its URL, its body already streamed) on the " + "logged response, the native call logs the request it sent" ) -F_CACHE_INJECTION: Final = "F: prompt cache_control injection is Python-only (detector cache_control_injection)" -F_TOOL_CUSTOM: Final = "F: hoisting a tool's custom field is Python-only (detector tool_custom_field)" -F_STREAM_COST: Final = "F: cost injection into streamed usage is Python-only (detector stream_cost_injection)" KNOWN_GAPS: Final[Mapping[str, Mapping[str, str | None]]] = MappingProxyType( { - "response_private_keys": _gaps(outcome=S6_PRIVATE_KEYS), "missing_max_tokens": _gaps(dispatch=A10_NO_MAX_TOKENS), - "mock_response": _gaps( - logged_response_headers=F_MOCK, - request=F_MOCK, - outcome=F_MOCK, - hidden_params=F_MOCK, - logged=F_MOCK, - logged_metadata=F_MOCK, - logged_api_key=F_MOCK, - logged_call=F_MOCK, - ), - "mock_response_rate_limit": _gaps( - logged_response_headers=F_MOCK, - request=F_MOCK, - outcome=F_MOCK, - logged=F_MOCK, - logged_api_key=F_MOCK, - logged_call=F_MOCK, - ), - "thinking_signature_rejected_then_retried": _gaps( - request=F_THINKING_RETRY, - outcome=F_THINKING_RETRY, - hidden_params=F_THINKING_RETRY, - logged=F_THINKING_RETRY, - logged_metadata=F_THINKING_RETRY, - logged_response_headers=F_THINKING_RETRY, - ), - "cache_control_injection_points": _gaps(request=F_CACHE_INJECTION), - "tool_custom_field": _gaps(request=F_TOOL_CUSTOM), - "stream_cost_injection": _gaps(outcome=F_STREAM_COST), - "enable_prompt_caching": _gaps(request=F_CACHE_INJECTION), + **{ + name: _gaps(logged_call=C_UNSENT_CALL_FLAG) + for name in ( + "speed_on_model_without_speed", + "temperature_on_adaptive_model", + "top_k_on_adaptive_model", + "legacy_thinking_non_numeric_budget_on_adaptive_model", + "legacy_thinking_null_budget_on_adaptive_model", + "missing_api_key", + "tls_security_level_python_cannot_apply", + "max_tokens_none", + "reasoning_effort_unknown", + "output_config_effort_unknown", + "reasoning_effort_unknown_on_adaptive_model", + "reasoning_effort_xhigh_on_model_without_xhigh", + "int_temperature_on_adaptive_model", + "int_top_p_on_adaptive_model", + "int_speed_on_model_without_speed", + ) + }, } ) @@ -440,6 +602,7 @@ REQUEST_CASES: Final = ( "legacy_thinking_non_numeric_budget_dropped", _kw(thinking={"type": "enabled", "budget_tokens": [1]}, max_tokens=8192, drop_params=True), model=OPUS_ADAPTIVE, + warned=True, ), Case( "legacy_thinking_carries_extra_keys", @@ -657,6 +820,192 @@ RESPONSE_CASES: Final = ( ), ), Case("response_private_keys", private_keys=True), + Case( + "response_gzip_under_a_padded_mixed_case_alias", + upstream=(_encoded(gzip.compress(json.dumps(dict(TEXT_RESPONSE)).encode(), mtime=0), " X-Gzip "),), + ), + Case("response_deflate_body_that_is_not_deflate", upstream=(_encoded(b"not deflate at all", "deflate"),)), + Case("response_gzip_body_with_a_bad_trailer", upstream=(_encoded(_BAD_TRAILER_GZIP, "gzip"),)), + Case("response_gzip_body_that_is_not_gzip", upstream=(_encoded(_NOT_GZIP, "gzip"),)), + Case( + "stream_deflate_body_that_is_not_deflate", + _kw(stream=True), + upstream=(_encoded(b"not deflate at all", "deflate"),), + ), + Case( + "stream_gzip_listed_with_an_unknown_coding", + _kw(stream=True), + upstream=(_encoded(gzip.compress(b"".join(_framed_bytes(TEXT_STREAM)), mtime=0), "gzip, br"),), + ), +) + +INPUT_VALUE_CASES: Final = ( + Case("max_tokens_numeric_string", _kw(max_tokens="1024")), + Case("max_tokens_fraction", _kw(max_tokens=1.5)), + Case("max_tokens_whole_float", _kw(max_tokens=1024.0)), + Case("max_tokens_bool", _kw(max_tokens=True)), + Case("max_tokens_beyond_64_bits", _kw(max_tokens=2**64)), + Case("reasoning_effort_with_fractional_max_tokens", _kw(reasoning_effort="high", max_tokens=1500.5)), + Case("temperature_numeric_string", _kw(temperature="0.5")), + Case("temperature_integer_beyond_float_precision", _kw(temperature=2**60 + 1)), + Case("top_p_integer_beyond_float_precision", _kw(top_p=-9223372036854775807)), + Case( + "reasoning_effort_with_numeric_string_max_tokens", + _kw(reasoning_effort="high", max_tokens="8192"), + upstream=(), + ), + Case("top_k_beyond_64_bits", _kw(top_k=2**70)), + Case("messages_mapping", _kw(messages={"role": "user", "content": "hi"})), + Case("messages_string", _kw(messages="hi")), + Case("messages_with_non_object_entries", _kw(messages=[dict(USER), "stray", 7])), + Case("system_lone_surrogate", _kw(system="sys \ud800 lone")), + Case("metadata_user_id_lone_surrogate", _kw(metadata={"user_id": "user-\udc00"})), + Case("message_text_lone_surrogate", _kw(messages=[{"role": "user", "content": "a\ud800b \u00e9"}])), + Case("text_starting_with_the_raw_leaf_mark", _kw(system="\uf8fflitellm-raw-json:1")), + Case("thinking_budget_beyond_64_bits", _kw(thinking={"type": "enabled", "budget_tokens": 2**70}, max_tokens=2048)), + Case( + "tool_schema_integers_beyond_64_bits", + _kw(tools=[{**WEATHER_TOOL, "input_schema": {"type": "integer", "maximum": 2**70, "minimum": -(2**70)}}]), + ), + Case("temperature_nan", _kw(temperature=float("nan"))), + Case( + "tool_schema_infinities", + _kw( + tools=[ + {**WEATHER_TOOL, "input_schema": {"type": "number", "maximum": float("inf"), "minimum": -float("inf")}} + ] + ), + ), +) + +LOOSE_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"name": "lookup", "description": "lookup", "input_schema": {"type": "object", "properties": {}}} +) + + +class _StringStreamHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + kwargs["stream"] = "true" + return kwargs + + +class _IntegerStreamHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + kwargs["stream"] = 1 + return kwargs + + +class _StringParamsHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + kwargs["litellm_params"] = "not-a-mapping" + return kwargs + + +class _IntegerProviderHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + params: Final = kwargs.setdefault("litellm_params", {}) + assert isinstance(params, dict) + params["custom_llm_provider"] = 5 + return kwargs + + +ARGUMENT_TYPE_CASES: Final = ( + Case("stream_string_true", _kw(stream="true"), upstream=(_stream(TEXT_STREAM),)), + Case("stream_string_false", _kw(stream="false"), upstream=(_stream(TEXT_STREAM),)), + Case("stream_zero", _kw(stream=0)), + Case("stream_one", _kw(stream=1), upstream=(_stream(TEXT_STREAM),)), + Case("stream_one_sync", _kw(stream=1), upstream=(_stream(TEXT_STREAM),), sync=True), + Case( + "pre_request_hook_streams_on_a_string", + _kw(stream=True), + callbacks=(_StringStreamHook,), + upstream=(_stream(TEXT_STREAM),), + ), + Case("pre_request_hook_streams_on_an_integer", callbacks=(_IntegerStreamHook,), upstream=(_stream(TEXT_STREAM),)), + Case("pre_request_hook_sets_string_litellm_params", callbacks=(_StringParamsHook,), model="claude-sonnet-4-5"), + Case("pre_request_hook_sets_integer_provider", callbacks=(_IntegerProviderHook,), model="claude-sonnet-4-5"), + Case("model_info_string", _kw(model_info="not-a-mapping")), + Case("tools_mapping", _kw(tools=dict(LOOSE_TOOL)), upstream=()), + Case("messages_none", _kw(messages=None), nones=("messages",), upstream=()), + Case("max_tokens_none", _kw(max_tokens=None), nones=("max_tokens",), upstream=()), + Case("reasoning_effort_unknown", _kw(reasoning_effort="ultra"), upstream=()), + Case("reasoning_effort_unknown_on_adaptive_model", _kw(reasoning_effort="ultra"), model=OPUS_ADAPTIVE, upstream=()), + Case( + "reasoning_effort_xhigh_on_model_without_xhigh", + _kw(reasoning_effort="xhigh", max_tokens=8192), + model="anthropic/claude-opus-4-6", + upstream=(), + ), + Case("int_temperature_on_adaptive_model", _kw(temperature=0), model=OPUS_ADAPTIVE, upstream=()), + Case("int_top_p_on_adaptive_model", _kw(top_p=1), model=OPUS_ADAPTIVE, upstream=()), + Case("int_speed_on_model_without_speed", _kw(speed=2), upstream=()), + Case("string_output_format_dropped", _kw(output_format="json", drop_params=True)), + Case("string_output_format_kept_without_drop_params", _kw(output_format="json")), + Case("non_string_reasoning_effort_warns", _kw(reasoning_effort=3), warned=True), + Case( + "reasoning_effort_that_cannot_fit_max_tokens_warns", + _kw(reasoning_effort="high", max_tokens=500), + warned=True, + ), + Case( + "adaptive_thinking_that_cannot_fit_max_tokens_warns", + _kw(thinking={"type": "adaptive"}, output_config={"effort": "high"}, max_tokens=1024), + warned=True, + ), + Case( + "adaptive_thinking_on_model_without_reasoning_warns", + _kw(thinking={"type": "adaptive"}), + model="anthropic/claude-3-haiku-20240307", + warned=True, + ), + Case("output_config_effort_unknown", _kw(output_config={"effort": "ultra"})), + Case( + "global_drop_params_string_true", + _kw(tools=[{**LOOSE_TOOL, "custom": {"note": "opaque"}}]), + settings=_kw(drop_params="true"), + ), + Case( + "global_drop_params_string_false", + _kw(tools=[{**LOOSE_TOOL, "custom": {"note": "opaque"}}]), + settings=_kw(drop_params="false"), + ), + Case( + "request_drop_params_string_true", + _kw(drop_params="true", tools=[{**LOOSE_TOOL, "custom": {"note": "opaque"}}]), + ), + Case( + "additional_drop_params_tool_custom", + _kw( + additional_drop_params=["tools[*].custom"], + tools=[{**LOOSE_TOOL, "custom": {"defer_loading": True, "note": "x"}}], + ), + ), + Case( + "additional_drop_params_tool_input_examples", + _kw( + additional_drop_params=["tools[*].input_examples", "metadata.user_id", "fz.nope"], + metadata={"user_id": "u1"}, + tools=[{**LOOSE_TOOL, "input_examples": [{"q": "x"}]}], + ), + ), + Case( + "response_without_stop_reason", + upstream=(_ok({key: value for key, value in TEXT_RESPONSE.items() if key != "stop_reason"}),), + ), + Case( + "response_without_stop_fields", + upstream=( + _ok({key: value for key, value in TEXT_RESPONSE.items() if key not in ("stop_reason", "stop_sequence")}), + ), + ), ) FAILURE_CASES: Final = ( @@ -684,16 +1033,122 @@ FAILURE_CASES: Final = ( "response_trickles_slower_than_timeout", _kw(timeout=1), upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), chunk_delay=0.5, body_chunks=4),), - gaps=_gaps( - outcome=S15_COMPLETE_DEADLINE, - hidden_params=S15_COMPLETE_DEADLINE, - logged=S15_COMPLETE_DEADLINE, - logged_metadata=S15_COMPLETE_DEADLINE, - logged_response_headers=S15_COMPLETE_DEADLINE, + ), + Case( + "response_body_stalls_past_timeout", + _kw(timeout=0.5), + upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), chunk_delay=1.0, body_chunks=2),), + ), + Case( + "upstream_500_body_cut", + upstream=( + ResponseSpec(body=dict(_upstream_error("api_error", "cut")), status=500, body_chunks=2, cut_after=1), ), ), + Case("response_body_cut", upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), body_chunks=2, cut_after=1),)), + Case("gzip_response", upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), gzip=True),)), + Case("upstream_500_gzip", upstream=(replace(_failure(500, "api_error", "internal"), gzip=True),)), Case("missing_max_tokens", _kw(max_tokens=None), upstream=()), Case("missing_api_key", _kw(api_key=None), upstream=()), + Case( + "api_key_with_a_trailing_newline", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_API_KEY": f"{API_KEY}\n"}), + ), + Case( + "api_key_with_a_trailing_crlf_streamed", + _kw(api_key=None, stream=True), + upstream=(_stream(TEXT_STREAM),), + env=MappingProxyType({"ANTHROPIC_API_KEY": f"{API_KEY}\r\n"}), + ), + Case( + "api_key_padded_with_whitespace", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_API_KEY": f" {API_KEY}\t\n"}), + ), + Case( + "api_key_padded_with_separators", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_API_KEY": f"\x1f{API_KEY}\x1f"}), + ), + Case( + "api_key_of_separators_falls_to_the_auth_token", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_API_KEY": "\x1c\x1f\n", "ANTHROPIC_AUTH_TOKEN": "oauth-token"}), + ), + Case( + "auth_token_with_a_trailing_newline", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_AUTH_TOKEN": "oauth-token\n"}), + ), + Case("caller_api_key_padded_with_separators", _kw(api_key=f"\x1f{API_KEY}\x1f")), + Case("caller_api_key_with_a_trailing_newline", _kw(api_key=f"{API_KEY}\n")), + Case( + "auth_token_padded_with_whitespace", + _kw(api_key=None), + env=MappingProxyType({"ANTHROPIC_AUTH_TOKEN": " fz-env-auth-token "}), + ), + Case( + "provider_redirect_is_followed", + gaps=_gaps(logged_sent_request=REDIRECTED_SENT_REQUEST), + upstream=( + ResponseSpec(body=b"moved", status=307, headers={"location": "/redirected/v1/messages"}), + ResponseSpec(body=dict(TEXT_RESPONSE)), + ), + ), + Case( + "provider_redirect_chain_of_eleven_hops", + gaps=_gaps(logged_sent_request=REDIRECTED_SENT_REQUEST), + upstream=( + *( + ResponseSpec(body=b"moved", status=307, headers={"location": f"/hop{hop}/v1/messages"}) + for hop in range(11) + ), + ResponseSpec(body=dict(TEXT_RESPONSE)), + ), + ), + Case( + "provider_redirect_chain_past_twenty_hops", + upstream=tuple( + ResponseSpec(body=b"moved", status=307, headers={"location": f"/hop{hop}/v1/messages"}) for hop in range(21) + ), + ), + Case( + "provider_see_other_redirect", + gaps=_gaps(logged_sent_request=REDIRECTED_SENT_REQUEST, request=F46_SEE_OTHER_CONTENT_TYPE), + upstream=( + ResponseSpec(body=b"see other", status=303, headers={"location": "/other/v1/messages"}), + ResponseSpec(body=dict(TEXT_RESPONSE)), + ), + ), + Case("extra_header_lone_surrogate", _kw(extra_headers={"x-fz-surrogate": "h\ud800"}), upstream=()), + Case( + "provider_specific_header_lone_surrogate", + _kw( + provider_specific_header={ + "custom_llm_provider": "anthropic", + "extra_headers": {"x-fz-surrogate": "h\ud800"}, + } + ), + upstream=(), + ), + Case("extra_header_non_ascii", _kw(extra_headers={"x-fz-unicode": "caf\u00e9"}), upstream=()), + Case("caller_api_key_non_ascii", _kw(api_key="sk-ant-\u200djoined"), upstream=()), + Case("caller_api_key_non_ascii_stream", _kw(api_key="sk-ant-\u200djoined", stream=True), upstream=()), + Case("api_base_with_a_space_and_no_scheme", _kw(api_base="event: message_stop"), upstream=()), + Case("api_base_with_a_space_and_no_scheme_stream", _kw(api_base="data: [DONE]", stream=True), upstream=()), + Case("api_base_with_a_nul", _kw(api_base="a\x00b"), upstream=()), + Case("api_base_non_ascii_without_a_scheme", _kw(api_base="h\u00e9llo"), upstream=()), + Case("api_base_with_an_unclosed_ipv6_bracket", _kw(api_base_suffix="data: [DONE]"), upstream=()), + Case("provider_specific_header_as_a_string", _kw(provider_specific_header="anthropic"), upstream=()), + Case("response_header_latin_1", upstream=(_ok(**{"x-fz-unicode": "caf\u00e9"}),)), + Case("response_header_utf_8", upstream=(_ok(**{"x-fz-unicode": "caf\u00c3\u00a9"}),)), + Case( + "response_header_utf_8_httpx_transport", + upstream=(_ok(**{"x-fz-unicode": "caf\u00c3\u00a9"}),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + ), ) STREAM_CASES: Final = ( @@ -705,6 +1160,75 @@ STREAM_CASES: Final = ( upstream=(_stream(THINKING_STREAM),), ), Case("stream_error_event_mid_stream", _kw(stream=True), upstream=(_stream(ERROR_MID_STREAM),)), + Case("stream_events_in_one_write", _kw(stream=True), upstream=(_burst(TEXT_STREAM),), partitioned=True), + Case( + "stream_body_in_one_write", + _kw(stream=True), + upstream=(_burst(TEXT_STREAM, chunked=False),), + partitioned=True, + ), + Case( + "stream_events_in_chunks_written_apart", + _kw(stream=True), + upstream=(_chunked(TEXT_STREAM, chunk_delay=0.05),), + partitioned=True, + ), + Case( + "stream_events_written_apart", + _kw(stream=True), + upstream=(_stream(TEXT_STREAM, chunk_delay=0.05),), + partitioned=True, + ), + Case( + "stream_pings_after_message_start_in_one_write", + _kw(stream=True), + upstream=(_burst(PINGED_STREAM),), + partitioned=True, + ), + Case( + "stream_pings_after_message_start_written_apart", + _kw(stream=True), + upstream=(_stream(PINGED_STREAM, chunk_delay=0.01),), + partitioned=True, + ), + Case("stream_burst_past_one_read", _kw(stream=True), upstream=(_burst(LARGE_STREAM),), partitioned=True), + Case( + "stream_thousand_pings_in_one_write", + _kw(stream=True), + upstream=(_burst(HEAVILY_PINGED_STREAM),), + partitioned=True, + ), + Case( + "stream_error_event_in_one_write", + _kw(stream=True), + upstream=(_burst(ERROR_MID_STREAM),), + partitioned=True, + ), + Case( + "stream_events_in_one_write_httpx_transport", + _kw(stream=True), + upstream=(_burst(TEXT_STREAM),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + partitioned=True, + ), + Case( + "stream_burst_past_one_read_httpx_transport", + _kw(stream=True), + upstream=(_burst(LARGE_STREAM),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + partitioned=True, + gaps=_gaps(outcome=E04_HTTPX_CHUNK_READS), + ), + Case( + "stream_events_written_apart_httpx_transport", + _kw(stream=True), + upstream=(_stream(TEXT_STREAM, chunk_delay=0.05),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + partitioned=True, + ), Case( "stream_longer_than_timeout", _kw(stream=True, timeout=1), @@ -721,6 +1245,81 @@ STREAM_CASES: Final = ( upstream=(_failure(429, "rate_limit_error", "slow down", **{"retry-after": "3"}),), ), Case("stream_false_explicit", _kw(stream=False)), + Case( + "stream_upstream_500_body_cut", + _kw(stream=True), + upstream=( + ResponseSpec(body=dict(_upstream_error("api_error", "cut")), status=500, body_chunks=2, cut_after=1), + ), + ), + Case( + "stream_cut_after_four_events", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM), cut_after=4, cut_delay=0.1),), + ), + Case( + "stream_cut_after_message_start", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM), cut_after=1, cut_delay=0.1),), + ), + Case( + "stream_cut_after_events_written_apart", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM, chunk_delay=0.05), cut_after=6, cut_delay=0.1),), + ), + Case( + "stream_chunked_cut_after_four_events", + _kw(stream=True), + upstream=(replace(_chunked(TEXT_STREAM, chunk_delay=0), cut_after=4, cut_delay=0.1),), + ), + Case( + "stream_cut_while_the_caller_is_busy", + _kw(stream=True), + upstream=(replace(_chunked(TEXT_STREAM, chunk_delay=0), cut_after=4, cut_delay=0.1),), + busy_before_reading=0.4, + ), + Case( + "stream_cut_after_message_start_while_the_caller_is_busy", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM), cut_after=1, cut_delay=0.1),), + busy_before_reading=0.4, + ), + Case( + "stream_upstream_500_body_stalls", + _kw(stream=True, timeout=8), + upstream=( + ResponseSpec(body=dict(_upstream_error("api_error", "stalled")), status=500, chunk_delay=6, body_chunks=2), + ), + ), + Case( + "stream_upstream_429_body_stalls_past_timeout", + _kw(stream=True, timeout=1), + upstream=( + ResponseSpec( + body=dict(_upstream_error("rate_limit_error", "stalled")), status=429, chunk_delay=2, body_chunks=2 + ), + ), + ), + Case("stream_gzip_response", _kw(stream=True), upstream=(replace(_stream(TEXT_STREAM), gzip=True),)), + Case( + "stream_read_stalls_past_timeout_httpx_transport", + _kw(stream=True, timeout=0.5), + upstream=(_stream(SLOW_STREAM, chunk_delay=1.0),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + ), + Case( + "stream_response_header_utf_8", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM), headers={"x-fz-unicode": "caf\u00c3\u00a9"}),), + ), + Case( + "stream_response_header_utf_8_httpx_transport", + _kw(stream=True), + upstream=(replace(_stream(TEXT_STREAM), headers={"x-fz-unicode": "caf\u00c3\u00a9"}),), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + ), ) SYNC_CASES: Final = ( @@ -729,47 +1328,2022 @@ SYNC_CASES: Final = ( Case("sync_upstream_429", upstream=(_failure(429, "rate_limit_error", "slow down"),), sync=True), ) -FALLBACK_CASES: Final = ( - Case("mock_response", _kw(mock_response="Hi from the mock"), upstream=()), - Case("mock_response_rate_limit", _kw(mock_response="litellm.RateLimitError"), upstream=()), - Case( - "thinking_replay", - _kw(messages=list(THINKING_REPLAY), thinking={"type": "enabled", "budget_tokens": 2048}, max_tokens=4096), - ), - Case( - "thinking_signature_rejected_then_retried", - _kw(messages=list(THINKING_REPLAY), thinking={"type": "enabled", "budget_tokens": 2048}, max_tokens=4096), - upstream=( - _failure(400, "invalid_request_error", "messages.1.content.0: Invalid `signature` in `thinking` block"), - _ok(), - ), - ), +SYSTEM_POINT: Final[Mapping[str, JsonValue]] = MappingProxyType({"location": "message", "role": "system"}) +LAST_MESSAGE_POINT: Final[Mapping[str, JsonValue]] = MappingProxyType({"location": "message", "index": -1}) +SYSTEM_BLOCKS: Final[tuple[JsonValue, ...]] = ( + {"type": "text", "text": "Answer in one word."}, + {"type": "text", "text": "Be terse."}, +) +MARKED_TURNS: Final[tuple[JsonValue, ...]] = ( + {"role": "user", "content": [{"type": "text", "text": "One.", "cache_control": {"type": "ephemeral"}}]}, + {"role": "assistant", "content": [{"type": "text", "text": "Two.", "cache_control": {"type": "ephemeral"}}]}, + {"role": "user", "content": [{"type": "text", "text": "Three.", "cache_control": {"type": "ephemeral"}}]}, +) + +PROMPT_CACHING_CASES: Final = ( Case( "cache_control_injection_points", - _kw(system="Answer in one word.", cache_control_injection_points=[{"location": "message", "role": "system"}]), + _kw(system="Answer in one word.", cache_control_injection_points=[dict(SYSTEM_POINT)]), ), - Case("tool_custom_field", _kw(tools=[{**WEATHER_TOOL, "custom": {"defer_loading": True}}])), + Case("enable_prompt_caching", _kw(system="Answer in one word.", enable_prompt_caching=True)), Case( - "strict_tools_rejected_then_retried", - _kw(tools=[{**WEATHER_TOOL, "strict": True}], drop_params=True), - upstream=( - _failure(400, "invalid_request_error", "tools.0.strict: too many strict tools"), - _ok(), + "enable_prompt_caching_without_system", + _kw(messages=list(TOOL_TURNS), tools=[dict(WEATHER_TOOL)], enable_prompt_caching=True), + ), + Case( + "global_prompt_caching_with_ttl", + _kw(system=list(SYSTEM_BLOCKS)), + settings=MappingProxyType({"enable_anthropic_prompt_caching": True, "anthropic_prompt_caching_ttl": "1h"}), + ), + Case( + "global_prompt_caching_stands_down_on_client_marks", + _kw(system=[{"type": "text", "text": "Answer in one word.", "cache_control": {"type": "ephemeral"}}]), + settings=MappingProxyType({"enable_anthropic_prompt_caching": True}), + ), + Case( + "global_prompt_caching_stands_down_on_marked_tools", + _kw(tools=[{**WEATHER_TOOL, "cache_control": {"type": "ephemeral"}}]), + settings=MappingProxyType({"enable_anthropic_prompt_caching": True}), + ), + Case( + "enable_prompt_caching_false_overrides_nothing", + _kw(system="Answer in one word.", enable_prompt_caching=False), + ), + Case( + "injection_point_negative_index", + _kw( + messages=list(TOOL_TURNS), + cache_control_injection_points=[ + {"location": "message", "index": -2, "control": {"type": "ephemeral", "ttl": "1h"}} + ], ), ), - Case("modify_params", _kw(max_tokens=1), settings=MappingProxyType({"modify_params": True})), + Case( + "injection_point_string_index", + _kw(messages=list(TOOL_TURNS), cache_control_injection_points=[{"location": "message", "index": "1"}]), + ), + Case( + "injection_point_out_of_range_index", + _kw(messages=list(TOOL_TURNS), cache_control_injection_points=[{"location": "message", "index": 7}]), + ), + Case( + "injection_point_by_role", + _kw(messages=list(TOOL_TURNS), cache_control_injection_points=[{"location": "message", "role": "user"}]), + ), + Case( + "injection_points_capped_by_client_marks", + _kw( + messages=list(MARKED_TURNS), + system=list(SYSTEM_BLOCKS), + tools=[{**WEATHER_TOOL, "cache_control": {"type": "ephemeral"}}], + cache_control_injection_points=[dict(SYSTEM_POINT), dict(LAST_MESSAGE_POINT)], + ), + ), + Case( + "injection_points_beside_client_marks", + _kw( + messages=[*MARKED_TURNS[:2], {"role": "user", "content": "Three."}], + cache_control_injection_points=[dict(SYSTEM_POINT), dict(LAST_MESSAGE_POINT)], + system="Answer in one word.", + ), + ), + Case( + "tool_config_point_marks_the_last_tool", + _kw( + tools=[dict(WEATHER_TOOL), {**WEATHER_TOOL, "name": "get_time"}], + cache_control_injection_points=[{"location": "tool_config"}, dict(LAST_MESSAGE_POINT)], + ), + ), + Case( + "tool_config_point_without_tools", + _kw(cache_control_injection_points=[{"location": "tool_config"}]), + ), + Case( + "injection_marks_the_gateway_deployment", + _kw( + system="Answer in one word.", + enable_prompt_caching=True, + litellm_metadata={"user_api_key": "hashed"}, + model_info={"id": "deployment-1"}, + ), + ), + Case( + "injection_into_whitespace_only_turn", + _kw( + messages=[dict(USER), {"role": "assistant", "content": "Paris"}, {"role": "user", "content": " "}], + cache_control_injection_points=[dict(LAST_MESSAGE_POINT)], + ), + upstream=(_failure(400, "invalid_request_error", "messages: text content blocks must be non-empty"),), + ), + Case( + "injection_after_empty_blocks_are_stripped", + _kw( + messages=[ + dict(USER), + {"role": "assistant", "content": [{"type": "text", "text": ""}]}, + {"role": "user", "content": "And Germany?"}, + ], + cache_control_injection_points=[{"location": "message", "index": 1}], + ), + ), + Case( + "stream_with_prompt_caching", + _kw(stream=True, system="Answer in one word.", enable_prompt_caching=True), + upstream=(_stream(TEXT_STREAM),), + ), + Case( + "global_prompt_caching_beside_an_unmatched_point", + _kw( + system="Answer in one word.", cache_control_injection_points=[{"location": "message", "role": "assistant"}] + ), + settings=MappingProxyType({"enable_anthropic_prompt_caching": True}), + ), +) + +SYNC_PROMPT_CACHING_CASES: Final = tuple( + replace(case, name=f"sync_{case.name}", sync=True) for case in PROMPT_CACHING_CASES +) + +LATEST_ALIAS: Final = "anthropic/claude-opus-latest" +CUSTOM_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType({**WEATHER_TOOL, "custom": {"defer_loading": True}}) +COST_HEADER: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"headers": {"x-litellm-include-cost-in-streaming-usage": "true"}} +) + +SERVED_NATIVELY_CASES: Final = ( + Case("mock_response", _kw(mock_response="Hi from the mock"), upstream=()), + Case("mock_response_rate_limit", _kw(mock_response="litellm.RateLimitError"), upstream=()), + Case("mock_response_context_window", _kw(mock_response="litellm.ContextWindowExceededError"), upstream=()), + Case("mock_response_empty_calls_the_provider", _kw(mock_response="")), + Case("mock_response_bad_metadata", _kw(mock_response="Hi", metadata={"user_id": 123}), upstream=()), + Case("mock_response_stream", _kw(mock_response="Hi from the mock", stream=True), upstream=()), + Case("mock_response_stream_rate_limit", _kw(mock_response="litellm.RateLimitError", stream=True), upstream=()), + Case( + "mock_response_stream_empty_calls_the_provider", + _kw(mock_response="", stream=True), + upstream=(_stream(TEXT_STREAM),), + ), + Case("mock_response_cached", _kw(mock_response="Hi from the mock"), upstream=(), cache=Cache), + Case("mock_response_stream_cached", _kw(mock_response="Hi from the mock", stream=True), upstream=(), cache=Cache), + Case("mock_response_sync", _kw(mock_response="Hi from the mock"), upstream=(), sync=True), + Case("mock_response_sync_stream", _kw(mock_response="Hi from the mock", stream=True), upstream=(), sync=True), + Case("mock_response_sync_rate_limit", _kw(mock_response="litellm.RateLimitError"), upstream=(), sync=True), + Case("mock_response_sync_internal_error", _kw(mock_response="litellm.InternalServerError"), upstream=(), sync=True), + Case("mock_response_sync_bad_metadata", _kw(mock_response="Hi", metadata={"user_id": 123}), upstream=(), sync=True), + Case("mock_response_sync_empty_calls_the_provider", _kw(mock_response=""), sync=True), + Case("latest_alias", model=LATEST_ALIAS), + Case("latest_alias_bare_with_provider", _kw(custom_llm_provider="anthropic"), model="claude-opus-latest"), + Case("latest_alias_stream", _kw(stream=True), upstream=(_stream(TEXT_STREAM),), model=LATEST_ALIAS), + Case( + "latest_alias_upstream_400", + upstream=(_failure(400, "invalid_request_error", "max_tokens: too large"),), + model=LATEST_ALIAS, + ), + Case("tool_custom_field", _kw(tools=[dict(CUSTOM_TOOL)])), + Case( + "tool_custom_field_keeps_other_custom_keys", + _kw(tools=[{**WEATHER_TOOL, "custom": {"defer_loading": False, "note": "kept"}}]), + ), + Case( + "tool_custom_field_dropped_with_drop_params", + _kw(tools=[{**WEATHER_TOOL, "custom": {"defer_loading": True, "note": "dropped"}}], drop_params=True), + ), + Case("tool_custom_field_not_an_object", _kw(tools=[{**WEATHER_TOOL, "custom": "opaque"}])), + Case( + "tool_custom_field_under_own_defer_loading", + _kw(tools=[{**WEATHER_TOOL, "defer_loading": False, "custom": {"defer_loading": True}}]), + ), Case( "stream_cost_injection", _kw(stream=True), upstream=(_stream(TEXT_STREAM),), settings=MappingProxyType({"include_cost_in_streaming_usage": True}), ), - Case("enable_prompt_caching", _kw(system="Answer in one word.", enable_prompt_caching=True)), + Case( + "stream_cost_injection_from_proxy_header", + _kw(stream=True, proxy_server_request=dict(COST_HEADER)), + upstream=(_stream(TOOL_STREAM, chunk_delay=0.01),), + ), + Case( + "cache_off_by_default", + settings=MappingProxyType({"cache": Cache(mode=CacheMode.default_off)}), + ), + Case( + "cache_skips_messages_call_type", + settings=MappingProxyType({"cache": Cache(supported_call_types=["acompletion"])}), + ), +) + +FALLBACK_CASES: Final = ( + Case("modify_params", _kw(max_tokens=1), settings=_MODIFY_PARAMS), + Case("modify_params_clamps_max_tokens", _kw(max_tokens=200_000), settings=_MODIFY_PARAMS), + Case( + "modify_params_clamps_streamed_max_tokens", + _kw(stream=True, max_tokens=200_000), + upstream=(_stream(TEXT_STREAM),), + settings=_MODIFY_PARAMS, + ), + Case( + "modify_params_clamps_tool_turns", + _kw(messages=list(TOOL_TURNS), tools=[dict(WEATHER_TOOL)], max_tokens=200_000), + upstream=(_ok(TOOL_USE_RESPONSE),), + settings=_MODIFY_PARAMS, + ), + Case( + "modify_params_clamps_thinking", + _kw(thinking={"type": "enabled", "budget_tokens": 2048}, max_tokens=200_000), + upstream=(_ok(THINKING_RESPONSE),), + settings=_MODIFY_PARAMS, + ), + Case( + "modify_params_image_content", + _kw( + messages=[ + { + "role": "user", + "content": [ + {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": PNG_PIXEL}}, + {"type": "text", "text": "What is this?"}, + ], + } + ], + max_tokens=200_000, + ), + settings=_MODIFY_PARAMS, + ), + Case( + "modify_params_unknown_model", + _kw(max_tokens=200_000), + model="anthropic/claude-parity-unknown", + settings=_MODIFY_PARAMS, + ), + Case("modify_params_hf_model_name", _kw(max_tokens=200_000, hf_model_name="gpt2"), settings=_MODIFY_PARAMS), + Case( + "modify_params_cache_write_without_read", + _kw(max_tokens=200_000, cache={"no-cache": True}), + upstream=(_ok(), _ok()), + settings=_MODIFY_PARAMS, + cache=Cache, + ), + Case( + "modify_params_clamped_call_never_hits_the_cache", + _kw(max_tokens=200_000), + upstream=(_ok(), _ok()), + settings=_MODIFY_PARAMS, + cache=Cache, + ), + Case( + "modify_params_unclamped_call_hits_the_cache", + _kw(max_tokens=10), + upstream=(_ok(), _ok()), + settings=_MODIFY_PARAMS, + cache=Cache, + ), + Case("cache_write_without_read", _kw(cache={"no-cache": True}), upstream=(_ok(), _ok()), cache=Cache), + Case("reply_with_wide_numbers", upstream=(ResponseSpec(body=WIDE_NUMBERS_REPLY),)), + Case("reply_with_a_wide_integer_cached", upstream=(ResponseSpec(body=WIDE_INTEGER_REPLY),), cache=Cache), + Case("reply_with_raw_leaf_marked_texts", upstream=(ResponseSpec(body=MARKED_TEXTS_REPLY),)), + Case("reply_with_raw_leaf_marked_texts_cached", upstream=(ResponseSpec(body=MARKED_TEXTS_REPLY),), cache=Cache), + Case( + "modify_params_clamped_stream_hits_the_cache", + _kw(max_tokens=200_000, stream=True), + upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), + settings=_MODIFY_PARAMS, + cache=Cache, + ), + Case( + "drop_params_drops_non_string_tool_result_texts", + _kw( + messages=_non_string_tool_result_texts(5, None, {"a": 1}, 8.5, 2**70, float("nan"), "kept"), + drop_params=True, + ), + ), + Case( + "global_drop_params_drops_every_tool_result_text", + _kw(messages=_non_string_tool_result_texts(5, None)), + settings=MappingProxyType({"drop_params": True}), + ), + Case( + "drop_params_keeps_string_tool_result_texts", + _kw(messages=_non_string_tool_result_texts("\uf8fflitellm-raw-json:1", "kept"), drop_params=True), + ), + Case("modify_params_sync", _kw(max_tokens=200_000), sync=True, settings=_MODIFY_PARAMS), Case("request_timeout_kwarg", _kw(request_timeout=30)), Case("stream_timeout_kwarg", _kw(stream=True, stream_timeout=30), upstream=(_stream(TEXT_STREAM),)), ) -CASES: Final = (*REQUEST_CASES, *RESPONSE_CASES, *FAILURE_CASES, *STREAM_CASES, *SYNC_CASES, *FALLBACK_CASES) +INVALID_SIGNATURE: Final = "messages.1.content.0: Invalid `signature` in `thinking` block" +BOUND_ELSEWHERE: Final = f"{INVALID_SIGNATURE}. The block is bound to a different conversation." +THINKING: Final[Mapping[str, JsonValue]] = MappingProxyType({"type": "enabled", "budget_tokens": 2048}) +BINDING_ERRORS: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"type": "adaptive", "block_binding": {"prefix_mismatch_behavior": "error"}} +) +THINKING_ONLY_REPLAY: Final[tuple[JsonValue, ...]] = ( + {"role": "user", "content": "What is the capital of France?"}, + { + "role": "assistant", + "content": [ + {"type": "redacted_thinking", "data": "EmwKAhgBEgy"}, + {"type": "thinking", "thinking": "Paris.", "signature": "EqQBCkYIARgCKkB"}, + ], + }, + {"role": "assistant", "content": []}, + {"role": "user", "content": "And Germany?"}, +) + + +def _replay(**kwargs: object) -> Mapping[str, object]: + return _kw(messages=list(THINKING_REPLAY), thinking=dict(THINKING), max_tokens=4096, **kwargs) + + +def _rejected(message: str = INVALID_SIGNATURE, status: int = 400) -> ResponseSpec: + return _failure(status, "invalid_request_error", message) + + +THINKING_RETRY_CASES: Final = ( + Case("thinking_replay", _replay()), + Case("thinking_signature_rejected_then_retried", _replay(), upstream=(_rejected(), _ok())), + Case( + "thinking_signature_rejected_then_retried_stream", + _replay(stream=True), + upstream=(_rejected(), _stream(TEXT_STREAM)), + ), + Case( + "thinking_signature_missing_then_retried", + _replay(), + upstream=(_rejected("messages.1.content.0.thinking.signature.str: Input should be a valid string"), _ok()), + ), + Case( + "empty_thinking_rejected_then_retried_without_thinking_only_turns", + _kw(messages=list(THINKING_ONLY_REPLAY), thinking=dict(THINKING), max_tokens=4096), + upstream=(_rejected("messages.1.content.1.thinking: each thinking block must contain thinking"), _ok()), + ), + Case("thinking_signature_rejected_twice", _replay(), upstream=(_rejected(), _rejected())), + Case( + "thinking_signature_rejected_twice_stream", + _replay(stream=True), + upstream=(_rejected(), _rejected()), + ), + Case("thinking_signature_text_on_a_429_is_not_retried", _replay(), upstream=(_rejected(status=429),)), + Case( + "unrelated_400_is_not_retried", + _replay(), + upstream=(_rejected("max_tokens: 4096 > 64000, which is the maximum allowed"),), + ), + Case( + "binding_mismatch_retried_when_the_caller_did_not_pin_it", + _kw(messages=list(THINKING_REPLAY), thinking={"type": "adaptive"}, max_tokens=4096), + model=OPUS_ADAPTIVE, + upstream=(_rejected(BOUND_ELSEWHERE), _ok()), + ), + Case( + "binding_mismatch_raised_when_the_caller_pinned_it", + _kw(messages=list(THINKING_REPLAY), thinking=dict(BINDING_ERRORS), max_tokens=4096), + model=OPUS_ADAPTIVE, + upstream=(_rejected(BOUND_ELSEWHERE),), + ), + Case( + "invalid_signature_retried_even_when_the_caller_pinned_binding", + _kw(messages=list(THINKING_REPLAY), thinking=dict(BINDING_ERRORS), max_tokens=4096), + model=OPUS_ADAPTIVE, + upstream=(_rejected(), _ok()), + ), +) + + +def _default_off_cache() -> Cache: + return Cache(mode=CacheMode.default_off) + + +def _completion_only_cache() -> Cache: + return Cache(supported_call_types=["acompletion"]) + + +CACHE_CASES: Final = ( + Case("cache_hit", upstream=(_ok(), _ok()), cache=Cache), + Case("cache_hit_stream", _kw(stream=True), upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), cache=Cache), + Case("cache_no_cache", _kw(cache={"no-cache": True}), upstream=(_ok(), _ok()), cache=Cache), + Case("cache_no_store", _kw(cache={"no-store": True}), upstream=(_ok(), _ok()), cache=Cache), + Case("cache_caching_false", _kw(caching=False), upstream=(_ok(), _ok()), cache=Cache), + Case( + "cache_ttl_and_namespace", _kw(cache={"ttl": 60, "namespace": "parity"}), upstream=(_ok(), _ok()), cache=Cache + ), + Case("cache_default_off", upstream=(_ok(), _ok()), cache=_default_off_cache), + Case( + "cache_default_off_use_cache", + _kw(cache={"use-cache": True}), + upstream=(_ok(), _ok()), + cache=_default_off_cache, + ), + Case("cache_unsupported_call_type", upstream=(_ok(), _ok()), cache=_completion_only_cache), + Case("cache_hit_with_metadata", _kw(metadata={"user_id": "user-123"}), upstream=(_ok(), _ok()), cache=Cache), + Case("cache_sync", sync=True, upstream=(_ok(), _ok()), cache=Cache), + *( + Case(name, _kw(stream=True), upstream=(_raw_stream(*frames), _raw_stream(*frames)), cache=Cache) + for name, frames in ( + ("cache_stream_data_only_frames", tuple(f"data: {json.dumps(data)}" for _, data in TEXT_STREAM)), + ("cache_stream_event_without_space", _framed(TEXT_STREAM, "event:")), + ("cache_stream_done_sentinel", (*_framed(TEXT_STREAM), "data: [DONE]")), + ( + "cache_stream_without_output", + _framed( + _events(_message_start("msg_01ParityEmpty"), *_text_block(0, ""), *_message_end("end_turn", 1)) + ), + ), + ( + "cache_stream_error_after_stop", + ( + *_framed(TEXT_STREAM), + *_framed((("error", dict(_upstream_error("overloaded_error", "Overloaded"))),)), + ), + ), + ) + ), +) + +STRICT_REJECTION: Final = "Too many strict tools (21). The maximum number of strict tools is 20." +STRICT_TOOLS: Final[tuple[JsonValue, ...]] = ( + {**WEATHER_TOOL, "strict": True}, + {**WEATHER_TOOL, "name": "get_time", "strict": False}, + dict(WEATHER_TOOL, name="get_tide"), +) + + +def _strict(**kwargs: object) -> Mapping[str, object]: + return _kw(tools=list(STRICT_TOOLS), **kwargs) + + +STRICT_TOOLS_RETRY_CASES: Final = ( + Case( + "strict_tools_rejected_then_retried", _strict(drop_params=True), upstream=(_rejected(STRICT_REJECTION), _ok()) + ), + Case( + "strict_tools_rejected_then_retried_stream", + _strict(drop_params=True, stream=True), + upstream=(_rejected(STRICT_REJECTION), _stream(TEXT_STREAM)), + ), + Case( + "strict_tools_rejected_then_retried_under_global_drop_params", + _strict(), + upstream=(_rejected("The compiled grammar is too large"), _ok()), + settings=MappingProxyType({"drop_params": True}), + ), + Case( + "strict_tools_custom_field_rejected_then_retried", + _strict(drop_params="true"), + upstream=(_rejected("tools.0.custom.strict: Extra inputs are not permitted"), _ok()), + ), + Case( + "strict_tools_rejected_without_drop_params", + _strict(), + upstream=(_rejected(STRICT_REJECTION),), + settings=MappingProxyType({"drop_params": False}), + ), + Case( + "strict_tools_rejected_under_a_truthy_global_drop_params_that_is_not_true", + _strict(), + upstream=(_rejected(STRICT_REJECTION),), + settings=MappingProxyType({"drop_params": 1}), + ), + Case( + "strict_rejection_without_a_strict_tool", + _kw(tools=[{**WEATHER_TOOL, "strict": False}], drop_params=True), + upstream=(_rejected(STRICT_REJECTION),), + ), + Case( + "strict_rejection_text_on_a_429_is_not_retried", + _strict(drop_params=True), + upstream=(_rejected(STRICT_REJECTION, status=429),), + ), + Case( + "strict_tools_rejected_twice", + _strict(drop_params=True), + upstream=(_rejected(STRICT_REJECTION), _rejected("Grammar compilation timed out")), + ), + Case( + "strict_tools_rejected_twice_stream", + _strict(drop_params=True, stream=True), + upstream=(_rejected(STRICT_REJECTION), _rejected(STRICT_REJECTION)), + ), + Case( + "strict_tools_and_thinking_strict_rejected_then_retried", + _replay(tools=list(STRICT_TOOLS), drop_params=True), + upstream=(_rejected(STRICT_REJECTION), _ok()), + ), + Case( + "strict_tools_and_thinking_signature_rejected_then_retried", + _replay(tools=list(STRICT_TOOLS), drop_params=True), + upstream=(_rejected(), _ok()), + ), + Case( + "strict_tools_and_thinking_each_rejected_spends_the_one_retry", + _replay(tools=list(STRICT_TOOLS), drop_params=True), + upstream=(_rejected(STRICT_REJECTION), _rejected()), + ), + Case( + "strict_tools_and_thinking_signature_then_strict_rejected", + _replay(tools=list(STRICT_TOOLS), drop_params=True), + upstream=(_rejected(), _rejected(STRICT_REJECTION), _ok()), + ), + Case( + "one_error_naming_both_drops_thinking_and_strict_without_drop_params", + _replay(tools=list(STRICT_TOOLS)), + upstream=(_rejected(f"{INVALID_SIGNATURE}. {STRICT_REJECTION}"), _ok()), + ), +) + +THREADS_BETA: Final = "message-threads-2026-08-12" +ADVISOR_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"type": "advisor_20260301", "name": "advisor", "model": "claude-opus-4-8"} +) +THREAD_CREATE: Final[Mapping[str, JsonValue]] = MappingProxyType({"type": "create"}) +THREAD_CONTINUE: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"type": "continue", "previous_message_id": "msg_01ParityText"} +) +ADVISOR_TURNS: Final[tuple[JsonValue, ...]] = ( + {"role": "user", "content": "Build a worker pool."}, + { + "role": "assistant", + "content": [ + {"type": "text", "text": "Let me consult the advisor."}, + {"type": "server_tool_use", "id": "srvtoolu_01Parity", "name": "advisor", "input": {}}, + { + "type": "advisor_tool_result", + "tool_use_id": "srvtoolu_01Parity", + "content": {"type": "advisor_result", "text": "Use channels."}, + }, + {"type": "text", "text": "Here is the implementation."}, + ], + }, + {"role": "user", "content": "Now add a timeout.", "output_config": {"effort": "low"}}, + {"role": "system", "content": [{"type": "tool_addition", "tool": {"type": "tool_reference", "name": "ping"}}]}, + {"role": "user", "content": "Go on."}, +) +THREAD_NOT_FOUND: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + "type": "error", + "error": { + "type": "not_found_error", + "message": "No thread state was found for the requested `previous_message_id`.", + "details": {"error_code": "thread_not_found"}, + }, + "request_id": "req_01Parity", + } +) + + +def _thread_not_found() -> ResponseSpec: + return ResponseSpec(body=dict(THREAD_NOT_FOUND), status=404) + + +THREAD_CASES: Final = ( + Case("thread_create", _kw(thread=dict(THREAD_CREATE), system="Answer in one word.")), + Case("thread_create_with_advisor_tool", _kw(thread=dict(THREAD_CREATE), tools=[dict(ADVISOR_TOOL)])), + Case("thread_create_scans_history", _kw(thread=dict(THREAD_CREATE), messages=list(ADVISOR_TURNS))), + Case("thread_continue", _kw(thread=dict(THREAD_CONTINUE))), + Case( + "thread_continue_keeps_history_and_skips_its_betas", + _kw(thread=dict(THREAD_CONTINUE), messages=list(ADVISOR_TURNS)), + ), + Case( + "thread_continue_keeps_param_betas", + _kw( + thread=dict(THREAD_CONTINUE), + messages=list(ADVISOR_TURNS), + compaction={}, + context_management={"edits": [{"type": "compact_20260112"}]}, + ), + ), + Case("thread_continue_without_previous_message_id", _kw(thread={"type": "continue"}, messages=list(ADVISOR_TURNS))), + Case( + "thread_continue_with_a_malformed_previous_message_id", + _kw(thread={"type": "continue", "previous_message_id": 7}, messages=list(ADVISOR_TURNS)), + ), + Case("thread_of_unknown_shape", _kw(thread="opaque", messages=list(ADVISOR_TURNS))), + Case("thread_none_is_left_out", _kw(thread=None)), + Case( + "thread_beside_a_client_beta", + _kw(thread=dict(THREAD_CONTINUE), extra_headers={"anthropic-beta": f"advisor-tool-2026-03-01,{THREADS_BETA}"}), + ), + Case( + "thread_dropped_by_additional_drop_params", _kw(thread=dict(THREAD_CREATE), additional_drop_params=["thread"]) + ), + Case("thread_create_stream", _kw(thread=dict(THREAD_CREATE), stream=True), upstream=(_stream(TEXT_STREAM),)), + Case( + "thread_continue_stream", + _kw(thread=dict(THREAD_CONTINUE), stream=True, messages=list(ADVISOR_TURNS)), + upstream=(_stream(TEXT_STREAM),), + ), + Case("thread_create_sync", _kw(thread=dict(THREAD_CREATE)), sync=True), + Case( + "thread_continue_sync_stream", + _kw(thread=dict(THREAD_CONTINUE), stream=True), + upstream=(_stream(TEXT_STREAM),), + sync=True, + ), + Case("thread_not_found", _kw(thread=dict(THREAD_CONTINUE)), upstream=(_thread_not_found(),)), + Case("thread_not_found_stream", _kw(thread=dict(THREAD_CONTINUE), stream=True), upstream=(_thread_not_found(),)), + Case("thread_not_found_sync", _kw(thread=dict(THREAD_CONTINUE)), upstream=(_thread_not_found(),), sync=True), + Case( + "thread_continue_retried_after_a_rejected_signature", + _replay(thread=dict(THREAD_CONTINUE)), + upstream=(_rejected(), _ok()), + ), +) + + +class _CallerHandler(AsyncHTTPHandler): + def __deepcopy__(self, memo: dict[int, object]) -> "_CallerHandler": + return _CallerHandler() + + +class _UncheckedHandler(_CallerHandler): + def __deepcopy__(self, memo: dict[int, object]) -> "_UncheckedHandler": + return _UncheckedHandler() + + async def post(self, url: str, **kwargs: object) -> httpx.Response: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the test double ignores the rest of the post + return httpx.Response(503, text="unavailable") + + +class _UnreadHandler(_CallerHandler): + def __deepcopy__(self, memo: dict[int, object]) -> "_UnreadHandler": + return _UnreadHandler() + + async def post(self, url: str, **kwargs: object) -> httpx.Response: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the test double ignores the rest of the post + return httpx.Response(500, stream=httpx.ByteStream(b"unread"), request=httpx.Request("POST", url)) + + +class _CallerHttpxClient(httpx.AsyncClient): + def __deepcopy__(self, memo: dict[int, object]) -> "_CallerHttpxClient": + return _CallerHttpxClient() + + +class _CallerSyncHandler(HTTPHandler): + def __deepcopy__(self, memo: dict[int, object]) -> "_CallerSyncHandler": + return _CallerSyncHandler() + + +def _caller(**kwargs: object) -> Mapping[str, object]: + return _kw(client=_CallerHandler(), **kwargs) + + +_TLS_LEVEL: Final = _tls(ssl_security_level="DEFAULT@SECLEVEL=1") +_TLS_CURVE: Final = _tls(ssl_ecdh_curve="secp521r1") + +TRANSPORT_CASES: Final = ( + Case("caller_client", _caller()), + Case("caller_client_stream", _caller(stream=True), upstream=(_stream(TEXT_STREAM),)), + Case( + "caller_client_upstream_429", + _caller(), + upstream=( + _failure(429, "rate_limit_error", "slow down", **{"retry-after": "7", "request-id": "req_01Parity"}), + ), + ), + Case( + "caller_client_stream_upstream_429", + _caller(stream=True), + upstream=(_failure(429, "rate_limit_error", "slow down", **{"retry-after": "3"}),), + ), + Case( + "caller_client_non_json_error", + _caller(), + upstream=(ResponseSpec(body=b"bad gateway", status=502),), + ), + Case("caller_client_invalid_json_success", _caller(), upstream=(ResponseSpec(body=b"not json", status=200),)), + Case("caller_client_timeout", _caller(timeout=0.5), upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), delay=1.5),)), + Case( + "caller_client_stream_read_stalls_past_timeout", + _caller(stream=True, timeout=0.5), + upstream=(_stream(SLOW_STREAM, chunk_delay=1.0),), + ), + Case( + "caller_client_thinking_signature_rejected_then_retried", + _kw(**_replay(), client=_CallerHandler()), + upstream=(_rejected(), _ok()), + ), + Case( + "caller_client_strict_tools_rejected_then_retried_stream", + _strict(drop_params=True, stream=True, client=_CallerHandler()), + upstream=(_rejected(STRICT_REJECTION), _stream(TEXT_STREAM)), + ), + Case("caller_client_sync", _caller(), sync=True), + Case("caller_client_post_returns_unchecked_failure", _kw(client=_UncheckedHandler()), upstream=()), + Case("caller_client_post_returns_unread_failure", _kw(client=_UnreadHandler(), stream=True), upstream=()), + Case("caller_httpx_client_is_ignored", _kw(client=_CallerHttpxClient())), + Case("caller_sync_handler_is_ignored", _kw(client=_CallerSyncHandler())), + Case("tls_security_level", settings=_TLS_LEVEL), + Case("tls_security_level_stream", _kw(stream=True), upstream=(_stream(TEXT_STREAM),), settings=_TLS_LEVEL), + Case("tls_ecdh_curve", settings=_TLS_CURVE), + Case("tls_ecdh_curve_x448", settings=_tls(ssl_ecdh_curve="X448")), + Case("tls_ecdh_curve_upstream_500", upstream=(_failure(500, "api_error", "internal"),), settings=_TLS_CURVE), + Case( + "tls_security_level_from_environment", + env=MappingProxyType({"SSL_SECURITY_LEVEL": "DEFAULT@SECLEVEL=1"}), + settings=_tls(), + ), + Case("tls_security_level_python_cannot_apply", upstream=(), settings=_tls(ssl_security_level="NOT-A-CIPHER")), + Case("tls_ecdh_curve_nist_name", settings=_tls(ssl_ecdh_curve="P-256")), + Case("tls_ecdh_curve_padded_lowercase", settings=_tls(ssl_ecdh_curve=" x25519 ")), + Case("negative_timeout", _kw(timeout=-1), upstream=(ResponseSpec(body=dict(TEXT_RESPONSE), delay=0.3),)), + Case( + "negative_timeout_stream", + _kw(stream=True, timeout=-0.5), + upstream=(replace(_stream(TEXT_STREAM), delay=0.3),), + ), + Case( + "zero_timeout_httpx_transport", + _kw(timeout=0), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + ), + Case( + "negative_timeout_httpx_transport", + _kw(timeout=-1), + env=MappingProxyType({"DISABLE_AIOHTTP_TRANSPORT": "true"}), + settings=_tls(), + ), +) + + +class _RewritingHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + kwargs["tools"] = [dict(WEATHER_TOOL)] + kwargs["tool_choice"] = {"type": "tool", "name": "get_weather"} + kwargs["temperature"] = 0.25 + kwargs["top_k"] = 7 + kwargs["system"] = "Answer as a forecaster." + kwargs["stop_sequences"] = ["STOP"] + kwargs["metadata"] = {"user_id": "hooked-user"} + kwargs["extra_headers"] = {"x-hooked": "1"} + return kwargs + + +class _InPlaceHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + messages.append({"role": "assistant", "content": [{"type": "text", "text": ""}]}) + messages.append({"role": "user", "content": "And Germany?"}) + return None + + +class _UnstreamingHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "stream": not kwargs["stream"]} + + +class _MockingHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "mock_response": "Hi from the hook"} + + +class _RaisingHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + raise ValueError("the hook refused the request") + + +class _ModelHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "model": OPUS_ADAPTIVE} + + +class _CredentialHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "api_key": "sk-ant-hooked"} + + +def _instance_hook() -> CustomLogger: + async def hook(model: str, messages: list[dict[str, object]], kwargs: dict[str, object]) -> dict[str, object]: + return {**kwargs, "temperature": 0.25, "metadata": {"user_id": "instance-hook"}} + + logger: Final = CustomLogger() + logger.async_pre_request_hook = hook # pyright: ignore[reportAttributeAccessIssue] # rebind-ok: an instance-level override, as a caller may install one + return logger + + +PRE_REQUEST_HOOK_CASES: Final = ( + Case("pre_request_hook_rewrites_the_request", callbacks=(_RewritingHook,), upstream=(_ok(TOOL_USE_RESPONSE),)), + Case("pre_request_hook_edits_messages_in_place", callbacks=(_InPlaceHook,)), + Case( + "pre_request_hook_after_prompt_caching", + _kw(cache_control_injection_points=[{"location": "message", "role": "user"}]), + callbacks=(_InPlaceHook,), + ), + Case( + "pre_request_hook_unstreams", + _kw(stream=True), + callbacks=(_UnstreamingHook,), + ), + Case( + "pre_request_hook_unstreams_behind_a_cache", + _kw(stream=True), + callbacks=(_UnstreamingHook,), + upstream=(_ok(), _ok()), + cache=Cache, + ), + Case("pre_request_hook_streams", callbacks=(_UnstreamingHook,), upstream=(_stream(TEXT_STREAM),)), + Case("pre_request_hook_sets_a_mock", callbacks=(_MockingHook,), upstream=()), + Case("pre_request_hook_raises", callbacks=(_RaisingHook,), upstream=()), + Case("pre_request_hook_set_on_the_instance", callbacks=(_instance_hook,)), + Case("pre_request_hook_names_the_model", callbacks=(_ModelHook,), upstream=()), + Case("pre_request_hook_names_a_credential", callbacks=(_CredentialHook,), upstream=()), + Case( + "pre_request_hook_two_hooks_chain", callbacks=(_RewritingHook, _InPlaceHook), upstream=(_ok(TOOL_USE_RESPONSE),) + ), + Case( + "pre_request_hook_behind_a_cache_hit", + callbacks=(_RewritingHook,), + upstream=(_ok(TOOL_USE_RESPONSE), _ok(TOOL_USE_RESPONSE)), + cache=Cache, + ), +) + +_OBJECTS: Final = TypeAdapter(list[dict[str, object]]) +_VOLATILE_HOOK_KWARGS: Final = frozenset({"litellm_call_id", "litellm_logging_obj"}) + + +def _content(response: object) -> list[dict[str, object]]: + if not isinstance(response, dict): + return [] + return _OBJECTS.validate_python(_OBJECT.validate_python(response).get("content") or []) + + +def _tool_calls(response: object) -> list[dict[str, object]]: + return [block for block in _content(response) if block.get("type") == "tool_use"] + + +class _FollowUpOnToolUse(CustomLogger): + """Answers each tool call with a canned result in one follow-up turn, recording what the hooks were handed.""" + + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # CustomLogger takes untyped kwargs + self.seen: list[Mapping[str, object]] = [] + + async def async_should_run_agentic_loop( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + response: object, + model: str, + messages: list[dict[str, object]], + tools: list[dict[str, object]] | None, + stream: bool, + custom_llm_provider: str, + kwargs: dict[str, object], + ) -> tuple[bool, dict[str, object]]: + calls: Final = _tool_calls(response) + self.seen.append( + { + "hook": "should_run", + "response": _OBJECT.validate_python({**response, "id": ""}) if isinstance(response, dict) else None, + "model": model, + "messages": _OBJECTS.validate_python(messages), + "tools": tools, + "stream": stream, + "custom_llm_provider": custom_llm_provider, + "kwargs": sorted(name for name in kwargs if name not in _VOLATILE_HOOK_KWARGS), + "api_key": kwargs.get("api_key"), + } + ) + return bool(calls), {"tool_calls": calls} + + async def async_build_agentic_loop_plan( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + tools: dict[str, object], + model: str, + messages: list[dict[str, object]], + response: object, + anthropic_messages_provider_config: object, + anthropic_messages_optional_request_params: dict[str, object], + logging_obj: Logging, + stream: bool, + kwargs: dict[str, object], + ) -> AgenticLoopPlan: + self.seen.append( + { + "hook": "build_plan", + "optional_params": anthropic_messages_optional_request_params, + "config": type(anthropic_messages_provider_config).__name__, + "agentic_loop_params": logging_obj.model_call_details.get("agentic_loop_params"), + "kwargs": sorted(name for name in kwargs if name not in _VOLATILE_HOOK_KWARGS), + } + ) + return self.plan(messages, response) + + def plan(self, messages: list[dict[str, object]], response: object) -> AgenticLoopPlan: + answers: Final = [ + {"type": "tool_result", "tool_use_id": call["id"], "content": "18C, sunny"} + for call in _tool_calls(response) + ] + return AgenticLoopPlan( + run_agentic_loop=True, + request_patch=AgenticLoopRequestPatch( + messages=[ + *messages, + {"role": "assistant", "content": _content(response)}, + {"role": "user", "content": answers}, + ] + ), + ) + + +class _HeldBack(_FollowUpOnToolUse): + server_fulfilled_tool_names: ClassVar[frozenset[str]] = frozenset({"get_weather"}) + + +class _Terminates(_FollowUpOnToolUse): + def plan(self, messages: list[dict[str, object]], response: object) -> AgenticLoopPlan: + return AgenticLoopPlan(terminate=True, stop_reason="answered") + + +class _Overrides(_FollowUpOnToolUse): + def plan(self, messages: list[dict[str, object]], response: object) -> AgenticLoopPlan: + return AgenticLoopPlan(response_override={**TEXT_RESPONSE, "id": "msg_01Override"}) + + +class _Fails(_FollowUpOnToolUse): + async def async_build_agentic_loop_plan( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + tools: dict[str, object], + model: str, + messages: list[dict[str, object]], + response: object, + anthropic_messages_provider_config: object, + anthropic_messages_optional_request_params: dict[str, object], + logging_obj: Logging, + stream: bool, + kwargs: dict[str, object], + ) -> AgenticLoopPlan: + raise ValueError("the agentic plan failed") + + +class _WebSearch(WebSearchInterceptionLogger): + """The stock web search interception, recording what its pre-request hook leaves for its agentic hook.""" + + def __init__(self, enabled_providers: list[str] | None = None, max_agentic_loops: int | None = None) -> None: + super().__init__( # pyright: ignore[reportUnknownMemberType] # the logger annotates bare containers + enabled_providers=list(enabled_providers) if enabled_providers is not None else None, + max_agentic_loops=max_agentic_loops, + ) + self.seen: list[Mapping[str, object]] = [] + + async def async_should_run_agentic_loop( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + response: object, + model: str, + messages: list[dict[str, object]], + tools: list[dict[str, object]] | None, + stream: bool, + custom_llm_provider: str, + kwargs: dict[str, object], + ) -> tuple[bool, dict[str, object]]: + self.seen.append( + { + "model": model, + "messages": _OBJECTS.validate_python(messages), + "tools": tools, + "stream": stream, + "custom_llm_provider": custom_llm_provider, + "kwargs": { + name: kwargs[name] + for name in sorted(kwargs) + if name == "max_agentic_loops" or name.startswith("_websearch_interception") + }, + "kwarg_names": sorted(name for name in kwargs if name not in _VOLATILE_HOOK_KWARGS), + } + ) + return await super().async_should_run_agentic_loop( # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # the logger annotates bare containers + response=response, + model=model, + messages=messages, + tools=tools, + stream=stream, + custom_llm_provider=custom_llm_provider, + kwargs=kwargs, + ) + + +class _DeploymentHooks(CustomLogger): + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # CustomLogger takes untyped kwargs + self.seen: list[Mapping[str, object]] = [] + + async def async_post_call_success_deployment_hook( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, request_data: dict[str, object], response: object, call_type: object + ) -> object: + self.seen.append({"hook": "success", "call_type": str(call_type)}) + return None + + async def async_post_call_failure_deployment_hook( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, request_data: Mapping[str, object], exception: Exception, call_type: object + ) -> None: + self.seen.append({"hook": "failure", "error": type(exception).__name__, "call_type": str(call_type)}) + + +def _loggers(*kinds: Callable[[], CustomLogger]) -> Callable[[], Sequence[CustomLogger]]: + return lambda: tuple(kind() for kind in kinds) + + +def _web_search() -> CustomLogger: + return _WebSearch(enabled_providers=["anthropic"], max_agentic_loops=2) + + +async def _search(*args: object, **kwargs: object) -> SearchResponse: # kwargs-ok: litellm.asearch's call shape + return SearchResponse.model_validate( + {"results": [{"title": "Paris", "url": "https://example.com/paris", "snippet": "Paris is the capital."}]} + ) + + +WEB_SEARCH_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"type": "web_search_20250305", "name": "web_search", "max_uses": 2} +) +WEB_SEARCH_CALL_RESPONSE: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + **TEXT_RESPONSE, + "id": "msg_01ParitySearch", + "content": [ + {"type": "tool_use", "id": "toolu_01Search", "name": "litellm_web_search", "input": {"query": "capital"}} + ], + "stop_reason": "tool_use", + } +) +_WEB_SEARCH_SETTINGS: Final[Mapping[str, object]] = MappingProxyType({"asearch": _search}) +_WEATHER: Final = _kw(tools=[dict(WEATHER_TOOL)]) + +AGENTIC_CASES: Final = ( + Case("agentic_loop_without_tool_use", _WEATHER, loggers=_loggers(_FollowUpOnToolUse)), + Case( + "agentic_loop_follow_up", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE), _ok()), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_follow_up_with_request_params", + _kw( + tools=[dict(WEATHER_TOOL)], + system="Answer in one word.", + temperature=0.3, + metadata={"user_id": "user-123"}, + thinking={"type": "enabled", "budget_tokens": 2048}, + max_tokens=4096, + messages=[{"role": "user", "content": "Weather?", "provider_specific_fields": {"x": 1}}], + ), + upstream=(_ok(TOOL_USE_RESPONSE), _ok()), + loggers=_loggers(_FollowUpOnToolUse), + ), + *( + Case( + f"agentic_loop_follow_up_keeps_{name}", + _kw(**{"tools": [dict(WEATHER_TOOL)], **params}), + upstream=(_ok(TOOL_USE_RESPONSE), _ok()), + model=model, + loggers=_loggers(_FollowUpOnToolUse), + ) + for name, params, model in ( + ( + "output_format", + { + "output_format": { + "type": "json_schema", + "schema": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}, + } + }, + SONNET, + ), + ("reasoning_effort", {"reasoning_effort": "high", "max_tokens": 8192}, SONNET), + ("output_config_effort", {"output_config": {"effort": "medium"}}, OPUS_ADAPTIVE), + ( + "injected_cache_points", + {"cache_control_injection_points": [{"location": "message", "role": "user"}]}, + SONNET, + ), + ("context_management", {"context_management": {"edits": [{"type": "clear_tool_uses_20250919"}]}}, SONNET), + ("speed", {"speed": "fast"}, OPUS_FAST), + ("service_tier", {"service_tier": "auto"}, SONNET), + ("inference_geo", {"inference_geo": "us"}, SONNET), + ( + "container", + {"container": {"skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]}}, + SONNET, + ), + ("custom_tool", {"tools": [{**WEATHER_TOOL, "type": "custom"}]}, SONNET), + ("metadata_extras", {"metadata": {"user_id": "user-123", "session": "dropped"}}, SONNET), + ) + ), + Case( + "agentic_loop_prices_the_final_round", + _kw(tools=[dict(WEATHER_TOOL)]), + upstream=(_ok(TOOL_USE_RESPONSE), _ok({**TEXT_RESPONSE, "usage": {"input_tokens": 900, "output_tokens": 300}})), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_prices_the_final_round_stream", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=( + _stream(TOOL_STREAM), + _stream( + _events(_message_start("msg_01ParityLate"), *_text_block(0, "Paris"), *_message_end("end_turn", 300)) + ), + ), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_follow_up_stream", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=(_stream(TOOL_STREAM), _stream(TEXT_STREAM)), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_follow_up_stream_in_one_write", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=(_burst(TOOL_STREAM), _burst(TEXT_STREAM)), + loggers=_loggers(_FollowUpOnToolUse), + partitioned=True, + ), + Case( + "agentic_loop_stream_without_tool_use_in_one_write", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=(_burst(TEXT_STREAM),), + loggers=_loggers(_FollowUpOnToolUse), + partitioned=True, + ), + Case( + "agentic_loop_stream_without_tool_use", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_holds_back_a_server_fulfilled_tool", + _kw(stream=True, tools=[dict(WEATHER_TOOL)]), + upstream=(_stream(TOOL_STREAM), _stream(TEXT_STREAM)), + loggers=_loggers(_HeldBack), + ), + Case( + "agentic_loop_terminates", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE),), + loggers=_loggers(_Terminates), + ), + Case( + "agentic_loop_response_override", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE),), + loggers=_loggers(_Overrides), + ), + Case( + "agentic_loop_plan_fails", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE),), + loggers=_loggers(_Fails), + ), + Case( + "agentic_loop_follow_up_fails", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE), _failure(529, "overloaded_error", "Overloaded")), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_plan_fails_runs_the_failure_deployment_hook_once", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE),), + loggers=_loggers(_Fails, _DeploymentHooks), + ), + Case( + "agentic_loop_follow_up_fails_runs_the_failure_deployment_hook_per_round", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE), _failure(529, "overloaded_error", "Overloaded")), + loggers=_loggers(_FollowUpOnToolUse, _DeploymentHooks), + ), + Case( + "agentic_loop_follow_up_runs_the_success_deployment_hook_per_round", + _WEATHER, + upstream=(_ok(TOOL_USE_RESPONSE), _ok()), + loggers=_loggers(_FollowUpOnToolUse, _DeploymentHooks), + ), + Case( + "pre_request_hook_raises_runs_the_failure_deployment_hook_once", + callbacks=(_RaisingHook,), + upstream=(), + loggers=_loggers(_DeploymentHooks), + ), + Case( + "agentic_loop_refused_past_max_loops", + _kw(tools=[dict(WEATHER_TOOL)], max_agentic_loops=1), + upstream=(_ok(TOOL_USE_RESPONSE), _ok(TOOL_USE_RESPONSE)), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "agentic_loop_upstream_error_skips_the_hooks", + _WEATHER, + upstream=(_failure(400, "invalid_request_error", "bad"),), + loggers=_loggers(_FollowUpOnToolUse), + ), + Case( + "web_search_interception", + _kw(tools=[dict(WEB_SEARCH_TOOL)]), + upstream=(_ok(WEB_SEARCH_CALL_RESPONSE), _ok()), + settings=_WEB_SEARCH_SETTINGS, + loggers=_loggers(_web_search), + ), + Case( + "web_search_interception_converted_stream", + _kw(stream=True, tools=[dict(WEB_SEARCH_TOOL)]), + upstream=(_ok(WEB_SEARCH_CALL_RESPONSE), _ok()), + settings=_WEB_SEARCH_SETTINGS, + loggers=_loggers(_web_search), + ), + Case( + "web_search_interception_without_a_search_call", + _kw(stream=True, tools=[dict(WEB_SEARCH_TOOL)]), + settings=_WEB_SEARCH_SETTINGS, + loggers=_loggers(_web_search), + ), + Case( + "web_search_interception_for_a_provider_it_skips", + _kw(tools=[dict(WEB_SEARCH_TOOL)]), + loggers=_loggers(_WebSearch), + ), + Case( + "web_search_interception_rewrites_the_messages_it_hands_the_loop", + _kw( + stream=True, + tools=[dict(WEB_SEARCH_TOOL)], + messages=[ + {"role": "user", "content": [{"type": "text", "text": ""}, {"type": "text", "text": "Capital?"}]} + ], + ), + upstream=(_ok(WEB_SEARCH_CALL_RESPONSE), _ok()), + settings=_WEB_SEARCH_SETTINGS, + loggers=_loggers(_web_search), + ), +) + +CLASSIFIER_MODEL: Final = "openai/parity-classifier" +CLASSIFIER_CALL_TYPE: Final = "acompletion" +NON_CLAUDE: Final = "anthropic/parity-tool-model" +DANGEROUS_TOOL_USE: Final[tuple[JsonValue, ...]] = ( + { + "type": "dangerous_tool_use", + "classifier_context": { + "permission_mode": "auto", + "platform": "linux", + "trusted_directories": ["/repo"], + "git_state": {"cwd": "/repo", "branch": "main", "dirty": True}, + "ignored": "not rendered", + }, + }, +) +FLAGGED: Final = json.dumps({"verdicts": {"toolu_01Parity": {"flagged": True, "explanation": "Sends the weather."}}}) +CLEARED: Final = json.dumps({"verdicts": {"toolu_01Parity": {"flagged": False}}}) +CUT_OFF_TOOL_STREAM: Final = (*TOOL_STREAM[:-2], *_message_end("max_tokens", 22)) +UPSTREAM_ANSWERED: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + **TOOL_USE_RESPONSE, + "safeguard_results": [{"type": "dangerous_tool_use", "status": {"type": "unsupported"}}], + } +) + + +def _safeguarded(**kwargs: object) -> Mapping[str, object]: + return _kw(safeguards=list(DANGEROUS_TOOL_USE), messages=list(TOOL_TURNS), tools=[dict(WEATHER_TOOL)], **kwargs) + + +SAFEGUARDS_CASES: Final = ( + Case( + "safeguards_classifier_flags_tool_use", + _safeguarded(litellm_metadata={"user_api_key_end_user_id": "end-user-1", "user_api_key": "hashed-key"}), + upstream=(_ok(TOOL_USE_RESPONSE),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_classifier_clears_tool_use", + _safeguarded(), + upstream=(_ok(TOOL_USE_RESPONSE),), + model=NON_CLAUDE, + classifier=CLEARED, + ), + Case( + "safeguards_classifier_unparsable_reply", + _safeguarded(), + upstream=(_ok(TOOL_USE_RESPONSE),), + model=NON_CLAUDE, + classifier="I cannot tell.", + ), + Case( + "safeguards_classifier_rejects_long_input", + _safeguarded(), + upstream=(_ok(TOOL_USE_RESPONSE),), + model=NON_CLAUDE, + classifier="litellm.ContextWindowExceededError", + ), + Case("safeguards_classifier_without_tool_use", _safeguarded(), model=NON_CLAUDE, classifier=FLAGGED), + Case( + "safeguards_classifier_upstream_answered", + _safeguarded(), + upstream=(_ok(UPSTREAM_ANSWERED),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_classifier_stream_tool_use", + _safeguarded(stream=True), + upstream=(_stream(TOOL_STREAM),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_classifier_stream_cut_off", + _safeguarded(stream=True), + upstream=(_stream(CUT_OFF_TOOL_STREAM),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_classifier_stream_text", + _safeguarded(stream=True), + upstream=(_stream(TEXT_STREAM),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_classifier_upstream_failure", + _safeguarded(), + upstream=(_failure(529, "overloaded_error", "Overloaded"),), + model=NON_CLAUDE, + classifier=FLAGGED, + ), + Case( + "safeguards_claude_model_is_not_classified", + _safeguarded(), + upstream=(_ok(TOOL_USE_RESPONSE),), + classifier=FLAGGED, + ), + Case("safeguards_classifier_sync", _safeguarded(), model=NON_CLAUDE, sync=True, classifier=FLAGGED), +) + +INTERCEPTED_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType({"type": "parity_intercept", "name": "intercept"}) +_ECHOED_KWARGS: Final = ( + "model", + "messages", + "tools", + "stream", + "max_tokens", + "custom_llm_provider", + "api_key", + "metadata", + "system", + "temperature", + "tool_choice", +) + + +class _Intercepting(MessagesInterceptor): + def can_handle(self, tools: Sequence[Mapping[str, object]] | None, custom_llm_provider: str | None) -> bool: + return custom_llm_provider == "anthropic" and any( + tool.get("type") == INTERCEPTED_TOOL["type"] for tool in tools or () + ) + + +class _Answering(_Intercepting): + async def handle(self, **kwargs: object) -> object: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the interceptor contract's keyword call + echoed: Final = {name: kwargs.get(name) for name in _ECHOED_KWARGS} + answer: Final = { + **TEXT_RESPONSE, + "id": "msg_01ParityIntercepted", + "content": [{"type": "text", "text": json.dumps(echoed, sort_keys=True, default=repr)}], + "extra_keys": sorted(name for name in kwargs if name not in _ECHOED_KWARGS), + } + if kwargs.get("stream"): + return FakeAnthropicMessagesStreamIterator( + cast(AnthropicMessagesResponse, answer) + ) # cast-ok: a synthetic Messages response + return answer + + +class _Delegating(_Intercepting): + async def handle(self, **kwargs: object) -> object: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the interceptor contract's keyword call + from litellm.messages import anthropic_messages + + tools: Final = cast(list[Mapping[str, object]], kwargs["tools"]) # cast-ok: the caller's tools + return await anthropic_messages( + model=kwargs["model"], + messages=kwargs["messages"], + max_tokens=kwargs["max_tokens"], + tools=[tool for tool in tools if tool.get("type") != INTERCEPTED_TOOL["type"]], + api_key=kwargs["api_key"], + api_base=kwargs["api_base"], + stream=kwargs["stream"], + ) + + +class _Refusing(_Intercepting): + async def handle(self, **kwargs: object) -> object: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the interceptor contract's keyword call + raise ValueError("the interceptor refused the call") + + +def _intercepted(**kwargs: object) -> Mapping[str, object]: + return _kw(tools=[dict(INTERCEPTED_TOOL), dict(WEATHER_TOOL)], **kwargs) + + +class _InterceptedToolHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "tools": [dict(INTERCEPTED_TOOL), *cast(list[object], kwargs.get("tools") or [])]} + + +class _UninterceptedToolHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "tools": [dict(WEATHER_TOOL)]} + + +class _DeploymentHookRecorder(CustomLogger): + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # CustomLogger takes untyped kwargs + self.seen: list[Mapping[str, object]] = [] + + async def async_pre_call_deployment_hook(self, kwargs: dict[str, object], call_type: object) -> None: # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self.seen.append({"logging_obj": type(kwargs.get("litellm_logging_obj")).__name__, "call_type": str(call_type)}) + + +class _DeploymentResponseRecorder(CustomLogger): + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # CustomLogger takes untyped kwargs + self.seen: list[Mapping[str, object]] = [] + + async def async_post_call_success_deployment_hook( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, request_data: dict[str, object], response: object, call_type: object + ) -> object: + self.seen.append({"response": type(response).__name__, "call_type": str(call_type)}) + return None + + +DEPLOYMENT_HOOK_CASES: Final = ( + Case( + "deployment_hook_sees_the_stream_of_a_string_flag", + _kw(stream="true"), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentResponseRecorder), + ), + Case( + "deployment_hook_sees_the_stream_of_an_integer_flag", + _kw(stream=1), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentResponseRecorder), + ), + Case( + "deployment_hook_sees_the_stream_of_a_bool_flag", + _kw(stream=True), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentResponseRecorder), + ), + Case( + "deployment_hook_sees_a_stream_a_hook_made", + upstream=(_stream(TEXT_STREAM),), + callbacks=(_UnstreamingHook,), + loggers=_loggers(_DeploymentResponseRecorder), + ), + Case( + "deployment_hook_sees_a_stream_a_hook_made_on_an_integer", + upstream=(_stream(TEXT_STREAM),), + callbacks=(_IntegerStreamHook,), + loggers=_loggers(_DeploymentResponseRecorder), + ), + Case("deployment_hook_sees_the_logging_object", loggers=_loggers(_DeploymentHookRecorder)), + Case( + "deployment_hook_sees_the_logging_object_stream", + _kw(stream=True), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentHookRecorder), + ), +) + +INTERCEPTOR_CASES: Final = ( + Case("interceptor_answers", _intercepted(), upstream=(), interceptor=_Answering), + Case( + "pre_request_hook_adds_a_tool_an_interceptor_owns", + _kw(tools=[dict(WEATHER_TOOL)]), + upstream=(), + callbacks=(_InterceptedToolHook,), + interceptor=_Answering, + ), + Case( + "pre_request_hook_adds_a_tool_an_interceptor_owns_stream", + _kw(tools=[dict(WEATHER_TOOL)], stream=True), + upstream=(), + callbacks=(_InterceptedToolHook,), + interceptor=_Answering, + ), + Case( + "pre_request_hook_unstreams_a_call_an_interceptor_owns", + _intercepted(stream=True), + upstream=(), + callbacks=(_UnstreamingHook,), + interceptor=_Answering, + ), + Case( + "pre_request_hook_removes_the_tool_an_interceptor_owns", + _intercepted(), + callbacks=(_UninterceptedToolHook,), + interceptor=_Answering, + ), + Case( + "interceptor_answers_with_system_and_metadata", + _intercepted(system="Be brief.", metadata={"user_id": "user-123"}, temperature=0.5), + upstream=(), + interceptor=_Answering, + ), + Case("interceptor_answers_stream", _intercepted(stream=True), upstream=(), interceptor=_Answering), + Case( + "interceptor_wins_over_mock_response", + _intercepted(mock_response="Hi from the mock"), + upstream=(), + interceptor=_Answering, + ), + Case( + "interceptor_answers_bare_model", + _intercepted(custom_llm_provider="anthropic"), + upstream=(), + model="claude-sonnet-4-5", + interceptor=_Answering, + ), + Case("interceptor_delegates_to_the_public_api", _intercepted(), interceptor=_Delegating), + Case( + "interceptor_delegates_a_stream", + _intercepted(stream=True), + upstream=(_stream(TEXT_STREAM),), + interceptor=_Delegating, + ), + Case("interceptor_raises", _intercepted(), upstream=(), interceptor=_Refusing), + Case("interceptor_is_not_consulted_on_a_sync_call", _intercepted(), upstream=(), sync=True, interceptor=_Answering), + Case( + "pre_request_hook_is_not_run_on_a_sync_call_an_interceptor_owns", + _intercepted(), + upstream=(), + sync=True, + callbacks=(_RaisingHook,), + interceptor=_Answering, + ), + Case("pre_request_hook_is_not_run_on_a_sync_call", upstream=(), sync=True, callbacks=(_RaisingHook,)), + Case( + "interceptor_raises_runs_the_failure_deployment_hook_once", + _intercepted(), + upstream=(), + interceptor=_Refusing, + loggers=_loggers(_DeploymentHooks), + ), + Case("interceptor_answer_is_cached", _intercepted(), upstream=(), cache=Cache, interceptor=_Answering), + Case( + "interceptor_stream_answer_with_cache", + _intercepted(stream=True), + upstream=(), + cache=Cache, + interceptor=_Answering, + ), + Case("interceptor_ignores_other_calls", _kw(tools=[dict(WEATHER_TOOL)]), interceptor=_Answering), +) + +SHORT_CIRCUITED: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + **TEXT_RESPONSE, + "id": "msg_01ParityShortCircuit", + "content": [{"type": "text", "text": "Paris is the capital."}], + } +) + + +class _ShortCircuit(WebSearchInterceptionLogger): + """A web search interception whose replaced short-circuit records its inputs and answers every call.""" + + answer: Mapping[str, JsonValue] | None = SHORT_CIRCUITED + + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # the logger annotates bare containers + self.seen: list[Mapping[str, object]] = [] + + async def try_short_circuit_search( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + model: str, + messages: list[dict[str, object]], + tools: list[dict[str, object]] | None, + custom_llm_provider: str | None, + kwargs: Mapping[str, object] | None = None, + ) -> dict[str, object] | None: + passed: Final = kwargs or {} + self.seen.append( + { + "model": model, + "messages": _OBJECTS.validate_python(messages), + "tools": tools, + "custom_llm_provider": custom_llm_provider, + "kwargs": sorted(name for name in passed if name not in _VOLATILE_HOOK_KWARGS), + "metadata": passed.get("metadata"), + "safeguards": passed.get("safeguards"), + } + ) + return None if self.answer is None else _OBJECT.validate_python(copy.deepcopy(dict(self.answer))) + + +class _ShortCircuitPassing(_ShortCircuit): + answer = None + + +class _ShortCircuitToolUse(_ShortCircuit): + answer = TOOL_USE_RESPONSE + + +class _ShortCircuitRefusing(_ShortCircuit): + async def try_short_circuit_search( # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + self, + model: str, + messages: list[dict[str, object]], + tools: list[dict[str, object]] | None, + custom_llm_provider: str | None, + kwargs: Mapping[str, object] | None = None, + ) -> dict[str, object] | None: + await super().try_short_circuit_search(model, messages, tools, custom_llm_provider, kwargs) + raise ValueError("the short-circuit search failed") + + +def _searched(**kwargs: object) -> Mapping[str, object]: + return _kw(tools=[dict(WEB_SEARCH_TOOL)], metadata={"user_id": "parity-user"}, **kwargs) + + +SHORT_CIRCUIT_CASES: Final = ( + Case("short_circuit_answers", _searched(), upstream=(), loggers=_loggers(_ShortCircuit)), + Case("short_circuit_answers_stream", _searched(stream=True), upstream=(), loggers=_loggers(_ShortCircuit)), + Case("short_circuit_raises", _searched(), upstream=(), loggers=_loggers(_ShortCircuitRefusing)), + Case("short_circuit_raises_stream", _searched(stream=True), upstream=(), loggers=_loggers(_ShortCircuitRefusing)), + Case("short_circuit_passes_the_call_on", _searched(), loggers=_loggers(_ShortCircuitPassing)), + Case( + "short_circuit_passes_a_stream_on", + _searched(stream=True), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_ShortCircuitPassing), + ), + Case( + "short_circuit_first_answer_wins", + _searched(), + upstream=(), + loggers=_loggers(_ShortCircuitPassing, _ShortCircuit, _ShortCircuitRefusing), + ), + Case( + "short_circuit_answers_before_the_interceptor", + _intercepted(), + upstream=(), + loggers=_loggers(_ShortCircuit), + interceptor=_Answering, + ), + Case( + "short_circuit_passes_on_to_the_interceptor", + _intercepted(), + upstream=(), + loggers=_loggers(_ShortCircuitPassing), + interceptor=_Answering, + ), + Case( + "short_circuit_answer_with_cache", + _searched(), + upstream=(), + cache=Cache, + loggers=_loggers(_ShortCircuit), + ), + Case( + "short_circuit_answer_is_classified", + _safeguarded(), + upstream=(), + model=NON_CLAUDE, + classifier=FLAGGED, + loggers=_loggers(_ShortCircuitToolUse), + ), + Case( + "short_circuit_stream_answer_is_classified", + _safeguarded(stream=True), + upstream=(), + model=NON_CLAUDE, + classifier=FLAGGED, + loggers=_loggers(_ShortCircuitToolUse), + ), + Case("short_circuit_is_not_consulted_on_a_sync_call", _searched(), sync=True, loggers=_loggers(_ShortCircuit)), +) + +MCP_REFERENCE: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + "type": "mcp", + "server_label": "litellm", + "server_url": "litellm_proxy/mcp/deepwiki", + "require_approval": "never", + } +) +MCP_NEEDS_APPROVAL: Final[Mapping[str, JsonValue]] = MappingProxyType( + {key: value for key, value in MCP_REFERENCE.items() if key != "require_approval"} +) +WIKI_TOOL_CALL: Final[Mapping[str, JsonValue]] = MappingProxyType( + {"type": "tool_use", "id": "toolu_01Wiki", "name": "read_wiki", "input": {"repo": "a/b"}} +) +WIKI_TOOL_USE_RESPONSE: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + **TEXT_RESPONSE, + "id": "msg_01ParityWiki", + "content": [{"type": "text", "text": "Reading the wiki."}, dict(WIKI_TOOL_CALL)], + "stop_reason": "tool_use", + } +) +WIKI_TOOL_STREAM: Final = _events( + _message_start("msg_01ParityWikiStream"), + ( + "content_block_start", + { + "type": "content_block_start", + "index": 0, + "content_block": {"type": "tool_use", "id": "toolu_01Wiki", "name": "read_wiki", "input": {}}, + }, + ), + ( + "content_block_delta", + { + "type": "content_block_delta", + "index": 0, + "delta": {"type": "input_json_delta", "partial_json": '{"repo": "a/b"}'}, + }, + ), + ("content_block_stop", {"type": "content_block_stop", "index": 0}), + *_message_end("tool_use", 9), +) + + +def _wiki(**kwargs: object) -> Mapping[str, object]: + return _kw(**{"tools": [dict(MCP_REFERENCE)], **kwargs}) + + +class _McpToolHook(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + return {**kwargs, "tools": [dict(MCP_REFERENCE), *cast(list[object], kwargs.get("tools") or [])]} + + +_SHARED_LOGGER: Final = ( + "the gateway's follow-up call rewrites the shared Logging object while the first call's async success callback " + "is still queued, on Python and Rust alike, so the callback logs whichever call it saw" +) +SHARED_LOGGER_RACE: Final = MappingProxyType( + { + "logged_request": _SHARED_LOGGER, + "logged_metadata": _SHARED_LOGGER, + "logged_response_headers": _SHARED_LOGGER, + "logged_sent_request": _SHARED_LOGGER, + } +) + + +MCP_CASES: Final = ( + Case( + "mcp_tool_runs_then_answers", + _wiki(), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "mcp_tool_runs_then_answers_stream", + _wiki(stream=True), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case("mcp_answers_without_a_tool", _wiki(), gateway=True), + Case( + "mcp_tool_beside_a_native_tool", + _wiki(tools=[dict(MCP_REFERENCE), dict(WEATHER_TOOL)], system="Be terse.", temperature=0.2), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "mcp_whole_gateway", + _wiki(tools=[{**MCP_REFERENCE, "server_url": "litellm_proxy"}]), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "mcp_tool_needs_approval", + _wiki(tools=[dict(MCP_NEEDS_APPROVAL)]), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE),), + gateway=True, + ), + Case( + "mcp_tool_needs_approval_stream", + _wiki(tools=[dict(MCP_NEEDS_APPROVAL)], stream=True), + upstream=(_stream(WIKI_TOOL_STREAM),), + gateway=True, + ), + Case( + "mcp_follow_up_fails", + _wiki(), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _failure(429, "rate_limit_error", "slow down")), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "mcp_first_call_fails", + _wiki(), + upstream=(_failure(400, "invalid_request_error", "max_tokens: too large"),), + gateway=True, + ), + Case( + "mcp_metadata_and_litellm_metadata", + _wiki(metadata={"user_id": "user-123"}, litellm_metadata={"user_api_key": "hashed", "tags": ["t1"]}), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "mcp_unserved_proxy_path_passes_through", + _wiki(tools=[{**MCP_REFERENCE, "server_url": "https://gateway.example/mcp/unknown"}]), + gateway=True, + ), + Case( + "mcp_skip_flag_passes_the_reference_through", + _wiki(_skip_mcp_handler=True), + gateway=True, + ), + Case( + "mcp_tool_execution_raises", + _wiki(), + upstream=(_ok({**WIKI_TOOL_USE_RESPONSE, "content": [{**WIKI_TOOL_CALL, "input": {"repo": "boom"}}]}),), + gateway=True, + ), + Case( + "mcp_cache_hit", + _wiki(), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok(), _ok(WIKI_TOOL_USE_RESPONSE), _ok()), + cache=Cache, + gateway=True, + ), + Case("mcp_sync", _wiki(), upstream=(), sync=True, gateway=True), + Case("mcp_mock_answers_first", _wiki(mock_response="Hi from the mock"), upstream=(), gateway=True), + Case("mcp_sync_mock_answers_first", _wiki(mock_response="Hi from the mock"), upstream=(), sync=True, gateway=True), + Case( + "pre_request_hook_adds_an_mcp_tool", + _kw(tools=[dict(WEATHER_TOOL)]), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok()), + callbacks=(_McpToolHook,), + gateway=True, + racy=SHARED_LOGGER_RACE, + ), + Case( + "pre_request_hook_removes_the_mcp_tool", + _wiki(), + callbacks=(_UninterceptedToolHook,), + gateway=True, + ), + Case( + "interceptor_answers_before_the_mcp_gateway", + _kw(tools=[dict(INTERCEPTED_TOOL), dict(MCP_REFERENCE)]), + upstream=(), + interceptor=_Answering, + gateway=True, + ), +) + + +class _OrderedMemory(InMemoryCache): + def __init__(self) -> None: + super().__init__() + self.ops: list[str] = [] + + async def async_set_cache(self, key: str, value: object, **kwargs: object) -> None: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: records the backend writes in order + self.ops.append(f"set {key}") + await super().async_set_cache(key, value, **kwargs) # pyright: ignore[reportUnknownMemberType] # InMemoryCache leaves its signature untyped + + async def async_get_cache(self, key: str, **kwargs: object) -> object: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: records the backend reads in order + self.ops.append(f"get {key}") + return await super().async_get_cache(key, **kwargs) # pyright: ignore[reportUnknownMemberType] # InMemoryCache leaves its signature untyped + + +def _ordered_cache() -> Cache: + cache: Final = Cache() + cache.cache = _OrderedMemory() + return cache + + +EMPTY_CONTENT_RESPONSE: Final[Mapping[str, JsonValue]] = MappingProxyType({**TEXT_RESPONSE, "content": []}) +EMPTY_TEXT_RESPONSE: Final[Mapping[str, JsonValue]] = MappingProxyType( + {**TEXT_RESPONSE, "content": [{"type": "text", "text": ""}]} +) + +HOOKED_STREAM_AND_CACHE_CASES: Final = ( + Case( + "pre_request_hook_streams_runs_the_deployment_success_hook", + callbacks=(_UnstreamingHook,), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentHooks), + ), + Case( + "pre_request_hook_streams_behind_a_cache", + callbacks=(_UnstreamingHook,), + upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), + cache=Cache, + ), + Case( + "stream_one_runs_the_deployment_success_hook", + _kw(stream=1), + upstream=(_stream(TEXT_STREAM),), + loggers=_loggers(_DeploymentHooks), + ), + Case( + "stream_one_behind_a_cache", _kw(stream=1), upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), cache=Cache + ), + Case( + "stream_one_sync_behind_a_cache", + _kw(stream=1), + upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), + cache=Cache, + sync=True, + ), + Case( + "stream_string_true_behind_a_cache", + _kw(stream="true"), + upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), + cache=Cache, + ), + Case( + "pre_request_hook_streams_on_an_integer_behind_a_cache", + callbacks=(_IntegerStreamHook,), + upstream=(_stream(TEXT_STREAM), _stream(TEXT_STREAM)), + cache=Cache, + ), + Case( + "cache_empty_content_is_not_stored", + upstream=(_ok(EMPTY_CONTENT_RESPONSE), _ok(EMPTY_CONTENT_RESPONSE)), + cache=Cache, + ), + Case( + "cache_empty_text_block_is_not_stored", + upstream=(_ok(EMPTY_TEXT_RESPONSE), _ok(EMPTY_TEXT_RESPONSE)), + cache=Cache, + ), + Case( + "mcp_cache_hit_stream", + _wiki(stream=True), + upstream=(_ok(WIKI_TOOL_USE_RESPONSE), _ok(), _ok(WIKI_TOOL_USE_RESPONSE), _ok()), + cache=Cache, + gateway=True, + ), + Case( + "safeguards_classifier_stream_cached", + _safeguarded(stream=True), + upstream=(_stream(TOOL_STREAM), _stream(TOOL_STREAM)), + model=NON_CLAUDE, + classifier=FLAGGED, + cache=_ordered_cache, + ), +) + +CASES: Final = ( + *REQUEST_CASES, + *INPUT_VALUE_CASES, + *ARGUMENT_TYPE_CASES, + *AGENTIC_CASES, + *PROMPT_CACHING_CASES, + *SYNC_PROMPT_CACHING_CASES, + *RESPONSE_CASES, + *FAILURE_CASES, + *STREAM_CASES, + *SYNC_CASES, + *SERVED_NATIVELY_CASES, + *THINKING_RETRY_CASES, + *STRICT_TOOLS_RETRY_CASES, + *FALLBACK_CASES, + *CACHE_CASES, + *THREAD_CASES, + *TRANSPORT_CASES, + *PRE_REQUEST_HOOK_CASES, + *SAFEGUARDS_CASES, + *INTERCEPTOR_CASES, + *SHORT_CIRCUIT_CASES, + *MCP_CASES, + *DEPLOYMENT_HOOK_CASES, + *HOOKED_STREAM_AND_CACHE_CASES, +) @dataclass(frozen=True, slots=True) @@ -780,6 +3354,11 @@ class Leg: hidden_params: Mapping[str, object] logged: Mapping[str, object] callback_kwargs: Mapping[str, object] + cached: tuple[str, ...] = () + warnings: tuple[str, ...] = () + hook_inputs: tuple[object, ...] = () + classified: tuple[Mapping[str, object], ...] = () + tool_runs: tuple[Mapping[str, object], ...] = () @dataclass(slots=True) @@ -806,7 +3385,6 @@ def native_messages() -> Iterator[FallbackProbe]: return _PYTHON_MESSAGES(*args, **kwargs) with ( - rebound(catalog, "RULES", (RouteRule(Route.MESSAGES, Rollout.RUST_OPT_OUT), *catalog.RULES)), rebound(dispatch, "_PYTHON_AMESSAGES", python_afallback), rebound(dispatch, "_PYTHON_MESSAGES", python_fallback), ): @@ -820,6 +3398,12 @@ def _environment(env: Mapping[str, str]) -> Generator[None]: *env, "ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN", + "ANTHROPIC_FEDERATION_RULE_ID", + "ANTHROPIC_ORGANIZATION_ID", + "ANTHROPIC_IDENTITY_TOKEN", + "ANTHROPIC_IDENTITY_TOKEN_FILE", + "ANTHROPIC_IDENTITY_SOURCE", + "LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS", "LITELLM_REASONING_AUTO_SUMMARY", "LITELLM_RUST", ) @@ -843,6 +3427,48 @@ def _settings(settings: Mapping[str, object]) -> Generator[None]: setattr(litellm, name, value) +@contextmanager +def _classifier(reply: str | None, calls: list[Mapping[str, object]]) -> Generator[None]: + if reply is None: + yield + return + acompletion: Final = litellm.acompletion + + async def classify(**kwargs: object) -> object: # kwargs-ok: stands in for litellm.acompletion + calls.append( + { + "names": sorted(kwargs), + **{name: kwargs.get(name) for name in ("model", "messages", "max_tokens", "num_retries", "user")}, + "litellm_metadata": _mapping(kwargs.get("litellm_metadata")), + } + ) + return await acompletion(**kwargs, mock_response=reply) + + with ( + rebound(proxy_server, "general_settings", {"safeguards_classifier_model": CLASSIFIER_MODEL}), + rebound(litellm, "acompletion", classify), + ): + yield + + +@contextmanager +def _interceptor(interceptor: Callable[[], MessagesInterceptor] | None) -> Generator[None]: + if interceptor is None: + yield + return + with rebound(messages_interceptors, "_interceptors", [interceptor(), *messages_interceptors._interceptors]): # pyright: ignore[reportPrivateUsage] # registers a test interceptor ahead of the shipped ones + yield + + +@contextmanager +def _cache(cache: Callable[[], Cache] | None) -> Generator[None]: + if cache is None: + yield + return + with rebound(litellm, "cache", cache()): + yield + + def _kwargs(case: Case, server: RecordingServer) -> dict[str, object]: # Deep: Python writes into the caller's own `litellm_metadata`, which must not leak into the # other leg. @@ -856,7 +3482,7 @@ def _kwargs(case: Case, server: RecordingServer) -> dict[str, object]: "api_base": f"{server.base_url}{suffix}", **supplied, } - return {name: value for name, value in kwargs.items() if value is not None or name in ("safeguards",)} + return {name: value for name, value in kwargs.items() if value is not None or name in ("safeguards", *case.nones)} def _mapping(value: object) -> Mapping[str, object]: @@ -881,15 +3507,60 @@ def _error(error: BaseException, phase: str, chunks: Iterable[object] = ()) -> M "llm_provider": getattr(error, "llm_provider", None), "model": getattr(error, "model", None), "message": _normalized(str(error)), + "details": AnthropicExceptionMapping.embedded_error_details(str(error)), + "keeps_the_deployment_warm": is_message_thread_not_found(error), "headers": {name: header_items.get(name) for name in ("retry-after", "request-id") if name in header_items}, "partial": _stream_text(chunks), } +def _sent_request(response: object) -> Mapping[str, object] | None: + if not isinstance(response, httpx.Response): + return None + try: + sent: Final = response.request + except RuntimeError: + return {"status": response.status_code, "request": None} + return { + "status": response.status_code, + "request": { + "method": sent.method, + "path": sent.url.path, + "anthropic-beta": sent.headers.get("anthropic-beta"), + "body": _sent_body(sent), + }, + } + + +def _sent_body(sent: httpx.Request) -> object: + try: + sent_body: Final = sent.read() + except (httpx.RequestNotRead, httpx.StreamClosed): + return None + return json.loads(sent_body) if sent_body else None + + +def _partition(chunks: Iterable[object]) -> tuple[int, ...]: + return tuple(len(chunk if isinstance(chunk, bytes) else str(chunk).encode()) for chunk in chunks) + + def _stream_text(chunks: Iterable[object]) -> str: return b"".join(chunk if isinstance(chunk, bytes) else str(chunk).encode() for chunk in chunks).decode() +def _scrubbed(value: object) -> object: + """Masks the random server tool ids inside a response, leaving every other value as it was.""" + match value: + case str(): + return _SERVER_TOOL_ID.sub("srvtoolu_", value) + case dict(): + return {name: _scrubbed(item) for name, item in cast(dict[object, object], value).items()} + case list(): + return [_scrubbed(item) for item in cast(list[object], value)] + case _: + return value + + def _response(result: object, private_keys: bool) -> Mapping[str, object]: assert isinstance(result, dict), f"expected a dict response, got {type(result).__name__}" body: Final = { @@ -897,13 +3568,13 @@ def _response(result: object, private_keys: bool) -> Mapping[str, object]: for name, value in cast(dict[str, object], result).items() if private_keys or not name.startswith("_") } - return {"kind": "response", "body": _OBJECT.validate_python(body)} + return {"kind": "response", "body": _LOGGED.validate_python(_scrubbed(body))} def _hidden_params(result: object) -> Mapping[str, object]: hidden: Final = dict(_mapping(get_hidden_params_dict(result))) headers: Final = _mapping(hidden.pop("additional_headers", None)) - header_names: Final = sorted(name for name in headers if name not in ("x-litellm-rust", "x-litellm-cache-key")) + header_names: Final = sorted(name for name in headers if name != "x-litellm-rust") return {"keys": sorted(hidden), "additional_headers": header_names} @@ -949,32 +3620,42 @@ async def _invoke( if isinstance(result, dict): body = cast(Mapping[str, object], result) return _response(body, case.private_keys), _hidden_params(body) + time.sleep(case.busy_before_reading) # noqa: ASYNC251 # holds the event loop, as a caller's own work between the call and its first read does chunks, failure = await _consume_async(cast(AsyncIterator[object], result)) hidden: Final = _hidden_params(result) + partition: Final = {"partition": _partition(chunks)} if case.partitioned else {} if failure is not None: - return _error(failure, "stream", chunks), hidden + return {**_error(failure, "stream", chunks), **partition}, hidden return { "kind": "stream", "chunk_types": sorted({type(chunk).__name__ for chunk in chunks}), - "text": _stream_text(chunks), + "text": _SERVER_TOOL_ID.sub("srvtoolu_", _stream_text(chunks)), + **partition, }, hidden -async def _terminal_events(recorder: RecordingLogger) -> tuple[str, ...]: +async def _terminal_events(recorder: RecordingLogger, since: int = 0) -> tuple[str, ...]: for _ in range(100): await drain_logging() - if any(name in _TERMINAL_EVENTS for name in recorder.names): + if any(name in _TERMINAL_EVENTS for name in recorder.names[since:]): break await asyncio.sleep(0.05) await asyncio.sleep(0.2) await drain_logging() - return tuple(name for name in recorder.names if name in _TERMINAL_EVENTS) + return tuple(name for name in recorder.names[since:] if name in _TERMINAL_EVENTS) -def _logged(recorder: RecordingLogger, events: tuple[str, ...]) -> tuple[Mapping[str, object], Mapping[str, object]]: - terminal: Final = [event for event in recorder.events if event.name in _TERMINAL_EVENTS] +def _logged( + recorder: RecordingLogger, events: tuple[str, ...], since: int = 0 +) -> tuple[Mapping[str, object], Mapping[str, object]]: + terminal: Final = [ + event + for event in recorder.events[since:] + if event.name in _TERMINAL_EVENTS and event.call_type != CLASSIFIER_CALL_TYPE + ] + hooks: Final = tuple(sorted(set(recorder.names[since:]))) if not terminal: - return {"events": events}, {} + return {"events": events, "hooks": hooks}, {} details: Final = _mapping(terminal[-1].kwargs) standard: Final = _mapping(details.get("standard_logging_object")) error_class: Final = _mapping(standard.get("error_information")).get("error_class") @@ -983,35 +3664,139 @@ def _logged(recorder: RecordingLogger, events: tuple[str, ...]) -> tuple[Mapping metadata_keys: Final = _mapping(metadata).keys() logged: Final[Mapping[str, object]] = { "events": events, + "hooks": hooks, **{name: standard.get(name) for name in _COMPARED_LOG_FIELDS}, "error_class": error_class, } callback_kwargs: Final[Mapping[str, object]] = { "logged_metadata": sorted(metadata_keys) if isinstance(metadata, dict) else metadata, "logged_model_info": litellm_params.get("model_info"), - "logged_response_headers": bool(details.get("response_headers")), + "logged_response_headers": { + name: value for name, value in _mapping(details.get("response_headers")).items() if name.lower() != "date" + }, "logged_api_key": details.get("api_key"), "logged_call": { "custom_llm_provider": details.get("custom_llm_provider"), "model": details.get("model"), "stream": details.get("stream"), + "aanthropic_messages": litellm_params.get("aanthropic_messages"), }, + "logged_request": { + "messages": details.get("messages"), + "thinking": details.get("thinking"), + "tools": details.get("tools"), + "complete_input_dict": _mapping(details.get("additional_args")).get("complete_input_dict"), + }, + "logged_sent_request": _sent_request(details.get("httpx_response")), + "logged_model_parameters": standard.get("model_parameters"), + "logged_error": _logged_error(details, standard), } return logged, callback_kwargs +def _logged_error(details: Mapping[str, object], standard: Mapping[str, object]) -> Mapping[str, object]: + exception: Final = details.get("exception") + information: Final = _mapping(standard.get("error_information")) + return { + "error_str": _normalized(str(standard.get("error_str"))), + "error_message": _normalized(str(information.get("error_message"))), + "error_code": information.get("error_code"), + "llm_provider": information.get("llm_provider"), + "exception": None if exception is None else _normalized(str(exception)), + "exception_model": getattr(exception, "model", None), + "exception_provider": getattr(exception, "llm_provider", None), + } + + +async def _prime(case: Case, server: RecordingServer, recorder: RecordingLogger, native: bool) -> int: + if case.cache is None: + return 0 + outcome: Final = await _invoke(case, _kwargs(case, server), native=native) + assert case.sync or outcome[0]["kind"] != "error", outcome + await _terminal_events(recorder) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + return len(recorder.events) + + +WIKI_MCP_TOOL: Final[Mapping[str, JsonValue]] = MappingProxyType( + { + "name": "read_wiki", + "description": "Read a repository wiki", + "inputSchema": {"type": "object", "properties": {"repo": {"type": "string"}}, "required": ["repo"]}, + } +) + + +@contextmanager +def _gateway(case: Case, runs: list[Mapping[str, object]]) -> Generator[None]: # mutable-ok: records the tool runs + if not case.gateway: + yield + return + from mcp.types import Tool as MCPTool + + from litellm.responses.mcp import tool_precheck + from litellm.responses.mcp.litellm_proxy_mcp_handler import LiteLLM_Proxy_MCP_Handler + + split_mcp_tools: Final = LiteLLM_Proxy_MCP_Handler.split_mcp_tools + + async def served(names: Iterable[str]) -> frozenset[str]: + return frozenset({"deepwiki"}) & frozenset(names) + + async def split(tools: Iterable[Mapping[str, object]] | None) -> object: + return await split_mcp_tools(tools, served) + + async def listed(**_: object) -> tuple[list[MCPTool], list[str]]: + return [MCPTool.model_validate(dict(WIKI_MCP_TOOL))], ["deepwiki"] + + async def executed(**kwargs: object) -> list[dict[str, object]]: + calls: Final = cast(list[Mapping[str, object]], kwargs["tool_calls"]) + runs.append( + { + "tool_calls": [dict(call) for call in calls], + "tool_server_map": kwargs["tool_server_map"], + "request_tags": kwargs["request_tags"], + "guardrail_context": json.loads(json.dumps(kwargs["guardrail_context"], default=repr)), + } + ) + if any(call.get("input") == {"repo": "boom"} for call in calls): + raise RuntimeError("the wiki server went away") + return [{"tool_call_id": call.get("id"), "result": "9 sections", "name": call.get("name")} for call in calls] + + with pytest.MonkeyPatch.context() as patch: + patch.setattr(tool_precheck, "_gateway_registry_loads", lambda: True) + patch.setattr(LiteLLM_Proxy_MCP_Handler, "split_mcp_tools", staticmethod(split)) + patch.setattr(LiteLLM_Proxy_MCP_Handler, "_get_mcp_tools_from_manager", staticmethod(listed)) + patch.setattr(LiteLLM_Proxy_MCP_Handler, "execute_tool_calls", staticmethod(executed)) + yield + + async def _leg(case: Case, server: RecordingServer, probe: FallbackProbe | None) -> Leg: - with isolated_callback_registries(), _environment(case.env), _settings(case.settings): - recorder: Final = RecordingLogger() - litellm.callbacks.append(recorder) + classified: Final[list[Mapping[str, object]]] = [] + runs: Final[list[Mapping[str, object]]] = [] + with ( + isolated_callback_registries(), + _environment(case.env), + _settings(case.settings), + _cache(case.cache), + _classifier(case.classifier, classified), + _interceptor(case.interceptor), + _gateway(case, runs), + ): for spec in case.upstream: server.enqueue(replace(spec)) request_count: Final = len(server.requests) + recorder: Final = RecordingLogger() + loggers: Final = () if case.loggers is None else case.loggers() + litellm.callbacks.extend(loggers) + litellm.callbacks.append(recorder) + litellm.callbacks.extend(callback() for callback in case.callbacks) fallbacks_before: Final = 0 if probe is None else probe.calls - outcome, hidden = await _invoke(case, _kwargs(case, server), native=probe is not None) - events: Final = await _terminal_events(recorder) + primed: Final = await _prime(case, server, recorder, native=probe is not None) + with _warnings() as warned: + outcome, hidden = await _invoke(case, _kwargs(case, server), native=probe is not None) + events: Final = await _terminal_events(recorder, primed) server.responses.clear() - logged, callback_kwargs = _logged(recorder, events) + logged, callback_kwargs = _logged(recorder, events, primed) return Leg( fell_back=probe is not None and probe.calls > fallbacks_before, requests=tuple( @@ -1029,9 +3814,40 @@ async def _leg(case: Case, server: RecordingServer, probe: FallbackProbe | None) hidden_params=hidden, logged=logged, callback_kwargs=callback_kwargs, + cached=() if litellm.cache is None else _cache_entries(litellm.cache), + warnings=tuple(warned), + hook_inputs=tuple(getattr(logger, "seen", ()) for logger in loggers), + classified=tuple(classified), + tool_runs=tuple(runs), ) +class _WarningLines(logging.Handler): + def __init__(self, lines: list[str]) -> None: # mutable-ok: the handler appends each warning as it is logged + super().__init__(logging.WARNING) + self.lines: Final = lines + + def emit(self, record: logging.LogRecord) -> None: + self.lines.append(record.getMessage()) + + +@contextmanager +def _warnings() -> Generator[list[str]]: # mutable-ok: filled while the call runs + lines: Final[list[str]] = [] + handler: Final = _WarningLines(lines) + verbose_logger.addHandler(handler) + try: + yield lines + finally: + verbose_logger.removeHandler(handler) + + +def _cache_entries(cache: Cache) -> tuple[str, ...]: + backend: Final = cache.cache + keys: Final = tuple(sorted(backend.cache_dict)) if isinstance(backend, InMemoryCache) else () + return (*keys, *backend.ops) if isinstance(backend, _OrderedMemory) else keys + + @pytest.fixture def parity_server(recording_server: RecordingServer) -> RecordingServer: recording_server.expected_requests = None @@ -1068,12 +3884,521 @@ async def test_native_messages_match_python( case "dispatch": assert not native.fell_back case "request": - assert native.requests == python.requests + assert _comparable(native.requests) == _comparable(python.requests) case "outcome": assert native.outcome == python.outcome case "hidden_params": assert native.hidden_params == python.hidden_params case "logged": assert native.logged == python.logged + case "cached": + assert native.cached == python.cached + case "warnings": + assert native.warnings == python.warnings + case "hook_inputs": + assert native.hook_inputs == python.hook_inputs + case "classified": + assert native.classified == python.classified + case "tool_runs": + assert native.tool_runs == python.tool_runs case _: - assert native.callback_kwargs.get(aspect) == python.callback_kwargs.get(aspect) + assert _comparable(native.callback_kwargs.get(aspect)) == _comparable(python.callback_kwargs.get(aspect)) + + +def _comparable(value: object) -> object: + match value: + case float() if math.isnan(value): + return "" + case Mapping(): + return {name: _comparable(item) for name, item in cast(Mapping[object, object], value).items()} + case list() | tuple(): + return [_comparable(item) for item in cast(Sequence[object], value)] + case _: + return value + + +@pytest.mark.parametrize( + "case", + [ + pytest.param(case, id=case.name) + for case in (*SERVED_NATIVELY_CASES, *AGENTIC_CASES, *SAFEGUARDS_CASES, *SHORT_CIRCUIT_CASES) + ], +) +def test_catalog_serves_the_case_natively(case: Case, parity_server: RecordingServer) -> None: + with ( + isolated_callback_registries(), + _environment(case.env), + _settings(case.settings), + _classifier(case.classifier, []), + ): + litellm.callbacks.extend(() if case.loggers is None else case.loggers()) + binding: Final = dispatch._MESSAGES if case.sync else dispatch._AMESSAGES # pyright: ignore[reportPrivateUsage] # the public binding the entry routes by + features: Final = dispatch._FEATURES # pyright: ignore[reportPrivateUsage] # the entry's own detectors + request: Final = dispatch._public_request(binding, (), _kwargs(case, parity_server)) # pyright: ignore[reportPrivateUsage] # the public binding the entry routes by + assert request is not None + context: Final = dispatch._context(request, features) # pyright: ignore[reportPrivateUsage] # the entry's own route context + assert catalog.rollout(context) is Rollout.RUST_REQUIRED, context.features + + +@pytest.mark.parametrize("case", [pytest.param(case, id=case.name) for case in TRANSPORT_CASES]) +def test_catalog_serves_the_transport_case_natively(case: Case, parity_server: RecordingServer) -> None: + with isolated_callback_registries(), _environment(case.env), _settings(case.settings): + request: Final = dispatch._public_request(dispatch._AMESSAGES, (), _kwargs(case, parity_server)) # pyright: ignore[reportPrivateUsage] # the public binding the async entry routes by + assert request is not None + context: Final = dispatch._context(request, dispatch._FEATURES) # pyright: ignore[reportPrivateUsage] # the async entry's own route context + assert catalog.rollout(context) is Rollout.RUST_REQUIRED, context.features + + +@dataclass(slots=True) +class _Exchanges: + posts: int = 0 + windows: int = 0 + + +async def _exchanges( + case: Case, server: RecordingServer, probe: FallbackProbe | None, monkeypatch: pytest.MonkeyPatch +) -> _Exchanges: + counted: Final = _Exchanges() + post: Final = AsyncHTTPHandler.post # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # the handler's untyped dict params + record: Final = logging_utils._set_duration_in_model_call_details # pyright: ignore[reportPrivateUsage] # the one recorder of an exchange window + + async def posted( + handler: AsyncHTTPHandler, *args: object, **kwargs: object + ) -> object: # kwargs-ok: the handler's own post signature + counted.posts += 1 + return await post(handler, *args, **kwargs) # pyright: ignore[reportArgumentType] # forwarded unchanged + + def windowed(**kwargs: object) -> None: # kwargs-ok: the recorder's own keywords + counted.windows += 1 + record(**kwargs) # pyright: ignore[reportArgumentType] # forwarded unchanged + + with monkeypatch.context() as patch: + patch.setattr(AsyncHTTPHandler, "post", posted) + patch.setattr(logging_utils, "_set_duration_in_model_call_details", windowed) + await _leg(case, server, probe) + return counted + + +@pytest.mark.asyncio +@pytest.mark.parametrize("case", [pytest.param(case, id=case.name) for case in TRANSPORT_CASES if not case.sync]) +async def test_transport_cases_post_through_the_handler_python_posts_through( + case: Case, parity_server: RecordingServer, native_messages: FallbackProbe, monkeypatch: pytest.MonkeyPatch +) -> None: + python: Final = await _exchanges(case, parity_server, None, monkeypatch) + native: Final = await _exchanges(case, parity_server, native_messages, monkeypatch) + ignored: Final = case.name.endswith("_is_ignored") + assert python.posts == len(case.upstream) + assert native.posts == (0 if ignored else python.posts) + assert native.windows == python.windows + assert native_messages.calls == 0 + + +_COST_CASES: Final = tuple( + pytest.param(case, id=case.name) for case in SERVED_NATIVELY_CASES if case.name.startswith("stream_cost_injection") +) + + +def _proxy_relayed(text: str, request_headers: Mapping[str, object]) -> str: + return "".join( + str( + ProxyBaseLLMRequestProcessing.process_chunk_with_cost_injection( + frame + "\n\n", "proxy-model-alias", None, request_headers=request_headers + ) + ) + for frame in text.split("\n\n") + if frame + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("case", _COST_CASES) +async def test_both_lanes_carry_one_cost_per_usage_through_the_proxy_relay( + case: Case, parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python, native = await _legs(case, parity_server, native_messages) + opted_in: Final = {"x-litellm-include-cost-in-streaming-usage": "true"} + python_text: Final = str(python.outcome["text"]) + native_text: Final = str(native.outcome["text"]) + assert '"cost"' in python_text + assert native_text == python_text + relayed: Final = _proxy_relayed(native_text, opted_in) + assert relayed == _proxy_relayed(python_text, opted_in) + assert all(frame.count('"cost"') <= 1 for frame in relayed.split("\n\n")) + + +def _proxied(kwargs: Mapping[str, object]) -> dict[str, object]: + logging_obj, data = litellm.utils.function_setup( + original_function="anthropic_messages", + rules_obj=litellm.utils.Rules(), + start_time=datetime.datetime.now(), + is_async_call=True, + litellm_call_id=str(uuid.uuid4()), + **kwargs, + ) + return {**data, "litellm_logging_obj": logging_obj} + + +async def _through_the_ownership_hook( + hook: MessageThreadOwnership, owner: UserAPIKeyAuth, data: dict[str, object], native: bool +) -> None: + acall: Final = _PUBLIC_AMESSAGES if native else _PYTHON_AMESSAGES + result: Final = await acall(**data) + if isinstance(result, dict): + await hook.async_post_call_success_hook(data, owner, cast(AnthropicMessagesResponse, result)) + return + async for _ in hook.async_post_call_streaming_iterator_hook(owner, cast(AsyncIterator[object], result), data): + pass + + +async def _thread_betas(server: RecordingServer, stream: bool, native: bool) -> tuple[str | None, str | None]: + hook: Final = MessageThreadOwnership(InternalUsageCache(dual_cache=DualCache())) + owner: Final = UserAPIKeyAuth(token="hashed-owner") + base: Final[dict[str, object]] = { + "model": SONNET, + "max_tokens": 64, + "messages": [dict(USER)], + "api_key": API_KEY, + "api_base": server.base_url, + } + server.enqueue(_stream(TEXT_STREAM) if stream else _ok()) + server.enqueue(_ok()) + sent: Final = len(server.requests) + with isolated_callback_registries(), _environment({}): + await _through_the_ownership_hook( + hook, + owner, + _proxied({**base, "thread": dict(THREAD_CREATE), "tools": [dict(ADVISOR_TOOL)], "stream": stream}), + native, + ) + replied: Final = "msg_01ParityStream" if stream else str(TEXT_RESPONSE["id"]) + continued: Final = _proxied({**base, "thread": {"type": "continue", "previous_message_id": replied}}) + hooked: Final = await hook.async_pre_call_hook(owner, DualCache(), continued, "anthropic_messages") + await _through_the_ownership_hook(hook, owner, continued if hooked is None else hooked, native) + await drain_logging() + server.responses.clear() + create, resumed = server.requests[sent:] + return create.headers.get("anthropic-beta"), resumed.headers.get("anthropic-beta") + + +@pytest.mark.asyncio +@pytest.mark.parametrize("stream", (False, True), ids=("json", "streamed")) +async def test_both_lanes_resend_a_thread_s_create_betas_through_the_ownership_hook( + stream: bool, parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python: Final = await _thread_betas(parity_server, stream, native=False) + native: Final = await _thread_betas(parity_server, stream, native=True) + + assert native_messages.calls == 0 + assert native == python + assert python == ("advisor-tool-2026-03-01,message-threads-2026-08-12",) * 2 + + +_WEB_SEARCH_PRE_HOOK_CASES: Final = tuple( + pytest.param(case, id=case.name) + for case in AGENTIC_CASES + if case.name in {"web_search_interception", "web_search_interception_converted_stream"} +) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("case", _WEB_SEARCH_PRE_HOOK_CASES) +async def test_both_lanes_hand_the_web_search_pre_hook_kwargs_to_the_agentic_loop( + case: Case, parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python, native = await _legs(case, parity_server, native_messages) + + assert native_messages.calls == 0 + assert native.hook_inputs == python.hook_inputs + [seen] = python.hook_inputs + first: Final = cast(list[Mapping[str, object]], seen)[0] + converted: Final = case.name.endswith("_converted_stream") + assert first["kwargs"] == { + "max_agentic_loops": 2, + "_websearch_interception_emit_native_blocks": True, + **({"_websearch_interception_converted_stream": True} if converted else {}), + } + assert [tool.get("name") for tool in cast(list[Mapping[str, object]], first["tools"])] == ["litellm_web_search"] + assert first["stream"] is False + + +class _CountingAnswering(_Answering): + def __init__(self) -> None: + self.asked = 0 + + def can_handle(self, tools: Sequence[Mapping[str, object]] | None, custom_llm_provider: str | None) -> bool: + self.asked += 1 + return super().can_handle(tools, custom_llm_provider) + + +async def _interceptor_asks(server: RecordingServer, hooked: bool, native: bool) -> tuple[int, tuple[object, ...]]: + counting: Final = _CountingAnswering() + acall: Final = _PUBLIC_AMESSAGES if native else _PYTHON_AMESSAGES + kwargs: Final[dict[str, object]] = { + "model": SONNET, + "max_tokens": 64, + "messages": [dict(USER)], + "api_key": API_KEY, + "api_base": server.base_url, + "tools": [dict(WEATHER_TOOL)] if hooked else [dict(INTERCEPTED_TOOL), dict(WEATHER_TOOL)], + } + answers: Final[list[object]] = [] + with ( + isolated_callback_registries(), + _environment({}), + _cache(Cache), + _interceptor(lambda: counting), + ): + if hooked: + litellm.callbacks.append(_InterceptedToolHook()) + for _ in range(2): + answers.append(_response(await acall(**copy.deepcopy(kwargs)), private_keys=False)) + await drain_logging() + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + return counting.asked, tuple(answers) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("hooked", (False, True), ids=("plain", "pre_request_hooked")) +async def test_both_lanes_ask_the_interceptor_only_on_a_cache_miss( + hooked: bool, parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python: Final = await _interceptor_asks(parity_server, hooked, native=False) + native: Final = await _interceptor_asks(parity_server, hooked, native=True) + + assert native_messages.calls == 0 + assert not parity_server.requests + assert native == python + assert python[0] == 1 + + +class _ServiceRecorder: + def __init__(self) -> None: + self.events: list[Mapping[str, object]] = [] # mutable-ok: appended per service hook + + async def async_service_success_hook(self, **kwargs: object) -> None: # kwargs-ok: the service hook's keyword call + self.events.append( + { + "service": kwargs.get("service"), + "call_type": kwargs.get("call_type"), + "timed": isinstance(kwargs.get("duration"), float), + "parent_otel_span": kwargs.get("parent_otel_span"), + } + ) + + +async def _llm_api_timings(server: RecordingServer, stream: bool, native: bool) -> tuple[Mapping[str, object], ...]: + recorder: Final = _ServiceRecorder() + server.enqueue(_stream(TEXT_STREAM) if stream else _ok()) + acall: Final = _PUBLIC_AMESSAGES if native else _PYTHON_AMESSAGES + with isolated_callback_registries(), _environment({}), rebound(logging_utils, "_service_logger", recorder): + result: Final = await acall( + model=SONNET, + max_tokens=64, + messages=[dict(USER)], + api_key=API_KEY, + api_base=server.base_url, + stream=stream, + ) + if not isinstance(result, dict): + await _consume_async(cast(AsyncIterator[object], result)) + await drain_logging() + await asyncio.sleep(0) + server.responses.clear() + return tuple(recorder.events) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("stream", (False, True), ids=("json", "streamed")) +async def test_both_lanes_time_the_provider_exchange_as_one_llm_service_event( + stream: bool, parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python: Final = await _llm_api_timings(parity_server, stream, native=False) + native: Final = await _llm_api_timings(parity_server, stream, native=True) + + assert native_messages.calls == 0 + assert native == python + assert [event["call_type"] for event in python] == ["post <- track_llm_api_timing"] + + +class _AttemptRecorder(CustomLogger): + def __init__(self) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # CustomLogger takes untyped kwargs + self.seen: list[Mapping[str, object]] = [] + + async def async_log_success_event( + self, kwargs: dict[str, object], response_obj: object, start_time: object, end_time: object + ) -> None: # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + logged: Final = _LOGGED.validate_python(kwargs.get("standard_logging_object") or {}) + self.seen.append( + { + "event": "success", + "model_id": logged.get("model_id"), + "completion_tokens": logged.get("completion_tokens"), + } + ) + + async def async_log_failure_event( + self, kwargs: dict[str, object], response_obj: object, start_time: object, end_time: object + ) -> None: # pyright: ignore[reportIncompatibleMethodOverride] # test double narrows the hook's types + logged: Final = _LOGGED.validate_python(kwargs.get("standard_logging_object") or {}) + self.seen.append( + { + "event": "failure", + "model_id": logged.get("model_id"), + "exception": type(kwargs.get("exception")).__name__, + } + ) + + +async def _stream_fallback_attempts( + server: RecordingServer, native: bool +) -> tuple[tuple[Mapping[str, object], ...], str]: + overloaded: Final = _events( + _message_start("msg_01ParityOverloaded"), ("error", dict(_upstream_error("overloaded_error", "Overloaded"))) + ) + server.enqueue(_stream(overloaded)) + server.enqueue(_stream(TEXT_STREAM)) + recorder: Final = _AttemptRecorder() + deployment: Final[Mapping[str, object]] = {"model": SONNET, "api_base": server.base_url, "api_key": API_KEY} + with contextlib.ExitStack() as stack: + stack.enter_context(isolated_callback_registries()) + stack.enter_context(_environment({})) + if not native: + stack.enter_context(rebound(litellm, "anthropic_messages", _PYTHON_AMESSAGES)) + litellm.callbacks.append(recorder) + router: Final = litellm.Router( + model_list=[ + {"model_name": "primary", "litellm_params": dict(deployment), "model_info": {"id": "dep-primary"}}, + {"model_name": "fallback", "litellm_params": dict(deployment), "model_info": {"id": "dep-fallback"}}, + ], + fallbacks=[{"primary": ["fallback"]}], + num_retries=0, + ) + result: Final = await router.aanthropic_messages( + model="primary", max_tokens=64, messages=[dict(USER)], stream=True + ) + chunks, failure = await _consume_async(cast(AsyncIterator[object], result)) + assert failure is None + for _ in range(100): + await drain_logging() + if len(recorder.seen) >= 2: + break + await asyncio.sleep(0.05) + server.responses.clear() + return tuple(recorder.seen), _stream_text(chunks) + + +@pytest.mark.asyncio +async def test_both_lanes_log_a_stream_superseded_by_a_router_fallback_as_its_frame_s_failure( + parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python: Final = await _stream_fallback_attempts(parity_server, native=False) + native: Final = await _stream_fallback_attempts(parity_server, native=True) + + assert native_messages.calls == 0 + assert native == python + assert sorted(str(event["event"]) for event in python[0]) == ["failure", "success"] + + +async def _router_stream( + server: RecordingServer, native: bool, upstream: tuple[ResponseSpec, ...] +) -> tuple[tuple[str, ...], tuple[Mapping[str, object], ...]]: + for response in upstream: + server.enqueue(response) + recorder: Final = _AttemptRecorder() + deployment: Final[Mapping[str, object]] = {"model": SONNET, "api_base": server.base_url, "api_key": API_KEY} + with contextlib.ExitStack() as stack: + stack.enter_context(isolated_callback_registries()) + stack.enter_context(_environment({})) + if not native: + stack.enter_context(rebound(litellm, "anthropic_messages", _PYTHON_AMESSAGES)) + litellm.callbacks.append(recorder) + router: Final = litellm.Router( + model_list=[ + {"model_name": "primary", "litellm_params": dict(deployment), "model_info": {"id": "dep-primary"}}, + {"model_name": "fallback", "litellm_params": dict(deployment), "model_info": {"id": "dep-fallback"}}, + ], + fallbacks=[{"primary": ["fallback"]}], + num_retries=0, + ) + result: Final = await router.aanthropic_messages( + model="primary", max_tokens=64, messages=[dict(USER)], stream=True + ) + chunks, failure = await _consume_async(cast(AsyncIterator[object], result)) + assert failure is None + for _ in range(100): + await drain_logging() + if recorder.seen: + break + await asyncio.sleep(0.05) + server.responses.clear() + return tuple(_stream_text((chunk,)) for chunk in chunks), tuple(recorder.seen) + + +OVERLOADED_AFTER_PINGS: Final = _events( + _message_start("msg_01ParityPingedOverloaded"), + *((_PING,) * 50), + ("error", dict(_upstream_error("overloaded_error", "Overloaded"))), +) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "upstream", + [ + pytest.param((_burst(PINGED_STREAM),), id="pings_after_message_start"), + pytest.param((_burst(HEAVILY_PINGED_STREAM),), id="a_thousand_pings_after_message_start"), + pytest.param((_burst(OVERLOADED_AFTER_PINGS), _burst(TEXT_STREAM)), id="pings_then_overloaded_then_fallback"), + ], +) +async def test_both_lanes_stream_a_router_burst_in_the_same_chunks( + parity_server: RecordingServer, native_messages: FallbackProbe, upstream: tuple[ResponseSpec, ...] +) -> None: + python: Final = await _router_stream(parity_server, native=False, upstream=upstream) + native: Final = await _router_stream(parity_server, native=True, upstream=upstream) + + assert native_messages.calls == 0 + assert native == python + + +async def _abandoned_stream( + server: RecordingServer, native: bool, upstream: ResponseSpec +) -> tuple[tuple[str, ...], tuple[Mapping[str, object], ...]]: + server.enqueue(upstream) + recorder: Final = _AttemptRecorder() + acall: Final = _PUBLIC_AMESSAGES if native else _PYTHON_AMESSAGES + with contextlib.ExitStack() as stack: + stack.enter_context(isolated_callback_registries()) + stack.enter_context(_environment({})) + litellm.callbacks.append(recorder) + stream: Final = cast( + AsyncGenerator[object], + await acall( + model=SONNET, + max_tokens=64, + messages=[dict(USER)], + api_key=API_KEY, + api_base=server.base_url, + stream=True, + ), + ) + first: Final = await anext(stream) + await stream.aclose() + for _ in range(100): + await drain_logging() + if recorder.seen: + break + await asyncio.sleep(0.05) + server.responses.clear() + return (_stream_text((first,)),), tuple(recorder.seen) + + +@pytest.mark.asyncio +async def test_both_lanes_bill_a_stream_abandoned_after_its_first_chunk_alike( + parity_server: RecordingServer, native_messages: FallbackProbe +) -> None: + python: Final = await _abandoned_stream(parity_server, native=False, upstream=_burst(TEXT_STREAM)) + native: Final = await _abandoned_stream(parity_server, native=True, upstream=_burst(TEXT_STREAM)) + + assert native_messages.calls == 0 + assert native == python diff --git a/tests/test_litellm_rust/cache/test_python_cache.py b/tests/test_litellm_rust/cache/test_python_cache.py index d88feec7d5e..4bf0b389356 100644 --- a/tests/test_litellm_rust/cache/test_python_cache.py +++ b/tests/test_litellm_rust/cache/test_python_cache.py @@ -6,6 +6,7 @@ from pydantic import TypeAdapter import litellm from litellm.caching.caching import Cache, CacheMode +from litellm.caching.in_memory_cache import InMemoryCache from litellm.caching.caching_handler import ( _PENDING_CACHE_WRITES, # pyright: ignore[reportPrivateUsage] # await the existing background cache writer before the next request ) @@ -33,6 +34,14 @@ from tests.test_litellm_rust.support.routing import native_route pytestmark = pytest.mark.requires_rust_extension +_STORED: Final = TypeAdapter(dict[str, object]) + + +def _entries(storage: InMemoryCache) -> dict[str, object]: + return _STORED.validate_python( + storage.cache_dict # pyright: ignore[reportUnknownMemberType] # InMemoryCache leaves its dict untyped + ) + @pytest.mark.asyncio @pytest.mark.parametrize( @@ -110,7 +119,9 @@ async def test_legacy_cache_controls_and_backend_credential_key_semantics(record recording_server.expected_requests = 3 litellm.cache = Cache() await invoke("messages", recording_server, {"cache": {"no-store": True}}) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) await invoke("messages", recording_server, {}) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) await invoke("messages", recording_server, {}) assert len(recording_server.requests) == 2 await invoke("messages", recording_server, {"cache": {"no-cache": True}}) @@ -137,9 +148,11 @@ async def test_legacy_messages_replays_a_completed_stream(recording_server: Reco assert cache_key(first_stream) is None first: Final = await collect(first_stream) await recorder.wait_for_async("async_log_success_event") + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) second_stream: Final = await litellm.anthropic_messages(**parameters) - assert isinstance(cache_key(second_stream), str) - assert cache_key(second_stream) == get_hidden_params_dict(second_stream)["cache_key"] + assert cache_key(second_stream) is None + assert get_hidden_params_dict(second_stream)["cache_hit"] is True + assert isinstance(get_hidden_params_dict(second_stream)["cache_key"], str) second: Final = await collect(second_stream) assert payload(first) == payload(second) assert first == b"".join(recording_server.default_response.payloads()) @@ -174,13 +187,18 @@ async def test_rust_messages_uses_a_legacy_cache_without_python_inference( "api_base": recording_server.base_url, } first: Final = await invoke("messages", recording_server, parameters) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) second: Final = await invoke("messages", recording_server, parameters) - assert cache_key(second) - assert cache_key(first) is None assert payload(first) == payload(second) assert len(recording_server.requests) == 1 + assert cache_key(first) is None + assert cache_key(second) is None - await logger.wait_for_async("async_log_success_event", count=2) + successes: Final = await logger.wait_for_async("async_log_success_event", count=2) + assert [TypeAdapter(dict[str, object]).validate_python(event.kwargs).get("cache_hit") for event in successes] == [ + None, + True, + ] assert logger.names.count("async_log_success_event") == 2 assert "log_failure_event" not in logger.names assert "async_log_failure_event" not in logger.names @@ -210,7 +228,9 @@ async def test_legacy_cache_default_off_requires_opt_in_even_for_existing_entrie @pytest.mark.asyncio -async def test_legacy_cache_lookup_uses_backend_request_callback_semantics(recording_server: RecordingServer) -> None: +async def test_a_legacy_cache_hit_skips_the_pre_call_callback_that_would_rewrite_the_request( + recording_server: RecordingServer, +) -> None: class Rewrite(RecordingLogger): temperature = 0.1 @@ -222,15 +242,16 @@ async def test_legacy_cache_lookup_uses_backend_request_callback_semantics(recor litellm.cache = Cache() recording_server.expected_requests = 1 await invoke("messages", recording_server, {"callbacks": [logger]}) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) first_hit: Final = await invoke("messages", recording_server, {"callbacks": [logger]}) logger.temperature = 0.8 await invoke("messages", recording_server, {"callbacks": [logger]}) second_hit: Final = await invoke("messages", recording_server, {"callbacks": [logger]}) - assert logger.names.count("log_pre_api_call") == 4 + assert logger.names.count("log_pre_api_call") == 1 + assert cache_key(first_hit) is None + assert cache_key(second_hit) is None assert len(recording_server.requests) == recording_server.expected_requests assert recording_server.requests[0].body["temperature"] == 0.1 - assert isinstance(cache_key(first_hit), str) - assert isinstance(cache_key(second_hit), str) @pytest.mark.asyncio @@ -258,7 +279,7 @@ async def test_rust_responses_rejects_a_configured_python_cache( @pytest.mark.asyncio @pytest.mark.parametrize("cancel_lookup", (False, True)) @pytest.mark.parametrize("stream", (False, True), ids=("response", "stream")) -async def test_python_cache_operations_stay_in_the_rust_callers_task_except_the_unary_store( +async def test_python_cache_lookups_stay_in_the_rust_callers_task_and_stores_run_detached( recording_server: RecordingServer, cancel_lookup: bool, stream: bool, @@ -287,11 +308,8 @@ async def test_python_cache_operations_stay_in_the_rust_callers_task_except_the_ async def async_set_cache(self, key: str, value: object, **kwargs: object) -> None: writer: Final = asyncio.current_task() - if stream: - assert writer is caller - else: - assert writer is not caller - assert writer in _PENDING_CACHE_WRITES + assert writer is not caller + assert writer in _PENDING_CACHE_WRITES await asyncio.sleep(0) storage.set_cache(key, value, **kwargs) @@ -314,7 +332,10 @@ async def test_python_cache_operations_stay_in_the_rust_callers_task_except_the_ second: Final = await invoke("messages", recording_server, {"stream": stream}) second_payload: Final = await collect(second) if stream else payload(second) assert first_payload == second_payload - assert cache_key(second) + assert cache_key(first) is None + assert cache_key(second) is None + if stream: + assert get_hidden_params_dict(second)["cache_key"] in _entries(storage) assert len(recording_server.requests) == 1 @@ -343,12 +364,12 @@ async def test_rust_unary_messages_store_keeps_the_hidden_params_stamped_after_t "model_id": "deployment", } assert get_hidden_params_dict(first)["additional_headers"] == { - "x-litellm-rust": "true", "x-litellm-model-group": "group", "x-litellm-attempted-retries": 0, } hit: Final = await invoke("messages", recording_server, {}) - assert get_hidden_params_dict(hit)["cache_key"] == cache_key(hit) + assert isinstance(get_hidden_params_dict(hit)["cache_key"], str) + assert cache_key(hit) is None assert len(recording_server.requests) == 1 @@ -389,6 +410,8 @@ async def test_messages_cache_stores_the_response_a_yielding_deployment_hook_ret async def test_rust_messages_legacy_cache_honors_request_namespaces( recording_server: RecordingServer, namespace_source: str ) -> None: + from litellm.caching.in_memory_cache import InMemoryCache + litellm.cache = Cache() recording_server.expected_requests = 2 first_options: Final = ( @@ -399,13 +422,20 @@ async def test_rust_messages_legacy_cache_honors_request_namespaces( if namespace_source == "cache" else {"metadata": {"redis_namespace": "second"}} ) + storage: Final = litellm.cache.cache + assert isinstance(storage, InMemoryCache) await invoke("messages", recording_server, first_options) - second: Final = await invoke("messages", recording_server, second_options) - first_hit: Final = await invoke("messages", recording_server, first_options) - second_hit: Final = await invoke("messages", recording_server, second_options) - assert cache_key(second) is None - assert cache_key(first_hit) is not None - assert cache_key(second_hit) is not None + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + first_keys: Final = set(_entries(storage)) + await invoke("messages", recording_server, second_options) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + second_keys: Final = set(_entries(storage)) - first_keys + assert len(recording_server.requests) == 2 + assert [key.split(":", 1)[0] for key in first_keys] == ["first"] + assert [key.split(":", 1)[0] for key in second_keys] == ["second"] + assert {key.split(":", 1)[1] for key in first_keys} == {key.split(":", 1)[1] for key in second_keys} + await invoke("messages", recording_server, first_options) + await invoke("messages", recording_server, second_options) assert len(recording_server.requests) == 2 @@ -420,9 +450,8 @@ async def test_rust_messages_legacy_semantic_cache_preserves_python_scope( first_options: Final = {"messages": [{"role": "user", "content": "hello"}]} second_options: Final = {"messages": [{"role": "user", "content": "hi"}]} first: Final = await invoke("messages", recording_server, first_options) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) second: Final = await invoke("messages", recording_server, second_options) - assert cache_key(first) is None - assert cache_key(second) is not None assert payload(first) == payload(second) assert len(recording_server.requests) == 1 @@ -443,3 +472,62 @@ async def test_legacy_cache_keeps_public_messages_responses_compatible( second_payload: Final = await collect(second) if stream else payload(second) assert second_payload == first_payload assert len(recording_server.requests) == 1 + + +_PER_CALL_HIDDEN_PARAMS: Final = frozenset( + {"_response_ms", "litellm_overhead_time_ms", "callback_duration_ms", "litellm_call_id"} +) + + +async def _write_then_read( + recording_server: RecordingServer, + monkeypatch: pytest.MonkeyPatch, + writer: bool, + reader: bool, + stream: bool, +) -> tuple[object, object, object, int]: + from litellm.caching.in_memory_cache import InMemoryCache + + storage: Final = InMemoryCache() + monkeypatch.setattr(litellm, "cache", Cache(_backend=storage)) + requests_before: Final = len(recording_server.requests) + monkeypatch.setenv("LITELLM_RUST", "1" if writer else "0") + first: Final = await invoke("messages", recording_server, {"stream": stream}, native=writer) + if stream: + await collect(first) + else: + add_retry_headers_to_response( + _add_headers_to_response(first, {"x-litellm-model-group": "group"}), attempted_retries=0 + ) + get_hidden_params_dict(first)["model_id"] = "deployment" + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + (entry,) = _entries(storage).values() + stored: Final = TypeAdapter(dict[str, object]).validate_python(entry)["response"] + monkeypatch.setenv("LITELLM_RUST", "1" if reader else "0") + hit: Final = await invoke("messages", recording_server, {"stream": stream}, native=reader) + hidden: Final = { + name: value for name, value in get_hidden_params_dict(hit).items() if name not in _PER_CALL_HIDDEN_PARAMS + } + headers: Final = TypeAdapter(dict[str, object]).validate_python(hidden.pop("additional_headers", {})) + kept: Final = { + name: value for name, value in headers.items() if name not in {"x-litellm-rust", "x-litellm-cache-key"} + } + served: Final = await collect(hit) if stream else payload(hit) + return stored, served, {**hidden, "additional_headers": kept}, len(recording_server.requests) - requests_before + + +@pytest.mark.asyncio +@pytest.mark.parametrize("stream", (False, True), ids=("response", "stream")) +@pytest.mark.parametrize(("writer", "reader"), ((True, False), (False, True)), ids=("rust_to_python", "python_to_rust")) +async def test_a_cache_entry_written_by_one_leg_is_stored_and_served_like_the_readers_own( + recording_server: RecordingServer, + monkeypatch: pytest.MonkeyPatch, + writer: bool, + reader: bool, + stream: bool, +) -> None: + recording_server.expected_requests = 2 + crossed: Final = await _write_then_read(recording_server, monkeypatch, writer, reader, stream) + own: Final = await _write_then_read(recording_server, monkeypatch, reader, reader, stream) + assert crossed == own + assert crossed[3] == 1 diff --git a/tests/test_litellm_rust/messages/data.py b/tests/test_litellm_rust/messages/data.py index 46127c9237a..d11c901d7d9 100644 --- a/tests/test_litellm_rust/messages/data.py +++ b/tests/test_litellm_rust/messages/data.py @@ -1,7 +1,6 @@ from typing import Final import litellm -from tests.test_litellm_rust.support.gaps import gap from tests.test_litellm_rust.support.recording_server import RecordingServer from tests.test_litellm_rust.support.routing import call_public @@ -57,6 +56,3 @@ async def call(server: RecordingServer, *, asynchronous: bool = True, **kwargs: asynchronous=asynchronous, **kwargs, ) - - -BODY_HOOKS: Final = gap("native Messages does not run the handler body hooks") diff --git a/tests/test_litellm_rust/messages/test_body_hooks.py b/tests/test_litellm_rust/messages/test_body_hooks.py index 59f27d5dc04..bf333a17725 100644 --- a/tests/test_litellm_rust/messages/test_body_hooks.py +++ b/tests/test_litellm_rust/messages/test_body_hooks.py @@ -1,16 +1,22 @@ +import asyncio from collections.abc import Iterator from datetime import datetime from typing import Final import pytest +from pydantic import TypeAdapter import litellm +from litellm.caching.caching import Cache +from litellm.caching.caching_handler import ( + _PENDING_CACHE_WRITES, # pyright: ignore[reportPrivateUsage] # the first call's entry must land before the second reads it +) from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger from litellm.litellm_core_utils.litellm_logging import Logging from litellm.llms.anthropic.messages.native import interceptors from litellm.llms.anthropic.messages.native.interceptors.base import MessagesInterceptor -from tests.test_litellm_rust.messages.data import BODY_HOOKS, MESSAGES_RESPONSE, REQUEST, call +from tests.test_litellm_rust.messages.data import MESSAGES_RESPONSE, REQUEST, call from tests.test_litellm_rust.support.callback_recorder import drain_logging from tests.test_litellm_rust.support.body_hooks import LegacyAgenticLoop, PlannedAgenticLoop, agentic_hooks from tests.test_litellm_rust.support.isolation import rebound @@ -20,6 +26,8 @@ from tests.test_litellm_rust.support.routing import CALL_ID, assert_served_nativ pytestmark = pytest.mark.requires_rust_extension +_SENT: Final = TypeAdapter(dict[str, object]) + @pytest.fixture def server(server: RecordingServer) -> Iterator[RecordingServer]: @@ -27,7 +35,6 @@ def server(server: RecordingServer) -> Iterator[RecordingServer]: @pytest.mark.asyncio -@BODY_HOOKS async def test_body_pre_request_hook_rewrites_the_provider_request(server: RecordingServer) -> None: class Rewrite(CustomLogger): async def async_pre_request_hook( @@ -44,7 +51,27 @@ async def test_body_pre_request_hook_rewrites_the_provider_request(server: Recor @pytest.mark.asyncio -@BODY_HOOKS +async def test_body_pre_request_hook_runs_only_after_a_response_cache_miss(server: RecordingServer) -> None: + seen: Final[list[object]] = [] + + class Rewrite(CustomLogger): + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object]: + seen.append(kwargs.get("stop_sequences")) + return {**kwargs, "stop_sequences": ["HOOKED"]} + + with rebound(litellm, "callbacks", [Rewrite()]), rebound(litellm, "cache", Cache()): + await call(server, stop_sequences=["CALLER"]) + await asyncio.gather(*tuple(_PENDING_CACHE_WRITES)) + await call(server, stop_sequences=["CALLER"]) + + assert seen == [None] + assert len(server.requests) == 1 + assert _SENT.validate_python(server.requests[0].body).get("stop_sequences") == ["HOOKED"] + + +@pytest.mark.asyncio async def test_body_websearch_short_circuit_answers_without_the_provider(server: RecordingServer) -> None: class ShortCircuit(WebSearchInterceptionLogger): async def try_short_circuit_search( @@ -65,7 +92,6 @@ async def test_body_websearch_short_circuit_answers_without_the_provider(server: @pytest.mark.asyncio -@BODY_HOOKS async def test_body_interceptor_replaces_the_provider_call(server: RecordingServer) -> None: class Replace(MessagesInterceptor): def can_handle(self, tools: list[dict[str, object]] | None, custom_llm_provider: str | None) -> bool: @@ -82,7 +108,6 @@ async def test_body_interceptor_replaces_the_provider_call(server: RecordingServ @pytest.mark.asyncio -@BODY_HOOKS async def test_body_planned_agentic_loop_sends_the_followup_and_replaces_the_response(server: RecordingServer) -> None: loop: Final = PlannedAgenticLoop() server.enqueue(ResponseSpec(body=MESSAGES_RESPONSE)) @@ -105,7 +130,6 @@ async def test_body_planned_agentic_loop_sends_the_followup_and_replaces_the_res @pytest.mark.asyncio -@BODY_HOOKS async def test_body_legacy_agentic_loop_replaces_the_response(server: RecordingServer) -> None: loop: Final = LegacyAgenticLoop() diff --git a/tests/test_litellm_rust/messages/test_dispatch.py b/tests/test_litellm_rust/messages/test_dispatch.py index b580eca2e42..e26aafa5e55 100644 --- a/tests/test_litellm_rust/messages/test_dispatch.py +++ b/tests/test_litellm_rust/messages/test_dispatch.py @@ -1,5 +1,5 @@ import inspect -from collections.abc import Awaitable, Callable, Mapping +from collections.abc import Awaitable, Callable, Iterator, Mapping, Sequence from typing import Final, cast # noqa: TID251 # narrows legacy callable signatures for inspect import httpx @@ -8,22 +8,29 @@ import pytest import litellm from litellm.caching.caching import Cache from litellm.constants import COMPLETION_HTTP_FALLBACK_SECONDS +from litellm.exceptions import UnsupportedParamsError from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger from litellm.llms.anthropic.messages.native import handler as python_messages +from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler +from litellm.llms.anthropic.messages.native import interceptors as messages_interceptors +from litellm.llms.anthropic.messages.native.interceptors import MessagesInterceptor from litellm.messages import dispatch from litellm.messages.dispatch import ( _ADISPATCH, # pyright: ignore[reportPrivateUsage] # tests configured dispatch _DISPATCH, # pyright: ignore[reportPrivateUsage] # tests configured dispatch ) from litellm.proxy import proxy_server +from litellm.rust_bridge import catalog from litellm.rust_bridge.bindings import NativeBinding -from litellm.rust_bridge.catalog import Feature, Route, RouteRule, Rules, Target +from litellm.rust_bridge.catalog import MESSAGES_PYTHON_FEATURES, RULES, Feature, Route, RouteRule, Rules, Target from litellm.rust_bridge.configuration import Rollout from litellm.rust_bridge.messages.entrypoints import NATIVE_AMESSAGES, NATIVE_MESSAGES, NativeAmessages, NativeMessages from litellm.rust_bridge.public_call import NativeCall from litellm.types.llms.anthropic import ANTHROPIC_ADVISOR_TOOL_TYPE from litellm.types.llms.anthropic_messages.anthropic_response import AnthropicMessagesResponse +from tests.test_litellm_rust.support.isolation import rebound +from tests.test_litellm_rust.support.routing import routed MESSAGES: Final = [{"role": "user", "content": "hi"}] PYTHON_RULES: Final[Rules] = () @@ -251,50 +258,6 @@ DANGEROUS_TOOL_USE: Final = [{"type": "dangerous_tool_use", "classifier_context" CLASSIFIER_SETTINGS: Final = {"safeguards_classifier_model": "gpt-oss-120b"} -@pytest.mark.parametrize( - ("model", "kwargs", "general_settings", "serves_python"), - ( - ("deepseek/deepseek-v4-flash", {"safeguards": DANGEROUS_TOOL_USE}, CLASSIFIER_SETTINGS, True), - ( - "deepseek-v4-flash", - {"safeguards": DANGEROUS_TOOL_USE, "custom_llm_provider": "deepseek"}, - CLASSIFIER_SETTINGS, - True, - ), - ("deepseek/deepseek-v4-flash", {"safeguards": DANGEROUS_TOOL_USE}, {}, False), - ("deepseek/deepseek-v4-flash", {}, CLASSIFIER_SETTINGS, False), - ("deepseek/deepseek-v4-flash", {"safeguards": [{"type": "other"}]}, CLASSIFIER_SETTINGS, False), - ("anthropic/claude-sonnet-4-5", {"safeguards": DANGEROUS_TOOL_USE}, CLASSIFIER_SETTINGS, False), - ), -) -def test_proxy_classified_safeguards_reach_the_feature_rule( - monkeypatch: pytest.MonkeyPatch, - model: str, - kwargs: Mapping[str, object], - general_settings: Mapping[str, object], - serves_python: bool, -) -> None: - monkeypatch.setattr(proxy_server, "general_settings", general_settings) - python_result: Final = response(model) - native_result: Final = response(model) - - def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: fallback - return python_result - - result: Final = _DISPATCH.run( - (16, MESSAGES, model), - kwargs, - python=python, - binding=messages_binding(lambda request: native_result), - native=lambda hook, request, call_args, call_kwargs: hook(request), - rules=( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.SAFEGUARDS_CLASSIFIER})), - RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), - ), - ) - assert result is (python_result if serves_python else native_result) - - @pytest.mark.parametrize( ("args", "kwargs"), ( @@ -460,92 +423,15 @@ class _Agentic(CustomLogger): return False, {} +class _ShortCircuit(WebSearchInterceptionLogger): + async def try_short_circuit_search(self, *args: object, **kwargs: object) -> dict[str, object] | None: # pyright: ignore[reportIncompatibleMethodOverride] # test double only needs the override + return None + + ADVISOR_TOOL: Final = {"type": ANTHROPIC_ADVISOR_TOOL_TYPE, "name": "advisor", "model": "claude-opus-5-5"} STRICT_TOOL: Final = {"name": "a", "input_schema": {"type": "object"}, "strict": True} -@pytest.mark.parametrize( - ("feature", "model", "kwargs", "settings"), - ( - (Feature.MOCK_RESPONSE, "anthropic/claude-sonnet-4-5", {"mock_response": "hi"}, {}), - ( - Feature.PROXY_MCP_TOOLS, - "anthropic/claude-sonnet-4-5", - {"tools": [{"type": "mcp", "server_label": "gateway", "server_url": "litellm_proxy"}]}, - {}, - ), - (Feature.CALLER_CLIENT, "anthropic/claude-sonnet-4-5", {"client": object()}, {}), - (Feature.AGENTIC_LOOP_HOOK, "anthropic/claude-sonnet-4-5", {}, {"callbacks": [_Agentic()]}), - (Feature.RESPONSE_CACHE, "anthropic/claude-sonnet-4-5", {}, {"cache": Cache()}), - (Feature.TLS_POLICY, "anthropic/claude-sonnet-4-5", {}, {"ssl_security_level": "DEFAULT@SECLEVEL=1"}), - (Feature.MODIFY_PARAMS, "anthropic/claude-sonnet-4-5", {}, {"modify_params": True}), - ( - Feature.WORKLOAD_IDENTITY, - "anthropic/claude-sonnet-4-5", - {"anthropic_federation_rule_id": "rule-1", "anthropic_organization_id": "org-1"}, - {}, - ), - (Feature.CACHE_CONTROL_INJECTION, "anthropic/claude-sonnet-4-5", {"enable_prompt_caching": True}, {}), - ( - Feature.THINKING_SIGNATURE_RETRY, - "anthropic/claude-sonnet-4-5", - {"messages": [{"role": "assistant", "content": [{"type": "redacted_thinking", "data": "x"}]}]}, - {}, - ), - ( - Feature.TOOL_CUSTOM_FIELD, - "anthropic/claude-sonnet-4-5", - {"tools": [{"name": "a", "input_schema": {"type": "object"}, "custom": {"eager_input_streaming": True}}]}, - {}, - ), - ( - Feature.STREAM_COST_INJECTION, - "anthropic/claude-sonnet-4-5", - {"stream": True}, - {"include_cost_in_streaming_usage": True}, - ), - ), -) -def test_each_detected_feature_reaches_its_rule( - monkeypatch: pytest.MonkeyPatch, - feature: Feature, - model: str, - kwargs: Mapping[str, object], - settings: Mapping[str, object], -) -> None: - rules: Final[Rules] = ( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({feature})), - RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), - ) - python_result: Final = response(model) - native_result: Final = response(model) - - def served(call_kwargs: Mapping[str, object]) -> AnthropicMessagesResponse: - messages: Final = call_kwargs.get("messages", MESSAGES) - return _DISPATCH.run( - (16, messages, model), - {name: value for name, value in call_kwargs.items() if name != "messages"}, - python=lambda *call_args, **python_kwargs: python_result, - binding=messages_binding(lambda request: native_result), - native=lambda hook, request, call_args, native_kwargs: hook(request), - rules=rules, - ) - - monkeypatch.setattr(litellm, "callbacks", []) - monkeypatch.setattr(litellm, "cache", None) - monkeypatch.setattr(litellm, "ssl_security_level", None) - for setting in ("modify_params", "enable_anthropic_prompt_caching", "include_cost_in_streaming_usage"): - monkeypatch.setattr(litellm, setting, False) - for name in ("SSL_SECURITY_LEVEL", "SSL_ECDH_CURVE", "ANTHROPIC_FEDERATION_RULE_ID", "ANTHROPIC_ORGANIZATION_ID"): - monkeypatch.delenv(name, raising=False) - monkeypatch.setenv("ANTHROPIC_API_KEY", "") - monkeypatch.delenv("ANTHROPIC_AUTH_TOKEN", raising=False) - assert served({}) is native_result - for name, value in settings.items(): - monkeypatch.setattr(litellm, name, value) - assert served(kwargs) is python_result - - @pytest.mark.parametrize( "kwargs", ( @@ -580,27 +466,103 @@ def test_proxy_request_shape_stays_native(kwargs: Mapping[str, object]) -> None: @pytest.mark.asyncio @pytest.mark.parametrize( - "kwargs", + "block", ( - pytest.param({"tools": [STRICT_TOOL]}, id="drop-params-unset"), - pytest.param({"drop_params": False, "tools": [STRICT_TOOL]}, id="drop-params-off"), - pytest.param( - {"drop_params": True, "tools": [{"name": "a", "input_schema": {"type": "object"}}]}, id="no-strict" - ), + pytest.param({"type": "thinking", "thinking": "x", "signature": "s"}, id="thinking"), + pytest.param({"type": "redacted_thinking", "data": "x"}, id="redacted-thinking"), ), ) -async def test_strict_tools_stay_native_unless_python_could_drop_strict( +async def test_replayed_thinking_is_served_natively_under_the_shipped_rules( + monkeypatch: pytest.MonkeyPatch, block: Mapping[str, object] +) -> None: + monkeypatch.setenv("LITELLM_RUST", "1") + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(litellm, "cache", None) + replay: Final = [ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [block, {"type": "text", "text": "hello"}]}, + {"role": "user", "content": "again"}, + ] + native_result: Final = response() + python_result: Final = response() + + async def python(*call_args: object, **python_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + return python_result + + async def native(request: NativeCall) -> AnthropicMessagesResponse: + return native_result + + served: Final = await _ADISPATCH.arun( + (16, replay, "anthropic/claude-sonnet-4-5"), + {"api_key": "sk-ant-test"}, + python=python, + binding=amessages_binding(native), + native=lambda hook, request, call_args, native_kwargs: hook(request), + rules=RULES, + ) + + assert served is native_result + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("kwargs", "global_drop_params"), + ( + pytest.param({"drop_params": True, "tools": [STRICT_TOOL]}, False, id="drop-params-kwarg"), + pytest.param({"tools": [STRICT_TOOL]}, True, id="drop-params-global"), + pytest.param({"tools": [STRICT_TOOL]}, False, id="drop-params-unset"), + ), +) +async def test_strict_tools_are_served_natively_under_the_shipped_rules( + monkeypatch: pytest.MonkeyPatch, kwargs: Mapping[str, object], global_drop_params: bool +) -> None: + monkeypatch.setenv("LITELLM_RUST", "1") + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(litellm, "cache", None) + monkeypatch.setattr(litellm, "drop_params", global_drop_params) + native_result: Final = response() + + async def python(*call_args: object, **python_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + pytest.fail("strict tools stay on the native path") + + async def native(request: NativeCall) -> AnthropicMessagesResponse: + return native_result + + served: Final = await _ADISPATCH.arun( + (16, MESSAGES, "anthropic/claude-sonnet-4-5"), + kwargs, + python=python, + binding=amessages_binding(native), + native=lambda hook, request, call_args, native_kwargs: hook(request), + rules=RULES, + ) + + assert served is native_result + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "kwargs", + ( + pytest.param({}, id="reads-and-writes"), + pytest.param({"cache": {"no-store": True}}, id="no-store"), + pytest.param({"cache": {"ttl": 60, "namespace": "team"}}, id="ttl-and-namespace"), + pytest.param({"stream": True}, id="stream"), + ), +) +async def test_a_configured_response_cache_stays_native( monkeypatch: pytest.MonkeyPatch, kwargs: Mapping[str, object] ) -> None: rules: Final[Rules] = ( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.STRICT_TOOLS_RETRY})), + RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=MESSAGES_PYTHON_FEATURES), RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), ) native_result: Final = response() - monkeypatch.setattr(litellm, "drop_params", False) + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(litellm, "cache", Cache()) async def python(*call_args: object, **python_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub - pytest.fail("Python cannot drop strict here") + pytest.fail("Rust reads and writes the configured response cache") async def native(request: NativeCall) -> AnthropicMessagesResponse: return native_result @@ -617,45 +579,61 @@ async def test_strict_tools_stay_native_unless_python_could_drop_strict( assert served is native_result -ASYNC_ONLY_FEATURES: Final = ( - pytest.param(Feature.PRE_REQUEST_HOOK, {}, {"callbacks": [_Rewrite()]}, id="pre-request-hook"), - pytest.param( - Feature.FOUNDRY_BETA_ROW, - {"api_base": "https://team.services.ai.azure.com/anthropic"}, +@pytest.mark.asyncio +async def test_modify_params_stays_native(monkeypatch: pytest.MonkeyPatch) -> None: + rules: Final[Rules] = ( + RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=catalog.MESSAGES_PYTHON_FEATURES), + RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), + ) + native_result: Final = response() + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(litellm, "modify_params", True) + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("modify_params must not fall back to Python") + + async def apython(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + pytest.fail("modify_params must not fall back to Python") + + async def native(request: NativeCall) -> AnthropicMessagesResponse: + return native_result + + call_args: Final = (200_000, MESSAGES, "anthropic/claude-sonnet-4-5") + served: Final = _DISPATCH.run( + call_args, {}, - id="foundry-beta-row", - ), - pytest.param( - Feature.WEBSEARCH_INTERCEPTION, {}, {"callbacks": [WebSearchInterceptionLogger()]}, id="websearch-interception" - ), - pytest.param( - Feature.MESSAGES_INTERCEPTOR, - {"model": "deepseek/deepseek-v4-flash", "tools": [ADVISOR_TOOL]}, + python=python, + binding=messages_binding(lambda request: native_result), + native=lambda hook, request, args, kwargs: hook(request), + rules=rules, + ) + aserved: Final = await _ADISPATCH.arun( + call_args, {}, - id="messages-interceptor", - ), - pytest.param( - Feature.STRICT_TOOLS_RETRY, {"drop_params": True, "tools": [STRICT_TOOL]}, {}, id="strict-tools-retry" - ), - pytest.param( - Feature.STRICT_TOOLS_RETRY, {"tools": [STRICT_TOOL]}, {"drop_params": True}, id="strict-tools-retry-global" - ), -) + python=apython, + binding=amessages_binding(native), + native=lambda hook, request, args, kwargs: hook(request), + rules=rules, + ) + + assert (served, aserved) == (native_result, native_result) @pytest.mark.asyncio -@pytest.mark.parametrize(("feature", "kwargs", "settings"), ASYNC_ONLY_FEATURES) -async def test_handler_hooks_the_sync_entry_never_runs_keep_only_async_calls_on_python( - monkeypatch: pytest.MonkeyPatch, feature: Feature, kwargs: Mapping[str, object], settings: Mapping[str, object] -) -> None: +@pytest.mark.parametrize( + "kwargs", + ( + pytest.param({"mock_response": "hi"}, id="unary"), + pytest.param({"mock_response": "hi", "stream": True}, id="streamed"), + ), +) +async def test_mock_response_is_served_natively(monkeypatch: pytest.MonkeyPatch, kwargs: Mapping[str, object]) -> None: rules: Final[Rules] = ( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({feature})), + RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.MOCK_RESPONSE})), RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), ) python_result: Final = response() native_result: Final = response() - model: Final = str(kwargs.get("model", "anthropic/claude-sonnet-4-5")) - call_kwargs: Final = {name: value for name, value in kwargs.items() if name != "model"} async def python(*call_args: object, **python_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub return python_result @@ -664,48 +642,331 @@ async def test_handler_hooks_the_sync_entry_never_runs_keep_only_async_calls_on_ return native_result monkeypatch.setattr(litellm, "callbacks", []) - for name, value in settings.items(): - monkeypatch.setattr(litellm, name, value) served_async: Final = await _ADISPATCH.arun( - (16, MESSAGES, model), - call_kwargs, + (16, MESSAGES, "anthropic/claude-sonnet-4-5"), + kwargs, python=python, binding=amessages_binding(native), native=lambda hook, request, args, native_kwargs: hook(request), rules=rules, ) served_sync: Final = _DISPATCH.run( - (16, MESSAGES, model), - call_kwargs, + (16, MESSAGES, "anthropic/claude-sonnet-4-5"), + kwargs, python=lambda *call_args, **python_kwargs: python_result, binding=messages_binding(lambda request: native_result), native=lambda hook, request, args, native_kwargs: hook(request), rules=rules, ) - assert served_async is python_result + assert served_async is native_result assert served_sync is native_result +class _Claims(MessagesInterceptor): + def can_handle(self, tools: Sequence[Mapping[str, object]] | None, custom_llm_provider: str | None) -> bool: + return custom_llm_provider == "anthropic" + + async def handle(self, **kwargs: object) -> AnthropicMessagesResponse: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: test double only needs the override + return response() + + @pytest.mark.asyncio -async def test_interceptor_feature_follows_the_resolved_provider() -> None: +async def test_a_call_a_registered_interceptor_owns_runs_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str] +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(messages_interceptors, "_interceptors", [_Claims()]) + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("Rust hands the call to the interceptor itself") + + with rebound(dispatch, "_PYTHON_AMESSAGES", python): + result: Final = await _public(True, "anthropic/claude-sonnet-4-5", {"tools": [ADVISOR_TOOL]}) + + assert isinstance(result, dict) + assert shipped_native == ["async"] + + +def test_a_federated_request_stays_native(monkeypatch: pytest.MonkeyPatch) -> None: + for name in ("ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"): + monkeypatch.delenv(name, raising=False) rules: Final[Rules] = ( - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.MESSAGES_INTERCEPTOR})), + RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.WORKLOAD_IDENTITY})), RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED), ) native_result: Final = response() - async def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub - pytest.fail("anthropic serves the advisor tool itself") + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("Rust mints the federation token itself") - async def native(request: NativeCall) -> AnthropicMessagesResponse: - return native_result - - result: Final = await _ADISPATCH.arun( - (16, MESSAGES, "claude-sonnet-4-5"), - {"tools": [ADVISOR_TOOL], "custom_llm_provider": "anthropic"}, + served: Final = _DISPATCH.run( + (16, MESSAGES, "anthropic/claude-sonnet-4-5"), + {"anthropic_federation_rule_id": "rule-1", "anthropic_organization_id": "org-1"}, python=python, - binding=amessages_binding(native), - native=lambda hook, request, call_args, call_kwargs: hook(request), + binding=messages_binding(lambda request: native_result), + native=lambda hook, request, call_args, native_kwargs: hook(request), rules=rules, ) - assert result is native_result + assert served is native_result + + +def _shipped_native(calls: list[str]) -> None: # mutable-ok: records which native entry ran + def native(request: NativeCall) -> AnthropicMessagesResponse: + calls.append("sync") + return response() + + async def anative(request: NativeCall) -> AnthropicMessagesResponse: + calls.append("async") + return response() + + NATIVE_MESSAGES.override(native) + NATIVE_AMESSAGES.override(anative) + + +@pytest.fixture +def shipped_native() -> Iterator[list[str]]: + calls: Final[list[str]] = [] + _shipped_native(calls) + with routed(*RULES): + yield calls + NATIVE_MESSAGES.reset() + NATIVE_AMESSAGES.reset() + + +async def _public(asynchronous: bool, model: str, kwargs: Mapping[str, object]) -> object: + call: Final = {"max_tokens": 16, "messages": MESSAGES, "model": model, "api_key": "sk-test", **kwargs} + if asynchronous: + return await dispatch.anthropic_messages(**call) + return dispatch.anthropic_messages_handler(**call) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +async def test_anthropic_runs_on_rust_without_the_opt_in( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool +) -> None: + monkeypatch.setenv("LITELLM_RUST", "0") + monkeypatch.setattr(litellm, "callbacks", []) + + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", {}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +@pytest.mark.parametrize( + "model", ("anthropic/parity-tool-model", "anthropic/claude-sonnet-4-5"), ids=("non-claude", "claude") +) +async def test_proxy_classified_safeguards_run_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool, model: str +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + monkeypatch.setattr(proxy_server, "general_settings", CLASSIFIER_SETTINGS) + + result: Final = await _public(asynchronous, model, {"safeguards": DANGEROUS_TOOL_USE}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +@pytest.mark.parametrize( + "thread", + ( + pytest.param({"type": "create"}, id="create"), + pytest.param({"type": "continue", "previous_message_id": "msg_1"}, id="continue"), + ), +) +async def test_a_message_thread_runs_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool, thread: Mapping[str, str] +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", {"thread": dict(thread)}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +async def test_anthropic_runs_pre_request_hooks_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str] +) -> None: + monkeypatch.setattr(litellm, "callbacks", [_Rewrite()]) + + result: Final = await _public(True, "anthropic/claude-sonnet-4-5", {}) + + assert isinstance(result, dict) + assert shipped_native == ["async"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +async def test_anthropic_runs_a_web_search_short_circuit_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool +) -> None: + monkeypatch.setattr(litellm, "callbacks", [_ShortCircuit()]) + + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", {}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +@pytest.mark.parametrize( + ("kwargs", "settings"), + ( + pytest.param({"client": object()}, {}, id="caller-client"), + pytest.param({"client": AsyncHTTPHandler()}, {}, id="caller-async-handler"), + pytest.param({}, {"ssl_security_level": "DEFAULT@SECLEVEL=1"}, id="tls-security-level"), + pytest.param({}, {"ssl_ecdh_curve": "secp521r1"}, id="tls-ecdh-curve"), + ), +) +async def test_anthropic_serves_the_http_transport_features_on_rust( + monkeypatch: pytest.MonkeyPatch, + shipped_native: list[str], + asynchronous: bool, + kwargs: Mapping[str, object], + settings: Mapping[str, object], +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + for name in ("SSL_SECURITY_LEVEL", "SSL_ECDH_CURVE"): + monkeypatch.delenv(name, raising=False) + for name, value in settings.items(): + monkeypatch.setattr(litellm, name, value) + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("anthropic has no Python Messages path") + + with rebound(dispatch, "_PYTHON_MESSAGES", python), rebound(dispatch, "_PYTHON_AMESSAGES", python): + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", kwargs) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +@pytest.mark.parametrize( + "callbacks", + ( + pytest.param([_Agentic()], id="agentic-loop"), + pytest.param([WebSearchInterceptionLogger(enabled_providers=["anthropic"])], id="websearch-interception"), + ), +) +async def test_anthropic_serves_agentic_loop_callbacks_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool, callbacks: list[object] +) -> None: + monkeypatch.setattr(litellm, "callbacks", callbacks) + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("anthropic has no Python Messages path") + + with rebound(dispatch, "_PYTHON_MESSAGES", python), rebound(dispatch, "_PYTHON_AMESSAGES", python): + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", {}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +@pytest.mark.parametrize( + "server_url", + ( + pytest.param("litellm_proxy", id="whole-gateway"), + pytest.param("litellm_proxy/mcp/deepwiki", id="one-server"), + pytest.param("https://gateway.example/mcp/deepwiki", id="proxy-path"), + ), +) +async def test_anthropic_serves_gateway_mcp_tools_on_rust( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool, server_url: str +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + tools: Final = [{"type": "mcp", "server_label": "gateway", "server_url": server_url, "require_approval": "never"}] + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: rejected fallback + pytest.fail("anthropic has no Python Messages path") + + with rebound(dispatch, "_PYTHON_MESSAGES", python), rebound(dispatch, "_PYTHON_AMESSAGES", python): + result: Final = await _public(asynchronous, "anthropic/claude-sonnet-4-5", {"tools": tools}) + + assert isinstance(result, dict) + assert shipped_native == ["async" if asynchronous else "sync"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +async def test_other_providers_keep_python_for_the_same_features( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + python_result: Final = response("deepseek/deepseek-v4-flash") + + def python(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + return python_result + + async def apython(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + return python_result + + with rebound(dispatch, "_PYTHON_MESSAGES", python), rebound(dispatch, "_PYTHON_AMESSAGES", apython): + result: Final = await _public(asynchronous, "deepseek/deepseek-v4-flash", {"client": object()}) + + assert result is python_result + assert shipped_native == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("model", "refused"), + ( + pytest.param("anthropic/claude-sonnet-4-5", True, id="anthropic"), + pytest.param("deepseek/deepseek-v4-flash", False, id="deepseek"), + ), +) +async def test_a_failing_detector_refuses_only_the_rust_only_provider( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], model: str, refused: bool +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + python_result: Final = response(model) + + def failing(request: NativeCall) -> bool: + raise RuntimeError("detector failed") + + async def apython(*call_args: object, **call_kwargs: object) -> AnthropicMessagesResponse: # kwargs-ok: stub + return python_result + + with ( + rebound(dispatch, "_FEATURES", {Feature.MOCK_RESPONSE: failing}), + rebound(dispatch, "_PYTHON_AMESSAGES", apython), + ): + if not refused: + assert await _public(True, model, {}) is python_result + return + with pytest.raises(UnsupportedParamsError, match="does not support this call"): + await _public(True, model, {}) + assert shipped_native == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True), ids=("sync", "async")) +async def test_an_anthropic_call_its_signature_rejects_keeps_python_s_type_error( + monkeypatch: pytest.MonkeyPatch, shipped_native: list[str], asynchronous: bool +) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + call: Final = {"messages": MESSAGES, "model": "anthropic/claude-sonnet-4-5", "api_key": "sk-test"} + + async def attempt() -> object: + if asynchronous: + return await dispatch.anthropic_messages(**call) + return dispatch.anthropic_messages_handler(**call) + + with pytest.raises(TypeError, match="max_tokens"): + await attempt() + + assert shipped_native == [] diff --git a/tests/test_litellm_rust/messages/test_workload_identity.py b/tests/test_litellm_rust/messages/test_workload_identity.py new file mode 100644 index 00000000000..d2c1a85de91 --- /dev/null +++ b/tests/test_litellm_rust/messages/test_workload_identity.py @@ -0,0 +1,219 @@ +import re +from collections.abc import Iterator, Mapping +from typing import Final + +import pytest + +import litellm +from litellm.llms.base_llm.auth.token_exchange import default_token_exchange_engine +from tests.test_litellm_rust.messages.data import MESSAGES_EVENTS, MESSAGES_RESPONSE, call +from tests.test_litellm_rust.support.isolation import rebound +from tests.test_litellm_rust.support.recording_server import RecordingServer, ResponseSpec, relaxed +from tests.test_litellm_rust.support.routing import assert_served_natively + +pytestmark = pytest.mark.requires_rust_extension + +IDENTITY_TOKEN: Final = "eyJ.native-identity.jwt" +MINTED_TOKEN: Final = "sk-ant-oat01-native-minted" +FEDERATION_IDS: Final = {"anthropic_federation_rule_id": "fdrl_native", "anthropic_organization_id": "org-native"} +MINTED: Final = ResponseSpec(body={"access_token": MINTED_TOKEN, "token_type": "Bearer", "expires_in": 3600}) +EXCHANGE: Final = { + "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", + "federation_rule_id": "fdrl_native", + "organization_id": "org-native", + "assertion": IDENTITY_TOKEN, +} +FEDERATION_ENV_NAMES: Final = ( + "ANTHROPIC_API_KEY", + "ANTHROPIC_AUTH_TOKEN", + "ANTHROPIC_FEDERATION_RULE_ID", + "ANTHROPIC_ORGANIZATION_ID", + "ANTHROPIC_IDENTITY_TOKEN", + "ANTHROPIC_IDENTITY_TOKEN_FILE", + "ANTHROPIC_IDENTITY_SOURCE", + "LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS", +) + + +@pytest.fixture +def server(server: RecordingServer) -> Iterator[RecordingServer]: + yield from relaxed(server) + + +@pytest.fixture +def federation(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]: + for name in FEDERATION_ENV_NAMES: + monkeypatch.delenv(name, raising=False) + monkeypatch.setenv("ANTHROPIC_IDENTITY_TOKEN", IDENTITY_TOKEN) + monkeypatch.setenv("LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS", "127.0.0.1") + with ( + rebound(default_token_exchange_engine, "_entries", {}), + rebound(default_token_exchange_engine, "_shared_store", None), + ): + yield + + +def wire(server: RecordingServer) -> tuple[tuple[str, object, Mapping[str, str]], ...]: + return tuple((sent.path, sent.body, sent.headers) for sent in server.requests) + + +def assert_minted_bearer(headers: Mapping[str, str]) -> None: + assert headers.get("authorization") == f"Bearer {MINTED_TOKEN}" + assert "x-api-key" not in headers + assert "oauth-2025-04-20" in headers.get("anthropic-beta", "").split(",") + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("federation") +@pytest.mark.parametrize( + ("kwargs", "env", "exchange"), + ( + pytest.param(FEDERATION_IDS, {}, EXCHANGE, id="ids-from-params"), + pytest.param( + {}, + {"ANTHROPIC_FEDERATION_RULE_ID": "fdrl_env", "ANTHROPIC_ORGANIZATION_ID": "org-env"}, + {**EXCHANGE, "federation_rule_id": "fdrl_env", "organization_id": "org-env"}, + id="ids-from-environment", + ), + pytest.param( + { + **FEDERATION_IDS, + "anthropic_federation_workspace_id": "wrkspc_native", + "anthropic_service_account_id": "svac_native", + }, + {}, + {**EXCHANGE, "workspace_id": "wrkspc_native", "service_account_id": "svac_native"}, + id="workspace-and-service-account", + ), + ), +) +async def test_workload_identity_mints_a_bearer_for_a_call_without_a_key( + server: RecordingServer, + monkeypatch: pytest.MonkeyPatch, + kwargs: Mapping[str, object], + env: Mapping[str, str], + exchange: Mapping[str, str], +) -> None: + for name, value in env.items(): + monkeypatch.setenv(name, value) + server.enqueue(MINTED) + + response: Final = await call(server, api_key=None, **kwargs) + + assert_served_natively(server, count=2) + (token_path, token_body, _), (messages_path, _, headers) = wire(server) + assert (token_path, token_body) == ("/v1/oauth/token", exchange) + assert messages_path == "/v1/messages" + assert_minted_bearer(headers) + assert isinstance(response, dict) + assert response["id"] == MESSAGES_RESPONSE["id"] + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("federation") +async def test_workload_identity_keeps_the_caller_betas_and_headers(server: RecordingServer) -> None: + server.enqueue(MINTED) + + await call( + server, + api_key=None, + extra_headers={"anthropic-beta": "files-api-2025-04-14", "x-trace-id": "trace-1"}, + **FEDERATION_IDS, + ) + + assert_served_natively(server, count=2) + _, (_, _, headers) = wire(server) + assert_minted_bearer(headers) + assert "files-api-2025-04-14" in headers["anthropic-beta"].split(",") + assert headers["x-trace-id"] == "trace-1" + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("federation") +async def test_workload_identity_streams_with_the_minted_bearer(server: RecordingServer) -> None: + server.enqueue(MINTED) + server.enqueue(ResponseSpec(body={}, events=MESSAGES_EVENTS)) + + stream: Final = await call(server, api_key=None, stream=True, **FEDERATION_IDS) + chunks: Final = [chunk async for chunk in stream] # pyright: ignore[reportGeneralTypeIssues] # the public call returns an async stream + + assert_served_natively(server, count=2) + _, (_, _, headers) = wire(server) + assert_minted_bearer(headers) + assert b"message_stop" in b"".join(chunk if isinstance(chunk, bytes) else str(chunk).encode() for chunk in chunks) + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("federation") +async def test_a_static_key_shadows_workload_identity(server: RecordingServer) -> None: + await call(server, api_key="sk-ant-static", **FEDERATION_IDS) + + assert_served_natively(server) + ((path, _, headers),) = wire(server) + assert path == "/v1/messages" + assert headers.get("x-api-key") == "sk-ant-static" + assert "authorization" not in headers + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("federation") +@pytest.mark.parametrize( + ("kwargs", "env", "upstream", "message", "sent"), + ( + pytest.param( + FEDERATION_IDS, + {}, + (ResponseSpec(body={"error": "authentication_error"}, status=401),), + "Anthropic workload identity federation failed. The token endpoint returned HTTP 401", + ("/v1/oauth/token",), + id="exchange-denied", + ), + pytest.param( + FEDERATION_IDS, + {"LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS": None}, + (), + "Anthropic workload identity federation refused to use host", + (), + id="untrusted-exchange-host", + ), + pytest.param( + {"anthropic_identity_token": "oidc/env/ANTHROPIC_IDENTITY_TOKEN"}, + {}, + (), + "anthropic_identity_token is set, but anthropic_federation_rule_id and anthropic_organization_id", + (), + id="identity-token-without-ids", + ), + pytest.param( + {**FEDERATION_IDS, "anthropic_disable_workload_identity_federation": True}, + {}, + (), + "Missing Anthropic API Key", + (), + id="federation-disabled", + ), + ), +) +async def test_workload_identity_failures_raise_before_the_messages_call( + server: RecordingServer, + monkeypatch: pytest.MonkeyPatch, + kwargs: Mapping[str, object], + env: Mapping[str, str | None], + upstream: tuple[ResponseSpec, ...], + message: str, + sent: tuple[str, ...], +) -> None: + for name, value in env.items(): + if value is None: + monkeypatch.delenv(name) + else: + monkeypatch.setenv(name, value) + for spec in upstream: + server.enqueue(spec) + + with pytest.raises(litellm.AuthenticationError, match=re.escape(message)) as raised: + await call(server, api_key=None, **kwargs) + + assert raised.value.llm_provider == "anthropic" + assert_served_natively(server, count=len(sent)) + assert tuple(path for path, _, _ in wire(server)) == sent diff --git a/tests/test_litellm_rust/support/recording_server.py b/tests/test_litellm_rust/support/recording_server.py index 5743658abdf..2b5e6fe93a6 100644 --- a/tests/test_litellm_rust/support/recording_server.py +++ b/tests/test_litellm_rust/support/recording_server.py @@ -1,5 +1,6 @@ import asyncio import copy +import gzip import json import threading import time @@ -29,13 +30,31 @@ class ResponseSpec: events: tuple[tuple[str, object], ...] = () # Splits a non-stream body into this many writes, `chunk_delay` apart, so it trickles in. body_chunks: int = 1 + cut_after: int | None = None + cut_delay: float = 0 + gzip: bool = False + # Writes every stream event in one write, so they reach the client in one read. + burst: bool = False + # Sends each stream event as its own HTTP/1.1 chunk instead of under a Content-Length. + chunked: bool = False def payloads(self) -> tuple[bytes, ...]: if not self.events: - body: Final = self.body if isinstance(self.body, bytes) else json.dumps(self.body).encode() + raw: Final = self.body if isinstance(self.body, bytes) else json.dumps(self.body).encode() + body: Final = gzip.compress(raw, mtime=0) if self.gzip else raw size: Final = max(-(-len(body) // max(self.body_chunks, 1)), 1) return tuple(body[start : start + size] for start in range(0, len(body), size)) or (body,) - return tuple(f"event: {event}\ndata: {json.dumps(data)}\n\n".encode() for event, data in self.events) + frames: Final = tuple(f"event: {event}\ndata: {json.dumps(data)}\n\n".encode() for event, data in self.events) + if self.gzip: + return (gzip.compress(b"".join(frames), mtime=0),) + return (b"".join(frames),) if self.burst and not self.chunked else frames + + def writes(self) -> tuple[bytes, ...]: + payloads: Final = self.payloads() + if not self.chunked: + return payloads + chunks: Final = (*(b"%x\r\n%s\r\n" % (len(payload), payload) for payload in payloads), b"0\r\n\r\n") + return (b"".join(chunks),) if self.burst else chunks @dataclass @@ -84,15 +103,28 @@ def recording_service() -> Iterator[RecordingServer]: response: Final = responses.pop(0) if responses else copy.deepcopy(recording_server.default_response) if response.delay: time.sleep(response.delay) - payloads: Final = response.payloads() + payloads: Final = response.writes() + if response.chunked: + self.protocol_version = "HTTP/1.1" + self.close_connection = True self.send_response(response.status) self.send_header("Content-Type", "text/event-stream" if response.events else "application/json") - self.send_header("Content-Length", str(sum(len(payload) for payload in payloads))) + if response.chunked: + self.send_header("Transfer-Encoding", "chunked") + self.send_header("Connection", "close") + else: + self.send_header("Content-Length", str(sum(len(payload) for payload in payloads))) + if response.gzip: + self.send_header("Content-Encoding", "gzip") for name, value in response.headers.items(): self.send_header(name, value) self.end_headers() try: for index, payload in enumerate(payloads): + if index == response.cut_after: + time.sleep(response.cut_delay) + self.close_connection = True + break if index and response.chunk_delay: time.sleep(response.chunk_delay) self.wfile.write(payload) diff --git a/tests/test_litellm_rust/support/served.py b/tests/test_litellm_rust/support/served.py index 0890077f745..5dfaa2cfaeb 100644 --- a/tests/test_litellm_rust/support/served.py +++ b/tests/test_litellm_rust/support/served.py @@ -6,11 +6,13 @@ from tests.test_litellm_rust.support.recording_server import RecordingServer def assert_served_natively(server: RecordingServer, *responses: object, count: int = 1) -> None: assert len(server.requests) == (len(responses) or count) - if not responses: - assert not any( - request.headers.get("user-agent", "").startswith("python-httpx") for request in server.requests - ) + marked: Final = tuple(response for response in responses if not isinstance(response, dict)) + if not marked: + assert not any(request.headers.get("user-agent", "").startswith("python-httpx") for request in server.requests) for response in responses: + if all(response is not other for other in marked): + assert "x-litellm-rust" not in str(get_hidden_params_dict(response)) + for response in marked: additional_headers: Final = get_hidden_params_dict(response).get("additional_headers") assert isinstance(additional_headers, dict) assert additional_headers.get("x-litellm-rust") == "true" diff --git a/tests/test_litellm_rust/test_dispatch.py b/tests/test_litellm_rust/test_dispatch.py index 193866409a2..10cc05e0801 100644 --- a/tests/test_litellm_rust/test_dispatch.py +++ b/tests/test_litellm_rust/test_dispatch.py @@ -189,7 +189,7 @@ def test_rules_for_other_routes_and_constrained_python_rules_skip_projection() - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, providers=frozenset({"other"})), RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, models=frozenset({"other"})), RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, targets=frozenset({Target.CHAT_COMPLETIONS})), - RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.SAFEGUARDS_CLASSIFIER})), + RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=frozenset({Feature.STREAMING})), ), ids=("providers", "models", "targets", "features"), ) diff --git a/tests/unit/cookbook/__init__.py b/tests/unit/cookbook/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/unit/cookbook/test_gpt_realtime_translate.py b/tests/unit/cookbook/test_gpt_realtime_translate.py deleted file mode 100644 index a40a3265600..00000000000 --- a/tests/unit/cookbook/test_gpt_realtime_translate.py +++ /dev/null @@ -1,141 +0,0 @@ -import asyncio -import base64 -import json -import wave -from pathlib import Path -from types import SimpleNamespace -from typing import Final, cast - -import pytest -from websockets.asyncio.client import ClientConnection - -from cookbook import gpt_realtime_translate as translate - - -@pytest.mark.asyncio -async def test_short_upload_waits_for_first_translated_audio(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: - monkeypatch.setattr(translate, "RESPONSE_TIMEOUT_SECONDS", 0.1) - audio: Final = bytes(480) - events: Final = iter( - ( - {"type": "session.output_audio.delta", "delta": base64.b64encode(audio).decode()}, - {"type": "error", "error": {"message": "session closed"}}, - ) - ) - - async def recv() -> str: - event: Final = next(events) - if event["type"] == "session.output_audio.delta": - await asyncio.sleep(0.03) - return json.dumps(event) - - sender_finished: Final = asyncio.Event() - sender_finished.set() - output: Final = tmp_path / "translation.wav" - - result: Final = await translate.receive_translation( - cast(ClientConnection, SimpleNamespace(recv=recv)), output, sender_finished - ) - - assert result == 'Realtime API error: {"message": "session closed"}' - with wave.open(str(output), "rb") as rendered: - assert rendered.readframes(240) == audio - - -@pytest.mark.asyncio -async def test_long_upload_keeps_waiting_for_first_translated_audio_while_still_sending( - monkeypatch: pytest.MonkeyPatch, tmp_path: Path -) -> None: - monkeypatch.setattr(translate, "RESPONSE_TIMEOUT_SECONDS", 0.05) - audio: Final = bytes(480) - pending: Final[asyncio.Queue[str]] = asyncio.Queue() - sender_finished: Final = asyncio.Event() - - async def speak_after_a_long_pause() -> None: - await asyncio.sleep(0.2) - await pending.put(json.dumps({"type": "session.output_audio.delta", "delta": base64.b64encode(audio).decode()})) - await asyncio.sleep(0.02) - sender_finished.set() - await pending.put(json.dumps({"type": "session.closed"})) - - output: Final = tmp_path / "translation.wav" - speaker: Final = asyncio.create_task(speak_after_a_long_pause()) - - result: Final = await translate.receive_translation( - cast(ClientConnection, SimpleNamespace(recv=pending.get)), output, sender_finished - ) - await speaker - - assert result is None - with wave.open(str(output), "rb") as rendered: - assert rendered.readframes(240) == audio - - -@pytest.mark.asyncio -async def test_a_quiet_gap_after_the_sender_stops_keeps_the_rest_of_the_translation( - monkeypatch: pytest.MonkeyPatch, tmp_path: Path -) -> None: - monkeypatch.setattr(translate, "RESPONSE_TIMEOUT_SECONDS", 1.0) - first: Final = bytes(480) - second: Final = bytes(range(240)) * 2 - events: Final = iter( - ( - {"type": "session.output_audio.delta", "delta": base64.b64encode(first).decode()}, - {"type": "session.output_audio.delta", "delta": base64.b64encode(second).decode()}, - {"type": "session.closed"}, - ) - ) - - async def recv() -> str: - event: Final = next(events) - if event.get("delta") == base64.b64encode(second).decode(): - await asyncio.sleep(0.3) - return json.dumps(event) - - sender_finished: Final = asyncio.Event() - sender_finished.set() - output: Final = tmp_path / "translation.wav" - - result: Final = await translate.receive_translation( - cast(ClientConnection, SimpleNamespace(recv=recv)), output, sender_finished - ) - - assert result is None - with wave.open(str(output), "rb") as rendered: - assert rendered.readframes(480) == first + second - - -@pytest.mark.asyncio -async def test_a_stream_that_never_closes_the_session_reports_an_error( - monkeypatch: pytest.MonkeyPatch, tmp_path: Path -) -> None: - monkeypatch.setattr(translate, "RESPONSE_TIMEOUT_SECONDS", 0.05) - audio: Final = bytes(480) - pending: Final[asyncio.Queue[str]] = asyncio.Queue() - await pending.put(json.dumps({"type": "session.output_audio.delta", "delta": base64.b64encode(audio).decode()})) - sender_finished: Final = asyncio.Event() - sender_finished.set() - - result: Final = await translate.receive_translation( - cast(ClientConnection, SimpleNamespace(recv=pending.get)), tmp_path / "translation.wav", sender_finished - ) - - assert result == "The translation stream went quiet for 0.05 s without closing the session" - - -@pytest.mark.asyncio -async def test_the_sender_closes_the_session_after_the_last_audio_chunk() -> None: - sent: Final[asyncio.Queue[str]] = asyncio.Queue() - finished: Final = asyncio.Event() - pcm: Final = bytes(translate.CHUNK_BYTES + 2) - - await translate.send_audio(cast(ClientConnection, SimpleNamespace(send=sent.put)), pcm, 0.0, finished) - - messages: Final = tuple(json.loads(sent.get_nowait()) for _ in range(sent.qsize())) - assert [message["type"] for message in messages] == [ - "session.input_audio_buffer.append", - "session.input_audio_buffer.append", - "session.close", - ] - assert b"".join(base64.b64decode(message["audio"]) for message in messages[:-1]) == pcm - assert finished.is_set() diff --git a/tests/unit/integrations/test_prometheus_metric_name_consistency.py b/tests/unit/integrations/test_prometheus_metric_name_consistency.py index 2c1def4c613..0303d7cde1c 100644 --- a/tests/unit/integrations/test_prometheus_metric_name_consistency.py +++ b/tests/unit/integrations/test_prometheus_metric_name_consistency.py @@ -28,7 +28,7 @@ from litellm.proxy.middleware.admission_control_middleware import create_prometh from litellm.proxy.middleware.in_flight_requests_middleware import InFlightRequestsMiddleware from litellm.tracing.exporter import lens_export_counters -_GRAFANA_DIR: Final = Path(__file__).parents[3] / "cookbook" / "litellm_proxy_server" / "grafana_dashboard" +_GRAFANA_DIR: Final = Path(__file__).parents[3] / "litellm" / "integrations" / "prometheus_helpers" / "grafana_dashboards" _ALL_METRICS_DASHBOARD: Final = _GRAFANA_DIR / "dashboard_all_metrics" / "grafana_dashboard.json" _LITELLM_DASHBOARDS: Final = (_ALL_METRICS_DASHBOARD, _GRAFANA_DIR / "dashboard_v2" / "grafana_dashboard.json") _METRIC_TOKEN_RE: Final = re.compile(r"\blitellm_[a-z0-9_]+") diff --git a/tests/unit/integrations/vector_store_integrations/test_vector_store_pre_call_hook.py b/tests/unit/integrations/vector_store_integrations/test_vector_store_pre_call_hook.py index 726ce2f7f1d..48d726aa4df 100644 --- a/tests/unit/integrations/vector_store_integrations/test_vector_store_pre_call_hook.py +++ b/tests/unit/integrations/vector_store_integrations/test_vector_store_pre_call_hook.py @@ -2,7 +2,7 @@ import logging from collections.abc import Callable, Iterable, Iterator, Mapping from dataclasses import dataclass, field from types import MappingProxyType -from typing import Literal, Protocol +from typing import Final, Literal, Protocol import pytest from fastapi import HTTPException @@ -157,6 +157,38 @@ async def _run_hook( ) +@pytest.mark.asyncio +@pytest.mark.parametrize("retrieval_query_param", ["retrievalQuery", "retrieval_query"]) +async def test_a_store_configured_with_a_raw_retrieval_query_still_runs_its_chat_search( + monkeypatch: pytest.MonkeyPatch, retrieval_query_param: str +) -> None: + monkeypatch.setattr( + litellm, + "vector_store_registry", + VectorStoreRegistry( + vector_stores=[ + LiteLLM_ManagedVectorStore( + vector_store_id="vs-raw", + custom_llm_provider="bedrock", + litellm_params={"aws_region_name": "us-west-2", retrieval_query_param: {"text": "from the store"}}, + ) + ], + ), + ) + router: Final = RecordingRouter() + + await _run_hook( + VectorStorePreCallHook(proxy_runtime=FakeProxyRuntime(router=router)), + ["vs-raw"], + FakeLoggingObj({}), + ) + + assert len(router.calls) == 1 + assert router.calls[0]["query"] == "what is litellm?" + assert router.calls[0]["aws_region_name"] == "us-west-2" + assert retrieval_query_param not in router.calls[0] + + @pytest.mark.asyncio async def test_hook_searches_through_the_injected_router_with_the_request_metadata( registry_with: RegisterStores, diff --git a/tests/unit/litellm_core_utils/test_core_helpers.py b/tests/unit/litellm_core_utils/test_core_helpers.py index 02476545cae..ef2048998b1 100644 --- a/tests/unit/litellm_core_utils/test_core_helpers.py +++ b/tests/unit/litellm_core_utils/test_core_helpers.py @@ -17,6 +17,7 @@ from litellm.litellm_core_utils.core_helpers import ( bind_budget_reservation_to_callbacks, budget_reservation_from_metadata, drop_params_env_flag, + env_flag, drop_params_flag, get_litellm_metadata_from_kwargs, get_or_create_metadata_bucket, @@ -497,6 +498,32 @@ def test_drop_params_env_flag_keeps_a_non_flag_value_on_with_a_warning(configure ) +@pytest.mark.parametrize( + ("configured", "expected"), + [("", False), ("false", False), ("False", False), ("0", False), ("no", False), ("true", True), (" 1 ", True)], +) +def test_env_flag_parses_modify_params_as_a_bool(configured: str, expected: bool, caplog: pytest.LogCaptureFixture): + with caplog.at_level(logging.WARNING, logger="env-flag-test"): + assert ( + env_flag({"LITELLM_MODIFY_PARAMS": configured}, "LITELLM_MODIFY_PARAMS", logging.getLogger("env-flag-test")) + is expected + ) + assert caplog.text == "" + + +def test_env_flag_treats_a_non_flag_value_as_on_with_a_warning(caplog: pytest.LogCaptureFixture): + with caplog.at_level(logging.WARNING, logger="env-flag-test"): + assert ( + env_flag({"LITELLM_MODIFY_PARAMS": "enabled"}, "LITELLM_MODIFY_PARAMS", logging.getLogger("env-flag-test")) + is True + ) + assert "LITELLM_MODIFY_PARAMS='enabled' is not a flag value, treating it as on" in caplog.text + + +def test_env_flag_is_off_when_unset(): + assert env_flag({}, "LITELLM_MODIFY_PARAMS", logging.getLogger("env-flag-test")) is False + + class TestIsExpectedClientError: def test_status_ranges(self): from litellm.litellm_core_utils.core_helpers import is_expected_client_error diff --git a/tests/unit/litellm_core_utils/test_litellm_logging.py b/tests/unit/litellm_core_utils/test_litellm_logging.py index c1d878d5b09..51fbcaa54bf 100644 --- a/tests/unit/litellm_core_utils/test_litellm_logging.py +++ b/tests/unit/litellm_core_utils/test_litellm_logging.py @@ -2376,6 +2376,7 @@ async def test_anthropic_messages_marks_litellm_params_async(): import litellm from litellm.integrations.custom_logger import CustomLogger + from litellm.llms.anthropic.messages.native import handler as python_messages captured = {} logged = asyncio.Event() @@ -2390,7 +2391,7 @@ async def test_anthropic_messages_marks_litellm_params_async(): original_callbacks = getattr(litellm, "callbacks", []) try: litellm.callbacks = [logger] - await litellm.anthropic_messages( + await python_messages.anthropic_messages( max_tokens=100, messages=[{"role": "user", "content": "Hey"}], model="anthropic/claude-sonnet-4-5", diff --git a/tests/unit/litellm_core_utils/test_redact_messages.py b/tests/unit/litellm_core_utils/test_redact_messages.py index 8e4bed02d7e..888eb9c9507 100644 --- a/tests/unit/litellm_core_utils/test_redact_messages.py +++ b/tests/unit/litellm_core_utils/test_redact_messages.py @@ -2011,6 +2011,69 @@ def test_request_body_redaction_replaces_instructions_only_when_sent() -> None: assert "instructions" not in chat_body +def _vector_store_search_details(query_image: Mapping[str, str]) -> dict[str, object]: + return { + "query_image": query_image, + "optional_params": {"query_image": query_image}, + "litellm_params": {"proxy_server_request": {"body": {"query_image": query_image}}}, + "standard_logging_object": {"model_parameters": {"query_image": query_image}, "messages": [], "response": {}}, + } + + +def test_redaction_removes_a_vector_store_query_image_from_every_logged_copy() -> None: + details: Final = _vector_store_search_details({"type": "base64", "media_type": "image/jpeg", "data": SECRET}) + + perform_redaction(details, result=None) + + assert details["query_image"] == REDACTED_BY_LITELLM + assert SECRET not in json.dumps(details, default=str) + + +def test_redaction_removes_a_query_image_sent_inside_extra_body() -> None: + image: Final = {"type": "base64", "media_type": "image/jpeg", "data": SECRET} + details: Final[dict[str, object]] = { + "optional_params": {"extra_body": {"query_image": image}}, + "litellm_params": {"proxy_server_request": {"body": {"extra_body": {"query_image": image}}}}, + } + + perform_redaction(details, result=None) + + assert SECRET not in json.dumps(details, default=str) + + +@pytest.mark.parametrize("retrieval_query_param", ["retrievalQuery", "retrieval_query"]) +def test_redaction_removes_a_raw_retrieval_query_sent_inside_extra_body(retrieval_query_param: str) -> None: + retrieval_query: Final = {"type": "IMAGE", "image": {"format": "jpeg", "inlineContent": SECRET}} + details: Final[dict[str, object]] = { + "litellm_params": {"proxy_server_request": {"body": {"extra_body": {retrieval_query_param: retrieval_query}}}}, + } + + perform_redaction(details, result=None) + + assert SECRET not in json.dumps(details, default=str) + + +def test_redaction_removes_the_image_from_the_provider_request_copy() -> None: + retrieval_query: Final = {"type": "IMAGE", "image": {"format": "jpeg", "inlineContent": SECRET}} + details: Final[dict[str, object]] = { + "additional_args": {"complete_input_dict": {"retrievalQuery": retrieval_query, "knowledgeBaseId": "kb"}}, + } + + perform_redaction(details, result=None) + + assert SECRET not in json.dumps(details, default=str) + assert details["additional_args"]["complete_input_dict"]["knowledgeBaseId"] == "kb" + + +def test_one_callback_opting_out_redacts_a_query_image_only_for_itself() -> None: + details: Final = _vector_store_search_details({"type": "base64", "media_type": "image/jpeg", "data": SECRET}) + + redacted: Final = redacted_model_call_details_for_custom_logger(details, TestCustomLogger(message_logging=False)) + + assert SECRET not in json.dumps(redacted, default=str) + assert SECRET in json.dumps(details, default=str) + + @pytest.mark.usefixtures("_vcr_outcome_gate", "drain_logging_worker", "isolate_litellm_state", "setup_and_teardown") @pytest.mark.asyncio async def test_redaction_responses_api_stream(): diff --git a/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py b/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py index 54f55aba46a..f434b1f4d9f 100644 --- a/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py +++ b/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py @@ -15,6 +15,7 @@ from httpx import Headers from pydantic import BaseModel, ConfigDict import litellm +from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.constants import ( ANTHROPIC_MIN_THINKING_BUDGET_TOKENS, DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET, @@ -4509,7 +4510,7 @@ async def test_native_compaction_wire_roundtrip( return httpx.Response(200, json=body) route.mock(side_effect=respond) - call: Final = litellm.anthropic.messages.acreate if messages_api else litellm.acompletion + call: Final = python_messages.anthropic_messages if messages_api else litellm.acompletion params: Final = dict( model=f"{'openai/' if gateway else ''}anthropic/claude-sonnet-5", api_key="test", diff --git a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_handler.py b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_handler.py index ff150af324d..54b76756975 100644 --- a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_handler.py +++ b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_handler.py @@ -20,6 +20,7 @@ from pydantic import TypeAdapter, ValidationError from unittest.mock import AsyncMock, MagicMock, patch import litellm +from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.anthropic_interface import messages from litellm.integrations.custom_logger import CustomLogger from litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKER @@ -1470,7 +1471,7 @@ async def test_native_messages_strips_replayed_provider_specific_fields_from_wir patch.object(httpx.AsyncClient, "send", fake_send), pytest.raises(litellm.exceptions.InternalServerError), ): - await litellm.anthropic.messages.acreate( + await python_messages.anthropic_messages( max_tokens=100, messages=messages, model="anthropic/claude-haiku-4-5-20251001", @@ -2451,7 +2452,7 @@ async def test_anthropic_messages_with_extra_headers(): mock_client.post = AsyncMock(return_value=mock_response) # Call the handler with extra_headers and our mocked client - response = await litellm.anthropic.messages.acreate( + response = await python_messages.anthropic_messages( messages=messages, api_key=api_key, model="claude-haiku-4-5-20251001", @@ -2515,7 +2516,7 @@ async def test_anthropic_messages_with_thinking(): mock_client.post = AsyncMock(return_value=mock_response) # Call the handler with extra_headers and our mocked client - response = await litellm.anthropic.messages.acreate( + response = await python_messages.anthropic_messages( messages=messages, api_key=api_key, model="claude-haiku-4-5-20251001", @@ -2785,7 +2786,7 @@ async def test_anthropic_messages_strict_tools_rejection_is_sent_again_without_s anthropic: Final = _RejectsStrictToolsOnce() tool: Final = {"name": "lookup_record", "input_schema": {"type": "object"}, "strict": True} - response: Final = await litellm.anthropic_messages( + response: Final = await python_messages.anthropic_messages( max_tokens=16, messages=[{"role": "user", "content": "Use lookup_record to find invoice 42"}], model="anthropic/claude-sonnet-4-6", diff --git a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_router.py b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_router.py index 1d0d70d8e60..a6aade2e3cf 100644 --- a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_router.py +++ b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_router.py @@ -18,6 +18,7 @@ import respx import litellm from litellm.integrations.custom_logger import CustomLogger +from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.router import Router from litellm.types.llms.anthropic import ( AnthropicMessagesTextParam, @@ -220,6 +221,11 @@ def _httpx_transport(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) +@pytest.fixture(autouse=True) +def _python_messages(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) + + @pytest.mark.asyncio async def test_router_aanthropic_messages_non_streaming_posts_anthropic_body(respx_mock): route: Final = respx_mock.post(url__regex=_ANTHROPIC_URL).mock( @@ -362,7 +368,7 @@ async def test_acreate_non_streaming_returns_dict_content_blocks( ): _set_fake_aws_env(monkeypatch) route: Final = respx_mock.post(url__regex=url).mock(return_value=httpx.Response(200, json=body)) - response: Final = await litellm.anthropic.messages.acreate( + response: Final = await python_messages.anthropic_messages( messages=[{"role": "user", "content": _PROMPT}], model=model, max_tokens=100, @@ -602,7 +608,7 @@ async def test_bedrock_converse_system_prompt_caching_returns_cache_tokens(respx }, ) ) - response: Final = await litellm.anthropic.messages.acreate( + response: Final = await python_messages.anthropic_messages( model=f"bedrock/converse/{_BEDROCK_SONNET}", messages=[{"role": "user", "content": "What are the key terms?"}], system=_cached_system(), @@ -632,7 +638,7 @@ async def test_bedrock_invoke_system_prompt_caching_returns_cache_tokens(respx_m }, ) ) - response: Final = await litellm.anthropic.messages.acreate( + response: Final = await python_messages.anthropic_messages( model=f"bedrock/invoke/{_BEDROCK_SONNET}", messages=[{"role": "user", "content": "What are the key terms?"}], system=_cached_system(), @@ -664,7 +670,7 @@ async def test_bedrock_streaming_message_start_carries_cache_usage_fields( route: Final = respx_mock.post(url__regex=url).mock( return_value=httpx.Response(200, content=body, headers={"content-type": "application/vnd.amazon.eventstream"}) ) - stream: Final = await litellm.anthropic.messages.acreate( + stream: Final = await python_messages.anthropic_messages( model=model, messages=[ { @@ -734,7 +740,7 @@ async def test_tool_search_forwards_deferred_tools_and_beta_header( }, ) ) - response: Final = await litellm.anthropic.messages.acreate( + response: Final = await python_messages.anthropic_messages( model="anthropic/claude-sonnet-4-5-20250929", messages=[{"role": "user", "content": prompt}], tools=[dict(tool) for tool in _tool_search_tools()], diff --git a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_transformation.py b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_transformation.py index 97d5b0550d4..d86c25c2558 100644 --- a/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_transformation.py +++ b/tests/unit/llms/anthropic/messages/native/test_anthropic_messages_transformation.py @@ -16,7 +16,6 @@ from litellm.litellm_core_utils.litellm_logging import Logging from litellm.llms.anthropic.messages.native.transformation import ( AnthropicMessagesConfig, ) -from litellm.llms.anthropic.wif import get_anthropic_wif_token from litellm.types.llms.anthropic_tool_search import get_tool_search_beta_header from litellm.llms.deepseek.messages.transformation import DeepSeekAnthropicMessagesConfig from litellm.llms.minimax.messages.transformation import MinimaxMessagesConfig @@ -27,12 +26,7 @@ from litellm.llms.vertex_ai.vertex_ai_partner_models.anthropic.experimental_pass ) from litellm.types.llms.anthropic import ANTHROPIC_BETA_HEADER_VALUES, AnthropicFinishReason from litellm.types.router import GenericLiteLLMParams -from tests.unit.llms.anthropic.test_anthropic_wif import ( - ScriptedPoster, - make_engine, - token_response, - write_token_file, -) +from tests.unit.llms.anthropic.test_anthropic_wif import write_token_file _WIF_PARAMS: Final[dict] = { "anthropic_federation_rule_id": "fdrl_abc123", @@ -165,18 +159,6 @@ def test_messages_request_never_defers_tools_off_claude( assert request["tools"] == [{"name": "A", "input_schema": _EMPTY_SCHEMA} if drop_params else wrapped_tool] -def test_workload_identity_allowed_for_anthropic() -> None: - assert AnthropicMessagesConfig()._allows_workload_identity is True - - -def test_workload_identity_blocked_for_minimax() -> None: - assert MinimaxMessagesConfig()._allows_workload_identity is False - - -def test_workload_identity_blocked_for_tencent() -> None: - assert TencentAnthropicMessagesConfig()._allows_workload_identity is False - - def test_minimax_validate_environment_never_attaches_anthropic_wif_credential( tmp_path: Path, monkeypatch: pytest.MonkeyPatch ) -> None: @@ -228,37 +210,6 @@ def test_tencent_validate_environment_never_attaches_anthropic_wif_credential( ) -def test_wif_token_exchange_reaches_only_anthropic_not_minimax_or_tencent( - tmp_path: Path, monkeypatch: pytest.MonkeyPatch -) -> None: - """get_anthropic_wif_token's engine parameter is the only DI seam in the WIF minting chain; - validate_anthropic_messages_environment always uses the module's default engine, so this - drives that seam directly with the exact litellm_params AnthropicModelInfo.get_auth_header - would receive from each config, proving MiniMax/Tencent never reach the token endpoint even - when a mint would otherwise succeed.""" - monkeypatch.setenv("ANTHROPIC_FEDERATION_RULE_ID", "fdrl_prod") - monkeypatch.setenv("ANTHROPIC_ORGANIZATION_ID", "org-prod-uuid") - monkeypatch.setenv("LITELLM_OIDC_ALLOWED_CREDENTIAL_DIRS", str(tmp_path)) - token_file = write_token_file(tmp_path, "jwt-assertion-value") - litellm_params = {"anthropic_identity_token_file": str(token_file)} - poster = ScriptedPoster([token_response("sk-ant-oat01-canary")]) - engine = make_engine(poster) - - minted: Final = get_anthropic_wif_token( - litellm_params, - "https://api.anthropic.com", - "claude-sonnet-4-5", - engine, - ) - assert minted == "sk-ant-oat01-canary" - assert len(poster.requests) == 1 - - for config in (MinimaxMessagesConfig(), TencentAnthropicMessagesConfig()): - assert config._allows_workload_identity is False - - assert len(poster.requests) == 1 - - DANGEROUS_TOOL_USE_BETA: Final = "dangerous-tool-use-2026-09-03" AUTO_MODE_SAFEGUARDS: Final = [ {"type": "dangerous_tool_use", "classifier_context": {"v": 1, "permission_mode": "auto"}} diff --git a/tests/unit/llms/anthropic/messages/native/test_response_cache.py b/tests/unit/llms/anthropic/messages/native/test_response_cache.py index ac104b55bde..bc26d5612df 100644 --- a/tests/unit/llms/anthropic/messages/native/test_response_cache.py +++ b/tests/unit/llms/anthropic/messages/native/test_response_cache.py @@ -99,9 +99,9 @@ async def test_non_streaming_request_is_served_from_cache(local_cache, request_k fake_handler = _CountingHandler([_anthropic_response("msg_1", "ALPHA"), _anthropic_response("msg_2", "BETA")]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - first = await litellm.anthropic_messages(**request_kwargs) + first = await handler.anthropic_messages(**request_kwargs) await asyncio.sleep(0) - second = await litellm.anthropic_messages(**request_kwargs) + second = await handler.anthropic_messages(**request_kwargs) assert len(fake_handler.calls) == 1 assert first == second @@ -115,9 +115,9 @@ async def test_cache_key_separates_different_system_prompts(local_cache, request fake_handler = _CountingHandler([_anthropic_response("msg_1", "ALPHA"), _anthropic_response("msg_2", "BETA")]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - first = await litellm.anthropic_messages(**request_kwargs, system="Always answer ALPHA") + first = await handler.anthropic_messages(**request_kwargs, system="Always answer ALPHA") await asyncio.sleep(0) - second = await litellm.anthropic_messages(**request_kwargs, system="Always answer BETA") + second = await handler.anthropic_messages(**request_kwargs, system="Always answer BETA") assert len(fake_handler.calls) == 2 assert first["content"][0]["text"] == "ALPHA" @@ -130,9 +130,9 @@ async def test_cache_key_separates_anthropic_native_params(local_cache, request_ fake_handler = _CountingHandler([_anthropic_response("msg_1", "ALPHA"), _anthropic_response("msg_2", "BETA")]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - await litellm.anthropic_messages(**request_kwargs) + await handler.anthropic_messages(**request_kwargs) await asyncio.sleep(0) - await litellm.anthropic_messages(**request_kwargs, **anthropic_param) + await handler.anthropic_messages(**request_kwargs, **anthropic_param) assert len(fake_handler.calls) == 2 @@ -181,9 +181,9 @@ async def test_streaming_request_is_replayed_from_cache(local_cache, request_kwa fake_handler = _CountingHandler([_byte_stream(events), _byte_stream([b"event: never_used\n\n"])]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - first = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + first = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) await asyncio.sleep(0) - second_stream = await litellm.anthropic_messages(**request_kwargs, stream=True) + second_stream = await handler.anthropic_messages(**request_kwargs, stream=True) second = await _collect(second_stream) assert len(fake_handler.calls) == 1 @@ -197,8 +197,8 @@ async def test_streaming_cache_is_not_shared_with_non_streaming(local_cache, req fake_handler = _CountingHandler([_byte_stream(STREAM_EVENTS), _anthropic_response("msg_2", "ALPHA")]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) - non_streaming = await litellm.anthropic_messages(**request_kwargs) + await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) + non_streaming = await handler.anthropic_messages(**request_kwargs) assert len(fake_handler.calls) == 2 assert non_streaming["content"][0]["text"] == "ALPHA" @@ -219,11 +219,11 @@ async def test_stream_without_output_is_not_cached(local_cache, request_kwargs, ) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - empty = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + empty = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) await asyncio.sleep(0) - refilled = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + refilled = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) await asyncio.sleep(0) - replayed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + replayed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert empty == empty_events assert refilled == STREAM_EVENTS @@ -239,8 +239,8 @@ async def test_failed_stream_is_not_cached(local_cache, request_kwargs, monkeypa fake_handler = _CountingHandler([_byte_stream(error_events), _byte_stream(STREAM_EVENTS)]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - failed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) - replayed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + failed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) + replayed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert failed == error_events assert len(fake_handler.calls) == 2 @@ -260,9 +260,9 @@ async def test_multibyte_utf8_split_across_chunks_streams_and_caches(local_cache fake_handler = _CountingHandler([_byte_stream(chunks), _byte_stream([b"event: never_used\n\n"])]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - first = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + first = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) await asyncio.sleep(0) - second = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + second = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert len(fake_handler.calls) == 1 assert first == chunks @@ -278,9 +278,9 @@ async def test_message_stop_split_across_chunks_still_caches(local_cache, reques fake_handler = _CountingHandler([_byte_stream(chunks), _byte_stream([b"event: never_used\n\n"])]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - first = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + first = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) await asyncio.sleep(0) - second = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + second = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert len(fake_handler.calls) == 1 assert first == chunks @@ -296,8 +296,8 @@ async def test_error_event_split_across_chunks_is_not_cached(local_cache, reques fake_handler = _CountingHandler([_byte_stream(chunks), _byte_stream(STREAM_EVENTS)]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - failed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) - replayed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + failed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) + replayed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert failed == chunks assert len(fake_handler.calls) == 2 @@ -309,11 +309,11 @@ async def test_abandoned_stream_is_not_cached(local_cache, request_kwargs, monke fake_handler = _CountingHandler([_byte_stream(STREAM_EVENTS), _byte_stream(STREAM_EVENTS)]) monkeypatch.setattr(handler, "anthropic_messages_handler", fake_handler) - partial_stream = await litellm.anthropic_messages(**request_kwargs, stream=True) + partial_stream = await handler.anthropic_messages(**request_kwargs, stream=True) await partial_stream.__anext__() await partial_stream.aclose() - replayed = await _collect(await litellm.anthropic_messages(**request_kwargs, stream=True)) + replayed = await _collect(await handler.anthropic_messages(**request_kwargs, stream=True)) assert len(fake_handler.calls) == 2 assert replayed == STREAM_EVENTS @@ -488,7 +488,5 @@ def test_cache_writer_forwards_has_buffered_provider_output(request_kwargs): ) held_back = AnthropicMessagesStreamCacheWriter(stream=_HeldBackStream(), caching_handler=caching_handler) assert held_back.has_buffered_provider_output is True - replayable = AnthropicMessagesStreamCacheWriter( - stream=_byte_stream(STREAM_EVENTS), caching_handler=caching_handler - ) + replayable = AnthropicMessagesStreamCacheWriter(stream=_byte_stream(STREAM_EVENTS), caching_handler=caching_handler) assert replayable.has_buffered_provider_output is False diff --git a/tests/unit/llms/anthropic/messages/native/test_streaming_iterator.py b/tests/unit/llms/anthropic/messages/native/test_streaming_iterator.py index 39f7a4a05cb..ded599512d0 100644 --- a/tests/unit/llms/anthropic/messages/native/test_streaming_iterator.py +++ b/tests/unit/llms/anthropic/messages/native/test_streaming_iterator.py @@ -1,5 +1,7 @@ import asyncio +import gc import json +import tracemalloc from collections.abc import AsyncIterator, Mapping, Sequence from datetime import datetime from typing import Final, Literal @@ -1921,3 +1923,303 @@ async def test_safeguarded_sse_stream_reports_upstream_buffering_and_closes_the_ assert SafeguardedAnthropicSSEStream( _chunked(b"", 1), _safeguards_evaluator(_OneVerdictClassifier("{}")) ).has_buffered_provider_output is False + + +def _finite_stream(chunks: int) -> AsyncIterator[dict[str, object]]: + async def _stream() -> AsyncIterator[dict[str, object]]: + yield {"type": "message_start", "message": {"id": "m", "usage": {"input_tokens": 5, "output_tokens": 1}}} + for i in range(chunks): + yield {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": f"t{i}"}} + yield {"type": "message_delta", "delta": {"stop_reason": "end_turn"}, "usage": {"output_tokens": 42}} + yield {"type": "message_stop"} + + return _stream() + + +async def _wait_until_no_live_pumps() -> None: + for _ in range(300): + if not any(not task.done() for task in streaming_iterator_module._UPSTREAM_PUMP_TASKS): + return + await asyncio.sleep(0.01) + raise AssertionError("pump task is still alive") + + +@pytest.mark.asyncio +async def test_pump_exits_when_relay_generator_is_never_closed_and_queue_is_full(monkeypatch: pytest.MonkeyPatch): + """ + Regression: a client that resets its connection while the relay queue is full + can leave the relay generator unfinalized, so client_detached is never set. + The pump must give up on the stalled client after the stall timeout instead of + waiting forever, then bill what it drained. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", 2) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0.05) + + iterator = _RecordingLoggingIterator(litellm_logging_obj=_make_logging_obj("pump_stall_full_queue"), request_body={}) + gen = iterator.async_sse_wrapper(_finite_stream(50)) + await gen.__anext__() + + await _wait_until_no_live_pumps() + + assert iterator.logging_call_count == 1 + assert any(c.startswith(b"event: message_stop\n") for c in iterator.logged_chunks) + + +@pytest.mark.asyncio +async def test_pump_keeps_streaming_to_slow_client_that_stays_within_stall_timeout(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", 2) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 5) + + iterator = _RecordingLoggingIterator(litellm_logging_obj=_make_logging_obj("pump_slow_client"), request_body={}) + received = [] + async for chunk in iterator.async_sse_wrapper(_finite_stream(20)): + received.append(chunk) + await asyncio.sleep(0.01) + + assert any(c.startswith(b"event: message_stop\n") for c in received) + assert len(received) == 23 + + +@pytest.mark.asyncio +async def test_pump_exits_when_queued_upstream_error_is_never_consumed_and_relay_is_never_closed( + monkeypatch: pytest.MonkeyPatch, +): + """ + Regression: the pump waits for the relay to consume a queued upstream error. + If the relay generator is never finalized, that wait must time out and fire + the detached failure hook instead of hanging forever. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0.05) + upstream_errored = asyncio.Event() + + async def _failing_stream() -> AsyncIterator[dict[str, object]]: + yield {"type": "message_start", "message": {"id": "msg_1", "usage": {"input_tokens": 52, "output_tokens": 1}}} + upstream_errored.set() + raise _ProviderStreamError("mid-stream failure", status_code=500) + + iterator = _RecordingLoggingIterator( + litellm_logging_obj=_make_logging_obj("pump_stall_queued_error", _FailureRecorder()), request_body={} + ) + detached_hook = _DetachedFailureRecorder() + iterator.litellm_logging_obj.on_detached_stream_failure = detached_hook + + gen = iterator.async_sse_wrapper(_failing_stream()) + await gen.__anext__() + await upstream_errored.wait() + + await _wait_until_no_live_pumps() + + assert len(detached_hook.exceptions) == 1 + + +@pytest.mark.asyncio +async def test_slow_client_that_resumes_after_an_unconsumed_upstream_error_still_gets_its_buffered_chunks( + monkeypatch: pytest.MonkeyPatch, +): + """ + Regression: when the pump gave up waiting for a stalled client to consume a queued provider + error, it emptied the whole relay queue to check whether the error was still in it, so a client + that resumed lost every chunk buffered ahead of the error. Only the error may be dropped. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0) + deltas: Final = tuple( + {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": f"t{i}"}} for i in range(3) + ) + + async def _failing_stream() -> AsyncIterator[dict[str, object]]: + yield {"type": "message_start", "message": {"id": "msg_1", "usage": {"input_tokens": 52, "output_tokens": 1}}} + for delta in deltas: + yield delta + raise _ProviderStreamError("mid-stream failure", status_code=500) + + iterator = _RecordingLoggingIterator( + litellm_logging_obj=_make_logging_obj("resumed_client_queued_error", _FailureRecorder()), request_body={} + ) + detached_hook = _DetachedFailureRecorder() + iterator.litellm_logging_obj.on_detached_stream_failure = detached_hook + + gen = iterator.async_sse_wrapper(_failing_stream()) + first_frame: Final = await gen.__anext__() + await _wait_until_no_live_pumps() + + async def _read_rest() -> list[bytes]: + return [frame async for frame in gen] + + rest: Final = await asyncio.wait_for(_read_rest(), timeout=5) + + assert first_frame.startswith(b"event: message_start\n") + assert rest == [ + *(iterator._convert_chunk_to_sse_format(delta) for delta in deltas), + _incomplete_stream_error_sse_event(), + ] + assert len(detached_hook.exceptions) == 1 + + +class _BilledChunkCountIterator(BaseAnthropicMessagesStreamingIterator): + def __init__(self, litellm_logging_obj: LiteLLMLoggingObj, billed_chunk_counts: list[int]): + super().__init__(litellm_logging_obj=litellm_logging_obj, request_body={}) + self._billed_chunk_counts: Final = billed_chunk_counts + + async def _handle_streaming_logging(self, collected_chunks: list[bytes], *, stream_teardown: bool = False) -> None: + self._billed_chunk_counts.append(len(collected_chunks)) + + +@pytest.mark.asyncio +async def test_async_sse_wrapper_releases_stalled_upstream_after_client_disconnect(monkeypatch: pytest.MonkeyPatch): + """ + Regression: when the provider stalls after the client disconnects, the detached pump kept the + provider stream open and every chunk it had buffered for billing alive until the provider read + timed out, so each such request leaked its whole response. The drain must stop at its time + limit, bill what it read, close the provider stream and free the buffer. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS", 0) + requests: Final = 5 + chunks_before_stall: Final = 50 + payload: Final = "x" * 65536 + response_bytes: Final = chunks_before_stall * len(payload) + provider_stalled: Final = asyncio.Event() + upstream_closed: Final = tuple(asyncio.Event() for _ in range(requests)) + billed_chunk_counts: Final[list[int]] = [] + + async def _stalling_stream(closed: asyncio.Event) -> AsyncIterator[dict[str, object]]: + try: + yield {"type": "message_start", "message": {"id": "m", "usage": {"input_tokens": 5, "output_tokens": 1}}} + for _ in range(chunks_before_stall): + yield {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": payload}} + await provider_stalled.wait() + finally: + closed.set() + + gc.collect() + tracemalloc.start() + try: + baseline: Final = tracemalloc.get_traced_memory()[0] + for index, closed in enumerate(upstream_closed): + iterator = _BilledChunkCountIterator(_make_logging_obj(f"stalled_drain_{index}"), billed_chunk_counts) + gen = iterator.async_sse_wrapper(_stalling_stream(closed)) + await gen.__anext__() + await gen.aclose() + try: + await asyncio.wait_for(asyncio.gather(*(closed.wait() for closed in upstream_closed)), timeout=5) + except asyncio.TimeoutError: + pass + gc.collect() + retained: Final = tracemalloc.get_traced_memory()[0] - baseline + closed_while_stalled: Final = sum(closed.is_set() for closed in upstream_closed) + billed_while_stalled: Final = tuple(billed_chunk_counts) + finally: + tracemalloc.stop() + provider_stalled.set() + await asyncio.gather(*tuple(streaming_iterator_module._UPSTREAM_PUMP_TASKS), return_exceptions=True) + + assert closed_while_stalled == requests, f"only {closed_while_stalled}/{requests} stalled provider streams closed" + assert retained < response_bytes, f"{retained} bytes still held after {requests} disconnected stalled streams" + assert billed_while_stalled == (chunks_before_stall + 1,) * requests + + +@pytest.mark.asyncio +async def test_slow_client_that_resumes_after_the_stall_timeout_gets_an_error_instead_of_hanging( + monkeypatch: pytest.MonkeyPatch, +): + """ + Regression: once the pump gave up on a stalled client it stopped feeding the relay without an + end-of-stream sentinel, so a client that started reading again drained the queue and then + waited forever. It must get the incomplete-stream error and an ended stream. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", 1) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0) + iterator = _RecordingLoggingIterator(litellm_logging_obj=_make_logging_obj("resumed_slow_client"), request_body={}) + gen = iterator.async_sse_wrapper(_finite_stream(20)) + first_frame: Final = await gen.__anext__() + await _wait_until_no_live_pumps() + + async def _read_rest() -> list[bytes]: + return [frame async for frame in gen] + + rest: Final = await asyncio.wait_for(_read_rest(), timeout=5) + + assert first_frame.startswith(b"event: message_start\n") + assert rest[-1] == _incomplete_stream_error_sse_event() + assert any(c.startswith(b"event: message_stop\n") for c in iterator.logged_chunks) + + + +@pytest.mark.asyncio +async def test_pump_closes_a_stalled_upstream_after_giving_up_on_a_client_that_never_closes( + monkeypatch: pytest.MonkeyPatch, +): + """ + Regression: a client that stops reading without closing its relay is detached by the stall + timeout, and the pump then drains on its own. If the provider stalls too, nothing else ever + ends that drain, so the drain time limit has to start when the stall timeout gives up. + """ + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", 1) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_DETACHED_STREAM_DRAIN_TIMEOUT_SECONDS", 0) + provider_stalled: Final = asyncio.Event() + upstream_closed: Final = asyncio.Event() + + async def _stalling_stream() -> AsyncIterator[dict[str, object]]: + try: + yield {"type": "message_start", "message": {"id": "m", "usage": {"input_tokens": 5, "output_tokens": 1}}} + for i in range(5): + yield {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": f"t{i}"}} + await provider_stalled.wait() + finally: + upstream_closed.set() + + iterator = _RecordingLoggingIterator(litellm_logging_obj=_make_logging_obj("client_never_closes"), request_body={}) + gen = iterator.async_sse_wrapper(_stalling_stream()) + await gen.__anext__() + try: + await asyncio.wait_for(upstream_closed.wait(), timeout=5) + except asyncio.TimeoutError: + pass + closed_while_stalled: Final = upstream_closed.is_set() + provider_stalled.set() + await _wait_until_no_live_pumps() + + assert closed_while_stalled, "the stalled provider stream stayed open after the client was given up on" + assert iterator.logging_call_count == 1 + + +@pytest.mark.asyncio +async def test_pump_gives_up_on_the_end_sentinel_and_a_resumed_client_still_gets_a_clean_complete_stream( + monkeypatch: pytest.MonkeyPatch, +): + """ + Regression: when the upstream had already finished and only the end-of-stream sentinel was + left, a stalled client with a full relay queue kept the pump waiting on that last put. The + pump must give up at the stall timeout with the request already billed, and a client that + resumes must still get every chunk, ending at message_stop with no error event after it. + """ + content_chunks: Final = 3 + remaining_events: Final = content_chunks + 2 + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_RELAY_QUEUE_MAXSIZE", remaining_events) + monkeypatch.setattr(streaming_iterator_module, "ANTHROPIC_MESSAGES_STREAM_CLIENT_STALL_TIMEOUT_SECONDS", 0) + client_stopped_reading: Final = asyncio.Event() + + async def _stream_that_finishes_after_the_client_stalls() -> AsyncIterator[dict[str, object]]: + yield {"type": "message_start", "message": {"id": "m", "usage": {"input_tokens": 5, "output_tokens": 1}}} + await client_stopped_reading.wait() + for i in range(content_chunks): + yield {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": f"t{i}"}} + yield {"type": "message_delta", "delta": {"stop_reason": "end_turn"}, "usage": {"output_tokens": 42}} + yield {"type": "message_stop"} + + iterator = _RecordingLoggingIterator(litellm_logging_obj=_make_logging_obj("blocked_end_sentinel"), request_body={}) + gen = iterator.async_sse_wrapper(_stream_that_finishes_after_the_client_stalls()) + first_frame: Final = await gen.__anext__() + client_stopped_reading.set() + await _wait_until_no_live_pumps() + billed_before_resume: Final = iterator.logging_call_count + + async def _read_rest() -> list[bytes]: + return [frame async for frame in gen] + + frames: Final = [first_frame, *await asyncio.wait_for(_read_rest(), timeout=5)] + + assert billed_before_resume == 1 + assert len(frames) == remaining_events + 1 + assert frames[-1].startswith(b"event: message_stop\n") + assert not any(frame.startswith(b"event: error\n") for frame in frames) diff --git a/tests/unit/llms/anthropic/test_anthropic_common_utils.py b/tests/unit/llms/anthropic/test_anthropic_common_utils.py index 4e8dc69fd01..d105a7958b4 100644 --- a/tests/unit/llms/anthropic/test_anthropic_common_utils.py +++ b/tests/unit/llms/anthropic/test_anthropic_common_utils.py @@ -3266,23 +3266,6 @@ class TestWifLitellmParamsPlumbing: assert headers["authorization"] == f"Bearer {FAKE_MINTED_TOKEN}" assert len(poster.requests) == 1 - def test_messages_mints_from_litellm_params(self, wif_engine): - from litellm.llms.anthropic.messages.native.transformation import ( - AnthropicMessagesConfig, - ) - - poster, _ = wif_engine - headers, _ = AnthropicMessagesConfig().validate_anthropic_messages_environment( - headers={}, - model="claude-sonnet-4-5", - messages=[{"role": "user", "content": "Hello"}], - optional_params={}, - litellm_params=dict(WIF_PARAMS_ONLY), - ) - - assert headers["authorization"] == f"Bearer {FAKE_MINTED_TOKEN}" - assert len(poster.requests) == 1 - class TestWifTokenUrlParity: """Both credential tiers must derive the SAME clean token URL from any form of @@ -3344,27 +3327,6 @@ class TestWifAsyncSeam: assert poster.thread_ids == [poster.thread_ids[0]] assert poster.thread_ids[0] != threading.get_ident() - @pytest.mark.asyncio - async def test_avalidate_messages_environment_mints_off_loop(self, wif_async_engine, monkeypatch): - from litellm.llms.anthropic.messages.native.transformation import ( - AnthropicMessagesConfig, - ) - - poster, sync_calls = wif_async_engine - monkeypatch.setenv("WIF_PARAMS_TEST_TOKEN", "params-jwt") - - headers, _ = await AnthropicMessagesConfig().avalidate_anthropic_messages_environment( - headers={}, - model="claude-sonnet-4-5", - messages=[{"role": "user", "content": "Hello"}], - optional_params={}, - litellm_params=dict(WIF_PARAMS_ONLY), - ) - - assert headers["authorization"] == f"Bearer {FAKE_MINTED_TOKEN}" - assert sync_calls == [] - assert poster.thread_ids[0] != threading.get_ident() - @pytest.mark.asyncio async def test_avalidate_delegates_to_subclass_sync_override(self): """A provider subclass that only overrides the sync method must keep its diff --git a/tests/unit/llms/anthropic/test_anthropic_prompt_cache_prediction.py b/tests/unit/llms/anthropic/test_anthropic_prompt_cache_prediction.py index 6a946c2e75c..e07695fcd03 100644 --- a/tests/unit/llms/anthropic/test_anthropic_prompt_cache_prediction.py +++ b/tests/unit/llms/anthropic/test_anthropic_prompt_cache_prediction.py @@ -11,6 +11,7 @@ import respx from pydantic import JsonValue import litellm +from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.caching.dual_cache import DualCache from litellm.caching.llm_caching_handler import LLMClientCache from litellm.llms.anthropic.count_tokens import handler as count_handler @@ -165,6 +166,7 @@ async def test_environment_credential_matches_native_count_and_observed_scope( monkeypatch.setenv("LIT7658_PROVIDER_KEY", _KEY) monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) monkeypatch.setattr(litellm, "in_memory_llm_clients_cache", LLMClientCache()) + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) params: Final = { "model": f"anthropic/{_MODEL}", "api_key": "os.environ/LIT7658_PROVIDER_KEY", diff --git a/tests/unit/llms/anthropic/test_messages_http_error_retry_cases.py b/tests/unit/llms/anthropic/test_messages_http_error_retry_cases.py new file mode 100644 index 00000000000..a9edb2160f7 --- /dev/null +++ b/tests/unit/llms/anthropic/test_messages_http_error_retry_cases.py @@ -0,0 +1,188 @@ +import copy +from collections.abc import Mapping +from pathlib import Path +from typing import Final + +import httpx +import pytest +from pydantic import TypeAdapter +from typing_extensions import ReadOnly, TypedDict + +import litellm +from litellm.llms.anthropic.common_utils import ( + ToolsWithoutStrict, + is_anthropic_invalid_thinking_block_error, + is_anthropic_thinking_binding_mismatch_error, + is_claude_strict_tools_rejection, + tools_without_strict, +) +from litellm.llms.anthropic.messages.native.transformation import AnthropicMessagesConfig +from litellm.llms.deepseek.messages.transformation import DeepSeekAnthropicMessagesConfig +from litellm.llms.base_llm.anthropic_messages.transformation import BaseAnthropicMessagesConfig + +FIXTURE_PATH: Final = ( + Path(__file__).parents[4] / "litellm-rust/crates/llms/tests/fixtures/anthropic_messages_http_error_retry.json" +) + + +class _TextCase(TypedDict): + name: ReadOnly[str] + error_text: ReadOnly[str] + expected: ReadOnly[bool] + + +class _RetryCase(TypedDict): + name: ReadOnly[str] + status: ReadOnly[int] + error_text: ReadOnly[str] + thinking: ReadOnly[Mapping[str, object]] + retried: ReadOnly[bool] + stripped: ReadOnly[bool] + + +class _RetryTable(TypedDict): + request: ReadOnly[Mapping[str, object]] + stripped_request: ReadOnly[Mapping[str, object]] + cases: ReadOnly[tuple[_RetryCase, ...]] + + +class _StrictRejectionCase(TypedDict): + name: ReadOnly[str] + status: ReadOnly[int] + error_text: ReadOnly[str] + expected: ReadOnly[bool] + + +class _ToolsWithoutStrictExpected(TypedDict): + tools: ReadOnly[tuple[Mapping[str, object], ...]] + dropped_count: ReadOnly[int] + + +class _ToolsWithoutStrictCase(TypedDict): + name: ReadOnly[str] + tools: ReadOnly[object] + expected: ReadOnly[_ToolsWithoutStrictExpected | None] + + +class _StrictRetryCase(TypedDict): + name: ReadOnly[str] + status: ReadOnly[int] + error_text: ReadOnly[str] + thinking: ReadOnly[Mapping[str, object]] + drops_unsupported_params: ReadOnly[bool] + retried: ReadOnly[bool] + stripped: ReadOnly[bool] + strict_dropped: ReadOnly[bool] + + +class _StrictRetryTable(TypedDict): + tools: ReadOnly[tuple[Mapping[str, object], ...]] + tools_without_strict: ReadOnly[tuple[Mapping[str, object], ...]] + dropped: ReadOnly[int] + cases: ReadOnly[tuple[_StrictRetryCase, ...]] + + +class _Fixture(TypedDict): + invalid_thinking_block_error: ReadOnly[tuple[_TextCase, ...]] + thinking_binding_mismatch_error: ReadOnly[tuple[_TextCase, ...]] + http_error_retry: ReadOnly[_RetryTable] + claude_strict_tools_rejection: ReadOnly[tuple[_StrictRejectionCase, ...]] + tools_without_strict: ReadOnly[tuple[_ToolsWithoutStrictCase, ...]] + strict_tools_retry: ReadOnly[_StrictRetryTable] + + +FIXTURE: Final = TypeAdapter(_Fixture).validate_json(FIXTURE_PATH.read_text()) +RETRY: Final = FIXTURE["http_error_retry"] +STRICT_RETRY: Final = FIXTURE["strict_tools_retry"] + + +@pytest.mark.parametrize( + "case", [pytest.param(case, id=case["name"]) for case in FIXTURE["invalid_thinking_block_error"]] +) +def test_invalid_thinking_block_errors_match_the_shared_cases(case: _TextCase) -> None: + assert is_anthropic_invalid_thinking_block_error(case["error_text"]) is case["expected"] + + +@pytest.mark.parametrize( + "case", [pytest.param(case, id=case["name"]) for case in FIXTURE["thinking_binding_mismatch_error"]] +) +def test_binding_mismatch_errors_match_the_shared_cases(case: _TextCase) -> None: + assert is_anthropic_thinking_binding_mismatch_error(case["error_text"]) is case["expected"] + + +@pytest.mark.parametrize( + "case", [pytest.param(case, id=case["name"]) for case in FIXTURE["claude_strict_tools_rejection"]] +) +def test_strict_tools_rejections_match_the_shared_cases(case: _StrictRejectionCase) -> None: + assert is_claude_strict_tools_rejection(case["status"], case["error_text"]) is case["expected"] + + +@pytest.mark.parametrize("case", [pytest.param(case, id=case["name"]) for case in FIXTURE["tools_without_strict"]]) +def test_tools_without_strict_matches_the_shared_cases(case: _ToolsWithoutStrictCase) -> None: + expected: Final = case["expected"] + + assert tools_without_strict(copy.deepcopy(case["tools"])) == ( + None + if expected is None + else ToolsWithoutStrict(tools=tuple(expected["tools"]), dropped_count=expected["dropped_count"]) + ) + + +def _rejection(case: _RetryCase | _StrictRetryCase) -> httpx.HTTPStatusError: + request: Final = httpx.Request("POST", "https://api.anthropic.com/v1/messages") + return httpx.HTTPStatusError( + "rejected", + request=request, + response=httpx.Response(case["status"], text=case["error_text"], request=request), + ) + + +@pytest.mark.parametrize( + "config", + [AnthropicMessagesConfig(), DeepSeekAnthropicMessagesConfig()], + ids=["anthropic", "deepseek"], +) +@pytest.mark.parametrize("case", [pytest.param(case, id=case["name"]) for case in RETRY["cases"]]) +def test_the_http_error_retry_matches_the_shared_cases(config: BaseAnthropicMessagesConfig, case: _RetryCase) -> None: + body: Final = {**copy.deepcopy(RETRY["request"]), "thinking": case["thinking"]} + + retried: Final = config.should_retry_anthropic_messages_on_http_error( + e=_rejection(case), litellm_params={}, request_body=body + ) + transformed: Final = config.transform_anthropic_messages_request_on_http_error( + e=_rejection(case), request_data=copy.deepcopy(body) + ) + + assert retried is case["retried"] + assert transformed == (RETRY["stripped_request"] if case["stripped"] else body) + + +@pytest.mark.parametrize( + "config", + [AnthropicMessagesConfig(), DeepSeekAnthropicMessagesConfig()], + ids=["anthropic", "deepseek"], +) +@pytest.mark.parametrize("case", [pytest.param(case, id=case["name"]) for case in STRICT_RETRY["cases"]]) +def test_the_strict_tools_retry_matches_the_shared_cases( + monkeypatch: pytest.MonkeyPatch, config: BaseAnthropicMessagesConfig, case: _StrictRetryCase +) -> None: + monkeypatch.setattr(litellm, "drop_params", False) + body: Final = { + **copy.deepcopy(RETRY["request"]), + "thinking": case["thinking"], + "tools": copy.deepcopy(list(STRICT_RETRY["tools"])), + } + expected: Final = { + **copy.deepcopy(RETRY["stripped_request"] if case["stripped"] else body), + "tools": list(STRICT_RETRY["tools_without_strict"] if case["strict_dropped"] else STRICT_RETRY["tools"]), + } + + retried: Final = config.should_retry_anthropic_messages_on_http_error( + e=_rejection(case), litellm_params={"drop_params": case["drops_unsupported_params"]}, request_body=body + ) + transformed: Final = config.transform_anthropic_messages_request_on_http_error( + e=_rejection(case), request_data=copy.deepcopy(body) + ) + + assert retried is case["retried"] + assert transformed == expected diff --git a/tests/unit/llms/azure_ai/image_edit/test_gpt_image_edit_transformation.py b/tests/unit/llms/azure_ai/image_edit/test_gpt_image_edit_transformation.py new file mode 100644 index 00000000000..6f4a91c7675 --- /dev/null +++ b/tests/unit/llms/azure_ai/image_edit/test_gpt_image_edit_transformation.py @@ -0,0 +1,193 @@ +from typing import Final + +import httpx +import pytest + +import litellm +from litellm.llms.azure_ai.image_edit.gpt_transformation import ( + AzureFoundryGPTImageEditConfig, +) +from litellm.llms.custom_httpx.http_handler import HTTPHandler + +FOUNDRY_API_BASE: Final = "https://example.services.ai.azure.com" +DEPLOYMENT_EDIT_URL: Final = ( + f"{FOUNDRY_API_BASE}/openai/deployments/gpt-image-2.5-flare/images/edits?api-version=2025-04-01-preview" +) + + +def test_gpt_image_edit_url_uses_foundry_deployment_route_and_configured_version(): + url: Final = AzureFoundryGPTImageEditConfig().get_complete_url( + model="gpt-image-2.5-flare", + api_base=FOUNDRY_API_BASE, + litellm_params={"api_version": "2025-06-01-preview"}, + ) + + assert url == f"{FOUNDRY_API_BASE}/openai/deployments/gpt-image-2.5-flare/images/edits?api-version=2025-06-01-preview" + + +def test_gpt_image_edit_url_defaults_to_an_edit_capable_version_on_a_proxy(monkeypatch: pytest.MonkeyPatch): + monkeypatch.delenv("AZURE_AI_API_VERSION", raising=False) + monkeypatch.setenv("AZURE_API_VERSION", litellm.AZURE_DEFAULT_API_VERSION) + monkeypatch.setattr(litellm, "api_version", None) + + url: Final = AzureFoundryGPTImageEditConfig().get_complete_url( + model="gpt-image-2.5-flare", + api_base=FOUNDRY_API_BASE, + litellm_params={}, + ) + + assert url == DEPLOYMENT_EDIT_URL + + +def test_gpt_image_edit_url_uses_azure_ai_api_base_and_version_env(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("AZURE_AI_API_BASE", FOUNDRY_API_BASE) + monkeypatch.setenv("AZURE_AI_API_VERSION", "2025-06-01-preview") + monkeypatch.setenv("AZURE_API_VERSION", litellm.AZURE_DEFAULT_API_VERSION) + monkeypatch.setattr(litellm, "api_base", None) + monkeypatch.setattr(litellm, "api_version", None) + + url: Final = AzureFoundryGPTImageEditConfig().get_complete_url( + model="gpt-image-2.5-flare", + api_base=None, + litellm_params={}, + ) + + assert url == f"{FOUNDRY_API_BASE}/openai/deployments/gpt-image-2.5-flare/images/edits?api-version=2025-06-01-preview" + + +def test_gpt_image_edit_url_uses_v1_surface_for_preview_version(): + url: Final = AzureFoundryGPTImageEditConfig().get_complete_url( + model="gpt-image-2.5-flare", + api_base=FOUNDRY_API_BASE, + litellm_params={"api_version": "preview"}, + ) + + assert url == f"{FOUNDRY_API_BASE}/openai/v1/images/edits?api-version=preview" + + +def test_gpt_image_edit_sends_api_key_header_without_changing_caller_headers(): + caller_headers: Final = {"x-trace": "abc"} + + headers: Final = AzureFoundryGPTImageEditConfig().validate_environment( + caller_headers, + "gpt-image-2.5-flare", + api_key="test-key", + ) + + assert headers == {"x-trace": "abc", "api-key": "test-key"} + assert caller_headers == {"x-trace": "abc"} + + +def test_gpt_image_edit_prefers_litellm_params_api_key(): + headers: Final = AzureFoundryGPTImageEditConfig().validate_environment( + {}, + "gpt-image-2.5-flare", + api_key="positional-key", + litellm_params={"api_key": "params-key"}, + ) + + assert headers["api-key"] == "params-key" + + +def test_gpt_image_edit_reads_azure_ai_api_key_env(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("AZURE_AI_API_KEY", "env-key") + monkeypatch.setattr(litellm, "api_key", None) + + headers: Final = AzureFoundryGPTImageEditConfig().validate_environment( + {}, + "gpt-image-2.5-flare", + ) + + assert headers["api-key"] == "env-key" + + +def test_gpt_image_edit_falls_back_to_entra_token(monkeypatch: pytest.MonkeyPatch, no_ambient_azure_credentials: None): + monkeypatch.delenv("AZURE_AI_API_KEY", raising=False) + monkeypatch.setattr(litellm, "api_key", None) + + headers: Final = AzureFoundryGPTImageEditConfig().validate_environment( + {}, + "gpt-image-2.5-flare", + litellm_params={"azure_ad_token": "entra-token"}, + ) + + assert headers == {"Authorization": "Bearer entra-token"} + + +def test_gpt_image_edit_strips_model_from_deployment_multipart(): + data: Final = AzureFoundryGPTImageEditConfig().finalize_image_edit_request_data( + {"model": "gpt-image-2.5-flare", "prompt": "Add a hat"}, + DEPLOYMENT_EDIT_URL, + ) + + assert data == {"prompt": "Add a hat"} + + +def test_gpt_image_edit_keeps_model_on_v1_multipart(): + data: Final = AzureFoundryGPTImageEditConfig().finalize_image_edit_request_data( + {"model": "gpt-image-2.5-flare", "prompt": "Add a hat"}, + f"{FOUNDRY_API_BASE}/openai/v1/images/edits?api-version=preview", + ) + + assert data == {"model": "gpt-image-2.5-flare", "prompt": "Add a hat"} + + +def _edit_through_fake_foundry(model: str, **kwargs: object) -> httpx.Request: + captured: Final[list[httpx.Request]] = [] # mutable-ok: the fake Foundry endpoint records what litellm sent + + def respond(request: httpx.Request) -> httpx.Response: + captured.append(request) + return httpx.Response(200, json={"created": 1, "data": [{"b64_json": "aW1n"}]}) + + response: Final = litellm.image_edit( + model=f"azure_ai/{model}", + image=b"image", + prompt="Add a hat", + api_base=FOUNDRY_API_BASE, + client=HTTPHandler(client=httpx.Client(transport=httpx.MockTransport(respond))), + **kwargs, + ) + + assert response.data[0]["b64_json"] == "aW1n" + assert len(captured) == 1 + return captured[0] + + +@pytest.mark.parametrize( + "model", + [ + "gpt-image-1", + "gpt-image-2", + "gpt-image-2.5-flare", + "gpt-image-2.5-flare-2026-09-08", + "gpt-image-2.5-sunburst", + "gpt-image-2.5-sunburst-2026-09-08", + "my-image-editor", + ], +) +def test_gpt_image_edit_end_to_end_posts_multipart_to_deployment_route(monkeypatch: pytest.MonkeyPatch, model: str): + monkeypatch.delenv("AZURE_AI_API_VERSION", raising=False) + monkeypatch.setenv("AZURE_API_VERSION", litellm.AZURE_DEFAULT_API_VERSION) + monkeypatch.setattr(litellm, "api_version", None) + + request: Final = _edit_through_fake_foundry(model, api_key="test-key") + + assert str(request.url) == ( + f"{FOUNDRY_API_BASE}/openai/deployments/{model}/images/edits?api-version=2025-04-01-preview" + ) + assert request.headers["api-key"] == "test-key" + assert b'name="prompt"' in request.content + assert b'name="model"' not in request.content + + +def test_gpt_image_edit_requires_a_foundry_api_base_instead_of_the_azure_openai_one(monkeypatch: pytest.MonkeyPatch): + monkeypatch.delenv("AZURE_AI_API_BASE", raising=False) + monkeypatch.setenv("AZURE_API_BASE", "https://other-resource.openai.azure.com") + monkeypatch.setattr(litellm, "api_base", None) + + with pytest.raises(ValueError, match="Azure AI API base is required"): + AzureFoundryGPTImageEditConfig().get_complete_url( + model="gpt-image-2.5-flare", + api_base=None, + litellm_params={}, + ) diff --git a/tests/unit/llms/bedrock/messages/invoke_transformations/test_anthropic_claude_transformation.py b/tests/unit/llms/bedrock/messages/invoke_transformations/test_anthropic_claude_transformation.py index 991a0c36f03..4d4a92f632e 100644 --- a/tests/unit/llms/bedrock/messages/invoke_transformations/test_anthropic_claude_transformation.py +++ b/tests/unit/llms/bedrock/messages/invoke_transformations/test_anthropic_claude_transformation.py @@ -4736,7 +4736,10 @@ async def test_bedrock_messages_fallback_to_anthropic_sends_the_tool_names_bedro unnamed_tool_extras: dict[str, object], sent_extras: dict[str, object], ) -> None: + from litellm.llms.anthropic.messages.native import handler as python_messages + monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) upstream: Final = BedrockDownAnthropicUp() respx_mock.post(url__regex=r"https://.*").mock(side_effect=upstream) router: Final = litellm.Router( diff --git a/tests/unit/llms/bedrock/vector_stores/test_bedrock_vector_store_transformation.py b/tests/unit/llms/bedrock/vector_stores/test_bedrock_vector_store_transformation.py index e69fb34038f..e20dfaffcc6 100644 --- a/tests/unit/llms/bedrock/vector_stores/test_bedrock_vector_store_transformation.py +++ b/tests/unit/llms/bedrock/vector_stores/test_bedrock_vector_store_transformation.py @@ -6,6 +6,7 @@ import httpx import pytest import respx +import litellm from litellm.llms.bedrock.common_utils import BedrockError from litellm.llms.bedrock.vector_stores.transformation import BedrockVectorStoreConfig @@ -378,6 +379,161 @@ async def test_bedrock_search_with_credentials_managed_registry( assert search_response["data"][0]["content"][0]["text"] == "Mock search result" +def _image_search_body(media_type: str, extra_body: dict[str, object] | None) -> dict[str, object]: + config: Final = BedrockVectorStoreConfig() + mock_log: Final = MagicMock() + mock_log.model_call_details = {} + _, body = config.transform_search_vector_store_request( + vector_store_id="kb123", + query="", + vector_store_search_optional_params={ + "max_num_results": 3, + "query_image": {"type": "base64", "media_type": media_type, "data": "aW1hZ2UtYnl0ZXM="}, + }, + api_base="https://bedrock-agent-runtime.us-west-2.amazonaws.com/knowledgebases", + litellm_logging_obj=mock_log, + litellm_params={}, + extra_body=extra_body, + ) + return body + + +@pytest.mark.parametrize( + ("media_type", "bedrock_format"), + [("image/jpeg", "jpeg"), ("image/png", "png"), ("image/gif", "gif"), ("image/webp", "webp")], +) +def test_transform_search_request_sends_query_image_as_an_image_retrieval_query( + media_type: str, bedrock_format: str +) -> None: + body: Final = _image_search_body(media_type, extra_body=None) + + assert body["retrievalQuery"] == { + "type": "IMAGE", + "image": {"format": bedrock_format, "inlineContent": "aW1hZ2UtYnl0ZXM="}, + } + assert body["retrievalConfiguration"] == {"vectorSearchConfiguration": {"numberOfResults": 3}} + + +CALLER_RETRIEVAL_QUERY: Final = {"type": "IMAGE", "image": {"format": "png", "inlineContent": "Y2FsbGVy"}} + + +@pytest.mark.parametrize("key", ["retrievalQuery", "retrieval_query"]) +@pytest.mark.parametrize("source", ["extra_body", "litellm_params"]) +def test_transform_search_request_rejects_a_callers_retrieval_query(key: str, source: str) -> None: + caller_fields: Final = {key: CALLER_RETRIEVAL_QUERY} + + with pytest.raises(litellm.BadRequestError) as exc_info: + _search_body( + extra_body=caller_fields if source == "extra_body" else None, + litellm_params=caller_fields if source == "litellm_params" else {}, + ) + + assert exc_info.value.status_code == 400 + assert "query_image" in str(exc_info.value) + + +def test_transform_search_request_drops_a_callers_retrieval_query_when_drop_params_is_on() -> None: + body: Final = _search_body( + extra_body={"retrievalQuery": CALLER_RETRIEVAL_QUERY}, litellm_params={"drop_params": True} + ) + + assert body["retrievalQuery"] == {"text": "hello"} + + +QUERY_IMAGE: Final = {"type": "base64", "media_type": "image/jpeg", "data": "/9j/4AAQSkZJRg=="} +IMAGE_HIT_METADATA: Final = { + "x-amz-bedrock-kb-source-uri": "s3://kb-images/shapes/red-circle.jpg", + "x-amz-bedrock-kb-source-file-mime-type": "image/jpeg", + "x-amz-bedrock-kb-source-file-modality": "IMAGE", +} +TEXT_HIT_METADATA: Final = {"x-amz-bedrock-kb-source-uri": "s3://kb-docs/shapes.txt"} +MIXED_RETRIEVAL_RESULTS: Final = [ + { + "content": {"type": "IMAGE", "byteContent": "data:image/png;base64,/9j/4AAQSkZJRg=="}, + "metadata": IMAGE_HIT_METADATA, + "location": {"type": "S3", "s3Location": {"uri": "s3://kb-images/shapes/red-circle.jpg"}}, + "score": 0.998, + }, + {"content": {"type": "TEXT", "text": "a red circle"}, "metadata": TEXT_HIT_METADATA, "score": 0.5}, + {"content": {"type": "ROW", "row": []}, "metadata": {}, "score": 0.4}, + {"content": {"type": "AUDIO", "byteContent": "data:audio/mpeg;base64,SUQz"}, "metadata": {}, "score": 0.3}, +] +TEXT_HIT: Final = { + "score": 0.5, + "content": [{"text": "a red circle", "type": "text"}], + "file_id": "s3://kb-docs/shapes.txt", + "filename": "shapes.txt", + "attributes": TEXT_HIT_METADATA, +} + + +def _search_response( + retrieval_results: list[dict[str, object]], query: str = "", query_image: dict[str, str] | None = QUERY_IMAGE +) -> dict[str, object]: + config: Final = BedrockVectorStoreConfig() + mock_log: Final = MagicMock() + mock_log.model_call_details = {"query": query, "query_image": query_image} + return config.transform_search_vector_store_response( + response=httpx.Response(200, json={"retrievalResults": retrieval_results}), + litellm_logging_obj=mock_log, + ) + + +def test_transform_search_response_to_an_image_search_returns_image_hits_next_to_text_hits() -> None: + response: Final = _search_response(MIXED_RETRIEVAL_RESULTS) + + assert response["search_query"] == "" + assert response["data"] == [ + { + "score": 0.998, + "content": [ + { + "type": "image", + "source": {"type": "base64", "media_type": "image/jpeg", "data": "/9j/4AAQSkZJRg=="}, + } + ], + "file_id": "s3://kb-images/shapes/red-circle.jpg", + "filename": "red-circle.jpg", + "attributes": IMAGE_HIT_METADATA, + }, + TEXT_HIT, + ] + + +def test_transform_search_response_to_a_text_search_returns_only_text_hits() -> None: + response: Final = _search_response(MIXED_RETRIEVAL_RESULTS, query="red circle", query_image=None) + + assert response["search_query"] == "red circle" + assert response["data"] == [TEXT_HIT] + + +@pytest.mark.parametrize( + ("byte_content", "metadata", "media_type", "data"), + [ + ("data:image/webp;base64,UklGRg==", {}, "image/webp", "UklGRg=="), + ("data:image/png;base64,iVBORw0K", {"x-amz-bedrock-kb-source-file-mime-type": ""}, "image/png", "iVBORw0K"), + ( + "data:image/png;base64,iVBORw0K", + {"x-amz-bedrock-kb-source-file-mime-type": "application/pdf"}, + "image/png", + "iVBORw0K", + ), + ("/9j/4AAQ", {"x-amz-bedrock-kb-source-file-mime-type": "image/jpeg"}, "image/jpeg", "/9j/4AAQ"), + ("/9j/4AAQ", {}, "application/octet-stream", "/9j/4AAQ"), + ], +) +def test_transform_search_response_image_hit_media_type_falls_back_to_the_data_uri( + byte_content: str, metadata: dict[str, object], media_type: str, data: str +) -> None: + response: Final = _search_response( + [{"content": {"type": "IMAGE", "byteContent": byte_content}, "metadata": metadata, "score": 0.9}] + ) + + assert response["data"][0]["content"] == [ + {"type": "image", "source": {"type": "base64", "media_type": media_type, "data": data}} + ] + + class _SearchLogging: def __init__(self, query: str) -> None: self.model_call_details: Final = {"query": query} diff --git a/tests/unit/llms/custom_httpx/test_llm_http_handler.py b/tests/unit/llms/custom_httpx/test_llm_http_handler.py index 4d8ba26d8d8..08f38352735 100644 --- a/tests/unit/llms/custom_httpx/test_llm_http_handler.py +++ b/tests/unit/llms/custom_httpx/test_llm_http_handler.py @@ -19,6 +19,7 @@ from botocore.credentials import RefreshableCredentials from h2.events import ConnectionTerminated import litellm +from litellm.llms.anthropic.messages.native import handler as python_messages from litellm._logging import verbose_logger from litellm.integrations.code_interpreter_interception.handler import ( CodeInterpreterInterceptionLogger, @@ -6493,7 +6494,7 @@ async def test_anthropic_messages_dropped_safeguards_send_neither_the_field_nor_ upstream: Final = AsyncHTTPHandler(transport=httpx.MockTransport(anthropic_answers)) try: - await litellm.anthropic.messages.acreate( + await python_messages.anthropic_messages( max_tokens=16, messages=[{"role": "user", "content": "hi"}], model="anthropic/claude-sonnet-4-6", @@ -6546,7 +6547,6 @@ async def _search_through(transport: httpx.MockTransport, is_async: bool) -> obj @pytest.mark.asyncio @pytest.mark.parametrize("stream", [False, True]) -@pytest.mark.parametrize("environment_base", [None, "ANTHROPIC_API_BASE", "ANTHROPIC_BASE_URL"]) @pytest.mark.parametrize( ("api_base", "explicit_header", "expected_session"), [ @@ -6557,7 +6557,6 @@ async def _search_through(transport: httpx.MockTransport, is_async: bool) -> obj ) async def test_messages_opencode_session_header( stream: bool, - environment_base: str | None, api_base: str, explicit_header: str | None, expected_session: str | None, @@ -6565,8 +6564,6 @@ async def test_messages_opencode_session_header( ) -> None: monkeypatch.delenv("ANTHROPIC_API_BASE", raising=False) monkeypatch.delenv("ANTHROPIC_BASE_URL", raising=False) - if environment_base: - monkeypatch.setenv(environment_base, "https://opencode.ai/inference/go/anthropic") received: Final[asyncio.Queue[httpx.Request]] = asyncio.Queue() payload: Final = { "id": "msg_test", @@ -6594,11 +6591,11 @@ async def test_messages_opencode_session_header( upstream: Final = AsyncHTTPHandler(transport=httpx.MockTransport(respond)) try: - result: Final = await litellm.anthropic.messages.acreate( + result: Final = await python_messages.anthropic_messages( model="anthropic/claude-haiku-5-5", messages=[{"role": "user", "content": "hello"}], max_tokens=128000, - api_base=None if environment_base and api_base == "https://opencode.ai/inference/go/anthropic" else api_base, + api_base=api_base, api_key="test-key", stream=stream, litellm_session_id="conversation-123", @@ -6737,20 +6734,6 @@ def _anthropic_messages_logging_obj(): @pytest.mark.parametrize( ("custom_llm_provider", "messages_config", "foundry_api_base", "forwarded_betas"), [ - pytest.param( - "anthropic", - "anthropic", - "https://my-resource.services.ai.azure.com/anthropic", - f"thinking-binding-controls-2026-08-01,{_BETA_THE_TABLE_DOES_NOT_LIST}", - id="anthropic-drops-what-the-azure-ai-row-rejects", - ), - pytest.param( - "anthropic", - "anthropic", - "https://my-resource.cognitiveservices.azure.com/anthropic", - f"thinking-binding-controls-2026-08-01,{_BETA_THE_TABLE_DOES_NOT_LIST}", - id="anthropic-on-a-cognitiveservices-host", - ), pytest.param( "azure_ai", "azure_ai", @@ -6775,7 +6758,6 @@ async def test_async_anthropic_messages_handler_picks_the_beta_row_by_deployment forwarded_betas: str, ) -> None: from litellm import anthropic_beta_headers_manager - from litellm.llms.anthropic.messages.native.transformation import AnthropicMessagesConfig from litellm.llms.azure_ai.anthropic.messages_transformation import AzureAnthropicMessagesConfig from litellm.llms.openai_like.messages.transformation import OpenAILikeAnthropicMessagesConfig @@ -6783,7 +6765,6 @@ async def test_async_anthropic_messages_handler_picks_the_beta_row_by_deployment monkeypatch.setattr(anthropic_beta_headers_manager, "_BETA_HEADERS_CONFIG", None) assert _BETA_THE_TABLE_DOES_NOT_LIST not in anthropic_beta_headers_manager._load_beta_headers_config()["azure_ai"] configs: Final = { - "anthropic": AnthropicMessagesConfig, "azure_ai": AzureAnthropicMessagesConfig, "pass_through": OpenAILikeAnthropicMessagesConfig, } @@ -6817,7 +6798,7 @@ async def test_first_foundry_request_with_betas_fetches_the_beta_table_off_the_e monkeypatch: pytest.MonkeyPatch, ) -> None: from litellm import anthropic_beta_headers_manager, anthropic_beta_headers_url - from litellm.llms.anthropic.messages.native.transformation import AnthropicMessagesConfig + from litellm.llms.azure_ai.anthropic.messages_transformation import AzureAnthropicMessagesConfig monkeypatch.delenv("LITELLM_LOCAL_ANTHROPIC_BETA_HEADERS", raising=False) monkeypatch.delenv("LITELLM_OFFLINE_MODE", raising=False) @@ -6835,9 +6816,9 @@ async def test_first_foundry_request_with_betas_fetches_the_beta_table_off_the_e await BaseLLMHTTPHandler().async_anthropic_messages_handler( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello"}], - anthropic_messages_provider_config=AnthropicMessagesConfig(), + anthropic_messages_provider_config=AzureAnthropicMessagesConfig(), anthropic_messages_optional_request_params={"max_tokens": 8}, - custom_llm_provider="anthropic", + custom_llm_provider="azure_ai", litellm_params=GenericLiteLLMParams(api_base=foundry_api_base), logging_obj=_anthropic_messages_logging_obj(), api_key="sk-test", diff --git a/tests/unit/llms/databricks/test_databricks_cost_calculator.py b/tests/unit/llms/databricks/test_databricks_cost_calculator.py index e9bc75119aa..b968191383d 100644 --- a/tests/unit/llms/databricks/test_databricks_cost_calculator.py +++ b/tests/unit/llms/databricks/test_databricks_cost_calculator.py @@ -44,6 +44,8 @@ PUBLISHED_DBU_PER_MILLION: Final = { "databricks/databricks-claude-opus-5-5": ("57.143", "285.714", "71.429", "2.857"), "databricks/databricks-claude-fable-5-1": ("142.858", "714.286", "178.572", "3.572"), "databricks/databricks-claude-fable-5": ("142.858", "714.286", "178.572", "14.286"), + "databricks/databricks-claude-fable-5-2": ("114.286", "571.429", "142.857", "2.857"), + "databricks/system.ai.claude-fable-5-2": ("114.286", "571.429", "142.857", "2.857"), "databricks/databricks-claude-opus-5": ("71.429", "357.143", "89.286", "7.143"), "databricks/databricks-claude-opus-4-8": ("71.429", "357.143", "89.286", "7.143"), "databricks/databricks-claude-opus-4-7": ("71.429", "357.143", "89.286", "7.143"), diff --git a/tests/unit/llms/mongodb/vector_stores/test_mongodb_transformation.py b/tests/unit/llms/mongodb/vector_stores/test_mongodb_transformation.py index 9de473fb1f0..d7d9b21ed20 100644 --- a/tests/unit/llms/mongodb/vector_stores/test_mongodb_transformation.py +++ b/tests/unit/llms/mongodb/vector_stores/test_mongodb_transformation.py @@ -220,3 +220,40 @@ async def test_public_sdk_preserves_http_errors_response_and_timeout( else: assert await search() == RESULT executor.call.assert_called_once_with("embedding-alias", "travel policy", {}) + + +QUERY_IMAGE: Final = {"type": "base64", "media_type": "image/jpeg", "data": "/9j/4AAQSkZJRg=="} + + +def _search_with_extra_body(extra_body: dict[str, object], **search_kwargs: object) -> VectorStoreSearchResponse: + def respond(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, json=RESULT) + + with httpx.Client(transport=httpx.MockTransport(respond)) as transport: + return litellm.vector_stores.search( + **BASE_PARAMS, + vector_store_id="policy_index", + query="travel policy", + custom_llm_provider="mongodb", + extra_body=extra_body, + _direct_vector_store_embedding_executor=RecordingEmbeddingExecutor(), + client=HTTPHandler(client=transport), + **search_kwargs, + ) + + +@pytest.mark.parametrize("drop_params_source", ["request", "global"]) +def test_search_with_drop_params_drops_an_extra_body_query_image( + drop_params_source: str, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setattr(litellm, "drop_params", drop_params_source == "global") + drop_kwargs: Final = {"drop_params": True} if drop_params_source == "request" else {} + + assert _search_with_extra_body({"query_image": QUERY_IMAGE}, **drop_kwargs) == RESULT + + +def test_search_with_drop_params_still_rejects_other_extra_body_overrides(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "drop_params", True) + + with pytest.raises(litellm.BadRequestError, match="does not support extra_body overrides"): + _search_with_extra_body({"query_image": QUERY_IMAGE, "other": "value"}) diff --git a/tests/unit/llms/oci/test_oci_common_utils.py b/tests/unit/llms/oci/test_oci_common_utils.py index e66645c4dcd..34e66629120 100644 --- a/tests/unit/llms/oci/test_oci_common_utils.py +++ b/tests/unit/llms/oci/test_oci_common_utils.py @@ -54,6 +54,20 @@ def test_sha256_base64_known_value(): assert sha256_base64(data) == expected +def test_sha256_base64_asks_for_a_security_digest(monkeypatch: pytest.MonkeyPatch) -> None: + import hashlib + + real_sha256: Final = hashlib.sha256 + + def security_only_sha256(data: bytes = b"", *, usedforsecurity: bool = True) -> "hashlib._Hash": + assert usedforsecurity, "usedforsecurity=False lets a provider outside the FIPS module serve the digest" + return real_sha256(data) + + monkeypatch.setattr(hashlib, "sha256", security_only_sha256) + + assert sha256_base64(b"hello") == "LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=" + + def test_sha256_base64_empty(): result = sha256_base64(b"") assert isinstance(result, str) diff --git a/tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py b/tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py index e7bcc696c0d..4cbe5320aa1 100644 --- a/tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py +++ b/tests/unit/proxy/auth/test_auth_checks_object_access_and_lookup.py @@ -7286,6 +7286,45 @@ async def test_model_discovery_route_bypasses_user_budget(): assert result is True +@pytest.mark.parametrize( + "method, route, expect_blocked", + [ + ("GET", "/v1/videos/video_abc", False), + ("GET", "/videos/video_abc/content", False), + ("POST", "/v1/videos", True), + ("POST", "/v1/videos/video_abc/remix", True), + ("GET", "/v1/videos", True), + ], +) +@pytest.mark.asyncio +async def test_exhausted_team_budget_spares_only_video_retrieval(method: str, route: str, expect_blocked: bool) -> None: + from litellm.proxy.auth.auth_checks import common_checks + + request: Final = MagicMock() + request.method = method + + async def run() -> bool: + return await common_checks( + request_body={}, + team_object=LiteLLM_TeamTable(team_id="test-team", spend=0.4, max_budget=0.3), + user_object=None, + end_user_object=None, + global_proxy_spend=None, + general_settings={}, + route=route, + llm_router=None, + proxy_logging_obj=AsyncMock(), + valid_token=UserAPIKeyAuth(token="test-token", team_id="test-team"), + request=request, + ) + + if expect_blocked: + with pytest.raises(litellm.BudgetExceededError): + await run() + else: + assert await run() is True + + @pytest.mark.parametrize("route", ["/health/services", "/auto_router/test_routing"]) @pytest.mark.asyncio async def test_side_effectful_info_route_still_enforces_budget(route: str) -> None: @@ -11202,6 +11241,34 @@ def test_request_skips_budget_checks_for_non_spending_requests( ) +@pytest.mark.parametrize( + "route, http_method, expected", + [ + ("/v1/videos/video_abc", "GET", True), + ("/videos/video_abc", "GET", True), + ("/v1/videos/video_abc/content", "GET", True), + ("/videos/video_abc/content", "GET", True), + ("/v1/videos/video_abc", "POST", False), + ("/v1/videos/video_abc/content", None, False), + ("/v1/videos", "GET", False), + ("/v1/videos", "POST", False), + ("/v1/videos/video_abc/remix", "POST", False), + ("/v1/videos/edits", "POST", False), + ("/v1/videos/video_abc/remix", "GET", False), + ("/v1/chat/completions", "GET", False), + ], +) +def test_request_skips_budget_checks_only_for_paid_video_retrieval( + route: str, http_method: str | None, expected: bool, free_and_paid_router: litellm.Router +) -> None: + assert ( + request_skips_budget_checks( + route=route, model="paid-model", llm_router=free_and_paid_router, http_method=http_method + ) + is expected + ) + + def _agent_model_ceiling_resolver( models: frozenset[str] | None, ) -> tuple[CeilingResolver, list[str]]: diff --git a/tests/unit/proxy/auth/test_auth_utils.py b/tests/unit/proxy/auth/test_auth_utils.py index 58a78aede3c..6a7bbb2f0ce 100644 --- a/tests/unit/proxy/auth/test_auth_utils.py +++ b/tests/unit/proxy/auth/test_auth_utils.py @@ -59,7 +59,7 @@ def test_token_exchange_settings_in_request_body_are_rejected(field: str) -> Non match="server-owned workload identity federation or OAuth token exchange parameter", ) as error: is_request_body_safe( - request_body={"model": "microsoft_365_copilot/chat", field: "attacker-chosen"}, + request_body={"model": "microsoft_365_copilot/chat", field: "caller-chosen"}, general_settings={"allow_client_side_credentials": True}, llm_router=None, model="microsoft_365_copilot/chat", @@ -151,6 +151,302 @@ def test_model_opt_in_cannot_allow_a_token_exchange_endpoint_in_a_request_body() ) +_AZURE_ENTRA_CREDENTIAL_PARAMS: Final = ( + "tenant_id", + "client_id", + "client_secret", + "azure_username", + "azure_password", + "azure_scope", +) + + +def _azure_entra_router(configurable_clientside_auth_params: tuple[str, ...] = ()) -> Router: + return Router( + model_list=[ + { + "model_name": "azure-group", + "litellm_params": { + "model": "azure/gpt-4o", + "api_base": "https://admin-endpoint.example.com", + "tenant_id": "admin-tenant", + "client_id": "admin-client", + "client_secret": "admin-secret", + "configurable_clientside_auth_params": list(configurable_clientside_auth_params), + }, + } + ] + ) + + +@pytest.mark.parametrize("param", _AZURE_ENTRA_CREDENTIAL_PARAMS) +@pytest.mark.parametrize("container", (None, "extra_body", "litellm_embedding_config")) +def test_azure_entra_credential_params_in_request_body_are_rejected(param: str, container: str | None) -> None: + override: Final = {param: "caller-chosen"} + with pytest.raises(ValueError, match=f"{param} is not allowed in request body"): + is_request_body_safe( + request_body={"model": "azure-group", **({container: override} if container else override)}, + general_settings={}, + llm_router=_azure_entra_router(), + model="azure-group", + route="/v1/chat/completions", + ) + + +@pytest.mark.parametrize("param", _AZURE_ENTRA_CREDENTIAL_PARAMS) +@pytest.mark.parametrize("metadata_key", ("metadata", "litellm_metadata")) +def test_azure_entra_credential_names_are_allowed_as_request_metadata(param: str, metadata_key: str) -> None: + assert ( + is_request_body_safe( + request_body={"model": "azure-group", metadata_key: {param: "caller-tag"}}, + general_settings={}, + llm_router=_azure_entra_router(), + model="azure-group", + route="/v1/chat/completions", + ) + is True + ) + + +def test_deployment_opt_in_allows_only_the_named_azure_entra_credential_param() -> None: + router: Final = _azure_entra_router(configurable_clientside_auth_params=("client_id",)) + + assert ( + is_request_body_safe( + request_body={"model": "azure-group", "client_id": "caller-client"}, + general_settings={}, + llm_router=router, + model="azure-group", + route="/v1/chat/completions", + ) + is True + ) + with pytest.raises(ValueError, match="client_secret"): + is_request_body_safe( + request_body={"model": "azure-group", "client_id": "caller-client", "client_secret": "caller-secret"}, + general_settings={}, + llm_router=router, + model="azure-group", + route="/v1/chat/completions", + ) + + +@pytest.mark.parametrize("param", (*_AZURE_ENTRA_CREDENTIAL_PARAMS, "api_key", "aws_access_key_id", "azure_ad_token")) +@pytest.mark.parametrize("reference", ("os.environ/LITELLM_MASTER_KEY", "oidc/env/LITELLM_MASTER_KEY")) +@pytest.mark.parametrize("container", (None, "extra_body")) +def test_secret_reference_in_a_credential_param_is_rejected_despite_client_side_opt_in( + param: str, reference: str, container: str | None +) -> None: + override: Final = {param: reference} + with pytest.raises(ValueError, match=f"{param} holds an? (oidc/ )?secret reference"): + is_request_body_safe( + request_body={"model": "azure-group", **({container: override} if container else override)}, + general_settings={"allow_client_side_credentials": True}, + llm_router=_azure_entra_router(), + model="azure-group", + route="/v1/chat/completions", + ) + + +def test_secret_reference_is_rejected_for_a_param_the_deployment_opted_in() -> None: + with pytest.raises(ValueError, match="client_id holds a secret reference"): + is_request_body_safe( + request_body={"model": "azure-group", "client_id": "os.environ/LITELLM_MASTER_KEY"}, + general_settings={}, + llm_router=_azure_entra_router(configurable_clientside_auth_params=("client_id",)), + model="azure-group", + route="/v1/chat/completions", + ) + + +@pytest.mark.parametrize( + "body", + ( + {"prompt": "os.environ/PATH is what in Python?"}, + {"input": "oidc/env/ tokens explained"}, + {"api_key": "sk-caller-own-key"}, + {"client_id": "an os.environ/ mention that is not a prefix"}, + ), +) +def test_values_that_are_not_secret_references_in_credential_params_are_allowed(body: Mapping[str, str]) -> None: + assert ( + is_request_body_safe( + request_body={"model": "azure-group", **body}, + general_settings={"allow_client_side_credentials": True}, + llm_router=_azure_entra_router(), + model="azure-group", + route="/v1/chat/completions", + ) + is True + ) + + +def test_deployment_management_body_may_carry_a_secret_reference() -> None: + assert ( + is_request_body_safe( + request_body={"model_name": "azure-group", "api_key": "os.environ/AZURE_API_KEY"}, + general_settings={}, + llm_router=None, + model="", + route="/model/new", + ) + is True + ) + + +@pytest.mark.parametrize("field", ("client_id", "client_secret")) +def test_mcp_oauth_token_form_may_carry_oauth_client_fields(field: str) -> None: + assert ( + is_request_body_safe( + request_body={"grant_type": "authorization_code", "code": "abc", field: "mcp-oauth-client"}, + general_settings={}, + llm_router=None, + model="", + route="/v1/mcp/server/oauth/abc123/token", + ) + is True + ) + + +@pytest.mark.parametrize("field", ("tenant_id", "azure_username", "azure_password", "azure_scope")) +def test_mcp_server_routes_still_reject_non_oauth_azure_entra_params(field: str) -> None: + with pytest.raises(ValueError, match=field): + is_request_body_safe( + request_body={"grant_type": "authorization_code", "code": "abc", field: "caller-chosen"}, + general_settings={}, + llm_router=None, + model="", + route="/v1/mcp/server/oauth/abc123/token", + ) + + +@pytest.mark.parametrize("body", ({"client_id": "gateway-1"}, {"client_id": "gateway-1", "client_secret": "gw-secret"})) +def test_token_introspection_form_may_carry_oauth_client_fields(body: Mapping[str, str]) -> None: + assert ( + is_request_body_safe( + request_body={"token": "llm_session_abc", **body}, + general_settings={}, + llm_router=None, + model="", + route="/introspect", + ) + is True + ) + + +@pytest.mark.parametrize("body", ({"tenant_id": "caller-tenant"}, {"client_id": "os.environ/LITELLM_MASTER_KEY"})) +def test_token_introspection_still_rejects_other_entra_params_and_secret_references(body: Mapping[str, str]) -> None: + with pytest.raises(ValueError, match=next(iter(body))): + is_request_body_safe( + request_body={"token": "llm_session_abc", **body}, + general_settings={}, + llm_router=None, + model="", + route="/introspect", + ) + + +_TRANSCRIPTION_SESSION_ROUTES: Final = ( + "/v1/realtime/transcription_sessions", + "/realtime/transcription_sessions", + "/openai/v1/realtime/transcription_sessions", +) + + +@pytest.mark.parametrize("route", _TRANSCRIPTION_SESSION_ROUTES) +def test_transcription_session_body_may_carry_its_client_secret_config(route: str) -> None: + assert ( + is_request_body_safe( + request_body={ + "model": "gpt-4o-transcribe", + "client_secret": {"expires_at": {"anchor": "created_at", "seconds": 600}}, + }, + general_settings={}, + llm_router=None, + model="", + route=route, + ) + is True + ) + + +@pytest.mark.parametrize("route", _TRANSCRIPTION_SESSION_ROUTES) +@pytest.mark.parametrize("body", ({"tenant_id": "caller-tenant"}, {"client_secret": "os.environ/LITELLM_MASTER_KEY"})) +def test_transcription_session_routes_still_reject_other_entra_params_and_secret_references( + route: str, body: Mapping[str, str] +) -> None: + with pytest.raises(ValueError, match=next(iter(body))): + is_request_body_safe( + request_body={"model": "gpt-4o-transcribe", **body}, + general_settings={}, + llm_router=None, + model="", + route=route, + ) + + +@pytest.mark.parametrize("param", _AZURE_ENTRA_CREDENTIAL_PARAMS) +@pytest.mark.parametrize("metadata_key", ("metadata", "litellm_metadata")) +@pytest.mark.parametrize("value", ("os.environ/HOME", "oidc/azure/team-a")) +def test_metadata_tags_whose_value_looks_like_a_secret_reference_are_allowed( + param: str, metadata_key: str, value: str +) -> None: + assert ( + is_request_body_safe( + request_body={"model": "azure-group", metadata_key: {param: value}}, + general_settings={}, + llm_router=_azure_entra_router(), + model="azure-group", + route="/v1/chat/completions", + ) + is True + ) + + +_USER_CONFIG_SECRET_REFERENCE_PARAMS: Final = ( + {"model": "openai/gpt-4o", "api_base": "https://caller.example.com", "api_key": "os.environ/LITELLM_MASTER_KEY"}, + {"model": "openai/gpt-4o", "organization": "os.environ/LITELLM_MASTER_KEY"}, + {"model": "openai/gpt-4o", "extra_body": {"api_key": "oidc/env/LITELLM_MASTER_KEY"}}, + {"model": "azure/gpt-4o", "dataSources": [{"parameters": {"key": "os.environ/LITELLM_MASTER_KEY"}}]}, +) + + +def _user_config(slot: str, litellm_params: Mapping[str, object]) -> Mapping[str, object]: + if slot == "default_litellm_params": + return {"default_litellm_params": dict(litellm_params)} + return {"model_list": [{"model_name": "caller-model", "litellm_params": dict(litellm_params)}]} + + +@pytest.mark.parametrize("litellm_params", _USER_CONFIG_SECRET_REFERENCE_PARAMS) +@pytest.mark.parametrize("slot", ("model_list", "default_litellm_params")) +def test_user_config_secret_references_are_rejected_despite_client_side_opt_in( + litellm_params: Mapping[str, object], slot: str +) -> None: + with pytest.raises(ValueError, match="holds a secret reference"): + is_request_body_safe( + request_body={"model": "caller-model", "user_config": _user_config(slot, litellm_params)}, + general_settings={"allow_client_side_credentials": True}, + llm_router=None, + model="caller-model", + route="/v1/chat/completions", + ) + + +def test_user_config_with_literal_credentials_is_allowed_with_client_side_opt_in() -> None: + litellm_params: Final = {"model": "openai/gpt-4o", "api_base": "https://caller.example.com", "api_key": "sk-own"} + + assert ( + is_request_body_safe( + request_body={"model": "caller-model", "user_config": _user_config("model_list", litellm_params)}, + general_settings={"allow_client_side_credentials": True}, + llm_router=None, + model="caller-model", + route="/v1/chat/completions", + ) + is True + ) + + @pytest.mark.parametrize( "param", sorted(ANTHROPIC_WIF_KWARGS_KEYS | OPENAI_WIF_KWARGS_KEYS | set(oauth_token_exchange_litellm_params)), @@ -5821,7 +6117,7 @@ def test_per_user_credential_slots_in_request_body_are_rejected(field: str) -> N connection by proxy-injected secret_fields; a body-supplied value could only spoof either.""" with pytest.raises(ValueError, match="Rejected Request") as error: is_request_body_safe( - request_body={"model": "github_copilot/gpt-4o", field: "attacker-chosen"}, + request_body={"model": "github_copilot/gpt-4o", field: "caller-chosen"}, general_settings={}, llm_router=None, model="github_copilot/gpt-4o", diff --git a/tests/unit/proxy/auth/test_custom_auth_end_user_budget.py b/tests/unit/proxy/auth/test_custom_auth_end_user_budget.py index e75a77325c6..2a5ee88dbf9 100644 --- a/tests/unit/proxy/auth/test_custom_auth_end_user_budget.py +++ b/tests/unit/proxy/auth/test_custom_auth_end_user_budget.py @@ -1,3 +1,4 @@ +from datetime import datetime, timezone from typing import Final from unittest.mock import AsyncMock, MagicMock, patch @@ -6,15 +7,24 @@ from starlette.requests import Request from starlette.routing import Route import litellm +from litellm.caching.dual_cache import DualCache from litellm.proxy._types import ( LiteLLM_BudgetTable, LiteLLM_EndUserTable, + Litellm_EntityType, + ProxyErrorTypes, + ProxyException, UserAPIKeyAuth, ) from litellm.proxy.auth.user_api_key_auth import ( _run_post_custom_auth_checks, update_valid_token_with_end_user_params, ) +from litellm.proxy.hooks.model_max_budget_limiter import ( + PROXY_VirtualKeyModelMaxBudgetLimiter, + model_budget_spend_cache_key, +) +from litellm.types.videos.utils import encode_video_id_with_provider @pytest.mark.asyncio @@ -513,3 +523,86 @@ async def test_custom_auth_judges_the_zero_cost_waiver_by_the_key_alias_target( result: Final = await run() assert result.token == "test_token" limiter.is_end_user_within_model_budget.assert_not_awaited() + + +_VIDEO_ID: Final = encode_video_id_with_provider(video_id="video_raw", provider="openai", model_id="sora-2") + + +async def _post_custom_auth_video_request( + valid_token: UserAPIKeyAuth, method: str, template: str, request_data: dict[str, object] +) -> UserAPIKeyAuth: + limiter: Final = PROXY_VirtualKeyModelMaxBudgetLimiter(dual_cache=DualCache()) + await limiter.dual_cache.async_set_cache( + key=model_budget_spend_cache_key( + entity_type=Litellm_EntityType.KEY, entity_id=valid_token.token, budget_model="sora-2", budget_duration="1d" + ), + value=0.4, + ) + path: Final = template.format(video_id=_VIDEO_ID) + http_request: Final = Request( + { + "type": "http", + "method": method, + "path": path, + "headers": [], + "query_string": b"", + "route": Route(template, endpoint=lambda request: None), + } + ) + with ( + patch("litellm.proxy.proxy_server.llm_router", None), + patch("litellm.proxy.proxy_server.model_max_budget_limiter", limiter), + patch("litellm.proxy.proxy_server.general_settings", {}), + ): + return await _run_post_custom_auth_checks( + valid_token=valid_token, + request=http_request, + request_data=request_data, + route=path, + parent_otel_span=None, + ) + + +def _exhausted_model_budget_token() -> UserAPIKeyAuth: + return UserAPIKeyAuth(token="test_token", model_max_budget={"sora-2": {"max_budget": 0.3, "budget_duration": "1d"}}) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "template", + ["/v1/videos/{video_id}", "/videos/{video_id}", "/v1/videos/{video_id}/content", "/videos/{video_id}/content"], +) +async def test_custom_auth_exhausted_model_budget_still_retrieves_an_already_paid_video(template: str) -> None: + result: Final = await _post_custom_auth_video_request( + _exhausted_model_budget_token(), "GET", template, {"video_id": _VIDEO_ID} + ) + + assert result.token == "test_token" + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "method, template, request_data", + [ + ("POST", "/v1/videos", {"model": "sora-2"}), + ("POST", "/v1/videos/{video_id}/remix", {"video_id": _VIDEO_ID}), + ("GET", "/v1/videos", {"model": "sora-2"}), + ], +) +async def test_custom_auth_exhausted_model_budget_still_blocks_video_requests_other_than_retrieval( + method: str, template: str, request_data: dict[str, object] +) -> None: + with pytest.raises(litellm.BudgetExceededError): + await _post_custom_auth_video_request(_exhausted_model_budget_token(), method, template, request_data) + + +@pytest.mark.asyncio +async def test_custom_auth_video_retrieval_still_rejects_an_expired_token() -> None: + expired_token: Final = _exhausted_model_budget_token().model_copy( + update={"expires": datetime(2000, 1, 1, tzinfo=timezone.utc)} + ) + + with pytest.raises(ProxyException) as exc_info: + await _post_custom_auth_video_request(expired_token, "GET", "/v1/videos/{video_id}", {"video_id": _VIDEO_ID}) + + assert exc_info.value.type == ProxyErrorTypes.expired_key diff --git a/tests/unit/proxy/auth/test_user_api_key_auth.py b/tests/unit/proxy/auth/test_user_api_key_auth.py index 7746fc96673..d39c8cb8c85 100644 --- a/tests/unit/proxy/auth/test_user_api_key_auth.py +++ b/tests/unit/proxy/auth/test_user_api_key_auth.py @@ -2360,6 +2360,115 @@ async def test_jwt_path_skips_user_model_budget_only_for_zero_spend_mcp_methods( assert user_model_budget_check.await_count == (1 if expect_user_model_budget_check else 0) +@pytest.mark.asyncio +@pytest.mark.parametrize( + "method, path, expect_rejected", + [ + ("GET", "/v1/videos/{video_id}", False), + ("GET", "/videos/{video_id}/content", False), + ("POST", "/v1/videos", True), + ("POST", "/v1/videos/{video_id}/remix", True), + ], +) +async def test_jwt_path_spares_only_video_retrieval_from_an_exhausted_user_model_budget( + monkeypatch: pytest.MonkeyPatch, method: str, path: str, expect_rejected: bool +) -> None: + from litellm.caching.dual_cache import DualCache + from litellm.proxy._types import JWTAuthBuilderResult, LiteLLM_JWTAuth, Litellm_EntityType, ProxyErrorTypes + from litellm.proxy.auth import user_api_key_auth as user_api_key_auth_module + from litellm.proxy.auth.handle_jwt import JWTAuthManager, JWTHandler + from litellm.proxy.auth.user_api_key_auth import user_api_key_auth_builder + from litellm.proxy.hooks.model_max_budget_limiter import ( + PROXY_VirtualKeyModelMaxBudgetLimiter, + model_budget_spend_cache_key, + ) + from litellm.types.videos.utils import encode_video_id_with_provider + + video_id: Final = encode_video_id_with_provider(video_id="video_raw", provider="openai", model_id="sora-2") + jwt_result: Final = JWTAuthBuilderResult( + is_proxy_admin=False, + team_object=None, + user_object=LiteLLM_UserTable( + user_id="jwt-user", + model_max_budget={"sora-2": {"budget_limit": 0.3, "time_period": "1d"}}, + ), + end_user_object=None, + org_object=None, + token="fake.jwt.token", + team_id=None, + user_id="jwt-user", + user_email=None, + end_user_id=None, + org_id=None, + team_membership=None, + jwt_claims={}, + agent_id=None, + ) + + class _VerifiedJWTAuthManager(JWTAuthManager): + @staticmethod + async def auth_builder( + api_key: object, + jwt_handler: object, + request_data: object, + general_settings: object, + route: object, + prisma_client: object, + user_api_key_cache: object, + parent_otel_span: object, + proxy_logging_obj: object, + request_headers: object = None, + request_method: object = None, + ) -> JWTAuthBuilderResult: + return jwt_result + + limiter: Final = PROXY_VirtualKeyModelMaxBudgetLimiter(dual_cache=DualCache()) + await limiter.dual_cache.async_set_cache( + key=model_budget_spend_cache_key( + entity_type=Litellm_EntityType.USER, entity_id="jwt-user", budget_model="sora-2", budget_duration="1d" + ), + value=0.4, + ) + jwt_handler: Final = JWTHandler() + jwt_handler.update_environment( + prisma_client=None, + user_api_key_cache=DualCache(), + litellm_jwtauth=LiteLLM_JWTAuth(), + ) + mock_request: Final = MagicMock() + mock_request.url.path = path.format(video_id=video_id) + mock_request.method = method + mock_request.headers = {"authorization": "Bearer fake.jwt.token"} + mock_request.query_params = {} + request_data: Final[dict[str, object]] = {"model": "sora-2"} if path == "/v1/videos" else {"video_id": video_id} + + monkeypatch.setattr(litellm.proxy.proxy_server, "general_settings", {"enable_jwt_auth": True}) + monkeypatch.setattr(litellm.proxy.proxy_server, "premium_user", True) + monkeypatch.setattr(litellm.proxy.proxy_server, "jwt_handler", jwt_handler) + monkeypatch.setattr(litellm.proxy.proxy_server, "llm_router", None) + monkeypatch.setattr(litellm.proxy.proxy_server, "model_max_budget_limiter", limiter) + monkeypatch.setattr(user_api_key_auth_module, "JWTAuthManager", _VerifiedJWTAuthManager) + + async def authenticate() -> str | None: + result: Final = await user_api_key_auth_builder( + request=mock_request, + api_key="Bearer fake.jwt.token", + azure_api_key_header="", + anthropic_api_key_header=None, + google_ai_studio_api_key_header=None, + azure_apim_header=None, + request_data=request_data, + ) + return result.user_id + + if not expect_rejected: + assert await authenticate() == "jwt-user" + return + with pytest.raises(ProxyException) as exc_info: + await authenticate() + assert exc_info.value.type == ProxyErrorTypes.budget_exceeded + + def _qa_websocket(messages): async def receive(): return {"type": "websocket.connect"} diff --git a/tests/unit/proxy/auth/test_user_api_key_auth_request_flow.py b/tests/unit/proxy/auth/test_user_api_key_auth_request_flow.py index 5824b5fccab..67a76906dc8 100644 --- a/tests/unit/proxy/auth/test_user_api_key_auth_request_flow.py +++ b/tests/unit/proxy/auth/test_user_api_key_auth_request_flow.py @@ -13,8 +13,8 @@ from functools import partial from io import BytesIO from pathlib import Path from textwrap import dedent -from types import SimpleNamespace -from typing import Final +from types import MappingProxyType, SimpleNamespace +from typing import Final, Literal from unittest.mock import ANY, AsyncMock, MagicMock, patch @@ -98,6 +98,7 @@ from litellm.proxy.auth.user_api_key_auth import ( ) from litellm.proxy.pass_through_endpoints import pass_through_endpoints as pass_through from litellm.proxy.spend_tracking.carried_budget_state import carried_budget_metadata +from litellm.types.videos.utils import encode_video_id_with_provider from tests.unit.proxy.db.fake_prisma_engine import engine_call from tests._master_key import MASTER_KEY @@ -13956,6 +13957,143 @@ async def test_exhausted_key_budget_spares_only_zero_spend_mcp_discovery( assert result.spend == 5.0 +_VIDEO_ID: Final = encode_video_id_with_provider(video_id="video_raw", provider="openai", model_id="sora-2") +_VIDEO_RETRIEVAL_ROUTES: Final = ( + f"/v1/videos/{_VIDEO_ID}", + f"/videos/{_VIDEO_ID}", + f"/v1/videos/{_VIDEO_ID}/content", + f"/videos/{_VIDEO_ID}/content", +) +_EXPIRED_BEFORE_ANY_TEST_RUN: Final = datetime(2000, 1, 1, tzinfo=timezone.utc) +_VIDEO_SPENDING_REQUESTS: Final = ( + ("POST", "/v1/videos", MappingProxyType({"model": "sora-2"})), + ("POST", f"/v1/videos/{_VIDEO_ID}/remix", MappingProxyType({"video_id": _VIDEO_ID})), + ("POST", "/v1/videos/edits", MappingProxyType({"model": "sora-2"})), + ("POST", f"/v1/videos/{_VIDEO_ID}", MappingProxyType({"video_id": _VIDEO_ID})), + ("GET", "/v1/videos", MappingProxyType({"model": "sora-2"})), +) + + +async def _authenticate_video_request( + key: UserAPIKeyAuth, api_key: str, method: str, route: str, request_data: dict[str, object] +) -> UserAPIKeyAuth: + user_api_key_cache: Final = DualCache() + await cache_key_object( + hashed_token=key.token or "", + user_api_key_obj=key, + user_api_key_cache=user_api_key_cache, + proxy_logging_obj=None, + ) + model_budget_limiter: Final = PROXY_VirtualKeyModelMaxBudgetLimiter(dual_cache=DualCache()) + await model_budget_limiter.dual_cache.async_set_cache( + key=model_budget_spend_cache_key( + entity_type=Litellm_EntityType.KEY, entity_id=key.token, budget_model="sora-2", budget_duration="1d" + ), + value=0.4, + ) + request: Final = Request( + { + "type": "http", + "method": method, + "path": route, + "headers": [(b"authorization", f"Bearer {api_key}".encode())], + "query_string": b"", + } + ) + proxy_logging_obj: Final = MagicMock() + proxy_logging_obj.budget_alerts = AsyncMock() + proxy_logging_obj.post_call_failure_hook = AsyncMock(return_value=None) + with ( + patch("litellm.proxy.proxy_server.general_settings", {}), + patch("litellm.proxy.proxy_server.master_key", "sk-master"), + patch("litellm.proxy.proxy_server.prisma_client", MagicMock()), + patch("litellm.proxy.proxy_server.llm_router", None), + patch("litellm.proxy.proxy_server.llm_model_list", []), + patch("litellm.proxy.proxy_server.user_api_key_cache", user_api_key_cache), + patch("litellm.proxy.proxy_server.proxy_logging_obj", proxy_logging_obj), + patch("litellm.proxy.proxy_server.model_max_budget_limiter", model_budget_limiter), + patch( + "litellm.proxy.auth.user_api_key_auth.virtual_key_max_budget_alert_check", + new_callable=AsyncMock, + ), + ): + resolved: Final = await user_api_key_auth_builder( + request=request, + api_key=f"Bearer {api_key}", + azure_api_key_header="", + anthropic_api_key_header=None, + google_ai_studio_api_key_header=None, + azure_apim_header=None, + request_data=request_data, + ) + await _authorize_authenticated_request(resolved, request, request_data, route, api_key) + return resolved + + +def _exhausted_video_key(budget: Literal["max_budget", "model_max_budget"]) -> tuple[UserAPIKeyAuth, str]: + from litellm.proxy.utils import hash_token + + api_key: Final = f"sk-exhausted-video-{budget}" + if budget == "max_budget": + return UserAPIKeyAuth(token=hash_token(api_key), max_budget=0.3, spend=0.4), api_key + return ( + UserAPIKeyAuth( + token=hash_token(api_key), model_max_budget={"sora-2": {"max_budget": 0.3, "budget_duration": "1d"}} + ), + api_key, + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("budget", ["max_budget", "model_max_budget"]) +@pytest.mark.parametrize("route", _VIDEO_RETRIEVAL_ROUTES) +async def test_exhausted_key_budget_still_retrieves_an_already_paid_video( + budget: Literal["max_budget", "model_max_budget"], route: str +) -> None: + key, api_key = _exhausted_video_key(budget) + + result: Final = await _authenticate_video_request(key, api_key, "GET", route, {"video_id": _VIDEO_ID}) + + assert result.token == key.token + + +@pytest.mark.asyncio +@pytest.mark.parametrize("budget", ["max_budget", "model_max_budget"]) +@pytest.mark.parametrize("method, route, request_data", _VIDEO_SPENDING_REQUESTS) +async def test_exhausted_key_budget_still_blocks_video_requests_other_than_retrieval( + budget: Literal["max_budget", "model_max_budget"], method: str, route: str, request_data: Mapping[str, object] +) -> None: + key, api_key = _exhausted_video_key(budget) + + with pytest.raises(ProxyException) as exc_info: + await _authenticate_video_request(key, api_key, method, route, dict(request_data)) + + assert exc_info.value.type == ProxyErrorTypes.budget_exceeded + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "overrides, expected_type", + [ + ({"expires": _EXPIRED_BEFORE_ANY_TEST_RUN}, ProxyErrorTypes.expired_key), + ({"blocked": True}, ProxyErrorTypes.auth_error), + ({"models": ["other-model"]}, ProxyErrorTypes.key_model_access_denied), + ], +) +@pytest.mark.parametrize("route", (_VIDEO_RETRIEVAL_ROUTES[0], _VIDEO_RETRIEVAL_ROUTES[2])) +async def test_video_retrieval_on_exhausted_key_keeps_key_access_controls( + overrides: dict[str, object], expected_type: ProxyErrorTypes, route: str +) -> None: + exhausted_key, api_key = _exhausted_video_key("max_budget") + + with pytest.raises(ProxyException) as exc_info: + await _authenticate_video_request( + exhausted_key.model_copy(update=overrides), api_key, "GET", route, {"video_id": _VIDEO_ID} + ) + + assert exc_info.value.type == expected_type + + @pytest.mark.asyncio @pytest.mark.parametrize( "requested_model, key_aliases, team_model_aliases, expect_blocked", diff --git a/tests/unit/proxy/discovery_endpoints/test_skill_scanning.py b/tests/unit/proxy/discovery_endpoints/test_skill_scanning.py index 934620e5de8..028a185f9a0 100644 --- a/tests/unit/proxy/discovery_endpoints/test_skill_scanning.py +++ b/tests/unit/proxy/discovery_endpoints/test_skill_scanning.py @@ -97,7 +97,7 @@ def test_scanner_config_rejects_unsafe_credential_destinations(endpoint: str) -> def test_adapter_authentication_and_exact_remote_source(monkeypatch: pytest.MonkeyPatch) -> None: - from cookbook.skill_scanner import server + from litellm.proxy.discovery_endpoints.skill_scanner_adapter import server monkeypatch.setenv("SKILL_SCANNER_API_KEY", "adapter-secret") clock: Final = MagicMock() @@ -123,7 +123,7 @@ def test_adapter_authentication_and_exact_remote_source(monkeypatch: pytest.Monk def test_adapter_accepts_expanded_stored_skill_bytes(monkeypatch: pytest.MonkeyPatch) -> None: - from cookbook.skill_scanner import server + from litellm.proxy.discovery_endpoints.skill_scanner_adapter import server from litellm.proxy.anthropic_endpoints.claude_code_endpoints.skill_upload_archive import ( build_uploaded_skill_archive, ) diff --git a/tests/unit/proxy/guardrails/guardrail_hooks/test_collieai.py b/tests/unit/proxy/guardrails/guardrail_hooks/test_collieai.py new file mode 100644 index 00000000000..40629355a57 --- /dev/null +++ b/tests/unit/proxy/guardrails/guardrail_hooks/test_collieai.py @@ -0,0 +1,362 @@ +from __future__ import annotations + +import importlib.util +from types import ModuleType, SimpleNamespace +from typing import Final + +import httpx +import pytest +import respx +from fastapi import HTTPException + +import litellm +from litellm.caching.dual_cache import DualCache +from litellm.exceptions import GuardrailRaisedException +from litellm.integrations.custom_guardrail import CustomGuardrail, GuardrailSetupError +from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth +from litellm.proxy.guardrails.guardrail_endpoints import ( + CreateGuardrailRequest, + create_guardrail, + get_guardrail_ui_settings, + get_provider_specific_params, +) +from litellm.proxy.guardrails.guardrail_hooks.collieai import CollieAiGuardrail, initialize_guardrail +from litellm.proxy.guardrails.guardrail_hooks.collieai.collieai import ( + MISSING_PACKAGE_MESSAGE, + PACKAGE_MODULE, + has_readiness_guard, + load_base, + package_guardrail, +) +from litellm.proxy.guardrails.guardrail_registry import InMemoryGuardrailHandler +from litellm.proxy.utils import ProxyLogging +from litellm.types.guardrails import Guardrail, LitellmParams +from litellm.types.proxy.guardrails.guardrail_hooks.collieai import ( + DEFAULT_API_BASE, + CollieAiGuardrailConfigModel, + CollieAiGuardrailConfigModelOptionalParams, +) + +PACKAGE_INSTALLED: Final = importlib.util.find_spec("collieai_guardrail") is not None +API_KEY: Final = "clai_" + "0" * 40 +CHAT_REQUEST: Final = {"model": "gpt-5.4-mini", "messages": [{"role": "user", "content": "hello"}]} + + +class _RecordingGuardrail(CustomGuardrail): + def __init__( + self, + *, + api_base: str | None = None, + api_key: str | None = None, + guardrail_name: str | None = None, + event_hook: object = None, + default_on: bool | None = None, + stream_scope: object = None, + **settings: object, + ) -> None: + super().__init__(guardrail_name=guardrail_name, default_on=bool(default_on), stream_scope=stream_scope) + self.given = { + "api_base": api_base, + "api_key": api_key, + "guardrail_name": guardrail_name, + "event_hook": event_hook, + "default_on": default_on, + "stream_scope": stream_scope, + **settings, + } + + +class _RefusesStreamScope(_RecordingGuardrail): + def apply_stream_scope(self, stream_scope: object) -> None: + if stream_scope not in (None, "both"): + raise RuntimeError("enforcement_mode block needs stream_scope unset or both") + super().apply_stream_scope(stream_scope) + + +def _params(**extras: object) -> LitellmParams: + return LitellmParams( + guardrail="collieai", mode=["pre_call", "post_call"], default_on=True, api_key=API_KEY, **extras + ) + + +def _guardrail(litellm_params: LitellmParams) -> Guardrail: + return Guardrail(guardrail_name="collieai", litellm_params=litellm_params) + + +def _init(litellm_params: LitellmParams) -> _RecordingGuardrail: + callback: Final = initialize_guardrail( + litellm_params, _guardrail(litellm_params), guardrail_cls=_RecordingGuardrail + ) + assert isinstance(callback, _RecordingGuardrail) + return callback + + +@pytest.fixture(autouse=True) +def _isolate_callbacks(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "callbacks", []) + + +def test_hands_the_entry_and_every_setting_to_the_package() -> None: + callback: Final = _init( + _params( + api_base="https://collieai.internal.example/v1/integrations/litellm", + enforcement_mode="block", + deadline_ms=2000, + network_margin_ms=300, + max_body_bytes=1024, + forward_conversation_id=True, + summary_interval_s=30, + synthetic_interval_s=0, + workspace_id="not-a-collieai-setting", + stream_scope="non_streaming", + ) + ) + + assert callback.given == { + "api_base": "https://collieai.internal.example/v1/integrations/litellm", + "api_key": API_KEY, + "guardrail_name": "collieai", + "event_hook": ["pre_call", "post_call"], + "default_on": True, + "stream_scope": "non_streaming", + "enforcement_mode": "block", + "deadline_ms": 2000, + "network_margin_ms": 300, + "max_body_bytes": 1024, + "forward_conversation_id": True, + "summary_interval_s": 30, + "synthetic_interval_s": 0, + "workspace_id": "not-a-collieai-setting", + } + assert litellm.callbacks == [callback] + + +def test_points_at_app_collieai_io_unless_told_otherwise() -> None: + callback: Final = _init(_params()) + + # The hosted service's base URL, from https://docs.collieai.io/integrations/litellm (2026-10-29) + assert callback.given["api_base"] == DEFAULT_API_BASE == "https://app.collieai.io/v1/integrations/litellm" + assert set(callback.given) == {"api_base", "api_key", "guardrail_name", "event_hook", "default_on", "stream_scope"} + + +def test_a_cleared_optional_setting_leaves_the_package_its_default() -> None: + callback: Final = _init(_params(deadline_ms=None, forward_conversation_id=None, network_margin_ms=300)) + + assert "deadline_ms" not in callback.given + assert "forward_conversation_id" not in callback.given + assert callback.given["network_margin_ms"] == 300 + + +def test_a_stream_scope_the_package_refuses_is_a_setup_error_and_adds_no_callback() -> None: + litellm_params: Final = _params(enforcement_mode="block", stream_scope="streaming") + + with pytest.raises(GuardrailSetupError, match="stream_scope"): + initialize_guardrail(litellm_params, _guardrail(litellm_params), guardrail_cls=_RefusesStreamScope) + + assert litellm.callbacks == [] + + +def test_hands_each_entry_its_own_name_phase_and_default_on() -> None: + litellm_params: Final = LitellmParams(guardrail="collieai", mode="pre_call", default_on=False, api_key=API_KEY) + callback: Final = initialize_guardrail( + litellm_params, + Guardrail(guardrail_name="collieai-prompts", litellm_params=litellm_params), + guardrail_cls=_RecordingGuardrail, + ) + + assert isinstance(callback, _RecordingGuardrail) + assert (callback.given["guardrail_name"], callback.given["event_hook"], callback.given["default_on"]) == ( + "collieai-prompts", + "pre_call", + False, + ) + + +def test_takes_the_key_from_collieai_api_key_only_when_the_entry_has_none(monkeypatch: pytest.MonkeyPatch) -> None: + from_environment: Final = "clai_" + "1" * 40 + monkeypatch.setenv("COLLIEAI_API_KEY", from_environment) + without_key: Final = LitellmParams(guardrail="collieai", mode=["pre_call", "post_call"], default_on=True) + + assert _init(without_key).given["api_key"] == from_environment + assert _init(_params()).given["api_key"] == API_KEY + + +def test_an_untouched_ui_form_leaves_every_setting_to_the_package() -> None: + model: Final = CollieAiGuardrailConfigModel(api_key=API_KEY) + optional: Final = CollieAiGuardrailConfigModelOptionalParams() + callback: Final = _init( + _params(**model.model_dump(exclude={"api_key", "optional_params"}), **optional.model_dump()) + ) + + assert callback.given["api_base"] == DEFAULT_API_BASE + assert set(callback.given) == {"api_base", "api_key", "guardrail_name", "event_hook", "default_on", "stream_scope"} + + +@pytest.mark.asyncio +async def test_ui_offers_collieai_fields_without_the_package() -> None: + assert CollieAiGuardrail.get_config_model() is CollieAiGuardrailConfigModel + + fields: Final = (await get_provider_specific_params())["collieai"] + + assert fields["ui_friendly_name"] == "CollieAi" + assert fields["api_key"]["required"] is False + assert set(fields["optional_params"]["fields"]) == {"deadline_ms", "forward_conversation_id"} + assert [name for name in ("api_key", "api_base") if "default_value" in fields[name]] == [] + assert [name for name, field in fields["optional_params"]["fields"].items() if "default_value" in field] == [] + + +@pytest.mark.asyncio +async def test_ui_offers_only_the_two_phases_collieai_checks() -> None: + settings: Final = await get_guardrail_ui_settings() + + assert settings.supported_modes_by_provider["collieai"] == ["pre_call", "post_call"] + + +def test_a_package_without_the_readiness_guard_is_too_old() -> None: + assert not has_readiness_guard(ModuleType("collieai_guardrail.guardrail")) + assert has_readiness_guard(SimpleNamespace(require_guardrail=object())) + + +def test_only_a_current_package_s_guardrail_class_is_taken() -> None: + guard: Final = object() + + assert package_guardrail(SimpleNamespace(require_guardrail=guard, CollieAIGuardrail=_RecordingGuardrail)) is ( + _RecordingGuardrail + ) + assert package_guardrail(SimpleNamespace(CollieAIGuardrail=_RecordingGuardrail)) is None + assert package_guardrail(SimpleNamespace(require_guardrail=guard, CollieAIGuardrail=object())) is None + assert package_guardrail(SimpleNamespace(require_guardrail=guard, CollieAIGuardrail=ValueError)) is None + + +def test_builds_on_the_package_only_when_it_is_current() -> None: + current: Final = SimpleNamespace(require_guardrail=object(), CollieAIGuardrail=_RecordingGuardrail) + too_old: Final = SimpleNamespace(CollieAIGuardrail=_RecordingGuardrail) + + assert load_base({PACKAGE_MODULE: current}.__getitem__) is _RecordingGuardrail + with pytest.raises(ImportError, match="pip install") as raised: + load_base({PACKAGE_MODULE: too_old}.__getitem__)(guardrail_name="collieai") + + assert str(raised.value) == MISSING_PACKAGE_MESSAGE + assert raised.value.__cause__ is None + + +def test_without_the_package_building_the_guardrail_names_what_to_install() -> None: + cause: Final = ModuleNotFoundError("No module named 'collieai_guardrail'", name="collieai_guardrail") + + def import_module(name: str) -> object: + raise cause + + with pytest.raises(ImportError, match="pip install") as raised: + load_base(import_module)(guardrail_name="collieai") + + assert str(raised.value) == MISSING_PACKAGE_MESSAGE + assert raised.value.__cause__ is cause + + +@pytest.mark.parametrize( + "cause", + [ + ModuleNotFoundError("No module named 'litellm.gone'", name="litellm.gone"), + ImportError("cannot import name 'Moved' from 'litellm.types'", name="litellm.types"), + ImportError("cannot import name 'Observer' from 'collieai_guardrail.observer'", name="collieai_guardrail.observer"), + AttributeError("module 'litellm' has no attribute 'moved'"), + ], +) +def test_an_installed_package_that_fails_to_load_says_so_instead_of_asking_to_install_it(cause: Exception) -> None: + def import_module(name: str) -> object: + raise cause + + with pytest.raises(ImportError, match="installed but failed to load") as raised: + load_base(import_module)(guardrail_name="collieai") + + assert str(cause) in str(raised.value) + assert MISSING_PACKAGE_MESSAGE not in str(raised.value) + assert raised.value.__cause__ is cause + + +@pytest.mark.skipif(PACKAGE_INSTALLED, reason="exercises the missing-package fallback") +def test_missing_package_fails_at_config_load_with_install_hint() -> None: + with pytest.raises(GuardrailSetupError, match="pip install") as raised: + InMemoryGuardrailHandler().initialize_guardrail(_guardrail(_params())) + + assert not isinstance(raised.value, (ValueError, TypeError)) + assert litellm.callbacks == [] + + +@pytest.mark.asyncio +async def test_creating_a_guardrail_the_package_refuses_answers_400_and_removes_the_row(mocker) -> None: + from unittest.mock import AsyncMock + + litellm_params: Final = { + "guardrail": "collieai", + "mode": ["pre_call", "post_call"], + "default_on": True, + "api_key": "sk-not-a-collieai-key", + } + row: Final = {"guardrail_name": "collieai-refused", "litellm_params": litellm_params, "guardrail_info": {}} + registry: Final = mocker.Mock(add_guardrail_to_db=AsyncMock(return_value={**row, "guardrail_id": "refused"})) + mocker.patch("litellm.proxy.guardrails.guardrail_endpoints.GUARDRAIL_REGISTRY", registry) + mocker.patch("litellm.proxy.proxy_server.prisma_client", mocker.Mock()) + mocker.patch("litellm.proxy.guardrails.guardrail_registry.IN_MEMORY_GUARDRAIL_HANDLER", InMemoryGuardrailHandler()) + delete_row: Final = mocker.patch("litellm.proxy.guardrails.guardrail_endpoints._delete_guardrail_row", AsyncMock()) + + with pytest.raises(HTTPException) as refused: + await create_guardrail( + CreateGuardrailRequest(guardrail=row), + user_api_key_dict=UserAPIKeyAuth(user_role=LitellmUserRoles.PROXY_ADMIN), + ) + + assert refused.value.status_code == 400 + delete_row.assert_awaited_once() + assert litellm.callbacks == [] + + +def _load(monkeypatch: pytest.MonkeyPatch, **extras: object) -> CustomGuardrail: + """The guardrail as the proxy loads `guardrail: collieai` from its config, with no synthetic check at start. Block + mode also needs the package's readiness guard among the proxy's callbacks, which the config file loads first""" + from collieai_guardrail.guardrail import require_guardrail + + block: Final = extras.get("enforcement_mode") == "block" + monkeypatch.setattr(litellm, "callbacks", [require_guardrail] if block else []) + InMemoryGuardrailHandler().initialize_guardrail(_guardrail(_params(synthetic_interval_s=0, **extras))) + loaded: Final = [callback for callback in litellm.callbacks if isinstance(callback, CollieAiGuardrail)] + assert len(loaded) == 1 + return loaded[0] + + +async def _pre_call() -> dict[str, object]: + data: Final = {**CHAT_REQUEST, "metadata": {}} + await ProxyLogging(user_api_key_cache=DualCache()).pre_call_hook( + user_api_key_dict=UserAPIKeyAuth(request_route="/v1/chat/completions"), data=data, call_type="acompletion" + ) + return data + + +@pytest.mark.skipif(not PACKAGE_INSTALLED, reason="needs collieai-litellm-guardrail") +@pytest.mark.asyncio +@respx.mock +async def test_block_refuses_the_call_when_collieai_is_unreachable(monkeypatch: pytest.MonkeyPatch) -> None: + route: Final = respx.post(url__startswith=DEFAULT_API_BASE).mock(side_effect=httpx.ConnectError("refused")) + _load(monkeypatch, enforcement_mode="block") + + with pytest.raises((GuardrailRaisedException, HTTPException)) as refused: + await _pre_call() + + assert route.called + assert getattr(refused.value, "status_code", None) == 503 + + +@pytest.mark.skipif(not PACKAGE_INSTALLED, reason="needs collieai-litellm-guardrail") +@pytest.mark.asyncio +@respx.mock +async def test_monitor_lets_the_call_go_on_and_records_why(monkeypatch: pytest.MonkeyPatch) -> None: + route: Final = respx.post(url__startswith=DEFAULT_API_BASE).mock(side_effect=httpx.ConnectError("refused")) + _load(monkeypatch) + + data: Final = await _pre_call() + + assert route.called + metadata: Final = data["metadata"] + assert isinstance(metadata, dict) + [record] = metadata["standard_logging_guardrail_information"] + assert (record["guardrail_provider"], record["guardrail_status"]) == ("collieai", "guardrail_failed_to_respond") diff --git a/tests/unit/proxy/guardrails/test_guardrail_endpoints.py b/tests/unit/proxy/guardrails/test_guardrail_endpoints.py index f5e5cc32357..cb11acc99cb 100644 --- a/tests/unit/proxy/guardrails/test_guardrail_endpoints.py +++ b/tests/unit/proxy/guardrails/test_guardrail_endpoints.py @@ -1,10 +1,10 @@ import json import time -from collections.abc import Callable +from collections.abc import Awaitable, Callable, Mapping, Sequence from datetime import datetime from types import MappingProxyType -from typing import Dict, Final, List, Literal, Optional -from unittest.mock import AsyncMock +from typing import Final, List, Literal, Optional +from unittest.mock import AsyncMock, Mock import httpx import pytest @@ -48,9 +48,9 @@ from litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_fil MOCK_ADMIN_USER = UserAPIKeyAuth(user_role=LitellmUserRoles.PROXY_ADMIN) from litellm.proxy.guardrails.guardrail_registry import ( - IN_MEMORY_GUARDRAIL_HANDLER, InMemoryGuardrailHandler, encrypt_guardrail_litellm_params, + guardrail_from_db_row, ) from litellm.types.guardrails import ( ApplyGuardrailRequest, @@ -1020,7 +1020,7 @@ def test_optional_params_not_returned_when_not_overridden(): """Test that optional_params is not returned when the config model doesn't override it""" from typing import Optional - from pydantic import BaseModel, Field + from pydantic import Field from litellm.proxy.guardrails.guardrail_endpoints import _get_fields_from_model from litellm.types.proxy.guardrails.guardrail_hooks.base import GuardrailConfigModel @@ -1080,7 +1080,7 @@ def test_optional_params_returned_when_properly_overridden(): @pytest.mark.asyncio async def test_bedrock_guardrail_prepare_request_with_api_key(): """Test _prepare_request method uses Bearer token when api_key is provided in data""" - from unittest.mock import Mock, patch + from unittest.mock import Mock from litellm.proxy.guardrails.guardrail_hooks.bedrock_guardrails import ( BedrockGuardrail, @@ -2029,6 +2029,286 @@ async def test_delete_guardrail_endpoint( assert "Failed to remove guardrail" in str(mock_logger.warning.call_args) +PLANTED_API_KEY: Final = "sk-planted-guardrail-api-key" +PLANTED_AUTH_HEADER: Final = "Bearer planted-guardrail-auth-header" +PLANTED_APIKEY_HEADER: Final = "planted-guardrail-apikey-header" +ROTATED_API_KEY: Final = "sk-planted-rotated-api-key" +PLANTED_SECRETS: Final = (PLANTED_API_KEY, ROTATED_API_KEY, PLANTED_AUTH_HEADER, PLANTED_APIKEY_HEADER, "litellm_enc::") +AUDIT_ADMIN: Final = UserAPIKeyAuth( + user_role=LitellmUserRoles.PROXY_ADMIN, user_id="security-admin", api_key="hashed-admin-key" +) +STORED_PARAMS: Final = MappingProxyType( + { + "guardrail": "generic_guardrail_api", + "mode": "pre_call", + "default_on": False, + "api_base": "https://guardrails.example.com/validate", + "api_key": PLANTED_API_KEY, + "headers": {"Authorization": PLANTED_AUTH_HEADER, "apikey": PLANTED_APIKEY_HEADER, "X-Tenant": "acme"}, + } +) +STORED_GUARDRAIL_SNAPSHOT: Final = MappingProxyType( + { + "guardrail_id": "gr-audit", + "guardrail_name": "audited-guard", + "guardrail_info": {"description": "audited"}, + "status": "active", + "litellm_params": {"guardrail": "generic_guardrail_api", "mode": "pre_call", "default_on": False}, + } +) +SAVED_AT: Final = datetime(2026, 11, 11, 12, 0, 0) + + +def _requested_guardrail(**params: object) -> Guardrail: + return Guardrail( + guardrail_name="audited-guard", + litellm_params=LitellmParams(**{**STORED_PARAMS, **params}), + guardrail_info={"description": "audited"}, + ) + + +def _row_as_written(where: Mapping[str, object], data: Mapping[str, object]): + """The guardrails table row holding exactly what the registry wrote, as Prisma returns it.""" + from prisma.models import LiteLLM_GuardrailsTable + + return LiteLLM_GuardrailsTable( + **{"guardrail_id": where["guardrail_id"], "status": "active", "created_at": SAVED_AT, **data} + ) + + +def _stored_row(): + return _row_as_written( + {"guardrail_id": "gr-audit"}, + { + "guardrail_name": "audited-guard", + "litellm_params": json.dumps( + encrypt_guardrail_litellm_params(LitellmParams(**STORED_PARAMS).model_dump()), default=str + ), + "guardrail_info": json.dumps({"description": "audited"}), + "updated_at": SAVED_AT, + }, + ) + + +@pytest.fixture +def audit_prisma(mocker: MockerFixture, monkeypatch: pytest.MonkeyPatch) -> Mock: + """Audit logging on, with a prisma client whose LiteLLM_AuditLog inserts are recorded and whose guardrails + table holds one stored guardrail and returns whatever the registry writes.""" + import litellm + + monkeypatch.setattr(litellm, "store_audit_logs", True) + monkeypatch.setattr(litellm, "audit_log_callbacks", []) + monkeypatch.delenv("GENERIC_GUARDRAIL_API_BASE", raising=False) + mocker.patch("litellm.proxy.proxy_server.premium_user", True) + prisma: Final = Mock() + prisma.db.litellm_auditlog.create = AsyncMock() + prisma.db.litellm_guardrailstable.find_unique = AsyncMock(return_value=_stored_row()) + prisma.db.litellm_guardrailstable.update = AsyncMock(side_effect=_row_as_written) + prisma.db.litellm_guardrailstable.create = AsyncMock( + side_effect=lambda data: _row_as_written({"guardrail_id": "gr-audit"}, data) + ) + prisma.db.litellm_guardrailstable.delete = AsyncMock() + mocker.patch("litellm.proxy.proxy_server.prisma_client", prisma) + return prisma + + +def _live_guardrails(mocker: MockerFixture, loaded: Sequence[object] = ()) -> InMemoryGuardrailHandler: + handler: Final = InMemoryGuardrailHandler() + for row in loaded: + handler.initialize_guardrail(guardrail=guardrail_from_db_row(row), source="db") + mocker.patch("litellm.proxy.guardrails.guardrail_registry.IN_MEMORY_GUARDRAIL_HANDLER", handler) + return handler + + +async def _written_audit_rows(prisma: Mock) -> tuple[Mapping[str, object], ...]: + from litellm.proxy.management_helpers.audit_logs import drain_audit_tasks + + await drain_audit_tasks() + insert: Final[AsyncMock] = prisma.db.litellm_auditlog.create + return tuple(MappingProxyType(call.kwargs["data"]) for call in insert.call_args_list) + + +def _audit_snapshot(row: Mapping[str, object], field: str) -> Mapping[str, object]: + value: Final = row[field] + assert isinstance(value, str), f"{field} should be a JSON string, got {value!r}" + return json.loads(value) + + +def _assert_no_planted_secret(row: Mapping[str, object]) -> None: + serialized: Final = json.dumps(dict(row), default=str) + for secret in PLANTED_SECRETS: + assert secret not in serialized, f"{secret!r} leaked into the audit row: {serialized}" + + +@pytest.mark.asyncio +async def test_create_guardrail_audit_row_records_the_caller_and_no_provider_secret( + mocker: MockerFixture, audit_prisma: Mock +): + _live_guardrails(mocker) + + await create_guardrail(CreateGuardrailRequest(guardrail=_requested_guardrail()), user_api_key_dict=AUDIT_ADMIN) + + rows: Final = await _written_audit_rows(audit_prisma) + assert [ + { + k: row.get(k) + for k in ("action", "table_name", "object_id", "changed_by", "changed_by_api_key", "before_value") + } + for row in rows + ] == [ + { + "action": "created", + "table_name": "LiteLLM_GuardrailsTable", + "object_id": "gr-audit", + "changed_by": "security-admin", + "changed_by_api_key": "hashed-admin-key", + "before_value": None, + } + ], rows + assert _audit_snapshot(rows[0], "updated_values") == STORED_GUARDRAIL_SNAPSHOT + _assert_no_planted_secret(rows[0]) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("method", ["put", "patch"]) +async def test_update_guardrail_audit_row_shows_the_mode_change_and_names_only_the_rotated_key( + method: str, mocker: MockerFixture, audit_prisma: Mock +): + _live_guardrails(mocker, loaded=(_stored_row(),)) + + if method == "put": + await update_guardrail( + "gr-audit", + UpdateGuardrailRequest(guardrail=_requested_guardrail(mode="post_call", api_key=ROTATED_API_KEY)), + user_api_key_dict=AUDIT_ADMIN, + ) + else: + await patch_guardrail( + "gr-audit", + PatchGuardrailRequest(litellm_params={"api_key": ROTATED_API_KEY, "mode": "post_call"}), + user_api_key_dict=AUDIT_ADMIN, + ) + + rows: Final = await _written_audit_rows(audit_prisma) + assert [(r["action"], r["object_id"], r["changed_by"]) for r in rows] == [ + ("updated", "gr-audit", "security-admin") + ], rows + assert _audit_snapshot(rows[0], "before_value") == STORED_GUARDRAIL_SNAPSHOT + assert _audit_snapshot(rows[0], "updated_values") == { + **STORED_GUARDRAIL_SNAPSHOT, + "litellm_params": {"guardrail": "generic_guardrail_api", "mode": "post_call", "default_on": False}, + "changed_litellm_params": ["api_key"], + }, "only api_key changed, so headers the live guardrail adds for itself must not show up" + _assert_no_planted_secret(rows[0]) + + +@pytest.mark.asyncio +async def test_delete_guardrail_audit_row_keeps_the_deleted_guardrail_without_secrets( + mocker: MockerFixture, audit_prisma: Mock +): + _live_guardrails(mocker, loaded=(_stored_row(),)) + + await delete_guardrail(guardrail_id="gr-audit", user_api_key_dict=AUDIT_ADMIN) + + rows: Final = await _written_audit_rows(audit_prisma) + assert [(r["action"], r["object_id"], r.get("updated_values")) for r in rows] == [("deleted", "gr-audit", None)], ( + rows + ) + assert _audit_snapshot(rows[0], "before_value") == STORED_GUARDRAIL_SNAPSHOT + _assert_no_planted_secret(rows[0]) + + +@pytest.mark.asyncio +async def test_rejected_guardrail_update_writes_no_audit_row(mocker: MockerFixture, audit_prisma: Mock): + _live_guardrails(mocker, loaded=(_stored_row(),)) + + with pytest.raises(HTTPException) as exc_info: + await update_guardrail( + "gr-audit", + UpdateGuardrailRequest(guardrail=_requested_guardrail(mode="post_call", api_base=None)), + user_api_key_dict=AUDIT_ADMIN, + ) + + assert exc_info.value.status_code == 422, exc_info.value.detail + assert await _written_audit_rows(audit_prisma) == (), "a rolled-back update must not be audited" + + +def _team_guardrail_row(status: str, params_stored_as_json_string: bool = False): + encrypted: Final = encrypt_guardrail_litellm_params(dict(STORED_PARAMS)) + return _row_as_written( + {"guardrail_id": "team-gr"}, + { + "guardrail_name": "team-guard", + "litellm_params": json.dumps(json.dumps(encrypted) if params_stored_as_json_string else encrypted), + "guardrail_info": json.dumps({"description": "team"}), + "status": status, + "team_id": "team-1", + "updated_at": SAVED_AT, + }, + ) + + +def _team_guardrail_snapshot(status: str) -> Mapping[str, object]: + return MappingProxyType( + { + "guardrail_id": "team-gr", + "guardrail_name": "team-guard", + "guardrail_info": {"description": "team"}, + "status": status, + "team_id": "team-1", + "litellm_params": {"guardrail": "generic_guardrail_api", "mode": "pre_call", "default_on": False}, + } + ) + + +@pytest.mark.asyncio +async def test_register_guardrail_audit_row_records_the_pending_submission_without_secrets( + audit_prisma: Mock, +) -> None: + audit_prisma.db.litellm_guardrailstable.find_unique = AsyncMock(return_value=None) + audit_prisma.db.litellm_guardrailstable.create = AsyncMock(return_value=_team_guardrail_row("pending_review")) + request: Final = RegisterGuardrailRequest( + guardrail_name="team-guard", litellm_params=dict(STORED_PARAMS), team_id="team-1" + ) + + await register_guardrail(request, AUDIT_ADMIN) + + rows: Final = await _written_audit_rows(audit_prisma) + assert [(r["action"], r["object_id"]) for r in rows] == [("created", "team-gr")], rows + assert _audit_snapshot(rows[0], "updated_values") == _team_guardrail_snapshot("pending_review") + _assert_no_planted_secret(rows[0]) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "review, new_status", [(approve_guardrail_submission, "active"), (reject_guardrail_submission, "rejected")] +) +@pytest.mark.parametrize("params_stored_as_json_string", [False, True], ids=["json_object", "json_string"]) +async def test_guardrail_submission_review_audit_row_shows_the_status_change( + review: Callable[[str, UserAPIKeyAuth], Awaitable[Mapping[str, object]]], + new_status: str, + params_stored_as_json_string: bool, + mocker: MockerFixture, + audit_prisma: Mock, +): + audit_prisma.db.litellm_guardrailstable.find_unique = AsyncMock( + return_value=_team_guardrail_row("pending_review", params_stored_as_json_string) + ) + audit_prisma.db.litellm_guardrailstable.update = AsyncMock( + return_value=_team_guardrail_row(new_status, params_stored_as_json_string) + ) + _live_guardrails(mocker) + + response: Final = await review("team-gr", AUDIT_ADMIN) + + assert response["status"] == new_status, response + rows: Final = await _written_audit_rows(audit_prisma) + assert [(r["action"], r["object_id"]) for r in rows] == [("updated", "team-gr")], rows + assert _audit_snapshot(rows[0], "before_value") == _team_guardrail_snapshot("pending_review") + assert _audit_snapshot(rows[0], "updated_values") == _team_guardrail_snapshot(new_status) + _assert_no_planted_secret(rows[0]) + + @pytest.mark.asyncio async def test_apply_guardrail_not_found(mocker): """ diff --git a/tests/unit/proxy/guardrails/test_guardrail_registry.py b/tests/unit/proxy/guardrails/test_guardrail_registry.py index 7eabc24e090..bf328264bab 100644 --- a/tests/unit/proxy/guardrails/test_guardrail_registry.py +++ b/tests/unit/proxy/guardrails/test_guardrail_registry.py @@ -649,6 +649,38 @@ def test_unchanged_db_params_do_not_register_as_changed(): assert handler._has_guardrail_params_changed(gid, new) is False +@pytest.mark.parametrize("field", ("api_key", "api_base")) +def test_db_poll_does_not_rebuild_a_guardrail_whose_secret_field_is_an_env_reference(monkeypatch, field): + from litellm.proxy.guardrails import guardrail_registry as registry_module + + built_with: Final[list[str | None]] = [] + + def _initializer(litellm_params, guardrail): + built_with.append(getattr(litellm_params, field)) + return CustomGuardrail( + guardrail_name=guardrail["guardrail_name"], event_hook=GuardrailEventHooks.pre_call, default_on=True + ) + + monkeypatch.setitem(registry_module.guardrail_initializer_registry, "env_ref_test", _initializer) + monkeypatch.setenv("ENV_REF_TEST_VALUE", "resolved-value") + row: Final = { + "guardrail_id": "env-ref", + "guardrail_name": "env-ref", + "litellm_params": { + "guardrail": "env_ref_test", + "mode": "pre_call", + field: "os.environ/ENV_REF_TEST_VALUE", + }, + } + handler: Final = InMemoryGuardrailHandler() + handler.initialize_guardrail(guardrail=dict(row), source="db") + + handler.sync_guardrail_from_db(dict(row)) + handler.sync_guardrail_from_db(dict(row)) + + assert built_with == ["resolved-value"] + + def test_db_poll_does_not_reinitialize_config_guardrail_without_default_on(): handler = InMemoryGuardrailHandler() guardrail_id: Final = "config-default-on-guardrail" diff --git a/tests/unit/proxy/hooks/test_autorouter_baseline_cache.py b/tests/unit/proxy/hooks/test_autorouter_baseline_cache.py index 12aa850afb6..86a7e03db84 100644 --- a/tests/unit/proxy/hooks/test_autorouter_baseline_cache.py +++ b/tests/unit/proxy/hooks/test_autorouter_baseline_cache.py @@ -1150,3 +1150,10 @@ async def test_a_turn_routed_to_a_non_anthropic_tier_says_its_provider_is_unsupp captured: Final = _observation(await rig.capture.payload()) assert captured.observation.outcome == "uncertain" assert captured.observation.reason == "unsupported_selected_provider" + + +@pytest.fixture(autouse=True) +def _python_messages(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.llms.anthropic.messages.native import handler as python_messages + + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) diff --git a/tests/unit/proxy/hooks/test_proxy_track_cost_callback.py b/tests/unit/proxy/hooks/test_proxy_track_cost_callback.py index dcec934188f..1e5ad21fc5d 100644 --- a/tests/unit/proxy/hooks/test_proxy_track_cost_callback.py +++ b/tests/unit/proxy/hooks/test_proxy_track_cost_callback.py @@ -1,11 +1,11 @@ import asyncio import json import logging -from collections.abc import Mapping +from collections.abc import Awaitable, Callable, Mapping from datetime import datetime, timedelta, timezone from pathlib import Path from types import MappingProxyType, SimpleNamespace -from typing import Final, cast +from typing import Final, ParamSpec, cast from unittest.mock import AsyncMock, MagicMock, create_autospec, patch import httpx @@ -29,6 +29,7 @@ from litellm.proxy.db.model_usage_rollup import build_model_usage_transaction from litellm.proxy.db.spend_log_tool_index import response_tool_call_names from litellm.proxy.hooks.proxy_track_cost_callback import ( ProxyDBLogger, + _IncrementSpendCounters, _charge_request_cost, _get_budget_reservation_from_metadata, _should_track_cost_callback, @@ -2970,7 +2971,42 @@ async def _counter_values(counters: SpendCounterStore) -> dict[str, float | None return {key: counters.get_local(key) for key in _LIVE_COUNTERS} +_P = ParamSpec("_P") + + +def _held_until( + release: asyncio.Event, counting: asyncio.Future[asyncio.Task[object]], store: Callable[_P, Awaitable[None]] +) -> Callable[_P, Awaitable[None]]: + async def held(*args: _P.args, **kwargs: _P.kwargs) -> None: + if (task := asyncio.current_task()) is not None and not counting.done(): + counting.set_result(task) + await release.wait() + await store(*args, **kwargs) + + return held + + +async def _fail_request_and_finish_counting_in_background( + store: _IncrementSpendCounters, failure: Mapping[str, object], committed: CommittedBudgetSpend | None = None +) -> None: + release: Final = asyncio.Event() + counting: Final[asyncio.Future[asyncio.Task[object]]] = asyncio.get_running_loop().create_future() + held: Final = _held_until(release, counting, store) + try: + await _fail_request( + ProxyDBLogger(spend_counters=lambda: held, failure_counter_wait_seconds=0), failure, committed + ) + background: Final = await counting + release.set() + await background + finally: + release.set() + if counting.done(): + await asyncio.wait((counting.result(),)) + + @pytest.mark.asyncio +@pytest.mark.timeout(30) @pytest.mark.parametrize( ("failure", "charged"), [ @@ -2982,7 +3018,6 @@ async def _counter_values(counters: SpendCounterStore) -> dict[str, float | None 0.125, ), (_failure_with_billed_attempts(), 1.25), - ({}, 0.0), ], ) async def test_failure_spend_rows_raise_the_live_spend_counters_by_their_cost( @@ -2990,10 +3025,12 @@ async def test_failure_spend_rows_raise_the_live_spend_counters_by_their_cost( ): """#35568: budget checks read the live counters, so a failure row's cost has to land there as well as in the spend log, or an over-budget key keeps passing until the counter is next repaired from the database.""" + from litellm.proxy.proxy_server import increment_spend_counters + for key, spend in _LIVE_COUNTERS.items(): live_spend_counters.set_local(key, spend) - await _fail_request(ProxyDBLogger(), failure) + await _fail_request_and_finish_counting_in_background(increment_spend_counters, failure) assert await _counter_values(live_spend_counters) == pytest.approx( {key: spend + charged for key, spend in _LIVE_COUNTERS.items()} @@ -3001,39 +3038,83 @@ async def test_failure_spend_rows_raise_the_live_spend_counters_by_their_cost( @pytest.mark.asyncio +async def test_a_failure_that_cost_nothing_leaves_the_live_spend_counters_alone(live_spend_counters: SpendCounterStore): + for key, spend in _LIVE_COUNTERS.items(): + live_spend_counters.set_local(key, spend) + + await _fail_request(ProxyDBLogger(), {}) + + assert await _counter_values(live_spend_counters) == pytest.approx(_LIVE_COUNTERS) + + +_COMMITTED_COUNTERS: Final = MappingProxyType( + { + "spend:committed:key:hashed-key": 0.2, + "spend:committed:team:team-1": 0.3, + "spend:committed:user:user-1": 0.4, + } +) +_BUDGETED_KEY_AND_TEAM: Final = CommittedBudgetSpend( + counter_keys=EntitySpendCounterKeys.of( + token="hashed-key", team_id="team-1", user_id=None, org_id=None, end_user_id=None + ) +) + + +def _committed_counter_values(counters: SpendCounterStore) -> dict[str, float | None]: + return {key: counters.get_local(key) for key in _COMMITTED_COUNTERS} + + +def _committed_counters_after_charging_key_and_team(charged: float) -> dict[str, float]: + return { + "spend:committed:key:hashed-key": 0.2 + charged, + "spend:committed:team:team-1": 0.3 + charged, + "spend:committed:user:user-1": 0.4, + } + + +@pytest.mark.asyncio +@pytest.mark.timeout(30) @pytest.mark.parametrize( ("failure", "charged"), [ ({"combined_usage_object": Usage(prompt_tokens=30), "response_cost": 0.125}, 0.125), (_failure_with_billed_attempts(), 1.25), - ({"standard_logging_object": {"cost_finalized": True, "response_cost": 0.125}}, 0.125), ], - ids=["recovered_stream_cost", "billed_retries", "completed_cost"], + ids=["recovered_stream_cost", "billed_retries"], ) async def test_a_failed_charge_moves_only_the_committed_counters_auth_named_as_budgeted( live_spend_counters: SpendCounterStore, failure: Mapping[str, object], charged: float ): """The remaining budget gauges read the committed counters, so a charge missing from them shows as budget the request never left behind, until the next reseed from the database.""" - budgeted: Final = EntitySpendCounterKeys.of( - token="hashed-key", team_id="team-1", user_id=None, org_id=None, end_user_id=None - ) - starting: Final = { - "spend:committed:key:hashed-key": 0.2, - "spend:committed:team:team-1": 0.3, - "spend:committed:user:user-1": 0.4, - } - for key, spend in starting.items(): + from litellm.proxy.proxy_server import increment_spend_counters + + for key, spend in _COMMITTED_COUNTERS.items(): live_spend_counters.set_local(key, spend) - await _fail_request(ProxyDBLogger(), failure, CommittedBudgetSpend(counter_keys=budgeted)) + await _fail_request_and_finish_counting_in_background(increment_spend_counters, failure, _BUDGETED_KEY_AND_TEAM) - assert {key: live_spend_counters.get_local(key) for key in starting} == pytest.approx( - { - "spend:committed:key:hashed-key": 0.2 + charged, - "spend:committed:team:team-1": 0.3 + charged, - "spend:committed:user:user-1": 0.4, - } + assert _committed_counter_values(live_spend_counters) == pytest.approx( + _committed_counters_after_charging_key_and_team(charged) + ) + + +@pytest.mark.asyncio +async def test_a_failed_completed_charge_moves_only_the_committed_counters_auth_named_as_budgeted( + live_spend_counters: SpendCounterStore, +): + for key, spend in _COMMITTED_COUNTERS.items(): + live_spend_counters.set_local(key, spend) + + await _fail_request( + ProxyDBLogger(), + {"standard_logging_object": {"cost_finalized": True, "response_cost": 0.125}}, + _BUDGETED_KEY_AND_TEAM, + ) + + assert _committed_counter_values(live_spend_counters) == pytest.approx( + _committed_counters_after_charging_key_and_team(0.125) ) @@ -3067,10 +3148,11 @@ async def test_failure_spend_rows_leave_the_live_spend_counters_alone_while_spen @pytest.mark.asyncio +@pytest.mark.timeout(30) async def test_a_failing_spend_counter_store_is_still_sent_every_failure_spend_row(): counters: Final = AsyncMock(side_effect=RuntimeError("redis unavailable")) - await _fail_request(ProxyDBLogger(spend_counters=lambda: counters), _failure_with_billed_attempts()) + await _fail_request_and_finish_counting_in_background(counters, _failure_with_billed_attempts()) assert [call.kwargs["response_cost"] for call in counters.call_args_list] == [0.5, 0.25, 0.5] @@ -3141,6 +3223,7 @@ async def test_a_failure_spend_row_lands_in_the_key_budget_window_as_of_the_requ @pytest.mark.asyncio +@pytest.mark.timeout(30) async def test_a_billed_attempt_on_a_deployment_the_router_dropped_debits_every_attributed_access_group( live_spend_counters: SpendCounterStore, monkeypatch: pytest.MonkeyPatch ): @@ -3159,8 +3242,10 @@ async def test_a_billed_attempt_on_a_deployment_the_router_dropped_debits_every_ ), ) - await _fail_request( - ProxyDBLogger(), + from litellm.proxy.proxy_server import increment_spend_counters + + await _fail_request_and_finish_counting_in_background( + increment_spend_counters, { **_failure_with_billed_attempts(), "metadata": {MODEL_ACCESS_GROUP_METADATA_KEY: ["pool", "premium"], "model_info": {"id": "dep-b"}}, diff --git a/tests/unit/proxy/management_endpoints/test_cost_tracking_settings.py b/tests/unit/proxy/management_endpoints/test_cost_tracking_settings.py index b93e23dcb94..8b06e6545a1 100644 --- a/tests/unit/proxy/management_endpoints/test_cost_tracking_settings.py +++ b/tests/unit/proxy/management_endpoints/test_cost_tracking_settings.py @@ -4,6 +4,7 @@ Tests for cost tracking settings management endpoints. Tests the GET and PATCH endpoints for managing cost discount configuration. """ +import asyncio from datetime import datetime, timezone from unittest.mock import AsyncMock, MagicMock, patch @@ -15,7 +16,11 @@ from pydantic import ValidationError import litellm from litellm._internal_context import pinned_billing_time from litellm.proxy._types import CostEstimateRequest -from litellm.proxy.management_endpoints.cost_tracking_settings import router +from litellm.proxy.management_endpoints.cost_tracking_settings import ( + router, + update_cost_discount_config, + update_cost_margin_config, +) from litellm.proxy.proxy_server import app client = TestClient(app) @@ -762,6 +767,55 @@ class TestEstimateCostOnPremProvider: +class TestCostSettingsPatchAgainstConfigReload: + @pytest.mark.asyncio + @pytest.mark.parametrize( + ("setting", "update", "stale", "fresh"), + [ + ( + "cost_margin_config", + update_cost_margin_config, + {"openai": {"percentage": 0.1, "fixed_amount": 0.001}}, + {"global": 1}, + ), + ("cost_discount_config", update_cost_discount_config, {"openai": 0.05}, {}), + ], + ) + async def test_patch_is_not_undone_by_a_reload_that_read_the_previous_row(self, setting, update, stale, fresh): + from litellm.proxy import proxy_server + + reload_has_read_the_row = asyncio.Event() + release_reload = asyncio.Event() + + async def reload_holding_the_previous_row() -> None: + async with proxy_server.DB_RECONCILE_LOCK: + reload_has_read_the_row.set() + await release_reload.wait() + proxy_server.ProxyConfig()._apply_litellm_settings_db_values({setting: stale}) + + mock_proxy_config = AsyncMock() + mock_proxy_config.get_config = AsyncMock(return_value={"litellm_settings": {setting: stale}}) + mock_proxy_config.save_config = AsyncMock() + + with ( + patch("litellm.proxy.proxy_server.prisma_client", MagicMock()), + patch("litellm.proxy.proxy_server.proxy_config", mock_proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + patch("litellm.proxy.proxy_server.DB_RECONCILE_LOCK", asyncio.Lock()), + patch.object(litellm, setting, stale), + ): + reload = asyncio.create_task(reload_holding_the_previous_row()) + await reload_has_read_the_row.wait() + patched = asyncio.create_task(update(fresh, user_api_key_dict=MagicMock())) + for _ in range(20): + await asyncio.sleep(0) + release_reload.set() + await asyncio.gather(reload, patched) + + assert patched.result()["values"] == fresh + assert getattr(litellm, setting) == fresh + + class TestBlockRequestsForModelsWithoutPricing: """Test suite for the block_requests_for_models_without_pricing toggle endpoints""" diff --git a/tests/unit/proxy/mcp_server/test_mcp_env_vars.py b/tests/unit/proxy/mcp_server/test_mcp_env_vars.py index 57ac6c0be2d..b3aebe49968 100644 --- a/tests/unit/proxy/mcp_server/test_mcp_env_vars.py +++ b/tests/unit/proxy/mcp_server/test_mcp_env_vars.py @@ -1748,3 +1748,46 @@ async def test_missing_user_env_vars_error_renders_in_mcp_call_tool(): assert "CorporateDB" in text assert "CORP_USERNAME" in text assert "fill_env_vars=srv-99" in text + + +@pytest.fixture +def blake2b_refused(monkeypatch: pytest.MonkeyPatch) -> None: + """hashlib.blake2b as FIPS Python builds ship it: the call raises.""" + import hashlib + from typing import NoReturn + + def blake2b(*_args: object, **_kwargs: object) -> NoReturn: + raise ValueError("blake2b is blocked when usedforsecurity=True") + + monkeypatch.setattr(hashlib, "blake2b", blake2b) + + +def test_identifier_lock_keys_are_unchanged_without_fips_mode() -> None: + from litellm.proxy.mcp_server.db import _mcp_identifier_lock_keys + + assert _mcp_identifier_lock_keys("GitHub", None, "gh") == (-1720930101670657375, -1498181317228972674) + + +@pytest.mark.usefixtures("fips_mode", "blake2b_refused") +def test_fips_mode_identifier_lock_keys_are_truncated_sha256() -> None: + import hashlib + + from litellm.proxy.mcp_server.db import _mcp_identifier_lock_keys + + assert _mcp_identifier_lock_keys("GitHub", None, "gh") == tuple( + int.from_bytes(hashlib.sha256(name).digest()[:8], "big", signed=True) + for name in (b"mcp_identifier:gh", b"mcp_identifier:github") + ) + assert _mcp_identifier_lock_keys("GitHub") == (-7731150984991732978,) + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("fips_mode", "blake2b_refused", "env_vars_salt_key") +async def test_fips_mode_merge_user_env_vars_takes_its_lock_without_blake2b() -> None: + from litellm.proxy.mcp_server.db import merge_user_env_vars + + merged: Final = await merge_user_env_vars( + _transactional_env_vars_prisma(), "alice", "srv-1", {"TOKEN": "abc"}, allowed_names=["TOKEN"] + ) + + assert merged == {"TOKEN": "abc"} diff --git a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py index ad12716ef2a..df011a8296f 100644 --- a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py +++ b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py @@ -3102,3 +3102,71 @@ def test_anthropic_passthrough_stream_bills_a_bedrock_guardrail_trace_whose_json ) (entry,) = _recorded_guardrail_entries(mock_logging_obj) assert entry["guardrail_usage"] == {"topicPolicyUnits": 3, "contentPolicyUnits": 3} + + +_DEPLOYMENT_PRICING: Final = {"input_cost_per_token": 3e-03, "output_cost_per_token": 7e-03} + + +def _deployment_priced_logging_obj(monkeypatch: pytest.MonkeyPatch, stream: bool) -> LiteLLMLoggingObj: + monkeypatch.setattr(litellm, "model_cost", {"sonnet-dep": {"litellm_provider": "anthropic", **_DEPLOYMENT_PRICING}}) + logging_obj: Final = LiteLLMLoggingObj( + model="claude-sonnet-4-5", + messages=[], + stream=stream, + call_type="pass_through_endpoint", + start_time=datetime(2025, 1, 1), + litellm_call_id="deployment-priced", + function_id="1", + ) + litellm_params: Final = {"metadata": {"model_info": {"id": "sonnet-dep", **_DEPLOYMENT_PRICING}}} + logging_obj.litellm_params = litellm_params + logging_obj.model_call_details["litellm_params"] = litellm_params + logging_obj.model_call_details["custom_llm_provider"] = "anthropic" + logging_obj.model_call_details["stream"] = stream + return logging_obj + + +def _deployment_price_of(usage: litellm.Usage) -> float: + return ( + usage.prompt_tokens * _DEPLOYMENT_PRICING["input_cost_per_token"] + + usage.completion_tokens * _DEPLOYMENT_PRICING["output_cost_per_token"] + ) + + +def test_a_response_naming_a_dated_snapshot_is_billed_at_the_resolved_deployment_price( + monkeypatch, mock_httpx_response +): + logging_obj: Final = _deployment_priced_logging_obj(monkeypatch, stream=False) + + result: Final = AnthropicPassthroughLoggingHandler.anthropic_passthrough_handler( + httpx_response=mock_httpx_response, + response_body=mock_httpx_response.json(), + logging_obj=logging_obj, + url_route="/v1/messages", + result="success", + start_time=datetime(2025, 1, 1), + end_time=datetime(2025, 1, 1), + cache_hit=False, + request_body={"model": "claude-sonnet-4-5", "messages": []}, + ) + + assert result["result"].usage.prompt_tokens > 0 + assert result["kwargs"]["response_cost"] == pytest.approx(_deployment_price_of(result["result"].usage)) + + +def test_a_stream_naming_a_dated_snapshot_is_billed_at_the_resolved_deployment_price(monkeypatch, all_chunks): + logging_obj: Final = _deployment_priced_logging_obj(monkeypatch, stream=True) + + result: Final = AnthropicPassthroughLoggingHandler.handle_logging_anthropic_collected_chunks( + litellm_logging_obj=logging_obj, + passthrough_success_handler_obj=MagicMock(), + url_route="/v1/messages", + request_body={"model": "claude-sonnet-4-5", "stream": True, "messages": []}, + endpoint_type=MagicMock(), + start_time=datetime(2025, 1, 1), + all_chunks=all_chunks, + end_time=datetime(2025, 1, 1), + ) + + assert result["result"].usage.prompt_tokens > 0 + assert result["kwargs"]["response_cost"] == pytest.approx(_deployment_price_of(result["result"].usage)) diff --git a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.py index 1f7acd0723f..4214c7fac3f 100644 --- a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.py +++ b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_batch_attribution.py @@ -102,8 +102,16 @@ class TestRequestTagsFromMetadata: ("https://api.anthropic.com/v1/messages/batches/msgbatch_1", "/v1/messages/batches", False), # a proxied base with a path prefix still resolves, because this is a suffix match ("https://gateway.internal/anthropic/v1/messages/batches", "/v1/messages/batches", True), - ("https://aiplatform.googleapis.com/v1/projects/p/locations/l/batchPredictionJobs", "batchPredictionJobs", True), - ("https://aiplatform.googleapis.com/v1/projects/p/locations/l/batchPredictionJobs/9", "batchPredictionJobs", False), + ( + "https://aiplatform.googleapis.com/v1/projects/p/locations/l/batchPredictionJobs", + "batchPredictionJobs", + True, + ), + ( + "https://aiplatform.googleapis.com/v1/projects/p/locations/l/batchPredictionJobs/9", + "batchPredictionJobs", + False, + ), ], ) def test_is_collection_route(url_route, suffix, expected): @@ -179,3 +187,115 @@ class TestLogBatchRegistrationResult: logger.info.assert_not_called() logger.error.assert_called_once() + + +def _pending_batch(batch_id: str): + from litellm.types.utils import LiteLLMBatch + + return LiteLLMBatch( + id=batch_id, + object="batch", + status="validating", + completion_window="24h", + created_at=1762905329, + endpoint="/v1/chat/completions", + input_file_id="files/wireinput123", + ) + + +def test_unified_batch_object_id_decodes_to_the_deployment_and_provider_batch_id(): + import base64 + + from litellm.proxy.openai_files_endpoints.common_utils import ( + get_batch_id_from_unified_batch_id, + get_model_id_from_unified_batch_id, + ) + from litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution import unified_batch_object_id + + unified = unified_batch_object_id("gemini/gemini-3.8-flash", "wire7h3x9batch") + padded = unified + "=" * (-len(unified) % 4) + decoded = base64.urlsafe_b64decode(padded).decode() + assert get_model_id_from_unified_batch_id(decoded) == "gemini/gemini-3.8-flash" + assert get_batch_id_from_unified_batch_id(decoded) == "wire7h3x9batch" + + +def test_register_passthrough_batch_stores_the_calling_key_team_and_tags(): + from unittest.mock import AsyncMock, MagicMock + + from litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution import ( + register_passthrough_batch, + ) + + hook = MagicMock() + hook.store_unified_object_id = AsyncMock() + batch_object = _pending_batch("b1") + metadata = { + "user_api_key": "hashed-key", + "user_api_key_user_id": "user-7", + "user_api_key_team_id": "team-3", + "tags": ["pipeline:nightly"], + } + + async def run(): + with patch("litellm.proxy.proxy_server.proxy_logging_obj") as proxy_logging: + proxy_logging.get_proxy_hook.return_value = hook + register_passthrough_batch("Gemini", "uoi", batch_object, "b1", metadata) + await asyncio.sleep(0) + await asyncio.sleep(0) + + asyncio.run(run()) + hook.store_unified_object_id.assert_awaited_once() + stored = hook.store_unified_object_id.await_args.kwargs + assert stored["unified_object_id"] == "uoi" + assert stored["model_object_id"] == "b1" + assert stored["file_object"] is batch_object + assert stored["file_purpose"] == "batch" + assert stored["persist_attribution"] is True + assert stored["request_tags"] == ("pipeline:nightly",) + assert stored["user_api_key_dict"].api_key == "hashed-key" + assert stored["user_api_key_dict"].user_id == "user-7" + assert stored["user_api_key_dict"].team_id == "team-3" + + +def test_register_passthrough_batch_leaves_the_user_unset_for_a_key_without_one(): + from unittest.mock import AsyncMock, MagicMock + + from litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution import ( + register_passthrough_batch, + ) + + hook = MagicMock() + hook.store_unified_object_id = AsyncMock() + + async def run(): + with patch("litellm.proxy.proxy_server.proxy_logging_obj") as proxy_logging: + proxy_logging.get_proxy_hook.return_value = hook + register_passthrough_batch("Gemini", "uoi", _pending_batch("b1"), "b1", {"user_api_key": "hashed-key"}) + await asyncio.sleep(0) + await asyncio.sleep(0) + + asyncio.run(run()) + stored = hook.store_unified_object_id.await_args.kwargs + assert stored["user_api_key_dict"].user_id is None + assert stored["user_api_key_dict"].api_key == "hashed-key" + + +def test_register_passthrough_batch_without_a_managed_files_hook_stores_nothing(): + from litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution import ( + register_passthrough_batch, + ) + + async def run(): + with ( + patch("litellm.proxy.proxy_server.proxy_logging_obj") as proxy_logging, + patch( + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.batch_attribution.verbose_proxy_logger" + ) as logger, + ): + proxy_logging.get_proxy_hook.return_value = None + register_passthrough_batch("Gemini", "uoi", _pending_batch("b1"), "b1", {}) + await asyncio.sleep(0) + return logger.warning.call_args + + warned = asyncio.run(run()) + assert warned is not None and "Gemini" in warned.args and "b1" in warned.args, warned diff --git a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py index 31d95984996..bb50a33cf17 100644 --- a/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py +++ b/tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py @@ -1,4 +1,5 @@ import asyncio +import base64 import json from collections.abc import Iterator from datetime import datetime @@ -10,6 +11,8 @@ import pytest import litellm from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj +from litellm.proxy._types import PassThroughEndpointLoggingTypedDict +from litellm.proxy.openai_files_endpoints.common_utils import get_model_id_from_unified_batch_id from litellm.proxy.pass_through_endpoints.llm_provider_handlers.gemini_passthrough_logging_handler import ( GeminiPassthroughLoggingHandler, ) @@ -145,12 +148,8 @@ class TestGeminiPassthroughLoggingHandler: assert model == "gemini-1.5-pro" @patch("litellm.completion_cost") - @patch( - "litellm.litellm_core_utils.litellm_logging.get_standard_logging_object_payload" - ) - def test_gemini_passthrough_handler_success( - self, mock_get_standard_logging, mock_completion_cost - ): + @patch("litellm.litellm_core_utils.litellm_logging.get_standard_logging_object_payload") + def test_gemini_passthrough_handler_success(self, mock_get_standard_logging, mock_completion_cost): """Test successful cost tracking for Gemini generateContent endpoint""" # Arrange mock_completion_cost.return_value = 0.000045 @@ -278,9 +277,7 @@ class TestGeminiPassthroughLoggingHandler: "litellm.proxy.pass_through_endpoints.llm_provider_handlers.gemini_passthrough_logging_handler.litellm.completion_cost", return_value=0.000050, ) - async def test_pass_through_success_handler_gemini_routing( - self, mock_completion_cost - ): + async def test_pass_through_success_handler_gemini_routing(self, mock_completion_cost): """Test that the success handler correctly routes Gemini requests to the Gemini handler""" handler = PassThroughEndpointLogging() @@ -344,11 +341,7 @@ class TestGeminiPassthroughLoggingHandler: # Request body with durationSeconds request_body = { - "instances": [ - { - "prompt": "A close up of two people staring at a cryptic drawing on a wall," - } - ], + "instances": [{"prompt": "A close up of two people staring at a cryptic drawing on a wall,"}], "parameters": {"durationSeconds": 8}, } @@ -592,3 +585,111 @@ def test_gemini_passthrough_bills_the_list_price_when_the_model_info_base_model_ recorded: Final = _cost_the_logger_records_for_gemini(stream=stream, model_info={"base_model": base_model}) assert recorded == pytest.approx(7 * _LIST_INPUT_RATE + 1 * _LIST_OUTPUT_RATE), stream + + +_BATCH_OPERATION: Final = { + "name": "batches/wire7h3x9batch", + "metadata": { + "@type": "type.googleapis.com/google.ai.generativelanguage.v1main.GenerateContentBatch", + "model": "models/gemini-3.8-flash", + "inputConfig": {"fileName": "files/wireinput123"}, + "createTime": "2026-11-11T23:15:29.000000Z", + "updateTime": "2026-11-11T23:15:29.000000Z", + "state": "BATCH_STATE_PENDING", + }, +} +_BATCH_ROUTE: Final = "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:batchGenerateContent" + + +def _decoded(unified_object_id: str) -> str: + return base64.urlsafe_b64decode(unified_object_id + "=" * (-len(unified_object_id) % 4)).decode() + + +def _gemini_router(model: str) -> litellm.Router: + return litellm.Router( + model_list=[ + {"model_name": model, "litellm_params": {"model": f"vertex_ai/{model}", "vertex_project": "p"}}, + { + "model_name": model, + "litellm_params": {"model": f"gemini/{model}", "api_key": "scripted"}, + "model_info": {"id": "gemini-deployment-1"}, + }, + ] + ) + + +def _batch_create_through_passthrough( + status_code: int, body: dict[str, object], router: litellm.Router | None +) -> tuple[PassThroughEndpointLoggingTypedDict, MagicMock]: + hook = MagicMock() + hook.store_unified_object_id = AsyncMock() + logging_obj = MagicMock(spec=LiteLLMLoggingObj) + logging_obj.model_call_details = {} + kwargs = {"litellm_params": {"metadata": {"user_api_key": "hashed-key", "user_api_key_team_id": "team-3"}}} + response = httpx.Response(status_code, json=body, request=httpx.Request("POST", _BATCH_ROUTE)) + + async def run(): + with ( + patch("litellm.proxy.proxy_server.proxy_logging_obj") as proxy_logging, + patch("litellm.proxy.proxy_server.llm_router", router), + ): + proxy_logging.get_proxy_hook.return_value = hook + outcome = GeminiPassthroughLoggingHandler.gemini_passthrough_handler( + httpx_response=response, + response_body=body, + logging_obj=logging_obj, + url_route=_BATCH_ROUTE, + result="", + start_time=datetime(2026, 11, 11, 23, 15, 29), + end_time=datetime(2026, 11, 11, 23, 15, 30), + cache_hit=False, + request_body={"batch": {"inputConfig": {"fileName": "files/wireinput123"}}}, + **kwargs, + ) + await asyncio.sleep(0) + await asyncio.sleep(0) + return outcome + + return asyncio.run(run()), hook + + +def test_batch_generate_content_is_a_tracked_gemini_route(): + assert PassThroughEndpointLogging().is_gemini_route(_BATCH_ROUTE, "gemini") is True + + +def test_a_created_gemini_batch_is_registered_against_the_gemini_deployment_at_zero_cost(): + outcome, hook = _batch_create_through_passthrough(200, _BATCH_OPERATION, _gemini_router("gemini-3.8-flash")) + + stored = hook.store_unified_object_id.await_args.kwargs + assert stored["model_object_id"] == "wire7h3x9batch" + assert get_model_id_from_unified_batch_id(_decoded(stored["unified_object_id"])) == "gemini-deployment-1" + assert stored["file_purpose"] == "batch" + assert stored["file_object"].status == "validating" + assert stored["user_api_key_dict"].api_key == "hashed-key" + assert stored["user_api_key_dict"].team_id == "team-3" + assert stored["unified_object_id"] == outcome["kwargs"]["unified_object_id"] + assert outcome["kwargs"]["model"] == "gemini-3.8-flash" + assert outcome["kwargs"]["custom_llm_provider"] == "gemini" + assert outcome["kwargs"]["batch_id"] == "wire7h3x9batch" + assert outcome["kwargs"]["response_cost"] == 0.0 + assert outcome["result"].object == "batch" + + +def test_a_created_gemini_batch_without_a_gemini_deployment_registers_nothing_but_names_the_model(): + outcome, hook = _batch_create_through_passthrough(200, _BATCH_OPERATION, _gemini_router("gemini-other")) + + hook.store_unified_object_id.assert_not_awaited() + assert outcome["result"] is None + assert outcome["kwargs"]["model"] == "gemini-3.8-flash" + assert outcome["kwargs"]["batch_id"] == "wire7h3x9batch" + + +def test_a_rejected_gemini_batch_create_registers_nothing(): + outcome, hook = _batch_create_through_passthrough( + 400, {"error": {"code": 400, "message": "bad file"}}, _gemini_router("gemini-3.8-flash") + ) + + hook.store_unified_object_id.assert_not_awaited() + assert outcome["result"] is None + assert outcome["kwargs"]["model"] == "gemini-3.8-flash" + assert "batch_id" not in outcome["kwargs"] diff --git a/tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py index 7f118fb3186..ca04787e592 100644 --- a/tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py +++ b/tests/unit/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py @@ -7256,6 +7256,256 @@ class TestAnthropicProxyRoute: assert thread_ids and thread_ids[0] != threading.get_ident() +_HAIKU_PRICING: Final = MappingProxyType({"input_cost_per_token": 1e-07, "output_cost_per_token": 5e-07}) + + +def _anthropic_deployment( + deployment_id: str, + model_name: str = "claude-haiku-5-5", + backend: str = "anthropic/claude-haiku-5-5", + model_info_pricing: Mapping[str, float] = _HAIKU_PRICING, + params_pricing: Mapping[str, float] = MappingProxyType({}), + team_id: str | None = None, +) -> dict[str, object]: + return { + "model_name": model_name, + "litellm_params": {"model": backend, "api_key": "sk-ant-test", **params_pricing}, + "model_info": {"id": deployment_id, **model_info_pricing, **({"team_id": team_id} if team_id else {})}, + } + + +def _passthrough_pricing( + monkeypatch: pytest.MonkeyPatch, + *deployments: dict[str, object], + request_body: Mapping[str, object] = MappingProxyType({"model": "claude-haiku-5-5"}), + team_id: str | None = None, +) -> Mapping[str, object] | None: + from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import ( + anthropic_deployment_pricing_model_info, + ) + + monkeypatch.setattr(litellm, "model_cost", dict(litellm.model_cost)) + router: Final = litellm.Router(model_list=[*deployments]) + return anthropic_deployment_pricing_model_info(router, request_body, team_id) + + +def test_anthropic_passthrough_prices_with_the_one_deployment_serving_the_requested_model(monkeypatch): + model_info: Final = _passthrough_pricing(monkeypatch, _anthropic_deployment("haiku-dep")) + + assert model_info is not None + assert model_info["id"] == "haiku-dep" + assert {key: model_info[key] for key in _HAIKU_PRICING} == _HAIKU_PRICING + + +def test_anthropic_passthrough_reads_custom_pricing_set_in_litellm_params(monkeypatch): + model_info: Final = _passthrough_pricing( + monkeypatch, + _anthropic_deployment("haiku-dep", model_info_pricing=MappingProxyType({}), params_pricing=_HAIKU_PRICING), + ) + + assert model_info is not None + assert model_info["id"] == "haiku-dep" + assert {key: model_info[key] for key in _HAIKU_PRICING} == _HAIKU_PRICING + + +def test_anthropic_passthrough_prices_a_deployment_configured_with_the_alias_the_caller_sends(monkeypatch): + model_info: Final = _passthrough_pricing( + monkeypatch, + _anthropic_deployment( + "haiku-latest-dep", model_name="claude-haiku-latest", backend="anthropic/claude-haiku-latest" + ), + request_body={"model": "claude-haiku-latest"}, + ) + + assert model_info is not None + assert model_info["id"] == "haiku-latest-dep" + + +@pytest.mark.parametrize( + ("caller_team_id", "priced"), + [ + pytest.param("team-a", True, id="owning-team"), + pytest.param("team-b", False, id="other-team"), + pytest.param(None, False, id="teamless-key"), + ], +) +def test_anthropic_passthrough_prices_a_team_deployment_only_for_its_team(monkeypatch, caller_team_id, priced): + model_info: Final = _passthrough_pricing( + monkeypatch, _anthropic_deployment("team-a-haiku-dep", team_id="team-a"), team_id=caller_team_id + ) + + assert (model_info is not None) is priced + + +@pytest.mark.parametrize( + "deployments", + [ + pytest.param( + ( + _anthropic_deployment("haiku-dep-a"), + _anthropic_deployment("haiku-dep-b", model_info_pricing={"input_cost_per_token": 9e-07}), + ), + id="two-deployments-could-bill-either-price", + ), + pytest.param( + (_anthropic_deployment("opus-dep", backend="anthropic/claude-opus-5-5"),), + id="group-serves-a-different-upstream-model", + ), + pytest.param( + (_anthropic_deployment("bedrock-dep", backend="bedrock/claude-haiku-5-5"),), + id="deployment-is-not-anthropic", + ), + pytest.param( + (_anthropic_deployment("other-group-dep", model_name="haiku-alias"),), + id="model-group-not-requested", + ), + pytest.param( + (_anthropic_deployment("unpriced-dep", model_info_pricing=MappingProxyType({})),), + id="deployment-has-no-custom-pricing", + ), + ], +) +def test_anthropic_passthrough_attaches_no_deployment_pricing_without_one_priced_match(monkeypatch, deployments): + assert _passthrough_pricing(monkeypatch, *deployments) is None + + +_RELAY_HAIKU_PRICING: Final = MappingProxyType({"input_cost_per_token": 1e-03, "output_cost_per_token": 2e-03}) +_RELAY_OPUS_PRICING: Final = MappingProxyType({"input_cost_per_token": 5e-03, "output_cost_per_token": 6e-03}) +_RELAY_MESSAGES: Final = ({"role": "user", "content": "hi"},) + + +async def _hook_passes_body_through(*, data: dict[str, object], **_: object) -> dict[str, object]: + return data + + +async def _hook_upgrades_to_opus(*, data: dict[str, object], **_: object) -> dict[str, object]: + return {**data, "model": "claude-opus-5-5"} + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("request_body", "pre_call_hook", "forwarded_model", "pricing"), + [ + pytest.param( + {"model": "claude-haiku-5-5", "messages": [*_RELAY_MESSAGES]}, + _hook_passes_body_through, + "claude-haiku-5-5", + _RELAY_HAIKU_PRICING, + id="requested-model", + ), + pytest.param( + {"model": "claude-haiku-5-5", "custom_body": {"model": "claude-opus-5-5", "messages": [*_RELAY_MESSAGES]}}, + _hook_passes_body_through, + "claude-opus-5-5", + _RELAY_OPUS_PRICING, + id="custom-body-envelope", + ), + pytest.param( + {"model": "claude-haiku-5-5", "messages": [*_RELAY_MESSAGES]}, + _hook_upgrades_to_opus, + "claude-opus-5-5", + _RELAY_OPUS_PRICING, + id="pre-call-hook-rewrite", + ), + ], +) +async def test_anthropic_proxy_route_bills_the_custom_price_of_the_forwarded_model( + monkeypatch, request_body, pre_call_hook, forwarded_model, pricing +): + for name in ( + "ANTHROPIC_AUTH_TOKEN", + "ANTHROPIC_API_BASE", + "ANTHROPIC_BASE_URL", + "ANTHROPIC_FEDERATION_RULE_ID", + "ANTHROPIC_ORGANIZATION_ID", + "ANTHROPIC_IDENTITY_TOKEN_FILE", + "ANTHROPIC_IDENTITY_TOKEN", + "SERVER_ROOT_PATH", + ): + monkeypatch.delenv(name, raising=False) + monkeypatch.setenv("ANTHROPIC_API_KEY", "sk-ant-test") + monkeypatch.setattr(litellm, "model_cost", dict(litellm.model_cost)) + monkeypatch.setattr( + "litellm.proxy.proxy_server.llm_router", + litellm.Router( + model_list=[ + _anthropic_deployment("haiku-dep", model_info_pricing=_RELAY_HAIKU_PRICING), + _anthropic_deployment( + "opus-dep", + model_name="claude-opus-5-5", + backend="anthropic/claude-opus-5-5", + model_info_pricing=_RELAY_OPUS_PRICING, + ), + ] + ), + ) + upstream_response: Final = httpx.Response( + 200, + json={ + "id": "msg_relay", + "type": "message", + "role": "assistant", + "model": forwarded_model, + "content": [{"type": "text", "text": "pong"}], + "stop_reason": "end_turn", + "usage": {"input_tokens": 18, "output_tokens": 4}, + }, + request=httpx.Request("POST", "https://api.anthropic.com/v1/messages"), + ) + httpx_client: Final = MagicMock() + httpx_client.build_request = MagicMock(return_value=MagicMock()) + httpx_client.send = AsyncMock(return_value=upstream_response) + client_wrapper: Final = MagicMock() + client_wrapper.client = httpx_client + body: Final = json.dumps(request_body).encode() + + async def receive() -> dict[str, object]: + return {"type": "http.request", "body": body, "more_body": False} + + request: Final = Request( + { + "type": "http", + "http_version": "1.1", + "method": "POST", + "scheme": "https", + "path": "/anthropic/v1/messages", + "raw_path": b"/anthropic/v1/messages", + "root_path": "", + "query_string": b"", + "headers": [(b"content-type", b"application/json")], + "client": ("127.0.0.1", 51234), + "server": ("proxy.local", 4000), + "state": {}, + }, + receive, + ) + + with ( + patch( # test-quality-ok: the upstream http client is the boundary, it answers with a real Anthropic body + "litellm.proxy.pass_through_endpoints.pass_through_endpoints.get_async_httpx_client", + return_value=client_wrapper, + ), + patch( # test-quality-ok: the relay calls these hooks, and they need a db this test has no use for + "litellm.proxy.proxy_server.proxy_logging_obj" + ) as mock_logging_obj, + ): + mock_logging_obj.pre_call_hook = AsyncMock(side_effect=pre_call_hook) + mock_logging_obj.post_call_success_hook = AsyncMock() + mock_logging_obj.post_call_failure_hook = AsyncMock() + mock_logging_obj.post_call_response_headers_hook = AsyncMock(return_value={}) + + response: Final = await anthropic_proxy_route( + endpoint="v1/messages", + request=request, + fastapi_response=MagicMock(spec=Response), + user_api_key_dict=UserAPIKeyAuth(api_key="sk-caller-virtual-key"), + ) + + assert float(response.headers["x-litellm-response-cost"]) == pytest.approx( + 18 * pricing["input_cost_per_token"] + 4 * pricing["output_cost_per_token"] + ) + + class TestAnthropicProxyRouteCallerAuthHeaders: """Regression for a caller credential riding upstream next to a server-owned one. diff --git a/tests/unit/proxy/rust_forward/supervisor/test_runtime.py b/tests/unit/proxy/rust_forward/supervisor/test_runtime.py index b84b1302e3c..c5d1bbc7a36 100644 --- a/tests/unit/proxy/rust_forward/supervisor/test_runtime.py +++ b/tests/unit/proxy/rust_forward/supervisor/test_runtime.py @@ -9,7 +9,7 @@ from typing import Final import anyio import pytest -from litellm.proxy.rust_forward.platform import Platform, current_platform +from litellm.proxy.rust_forward.platform import ChildProcess, Platform, current_platform from litellm.proxy.rust_forward.platform.windows import WindowsPlatform from litellm.proxy.rust_forward.supervisor import supervise from litellm.proxy.rust_forward.supervisor.children import ChildSpec @@ -23,7 +23,7 @@ from litellm.proxy.rust_forward.supervisor.lifecycle import ( Send, Spawn, ) -from litellm.proxy.rust_forward.supervisor.runtime import SpawnFailed, drive, exit_like, open_children +from litellm.proxy.rust_forward.supervisor.runtime import SpawnFailed, drive, exit_like, open_children, spawn_subprocess from tests.unit.proxy.rust_forward.supervisor._support import python_server @@ -129,34 +129,80 @@ def _children(argv: tuple[str, ...]) -> MappingProxyType[Child, ChildSpec]: return MappingProxyType({Child.PYTHON: spec, Child.RUST: spec}) -SLOW_TO_STOP: Final = ( - sys.executable, - "-c", - "import signal, time; signal.signal(signal.SIGTERM, lambda *_: (time.sleep(0.5), exit(0))); time.sleep(30)", -) +@dataclass(slots=True) +class HeldChild: + exits: anyio.Event + waiting: int = 0 + stdin: None = None + + @property + def pid(self) -> int: + raise NotImplementedError + + def send_signal(self, signum: int, /) -> None: + raise NotImplementedError + + async def wait(self) -> int: + self.waiting += 1 + try: + await self.exits.wait() + finally: + self.waiting -= 1 + return 0 + + +@dataclass(frozen=True, slots=True) +class StopRecorder: + stopped: list[ChildProcess] = field(default_factory=list) + + def signal_child(self, process: ChildProcess, signum: signal.Signals) -> None: + raise NotImplementedError + + def stop_group(self, process: ChildProcess) -> None: + self.stopped.append(process) -@POSIX_ONLY async def test_a_cancelled_supervisor_still_waits_for_the_child_it_stops() -> None: - with anyio.CancelScope() as scope: - async with open_children(current_platform(), _children(SLOW_TO_STOP), 1) as children: - assert await children.spawn(Child.RUST) is None - process: Final = children.processes[Child.RUST] - await anyio.sleep(0.3) - scope.cancel() - await anyio.sleep(1) - assert process.returncode == 0 + child: Final = HeldChild(anyio.Event()) + control: Final = StopRecorder() + supervisor: Final = anyio.CancelScope() + returned: Final = anyio.Event() + + async def spawn(_spec: ChildSpec) -> HeldChild: + return child + + async def supervise_one_child() -> None: + with supervisor: + async with open_children(control, spawn, _children(("held",)), 1) as children: + assert await children.spawn(Child.RUST) is None + await anyio.sleep_forever() + returned.set() + + async with anyio.create_task_group() as tasks: + tasks.start_soon(supervise_one_child) + await anyio.wait_all_tasks_blocked() + supervisor.cancel() + await anyio.wait_all_tasks_blocked() + while_child_runs: Final = (tuple(control.stopped), child.waiting, returned.is_set()) + child.exits.set() + await anyio.wait_all_tasks_blocked() + once_child_exits: Final = returned.is_set() + assert (while_child_runs, once_child_exits) == (((child,), 1, False), True) async def test_exiting_children_are_reported_as_events() -> None: - async with open_children(current_platform(), _children((sys.executable, "-c", "exit(7)")), 1) as children: + async with open_children( + current_platform(), spawn_subprocess, _children((sys.executable, "-c", "exit(7)")), 1 + ) as children: assert await children.spawn(Child.RUST) is None with anyio.fail_after(5): assert await children.next_event() == ChildExited(Child.RUST, 7) async def test_a_child_that_cannot_start_is_returned_as_a_failure(tmp_path: Path) -> None: - async with open_children(current_platform(), _children((str(tmp_path / "missing"),)), 1) as children: + async with open_children( + current_platform(), spawn_subprocess, _children((str(tmp_path / "missing"),)), 1 + ) as children: outcome: Final = await children.spawn(Child.RUST) assert isinstance(outcome, SpawnFailed) assert isinstance(outcome.error, FileNotFoundError) diff --git a/tests/unit/proxy/test_common_request_processing.py b/tests/unit/proxy/test_common_request_processing.py index 9a5caca316d..70349e73c42 100644 --- a/tests/unit/proxy/test_common_request_processing.py +++ b/tests/unit/proxy/test_common_request_processing.py @@ -1648,6 +1648,49 @@ class TestProxyBaseLLMRequestProcessing: ) tag_budget_check.assert_not_awaited() + @pytest.mark.asyncio + @pytest.mark.parametrize( + "http_method, route, route_type, expect_rejected", + [ + ("GET", "/v1/videos/video_abc", "avideo_status", False), + ("GET", "/videos/video_abc/content", "avideo_content", False), + ("POST", "/v1/videos", "avideo_generation", True), + ("POST", "/v1/videos/video_abc/remix", "avideo_remix", True), + ("GET", "/v1/videos", "avideo_list", True), + ], + ) + async def test_common_processing_pre_call_logic_spares_only_video_retrieval_from_exhausted_guardrail_tags( + self, monkeypatch: pytest.MonkeyPatch, http_method: str, route: str, route_type: str, expect_rejected: bool + ) -> None: + processing_obj, mock_request, mock_proxy_logging_obj, mock_proxy_config, tag_budget_check = ( + self._guardrail_tag_budget_harness( + monkeypatch, + request_body={"model": "paid-model", "metadata": {"tags": ["existing-tag"]}}, + guardrail_tags=["guardrail-tag"], + route=route, + ) + ) + tag_budget_check.side_effect = litellm.BudgetExceededError(current_cost=0.4, max_budget=0.3) + mock_request.method = http_method + + async def pre_call() -> None: + await processing_obj.common_processing_pre_call_logic( + request=mock_request, + general_settings={}, + user_api_key_dict=ProxyUserAPIKeyAuth(api_key="sk-test"), + proxy_logging_obj=mock_proxy_logging_obj, + proxy_config=mock_proxy_config, + route_type=route_type, + llm_router=self._router_with_free_and_paid_models(), + ) + + if not expect_rejected: + await pre_call() + return + with pytest.raises(ProxyException) as exc_info: + await pre_call() + assert exc_info.value.type == ProxyErrorTypes.budget_exceeded + @pytest.mark.asyncio async def test_enforce_guardrail_added_tag_budgets_raises_budget_exceeded_proxy_exception(self, monkeypatch): from litellm.proxy.common_request_processing import _enforce_guardrail_added_tag_budgets diff --git a/tests/unit/proxy/test_credential_slot_registry.py b/tests/unit/proxy/test_credential_slot_registry.py index 6332038feb8..47566b853a0 100644 --- a/tests/unit/proxy/test_credential_slot_registry.py +++ b/tests/unit/proxy/test_credential_slot_registry.py @@ -147,8 +147,6 @@ REQUEST_BODY_PARAM_CLASSIFICATION: Final[Mapping[str, Classification]] = Mapping "aws_access_key_id": Unplanted(), "aws_secret_access_key": Unplanted(), "aws_session_token": Unplanted(), - "azure_password": Unplanted(), - "client_secret": Unplanted(), "s3_access_key_id": Unplanted(), "s3_secret_access_key": Unplanted(), "valkey_password": Unplanted(), diff --git a/tests/unit/proxy/test_fallback_management_endpoints.py b/tests/unit/proxy/test_fallback_management_endpoints.py index e3d0d072e0a..06adc0ed340 100644 --- a/tests/unit/proxy/test_fallback_management_endpoints.py +++ b/tests/unit/proxy/test_fallback_management_endpoints.py @@ -8,34 +8,44 @@ Tests: 4. Validation tests (invalid models, duplicate fallbacks, etc.) """ +import asyncio import copy import json -from collections.abc import AsyncIterator, Mapping +from collections.abc import AsyncIterator, Awaitable, Callable, Iterator, Mapping, Sequence +from contextlib import asynccontextmanager from types import MappingProxyType, SimpleNamespace -from typing import Final, Literal, get_args +from typing import Final, Literal, TypeAlias, get_args from unittest.mock import AsyncMock, MagicMock, patch import pytest from fastapi import HTTPException +from fastapi.testclient import TestClient from pydantic import JsonValue, TypeAdapter from redis.exceptions import NoPermissionError import litellm from litellm import Router +from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth +from litellm.proxy.auth.user_api_key_auth import user_api_key_auth from litellm.proxy.config_resolvers.settings_rules import Section +from litellm.proxy.deps.database import get_database from litellm.proxy.management_endpoints.fallback_management_endpoints import ( FallbackCreateRequest, FallbackDeleteResponse, + FallbackGetResponse, FallbackResponse, create_fallback, delete_fallback, get_fallback, ) -from litellm.proxy.proxy_server import ProxyConfig +from litellm.proxy.proxy_server import ProxyConfig, app from litellm.proxy.utils import evict_config_param, get_config_param, litellm_config_cache +from litellm.repositories.config_repository import ConfigRepository +from litellm.repositories.database import Database from litellm.router_api import ChangeSet from litellm.router_api import RouterSettings as RouterSettingsSnapshot from litellm.types.router import DeploymentTypedDict, LiteLLMParamsTypedDict +from tests._support.native_database import native_database @pytest.fixture(autouse=True) @@ -79,9 +89,7 @@ class TestFallbackCreateRequest: def test_duplicate_fallback_models(self): """Test that duplicate fallback models raise validation error""" - with pytest.raises( - ValueError, match="fallback_models must not contain duplicates" - ): + with pytest.raises(ValueError, match="fallback_models must not contain duplicates"): FallbackCreateRequest( model="gpt-3.5-turbo", fallback_models=["gpt-4", "gpt-4"], @@ -180,13 +188,12 @@ class TestCreateFallbackForTeamScopedModels: return _team_router() @pytest.fixture - def prisma_client(self) -> MagicMock: - client: Final = MagicMock() - client.writer_db = client.db - client.db.litellm_config.find_unique = AsyncMock(return_value=None) - client.db.litellm_config.upsert = AsyncMock() - client.get_generic_data = AsyncMock(return_value=None) - return client + def stored(self) -> "_StoredRouterSettings": + return _StoredRouterSettings(None) + + @pytest.fixture + def prisma_client(self, stored: "_StoredRouterSettings") -> MagicMock: + return stored.prisma_client @pytest.fixture def proxy_config(self) -> ProxyConfig: @@ -197,14 +204,13 @@ class TestCreateFallbackForTeamScopedModels: ) -> FallbackResponse: with ( patch("litellm.proxy.proxy_server.llm_router", router), - patch("litellm.proxy.proxy_server.prisma_client", prisma_client), patch("litellm.proxy.proxy_server.proxy_config", proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): - return await create_fallback(request, MagicMock()) + return await create_fallback(request, MagicMock(), fallbacks=ConfigRepository(prisma_client)) async def test_public_names_create_a_rule_keyed_on_the_public_name( - self, router: Router, prisma_client: MagicMock, proxy_config: MagicMock + self, router: Router, stored: "_StoredRouterSettings", prisma_client: MagicMock, proxy_config: MagicMock ) -> None: request: Final = FallbackCreateRequest(model="team-primary", fallback_models=["team-fallback"]) @@ -213,10 +219,7 @@ class TestCreateFallbackForTeamScopedModels: assert response.model == "team-primary" assert response.fallback_models == ["team-fallback"] assert router.settings().fallbacks == [{"team-primary": ["team-fallback"]}] - persisted: Final = json.loads( - prisma_client.db.litellm_config.upsert.call_args.kwargs["data"]["create"]["param_value"] - ) - assert persisted["fallbacks"] == [{"team-primary": ["team-fallback"]}] + assert stored.stored_fallbacks() == [{"team-primary": ["team-fallback"]}] async def test_internal_names_keep_working( self, router: Router, prisma_client: MagicMock, proxy_config: MagicMock @@ -279,8 +282,45 @@ class _ConfigFileProxyConfig(ProxyConfig): return {"router_settings": copy.deepcopy(self.config_file)} +NATIVE: Final = native_database() + + +class _ConfigTransaction: + def __init__(self, stored: "_StoredRouterSettings") -> None: + self._stored: Final = stored + self.staged: SimpleNamespace | None = None + self.holds_lock = False + + @property + def litellm_config(self) -> "_ConfigTransaction": + return self + + async def query_raw(self, query: str, *args: object) -> Sequence[Mapping[str, int]]: + if "router_settings" not in args or self.holds_lock: + return () + if self._stored.lock.locked(): + self._stored.lock_contended.set() + await self._stored.lock.acquire() + self.holds_lock = True + return ({"locked": 1},) + + async def find_unique(self, where: Mapping[str, str]) -> SimpleNamespace | None: + visible: Final = self.staged or copy.deepcopy(self._stored.row) + await self._stored.after_read() + return visible + + async def find_first(self, where: Mapping[str, str]) -> SimpleNamespace | None: + return await self.find_unique(where) + + async def upsert(self, where: Mapping[str, str], data: Mapping[str, Mapping[str, str]]) -> None: + if self._stored.fail_writes: + raise RuntimeError("the database refused the write") + self.staged = _config_row(json.loads(data["update"]["param_value"])) + + class _StoredRouterSettings: - """The LiteLLM_Config router_settings row, with the proxy objects that read it through the config cache""" + """The LiteLLM_Config router_settings row behind a writer with PostgreSQL's transaction semantics: a + transaction's write lands only when it commits, and the advisory lock waits for the transaction holding it""" def __init__( self, @@ -288,23 +328,50 @@ class _StoredRouterSettings: config_file: RouterSettings | None = None, *, lagging_replica: bool = False, + hold_first_read: bool = False, + fail_writes: bool = False, ) -> None: self.row: SimpleNamespace | None = None if router_settings is None else _config_row(router_settings) + self.writes = 0 + self.fail_writes: Final = fail_writes + self.lock: Final = asyncio.Lock() + self.lock_contended: Final = asyncio.Event() + self._holding_next_read = hold_first_read + self.read_held: Final = asyncio.Event() + self.held_read_released: Final = asyncio.Event() self.prisma_client: Final = MagicMock() self.prisma_client.get_generic_data = AsyncMock( side_effect=lambda value, **_: self.row if value == "router_settings" else None ) - self.prisma_client.writer_db.litellm_config.find_unique = AsyncMock( - side_effect=lambda **_: copy.deepcopy(self.row) - ) + self.prisma_client.writer_db.tx = self._transaction + self.prisma_client.tx = self._transaction self.prisma_client.db.litellm_config.find_unique = AsyncMock( side_effect=lambda **_: None if lagging_replica else copy.deepcopy(self.row) ) - self.prisma_client.db.litellm_config.upsert = AsyncMock(side_effect=self._upsert) self.proxy_config: Final = _ConfigFileProxyConfig(config_file) + self.prisma_client.writer_db.litellm_config.find_unique = AsyncMock( + side_effect=lambda **_: copy.deepcopy(self.row) + ) + self.fallbacks: Final = ConfigRepository(self.prisma_client, use_writer=True) - async def _upsert(self, where: dict[str, str], data: dict[str, dict[str, str]]) -> None: - self.row = _config_row(json.loads(data["update"]["param_value"])) + @asynccontextmanager + async def _transaction(self) -> AsyncIterator[_ConfigTransaction]: + transaction: Final = _ConfigTransaction(self) + try: + yield transaction + if transaction.staged is not None: + self.row = transaction.staged + self.writes += 1 + finally: + if transaction.holds_lock: + self.lock.release() + + async def after_read(self) -> None: + if not self._holding_next_read: + return + self._holding_next_read = False + self.read_held.set() + await self.held_read_released.wait() def written_by_another_instance(self, router_settings: RouterSettings) -> None: self.row = _config_row(router_settings) @@ -318,6 +385,7 @@ class _StoredRouterSettings: return row.param_value["fallbacks"] +FallbackWrite: TypeAlias = Callable[[], Awaitable[object]] TEAM_RULE: Final = {"team-primary": ["team-fallback"]} GATEWAY_RULE: Final = {"gpt-5.4-mini": ["team-fallback"]} MALFORMED_GATEWAY_RULE: Final = {"gpt-5.4-mini": "team-fallback"} @@ -347,20 +415,260 @@ class TestFallbackWritesSeeTheLatestStoredRules: async def _create(self, request: FallbackCreateRequest, stored: _StoredRouterSettings) -> FallbackResponse: with ( patch("litellm.proxy.proxy_server.llm_router", _team_router()), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): - return await create_fallback(request, MagicMock()) + return await create_fallback(request, MagicMock(), fallbacks=stored.fallbacks) async def _delete(self, model: str, stored: _StoredRouterSettings) -> FallbackDeleteResponse: with ( patch("litellm.proxy.proxy_server.llm_router", _team_router()), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): - return await delete_fallback(model, "general", MagicMock()) + return await delete_fallback(model, "general", MagicMock(), fallbacks=stored.fallbacks) + + async def _get( + self, + model: str, + stored: _StoredRouterSettings, + fallback_type: Literal["general", "context_window", "content_policy"] = "general", + router: Router | None = None, + ) -> FallbackGetResponse: + with ( + patch("litellm.proxy.proxy_server.llm_router", router or _team_router()), + patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + ): + return await get_fallback(model, fallback_type, MagicMock(), fallbacks=stored.fallbacks) + + async def _read_status(self, model: str, stored: _StoredRouterSettings, router: Router | None = None) -> int: + try: + await self._get(model, stored, router=router) + except HTTPException as refused: + return refused.status_code + return 200 + + async def test_a_replica_that_has_not_reloaded_reads_each_write_as_saved(self) -> None: + stored: Final = _StoredRouterSettings(None, lagging_replica=True) + stale_router: Final = _team_router() + stale_router.apply(ChangeSet(assign={"fallbacks": [{"team-primary": ["gpt-5.4-mini"]}]})) + + await self._create(FallbackCreateRequest(model="team-primary", fallback_models=["team-fallback"]), stored) + created: Final = await self._get("team-primary", stored, router=stale_router) + await self._create( + FallbackCreateRequest(model="team-primary", fallback_models=["gpt-5.4-mini", "team-fallback"]), stored + ) + updated: Final = await self._get("team-primary", stored, router=stale_router) + await self._delete("team-primary", stored) + + assert created.fallback_models == ["team-fallback"] + assert updated.fallback_models == ["gpt-5.4-mini", "team-fallback"] + assert await self._read_status("team-primary", stored, router=stale_router) == 404 + assert stale_router.settings().fallbacks == [{"team-primary": ["gpt-5.4-mini"]}] + + @pytest.mark.parametrize( + ("fallback_type", "fallback_key"), + [ + ("general", "fallbacks"), + ("context_window", "context_window_fallbacks"), + ("content_policy", "content_policy_fallbacks"), + ], + ) + async def test_a_read_names_every_saved_target_of_each_fallback_type( + self, fallback_type: Literal["general", "context_window", "content_policy"], fallback_key: str + ) -> None: + stored: Final = _StoredRouterSettings( + {fallback_key: [{"team-primary": [{"model": "gpt-5.4-mini", "api_key": "sk-test"}, "team-fallback"]}]} + ) + + response: Final = await self._get("team-primary", stored, fallback_type) + + assert response.fallback_models == ["gpt-5.4-mini", "team-fallback"] + assert response.fallback_type == fallback_type + + @pytest.mark.parametrize( + ("fallback_type", "fallback_key"), + [("general", "fallbacks"), ("content_policy", "content_policy_fallbacks")], + ) + async def test_a_read_skips_a_malformed_saved_rule_and_serves_the_valid_ones( + self, fallback_type: Literal["general", "content_policy"], fallback_key: str + ) -> None: + stored: Final = _StoredRouterSettings(None) + stored.row = SimpleNamespace(param_name="router_settings", param_value={fallback_key: [42, TEAM_RULE, None]}) + + response: Final = await self._get("team-primary", stored, fallback_type) + + assert response.fallback_models == ["team-fallback"] + + async def test_a_read_resolves_the_saved_wildcard_rule(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [GATEWAY_RULE, {"*": ["gpt-5.4-mini"]}]}) + + response: Final = await self._get("team-primary", stored) + + assert response.fallback_models == ["gpt-5.4-mini"] + + @pytest.mark.parametrize( + "router_settings", + [None, {"routing_strategy": "latency-based-routing"}, {"fallbacks": None}, {"fallbacks": "team-primary"}], + ) + async def test_a_read_does_not_answer_with_rules_only_the_routers_memory_holds( + self, router_settings: RouterSettings | None + ) -> None: + stored: Final = _StoredRouterSettings(router_settings) + stale_router: Final = _team_router() + stale_router.apply(ChangeSet(assign={"fallbacks": [TEAM_RULE]})) + + assert await self._read_status("team-primary", stored, router=stale_router) == 404 + + async def test_a_content_policy_read_layers_the_saved_rules_over_the_litellm_settings_rules( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + monkeypatch.setattr(litellm, "content_policy_fallbacks", [TEAM_RULE, {"gpt-5.4-mini": ["team-primary"]}]) + stored: Final = _StoredRouterSettings({"content_policy_fallbacks": [GATEWAY_RULE]}) + emptied: Final = _StoredRouterSettings({"content_policy_fallbacks": []}) + + saved_rule: Final = await self._get("gpt-5.4-mini", stored, "content_policy") + file_rule: Final = await self._get("team-primary", stored, "content_policy") + after_delete: Final = await self._get("gpt-5.4-mini", emptied, "content_policy") + + assert saved_rule.fallback_models == ["team-fallback"] + assert file_rule.fallback_models == ["team-fallback"] + assert after_delete.fallback_models == ["team-primary"] + + async def test_a_read_outside_database_mode_answers_from_the_router(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}) + router: Final = _team_router() + router.apply(ChangeSet(assign={"fallbacks": [GATEWAY_RULE]})) + + with ( + patch("litellm.proxy.proxy_server.llm_router", router), + patch("litellm.proxy.proxy_server.store_model_in_db", False), + ): + response: Final = await get_fallback("gpt-5.4-mini", "general", MagicMock(), fallbacks=stored.fallbacks) + + assert response.fallback_models == ["team-fallback"] + + async def test_a_read_of_a_router_settings_row_that_fails_answers_500(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}) + stored.prisma_client.writer_db.litellm_config.find_unique = AsyncMock(side_effect=RuntimeError("db down")) + + with pytest.raises(HTTPException) as failed: + await self._get("team-primary", stored) + + assert failed.value.status_code == 500 + + async def _while_a_write_holds_the_rules( + self, stored: _StoredRouterSettings, holder: FallbackWrite, contender: FallbackWrite + ) -> None: + with ( + patch("litellm.proxy.proxy_server.llm_router", _team_router()), + patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + ): + holding: Final = asyncio.create_task(holder()) + await stored.read_held.wait() + contending: Final = asyncio.create_task(contender()) + blocked: Final = asyncio.create_task(stored.lock_contended.wait()) + await asyncio.wait((contending, blocked), return_when=asyncio.FIRST_COMPLETED) + blocked.cancel() + stored.held_read_released.set() + await asyncio.gather(holding, contending) + + async def test_concurrent_first_creates_keep_both_rules(self) -> None: + stored: Final = _StoredRouterSettings(None, hold_first_read=True) + + await self._while_a_write_holds_the_rules( + stored, + lambda: create_fallback( + FallbackCreateRequest(model="team-primary", fallback_models=["team-fallback"]), + MagicMock(), + fallbacks=stored.fallbacks, + ), + lambda: create_fallback( + FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), + MagicMock(), + fallbacks=stored.fallbacks, + ), + ) + + assert stored.stored_fallbacks() == [TEAM_RULE, GATEWAY_RULE] + + async def test_a_delete_racing_a_create_keeps_the_created_rule(self) -> None: + stored: Final = _StoredRouterSettings( + {"fallbacks": [TEAM_RULE], "routing_strategy": "latency-based-routing"}, hold_first_read=True + ) + + await self._while_a_write_holds_the_rules( + stored, + lambda: create_fallback( + FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), + MagicMock(), + fallbacks=stored.fallbacks, + ), + lambda: delete_fallback("team-primary", "general", MagicMock(), fallbacks=stored.fallbacks), + ) + + assert stored.row is not None + assert stored.row.param_value == {"fallbacks": [GATEWAY_RULE], "routing_strategy": "latency-based-routing"} + + async def test_a_config_section_write_racing_a_fallback_write_keeps_both_changes(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}, hold_first_read=True) + + await self._while_a_write_holds_the_rules( + stored, + lambda: create_fallback( + FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), + MagicMock(), + fallbacks=stored.fallbacks, + ), + lambda: stored.proxy_config._upsert_changed_config_section( + section_name="router_settings", + changed_keys={"routing_strategy": "latency-based-routing"}, + removed_keys=frozenset(), + prisma_client=stored.prisma_client, + ), + ) + + assert stored.row is not None + assert stored.row.param_value == { + "fallbacks": [TEAM_RULE, GATEWAY_RULE], + "routing_strategy": "latency-based-routing", + } + + async def test_a_failed_write_changes_neither_the_stored_rules_nor_the_router(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}, fail_writes=True) + router: Final = _team_router() + router.apply(ChangeSet(assign={"fallbacks": [TEAM_RULE]})) + + with ( + patch("litellm.proxy.proxy_server.llm_router", router), + patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + pytest.raises(HTTPException) as failed, + ): + await create_fallback( + FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), + MagicMock(), + fallbacks=stored.fallbacks, + ) + + assert failed.value.status_code == 500 + assert stored.stored_fallbacks() == [TEAM_RULE] + assert router.settings().fallbacks == [TEAM_RULE] + + async def test_a_delete_of_a_missing_rule_answers_404_and_leaves_the_row_and_lock_untouched(self) -> None: + settings: Final = {"fallbacks": [TEAM_RULE], "routing_strategy": "latency-based-routing"} + stored: Final = _StoredRouterSettings(copy.deepcopy(settings)) + + with pytest.raises(HTTPException) as missing: + await self._delete("gpt-5.4-mini", stored) + await self._create(FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), stored) + + assert missing.value.status_code == 404 + assert stored.writes == 1 + assert stored.row is not None + assert stored.row.param_value == {**settings, "fallbacks": [TEAM_RULE, GATEWAY_RULE]} async def test_a_create_reads_the_rules_from_the_writer_while_the_replica_lags(self) -> None: stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}, lagging_replica=True) @@ -397,7 +705,6 @@ class TestFallbackWritesSeeTheLatestStoredRules: stored: Final = _StoredRouterSettings(None) with ( patch("litellm.proxy.proxy_server.llm_router", router), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): @@ -406,10 +713,15 @@ class TestFallbackWritesSeeTheLatestStoredRules: model="gpt-5.4-mini", fallback_models=["team-fallback"], fallback_type="content_policy" ), MagicMock(), + fallbacks=stored.fallbacks, + ) + after_create: Final = await get_fallback( + "team-primary", "content_policy", MagicMock(), fallbacks=stored.fallbacks + ) + await delete_fallback("gpt-5.4-mini", "content_policy", MagicMock(), fallbacks=stored.fallbacks) + after_delete: Final = await get_fallback( + "team-primary", "content_policy", MagicMock(), fallbacks=stored.fallbacks ) - after_create: Final = await get_fallback("team-primary", "content_policy", MagicMock()) - await delete_fallback("gpt-5.4-mini", "content_policy", MagicMock()) - after_delete: Final = await get_fallback("team-primary", "content_policy", MagicMock()) assert after_create.fallback_models == ["team-fallback"] assert after_delete.fallback_models == ["team-fallback"] @@ -419,7 +731,6 @@ class TestFallbackWritesSeeTheLatestStoredRules: stored: Final = _StoredRouterSettings({"content_policy_fallbacks": [MALFORMED_GATEWAY_RULE]}) with ( patch("litellm.proxy.proxy_server.llm_router", router), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): @@ -428,8 +739,11 @@ class TestFallbackWritesSeeTheLatestStoredRules: model="team-primary", fallback_models=["team-fallback"], fallback_type="content_policy" ), MagicMock(), + fallbacks=stored.fallbacks, + ) + after_create: Final = await get_fallback( + "team-primary", "content_policy", MagicMock(), fallbacks=stored.fallbacks ) - after_create: Final = await get_fallback("team-primary", "content_policy", MagicMock()) assert after_create.fallback_models == ["team-fallback"] @@ -445,7 +759,7 @@ class TestFallbackWritesSeeTheLatestStoredRules: **{router_setting: [{"team-primary": [{"model": "gpt-5.4-mini", "api_key": "sk-test"}, "team-fallback"]}]} ) with patch("litellm.proxy.proxy_server.llm_router", router): - response: Final = await get_fallback("team-primary", fallback_type, MagicMock()) + response: Final = await get_fallback("team-primary", fallback_type, MagicMock(), fallbacks=None) assert response.fallback_models == ["gpt-5.4-mini", "team-fallback"] @@ -459,7 +773,7 @@ class TestFallbackWritesSeeTheLatestStoredRules: router: Final = _team_router() router.update_settings(**{router_setting: [{"team-primary": [{"temperature": 0}, "team-fallback"]}]}) with patch("litellm.proxy.proxy_server.llm_router", router): - response: Final = await get_fallback("team-primary", fallback_type, MagicMock()) + response: Final = await get_fallback("team-primary", fallback_type, MagicMock(), fallbacks=None) assert response.fallback_models == ["team-primary", "team-fallback"] @@ -467,7 +781,7 @@ class TestFallbackWritesSeeTheLatestStoredRules: router: Final = _team_router() router.update_settings(fallbacks=[{"team-primary": "team-fallback"}]) with patch("litellm.proxy.proxy_server.llm_router", router), pytest.raises(HTTPException) as raised: - await get_fallback("team-primary", "general", MagicMock()) + await get_fallback("team-primary", "general", MagicMock(), fallbacks=None) assert raised.value.status_code == 500 @@ -530,6 +844,79 @@ class TestFallbackWritesSeeTheLatestStoredRules: assert stored.row.param_value == {"fallbacks": [GATEWAY_RULE]} +class TestFallbackRoutesResolveTheirRepository: + @pytest.fixture + def stored(self) -> Iterator[_StoredRouterSettings]: + stored: Final = _StoredRouterSettings(None, lagging_replica=True) + app.dependency_overrides[user_api_key_auth] = lambda: UserAPIKeyAuth(user_role=LitellmUserRoles.PROXY_ADMIN) + with ( + patch("litellm.proxy.proxy_server.llm_router", _team_router()), + patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + ): + yield stored + app.dependency_overrides.pop(user_api_key_auth, None) + app.dependency_overrides.pop(get_database, None) + + def test_a_create_stores_the_rule_through_the_request_database(self, stored: _StoredRouterSettings) -> None: + app.dependency_overrides[get_database] = lambda: Database(prisma=stored.prisma_client, native=NATIVE) + + response: Final = TestClient(app).post( + "/fallback", json={"model": "team-primary", "fallback_models": ["team-fallback"]} + ) + + assert response.status_code == 200, response.text + assert stored.stored_fallbacks() == [TEAM_RULE] + + @pytest.mark.parametrize( + ("method", "path", "body"), + [ + ("POST", "/fallback", {"model": "team-primary", "fallback_models": ["team-fallback"]}), + ("DELETE", "/fallback/team-primary", None), + ], + ) + def test_writes_without_a_database_are_refused( + self, stored: _StoredRouterSettings, method: str, path: str, body: Mapping[str, JsonValue] | None + ) -> None: + app.dependency_overrides[get_database] = lambda: None + + response: Final = TestClient(app).request(method, path, json=body) + + assert response.status_code == 400, response.text + assert "Database storage not enabled" in response.text + assert stored.row is None + + def test_a_read_serves_the_saved_rule_the_routers_memory_lacks(self, stored: _StoredRouterSettings) -> None: + stored.written_by_another_instance({"fallbacks": [TEAM_RULE]}) + app.dependency_overrides[get_database] = lambda: Database(prisma=stored.prisma_client, native=NATIVE) + + response: Final = TestClient(app).get("/fallback/team-primary", params={"fallback_type": "general"}) + + assert response.status_code == 200, response.text + assert response.json() == { + "model": "team-primary", + "fallback_models": ["team-fallback"], + "fallback_type": "general", + } + + def test_a_read_without_a_database_answers_from_the_router(self, stored: _StoredRouterSettings) -> None: + stored.written_by_another_instance({"fallbacks": [TEAM_RULE]}) + app.dependency_overrides[get_database] = lambda: None + + response: Final = TestClient(app).get("/fallback/team-primary", params={"fallback_type": "general"}) + + assert response.status_code == 404, response.text + + def test_an_unknown_model_is_refused_before_the_missing_database(self, stored: _StoredRouterSettings) -> None: + app.dependency_overrides[get_database] = lambda: None + + response: Final = TestClient(app).post( + "/fallback", json={"model": "team-missing", "fallback_models": ["team-fallback"]} + ) + + assert response.status_code == 404, response.text + + CONFIG_RULE: Final = {"gpt-5.4-mini": ["team-fallback"]} CONFIG_WINDOW_RULE: Final = {"team-primary": ["gpt-5.4-mini"]} @@ -557,20 +944,18 @@ class TestFallbackWritesHonourTheConfigFile: ) -> FallbackResponse: with ( patch("litellm.proxy.proxy_server.llm_router", router), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): - return await create_fallback(request, MagicMock()) + return await create_fallback(request, MagicMock(), fallbacks=stored.fallbacks) async def _delete(self, model: str, router: Router, stored: _StoredRouterSettings) -> FallbackDeleteResponse: with ( patch("litellm.proxy.proxy_server.llm_router", router), - patch("litellm.proxy.proxy_server.prisma_client", stored.prisma_client), patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), patch("litellm.proxy.proxy_server.store_model_in_db", True), ): - return await delete_fallback(model, "general", MagicMock()) + return await delete_fallback(model, "general", MagicMock(), fallbacks=stored.fallbacks) async def test_a_create_that_adds_a_rule_to_a_config_owned_list_is_refused( self, router: Router, stored: _StoredRouterSettings @@ -584,7 +969,7 @@ class TestFallbackWritesHonourTheConfigFile: assert refused.value.status_code == 400 assert "key 'fallbacks' is set in the config file" in str(refused.value.detail) assert stored.stored_fallbacks() == [CONFIG_RULE] - stored.prisma_client.db.litellm_config.upsert.assert_not_awaited() + assert stored.writes == 0 assert router.settings().fallbacks == [CONFIG_RULE] async def test_a_create_after_the_config_file_takes_over_the_key_is_refused(self, router: Router) -> None: @@ -610,7 +995,7 @@ class TestFallbackWritesHonourTheConfigFile: assert refused.value.status_code == 400 assert "key 'fallbacks' is set in the config file" in str(refused.value.detail) assert stored.stored_fallbacks() == [CONFIG_RULE] - stored.prisma_client.db.litellm_config.upsert.assert_not_awaited() + assert stored.writes == 0 assert router.settings().fallbacks == [CONFIG_RULE] async def test_a_delete_of_a_rule_only_the_config_file_holds_is_refused(self, router: Router) -> None: @@ -629,10 +1014,14 @@ class TestFallbackWritesHonourTheConfigFile: self, router: Router, monkeypatch: pytest.MonkeyPatch ) -> None: monkeypatch.delenv("LITELLM_TEST_UNSET_FALLBACKS", raising=False) - stored: Final = _StoredRouterSettings(None, config_file={"fallbacks": "os.environ/LITELLM_TEST_UNSET_FALLBACKS"}) + stored: Final = _StoredRouterSettings( + None, config_file={"fallbacks": "os.environ/LITELLM_TEST_UNSET_FALLBACKS"} + ) with pytest.raises(HTTPException) as refused: - await self._create(FallbackCreateRequest(model="team-primary", fallback_models=["team-fallback"]), router, stored) + await self._create( + FallbackCreateRequest(model="team-primary", fallback_models=["team-fallback"]), router, stored + ) with pytest.raises(HTTPException) as not_found: await self._delete("team-primary", router, stored) @@ -696,13 +1085,30 @@ class TestFallbackWritesHonourTheConfigFile: {"fallbacks": [TEAM_RULE]}, config_file={"routing_strategy": "latency-based-routing"} ) - await self._create(FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), router, stored) + await self._create( + FallbackCreateRequest(model="gpt-5.4-mini", fallback_models=["team-fallback"]), router, stored + ) assert stored.row is not None assert stored.row.param_value == {"fallbacks": [TEAM_RULE, GATEWAY_RULE]} await self._delete("team-primary", router, stored) assert stored.row.param_value == {"fallbacks": [GATEWAY_RULE]} + async def test_a_read_of_a_config_owned_list_answers_from_the_file_not_the_shadowed_row(self) -> None: + stored: Final = _StoredRouterSettings({"fallbacks": [TEAM_RULE]}, config_file={"fallbacks": [CONFIG_RULE]}) + + with ( + patch("litellm.proxy.proxy_server.llm_router", _team_router()), + patch("litellm.proxy.proxy_server.proxy_config", stored.proxy_config), + patch("litellm.proxy.proxy_server.store_model_in_db", True), + ): + from_file: Final = await get_fallback("gpt-5.4-mini", "general", MagicMock(), fallbacks=stored.fallbacks) + with pytest.raises(HTTPException) as shadowed: + await get_fallback("team-primary", "general", MagicMock(), fallbacks=stored.fallbacks) + + assert from_file.fallback_models == ["team-fallback"] + assert shadowed.value.status_code == 404 + async def test_a_sibling_list_the_config_file_does_not_set_stays_writable( self, router: Router, stored: _StoredRouterSettings ) -> None: @@ -737,15 +1143,12 @@ class TestCreateFallback: return router @pytest.fixture - def mock_prisma_client(self): - """Create a mock prisma client""" - client = MagicMock() - client.writer_db = client.db - client.db.litellm_config.find_unique = AsyncMock(return_value=None) - client.db.litellm_config.upsert = AsyncMock() - client.get_generic_data = AsyncMock(return_value=None) - client.jsonify_object = lambda x: x - return client + def stored(self) -> _StoredRouterSettings: + return _StoredRouterSettings(None) + + @pytest.fixture + def mock_prisma_client(self, stored: _StoredRouterSettings) -> MagicMock: + return stored.prisma_client @pytest.fixture def mock_proxy_config(self): @@ -758,7 +1161,7 @@ class TestCreateFallback: return MagicMock() async def test_create_fallback_success( - self, mock_router, mock_prisma_client, mock_proxy_config, mock_user_api_key_dict + self, mock_router, stored, mock_prisma_client, mock_proxy_config, mock_user_api_key_dict ): """Test successful fallback creation""" request = FallbackCreateRequest( @@ -785,18 +1188,16 @@ class TestCreateFallback: True, ), ): - response = await create_fallback(request, mock_user_api_key_dict) + response = await create_fallback( + request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client) + ) assert response.model == "gpt-3.5-turbo" assert response.fallback_models == ["gpt-4", "claude-3-haiku"] assert response.fallback_type == "general" - assert ( - "created" in response.message.lower() - or "updated" in response.message.lower() - ) + assert "created" in response.message.lower() or "updated" in response.message.lower() - # Verify database was updated - mock_prisma_client.db.litellm_config.upsert.assert_called_once() + assert stored.stored_fallbacks() == [{"gpt-3.5-turbo": ["gpt-4", "claude-3-haiku"]}] async def test_create_fallback_router_not_initialized( self, mock_prisma_client, mock_proxy_config, mock_user_api_key_dict @@ -814,7 +1215,7 @@ class TestCreateFallback: ), pytest.raises(HTTPException) as exc_info, ): - await create_fallback(request, mock_user_api_key_dict) + await create_fallback(request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client)) assert exc_info.value.status_code == 500 assert "Router not initialized" in str(exc_info.value.detail) @@ -843,7 +1244,7 @@ class TestCreateFallback: ), pytest.raises(HTTPException) as exc_info, ): - await create_fallback(request, mock_user_api_key_dict) + await create_fallback(request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client)) assert exc_info.value.status_code == 404 assert "not found in router" in str(exc_info.value.detail) @@ -872,7 +1273,7 @@ class TestCreateFallback: ), pytest.raises(HTTPException) as exc_info, ): - await create_fallback(request, mock_user_api_key_dict) + await create_fallback(request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client)) assert exc_info.value.status_code == 400 assert "Invalid fallback models" in str(exc_info.value.detail) @@ -901,14 +1302,12 @@ class TestCreateFallback: ), pytest.raises(HTTPException) as exc_info, ): - await create_fallback(request, mock_user_api_key_dict) + await create_fallback(request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client)) assert exc_info.value.status_code == 400 assert "cannot be its own fallback" in str(exc_info.value.detail) - async def test_create_fallback_db_not_enabled( - self, mock_router, mock_user_api_key_dict - ): + async def test_create_fallback_db_not_enabled(self, mock_router, mock_user_api_key_dict): """Test error when database storage is not enabled""" request = FallbackCreateRequest( model="gpt-3.5-turbo", @@ -926,7 +1325,7 @@ class TestCreateFallback: ), pytest.raises(HTTPException) as exc_info, ): - await create_fallback(request, mock_user_api_key_dict) + await create_fallback(request, mock_user_api_key_dict, fallbacks=None) assert exc_info.value.status_code == 400 assert "Database storage not enabled" in str(exc_info.value.detail) @@ -959,7 +1358,9 @@ class TestCreateFallback: True, ), ): - response = await create_fallback(request, mock_user_api_key_dict) + response = await create_fallback( + request, mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client) + ) assert response.fallback_type == "context_window" # Verify the correct setting was updated @@ -988,25 +1389,19 @@ class TestGetFallback: """Create a mock user API key dict""" return MagicMock() - async def test_get_fallback_success( - self, mock_router_with_fallbacks, mock_user_api_key_dict - ): + async def test_get_fallback_success(self, mock_router_with_fallbacks, mock_user_api_key_dict): """Test successful fallback retrieval""" with patch( "litellm.proxy.proxy_server.llm_router", mock_router_with_fallbacks, ): - response = await get_fallback( - "gpt-3.5-turbo", "general", mock_user_api_key_dict - ) + response = await get_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict, fallbacks=None) assert response.model == "gpt-3.5-turbo" assert response.fallback_models == ["gpt-4", "claude-3-haiku"] assert response.fallback_type == "general" - async def test_get_fallback_not_found( - self, mock_router_with_fallbacks, mock_user_api_key_dict - ): + async def test_get_fallback_not_found(self, mock_router_with_fallbacks, mock_user_api_key_dict): """Test error when fallback is not found""" with ( patch( @@ -1015,7 +1410,7 @@ class TestGetFallback: ), pytest.raises(HTTPException) as exc_info, ): - await get_fallback("gpt-4", "general", mock_user_api_key_dict) + await get_fallback("gpt-4", "general", mock_user_api_key_dict, fallbacks=None) assert exc_info.value.status_code == 404 assert "No general fallbacks configured" in str(exc_info.value.detail) @@ -1029,7 +1424,7 @@ class TestGetFallback: ), pytest.raises(HTTPException) as exc_info, ): - await get_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict) + await get_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict, fallbacks=None) assert exc_info.value.status_code == 500 assert "Router not initialized" in str(exc_info.value.detail) @@ -1051,17 +1446,12 @@ class TestDeleteFallback: return router @pytest.fixture - def mock_prisma_client(self): - """Create a mock prisma client""" - client = MagicMock() - client.writer_db = client.db - client.db.litellm_config.find_unique = AsyncMock( - return_value=_config_row({"fallbacks": [{"gpt-3.5-turbo": ["gpt-4", "claude-3-haiku"]}]}) - ) - client.db.litellm_config.upsert = AsyncMock() - client.get_generic_data = AsyncMock(return_value=None) - client.jsonify_object = lambda x: x - return client + def stored(self) -> _StoredRouterSettings: + return _StoredRouterSettings({"fallbacks": [{"gpt-3.5-turbo": ["gpt-4", "claude-3-haiku"]}]}) + + @pytest.fixture + def mock_prisma_client(self, stored: _StoredRouterSettings) -> MagicMock: + return stored.prisma_client @pytest.fixture def mock_proxy_config(self): @@ -1076,6 +1466,7 @@ class TestDeleteFallback: async def test_delete_fallback_success( self, mock_router_with_fallbacks, + stored, mock_prisma_client, mock_proxy_config, mock_user_api_key_dict, @@ -1100,15 +1491,17 @@ class TestDeleteFallback: ), ): response = await delete_fallback( - "gpt-3.5-turbo", "general", mock_user_api_key_dict + "gpt-3.5-turbo", + "general", + mock_user_api_key_dict, + fallbacks=ConfigRepository(mock_prisma_client), ) assert response.model == "gpt-3.5-turbo" assert response.fallback_type == "general" assert "deleted" in response.message.lower() - # Verify database was updated - mock_prisma_client.db.litellm_config.upsert.assert_called_once() + assert stored.stored_fallbacks() == [] async def test_delete_fallback_not_found( self, @@ -1137,7 +1530,9 @@ class TestDeleteFallback: ), pytest.raises(HTTPException) as exc_info, ): - await delete_fallback("gpt-4", "general", mock_user_api_key_dict) + await delete_fallback( + "gpt-4", "general", mock_user_api_key_dict, fallbacks=ConfigRepository(mock_prisma_client) + ) assert exc_info.value.status_code == 404 assert "No general fallbacks configured" in str(exc_info.value.detail) @@ -1151,14 +1546,12 @@ class TestDeleteFallback: ), pytest.raises(HTTPException) as exc_info, ): - await delete_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict) + await delete_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict, fallbacks=None) assert exc_info.value.status_code == 500 assert "Router not initialized" in str(exc_info.value.detail) - async def test_delete_fallback_db_not_enabled( - self, mock_router_with_fallbacks, mock_user_api_key_dict - ): + async def test_delete_fallback_db_not_enabled(self, mock_router_with_fallbacks, mock_user_api_key_dict): """Test error when database storage is not enabled""" with ( patch( @@ -1171,7 +1564,7 @@ class TestDeleteFallback: ), pytest.raises(HTTPException) as exc_info, ): - await delete_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict) + await delete_fallback("gpt-3.5-turbo", "general", mock_user_api_key_dict, fallbacks=None) assert exc_info.value.status_code == 400 assert "Database storage not enabled" in str(exc_info.value.detail) diff --git a/tests/unit/proxy/test_health_check_functions.py b/tests/unit/proxy/test_health_check_functions.py index 79eec44958f..fb26b9706f6 100644 --- a/tests/unit/proxy/test_health_check_functions.py +++ b/tests/unit/proxy/test_health_check_functions.py @@ -4,10 +4,19 @@ from datetime import datetime, timedelta, timezone from typing import Final from unittest.mock import AsyncMock, MagicMock, patch +import httpx import pytest +import respx +from pydantic import TypeAdapter +from starlette.requests import Request -from litellm.proxy._types import UserAPIKeyAuth +import litellm +from litellm.integrations.custom_logger import CustomLogger +from litellm.llms.chatgpt import authenticator as chatgpt_authenticator +from litellm.proxy import proxy_server +from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth from litellm.proxy.db.health_check_latest import LatestHealthCheckRow +from litellm.proxy.health_check import _same_health_check_model, update_litellm_params_for_health_check from litellm.proxy.health_endpoints._health_endpoints import ( _aggregate_health_check_results, _build_model_param_to_info_mapping, @@ -16,8 +25,10 @@ from litellm.proxy.health_endpoints._health_endpoints import ( _save_health_check_results_if_changed, _save_health_check_to_db, latest_health_checks_endpoint, + test_model_connection as probe_model_connection, ) from litellm.proxy.utils import PrismaClient +from litellm.types.utils import StandardLoggingPayload @pytest.fixture @@ -946,5 +957,213 @@ def test_filter_deployments_to_model_groups(): assert filter_deployments_to_model_groups(model_list, frozenset()) == () +@pytest.mark.asyncio +@pytest.mark.parametrize( + "pricing", [{"base_model": "gpt-5.4"}, {"input_cost_per_token": 0.02, "output_cost_per_token": 0.03}] +) +@pytest.mark.parametrize("deployment_id", [None, "alternate-probe-deployment"]) +@pytest.mark.parametrize("override", ["health_check_model", "health_check_params", "same_model"]) +async def test_alternate_health_check_model_uses_its_own_price( + pricing: dict[str, object], deployment_id: str | None, override: str, monkeypatch: pytest.MonkeyPatch +) -> None: + events: Final[asyncio.Queue[StandardLoggingPayload]] = asyncio.Queue() + + class SpendCapture(CustomLogger): + async def async_log_success_event( + self, kwargs: dict[str, object], response_obj: object, start_time: datetime, end_time: datetime + ) -> None: + events.put_nowait(TypeAdapter(StandardLoggingPayload).validate_python(kwargs["standard_logging_object"])) + + monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) + monkeypatch.setattr(litellm, "_async_success_callback", [SpendCapture()]) + monkeypatch.setattr(proxy_server, "llm_router", None) + monkeypatch.setattr( + proxy_server, + "prisma_client", + PrismaClient( + database_url="postgresql://test:test@localhost/test", proxy_logging_obj=proxy_server.proxy_logging_obj + ), + ) + monkeypatch.setitem( + litellm.model_cost, + "health-probe", + { + "input_cost_per_token": 0.00001, + "output_cost_per_token": 0.00002, + "litellm_provider": "openai", + "mode": "chat", + }, + ) + monkeypatch.setitem( + litellm.model_cost, + "gpt-5.4", + {"input_cost_per_token": 0.001, "output_cost_per_token": 0.002, "litellm_provider": "openai", "mode": "chat"}, + ) + if deployment_id is not None: + monkeypatch.setitem( + litellm.model_cost, deployment_id, {**pricing, "litellm_provider": "openai", "mode": "chat"} + ) + params: Final = {"api_base": "https://health-test.example/v1", "api_key": "test-key"} + model_info: Final = { + **pricing, + **( + {"health_check_params": {"model": "openai/health-probe"}} + if override == "health_check_params" + else {"health_check_model": "openai/health-probe"} + ), + **({"id": deployment_id} if deployment_id is not None else {}), + } + payload: Final = { + "id": "chatcmpl-health-probe", + "object": "chat.completion", + "created": 1, + "model": "health-probe", + "choices": [{"index": 0, "message": {"role": "assistant", "content": "ok"}, "finish_reason": "stop"}], + "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}, + } + with respx.mock: + respx.post("https://health-test.example/v1/chat/completions").mock( + return_value=httpx.Response(200, json=payload) + ) + await litellm.acompletion( + model="openai/health-probe", + messages=[{"role": "user", "content": "test"}], + litellm_metadata={"model_info": model_info} if override == "same_model" else {}, + **params, + ) + normal: Final = await asyncio.wait_for(events.get(), timeout=10) + result: Final = await probe_model_connection( + request=Request({"type": "http", "headers": []}), + mode="chat", + litellm_params={"model": "openai/health-probe" if override == "same_model" else "openai/gpt-5.4", **params}, + model_info=model_info, + user_api_key_dict=UserAPIKeyAuth(user_role=LitellmUserRoles.PROXY_ADMIN), + ) + assert result["status"] == "success", result + health: Final = await asyncio.wait_for(events.get(), timeout=10) + + assert health["call_type"] == normal["call_type"] + assert health["model"] == normal["model"] + assert health["response_cost"] == normal["response_cost"] + assert health["response_cost"] > 0 + assert health["model_id"] == (deployment_id or "") + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("stored_model", "requested_model"), + [("openai/health-probe", "health-probe"), ("health-probe", "openai/health-probe")], +) +async def test_equivalent_health_check_model_names_keep_deployment_prices( + stored_model: str, requested_model: str, monkeypatch: pytest.MonkeyPatch +) -> None: + events: Final[asyncio.Queue[StandardLoggingPayload]] = asyncio.Queue() + + class SpendCapture(CustomLogger): + async def async_log_success_event( + self, kwargs: dict[str, object], response_obj: object, start_time: datetime, end_time: datetime + ) -> None: + events.put_nowait(TypeAdapter(StandardLoggingPayload).validate_python(kwargs["standard_logging_object"])) + + monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) + monkeypatch.setattr(litellm, "_async_success_callback", [SpendCapture()]) + monkeypatch.setitem( + litellm.model_cost, + "health-probe", + { + "input_cost_per_token": 0.00001, + "output_cost_per_token": 0.00002, + "litellm_provider": "openai", + "mode": "chat", + }, + ) + params: Final = { + "api_base": "https://equivalent-health.example/v1", + "api_key": "test-key", + "custom_llm_provider": "openai", + } + deployment_id: Final = "priced-health-deployment" + model_info: Final = { + "id": deployment_id, + "mode": "chat", + "input_cost_per_token": 0.02, + "output_cost_per_token": 0.03, + } + router: Final = litellm.Router( + model_list=[ + { + "model_name": "priced-health", + "litellm_params": {"model": stored_model, **params}, + "model_info": model_info, + } + ] + ) + monkeypatch.setattr(proxy_server, "llm_router", router) + monkeypatch.setattr( + proxy_server, + "prisma_client", + PrismaClient( + database_url="postgresql://test:test@localhost/test", proxy_logging_obj=proxy_server.proxy_logging_obj + ), + ) + payload: Final = { + "id": "chatcmpl-equivalent-health", + "object": "chat.completion", + "created": 1, + "model": "health-probe", + "choices": [{"index": 0, "message": {"role": "assistant", "content": "ok"}, "finish_reason": "stop"}], + "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}, + } + with respx.mock: + respx.post("https://equivalent-health.example/v1/chat/completions").mock( + return_value=httpx.Response(200, json=payload) + ) + result: Final = await probe_model_connection( + request=Request({"type": "http", "headers": []}), + mode="chat", + litellm_params={"model": requested_model, "custom_llm_provider": "openai"}, + model_info={"id": deployment_id}, + user_api_key_dict=UserAPIKeyAuth(user_role=LitellmUserRoles.PROXY_ADMIN), + ) + assert result["status"] == "success", result + health: Final = await asyncio.wait_for(events.get(), timeout=10) + + assert health["response_cost"] == 10 * model_info["input_cost_per_token"] + 5 * model_info["output_cost_per_token"] + assert health["model"] == "health-probe" + assert health["model_id"] == deployment_id + + +def test_health_check_without_deployment_model_keeps_probe_but_drops_deployment_prices() -> None: + deployment_info: Final = { + "id": "probe-deployment", + "base_model": "openai/deployment-model", + "input_cost_per_token": 0.02, + "output_cost_per_token": 0.03, + } + probe_model: Final = "openai/health-probe" + + probe_params: Final = update_litellm_params_for_health_check( + model_info={"mode": "chat", "health_check_model": probe_model}, + litellm_params={"model_info": deployment_info}, + ) + + assert probe_params["model"] == probe_model + assert probe_params["model_info"] == {"id": deployment_info["id"]} + + +@pytest.mark.parametrize(("model", "expected"), [("health-probe", True), ("other-health-probe", False)]) +def test_chatgpt_health_check_model_comparison_does_not_access_credentials( + model: str, expected: bool, monkeypatch: pytest.MonkeyPatch +) -> None: + def forbidden_auth_file_access(*args: object, **kwargs: object) -> None: + pytest.fail("Health-check model comparison accessed the ChatGPT auth file") + + monkeypatch.setattr(chatgpt_authenticator, "open", forbidden_auth_file_access, raising=False) + + assert ( + _same_health_check_model("chatgpt/health-probe", {"model": model, "custom_llm_provider": "chatgpt"}) is expected + ) + + if __name__ == "__main__": pytest.main([__file__]) diff --git a/tests/unit/proxy/test_route_llm_request.py b/tests/unit/proxy/test_route_llm_request.py index 75a17d49d3a..fa53f422f36 100644 --- a/tests/unit/proxy/test_route_llm_request.py +++ b/tests/unit/proxy/test_route_llm_request.py @@ -1899,6 +1899,10 @@ def test_raise_if_required_body_param_missing_names_each_missing_param(route_typ ("aspeech", {"model": "gpt-4o-mini-tts", "input": "hi", "voice": "alloy"}), ("amoderation", {"model": "omni-moderation-latest", "input": ""}), ("asearch", {"model": "perplexity-search", "query": "litellm"}), + ( + "avector_store_search", + {"vector_store_id": "kb1", "query_image": {"type": "base64", "media_type": "image/png", "data": "iVBO"}}, + ), ( "acreate_batch", {"input_file_id": "file-abc", "endpoint": "/v1/chat/completions", "completion_window": "24h"}, diff --git a/tests/unit/proxy/vector_store_endpoints/test_vector_store_endpoints.py b/tests/unit/proxy/vector_store_endpoints/test_vector_store_endpoints.py index fa4a1656bc3..2d0f3679144 100644 --- a/tests/unit/proxy/vector_store_endpoints/test_vector_store_endpoints.py +++ b/tests/unit/proxy/vector_store_endpoints/test_vector_store_endpoints.py @@ -1,5 +1,6 @@ import json from datetime import datetime, timezone +from typing import Final from unittest.mock import AsyncMock, MagicMock, patch import pytest @@ -15,8 +16,10 @@ from litellm.llms.base_llm.vector_store.transformation import ( RouterVectorStoreEmbeddingExecutor, ) from litellm.proxy._types import CommonProxyErrors, LitellmUserRoles, UserAPIKeyAuth +from litellm.vector_stores.search_query import with_caller_query_params from litellm.proxy.vector_store_endpoints.endpoints import ( _update_request_data_with_litellm_managed_vector_store_registry, + build_request_data_from_managed_vector_store, index_create, index_list, ) @@ -3103,6 +3106,83 @@ def test_vector_store_search_rejects_caller_opensearch_index_name_only_on_opense assert fake_search.await_count == expected_searches +def test_vector_store_search_accepts_a_query_image_without_a_query(): + from fastapi.testclient import TestClient + + from litellm.proxy.auth.user_api_key_auth import user_api_key_auth + from litellm.proxy.proxy_server import app + from litellm.types.vector_stores import VectorStoreSearchResponse + + query_image: Final = {"type": "base64", "media_type": "image/png", "data": "iVBORw0KGgo="} + store: Final = { + "vector_store_id": "kb", + "custom_llm_provider": "bedrock", + "litellm_params": {"vector_store_id": "kb", "custom_llm_provider": "bedrock"}, + } + registry: Final = MagicMock() + registry.get_litellm_managed_vector_store_from_registry.return_value = store + fake_search: Final = AsyncMock( + return_value=VectorStoreSearchResponse(object="vector_store.search_results.page", search_query="", data=[]) + ) + mock_auth: Final = UserAPIKeyAuth(user_id="test_internal_user", user_role=LitellmUserRoles.INTERNAL_USER.value) + original_overrides: Final = app.dependency_overrides.copy() + app.dependency_overrides[user_api_key_auth] = lambda: mock_auth + try: + with ( + patch("litellm.vector_stores.main.asearch", new=fake_search), # test-quality-ok: the search boundary under test + patch.object(litellm, "vector_store_registry", registry), # test-quality-ok: seeds the store under test + patch( # test-quality-ok: store access is not under test, so the request reaches the search boundary + "litellm.proxy.vector_store_endpoints.utils.can_user_access_vector_store", + new=AsyncMock(return_value=True), + ), + ): + router: Final = litellm.Router(model_list=[]) + with patch("litellm.proxy.proxy_server.llm_router", router): # test-quality-ok: router built over the fake search + response: Final = TestClient(app).post("/v1/vector_stores/kb/search", json={"query_image": query_image}) + finally: + app.dependency_overrides = original_overrides + + assert response.status_code == 200, response.json() + assert fake_search.await_args.kwargs["query_image"] == query_image + + +@pytest.mark.parametrize("retrieval_query_param", ["retrievalQuery", "retrieval_query"]) +def test_a_stored_raw_retrieval_query_never_reaches_the_search_request(retrieval_query_param: str): + request_data: Final = build_request_data_from_managed_vector_store( + { + "vector_store_id": "kb", + "custom_llm_provider": "bedrock", + "litellm_params": {"aws_region_name": "us-west-2", retrieval_query_param: {"text": "from the store"}}, + } + ) + + assert request_data == {"custom_llm_provider": "bedrock", "aws_region_name": "us-west-2"} + + +@pytest.mark.parametrize("retrieval_query_param", ["retrievalQuery", "retrieval_query"]) +def test_a_raw_retrieval_query_in_a_stores_extra_body_never_reaches_the_search_request(retrieval_query_param: str): + request_data: Final = build_request_data_from_managed_vector_store( + { + "vector_store_id": "kb", + "custom_llm_provider": "bedrock", + "litellm_params": {"extra_body": {retrieval_query_param: {"text": "from the store"}, "kept": "value"}}, + } + ) + + assert request_data == {"custom_llm_provider": "bedrock", "extra_body": {"kept": "value"}} + + +@pytest.mark.parametrize("caller_param", ["query_image", "retrievalQuery", "retrieval_query"]) +def test_a_callers_query_survives_a_stores_own_extra_body(caller_param: str): + caller_value: Final = {"type": "base64", "media_type": "image/png", "data": "iVBORw0KGgo="} + request_data: Final = with_caller_query_params( + {"custom_llm_provider": "bedrock", "extra_body": {"retrievalConfiguration": "from the store"}}, + {caller_param: caller_value, "retrievalConfiguration": "from the caller", "other": "from the caller"}, + ) + + assert request_data["extra_body"] == {"retrievalConfiguration": "from the store", caller_param: caller_value} + + class TestConfigOwnedVectorStores: """Stores declared under ``vector_store_registry`` in config.yaml are owned by the config file""" diff --git a/tests/unit/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py b/tests/unit/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py index 1a6e3cc7832..0dce041cce8 100644 --- a/tests/unit/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py +++ b/tests/unit/responses/litellm_completion_transformation/test_streaming_iterator_transformation.py @@ -81,14 +81,14 @@ class _FakeStreamWrapper: return self._chunks.pop(0) -def _build_iterator(chunks) -> LiteLLMCompletionStreamingIterator: +def _build_iterator(chunks, litellm_metadata: dict[str, object] | None = None) -> LiteLLMCompletionStreamingIterator: return LiteLLMCompletionStreamingIterator( model="claude-haiku-4-5", litellm_custom_stream_wrapper=_FakeStreamWrapper(chunks), request_input="What is the weather in San Francisco?", responses_api_request={}, custom_llm_provider="anthropic", - litellm_metadata={}, + litellm_metadata=litellm_metadata or {}, ) @@ -1774,6 +1774,56 @@ async def test_completed_output_follows_the_streamed_output_indexes(sync_mode: b assert [item.id for item in completed.response.output] == [event.item.id for event in added] +_REASONING_ITEM_EVENT_TYPES: Final = frozenset( + { + ResponsesAPIStreamEvents.RESPONSE_PART_ADDED, + ResponsesAPIStreamEvents.REASONING_SUMMARY_TEXT_DELTA, + ResponsesAPIStreamEvents.REASONING_SUMMARY_TEXT_DONE, + ResponsesAPIStreamEvents.REASONING_SUMMARY_PART_DONE, + } +) + + +def _reasoning_item_ids(events: list[BaseLiteLLMOpenAIResponseObject]) -> set[str]: + completed: Final = next( + event for event in events if getattr(event, "type", None) == ResponsesAPIStreamEvents.RESPONSE_COMPLETED + ) + streamed_items: Final = { + event.item.id for event in events if getattr(getattr(event, "item", None), "type", None) == "reasoning" + } + scoped_events: Final = { + event.item_id for event in events if getattr(event, "type", None) in _REASONING_ITEM_EVENT_TYPES + } + completed_items: Final = {item.id for item in completed.response.output if item.type == "reasoning"} + return streamed_items | scoped_events | completed_items + + +@pytest.mark.parametrize( + "stream_chunks", + [_reasoning_then_text_chunks, _signed_thinking_and_text_in_one_chunk], + ids=["reasoning_then_text_chunks", "signed_thinking_and_text_in_one_chunk"], +) +@pytest.mark.parametrize( + "litellm_metadata, origin", + [({"encrypted_content_affinity_enabled": True, "model_info": {"id": "dep-1"}}, "dep-1"), ({}, None)], + ids=["affinity-on", "affinity-off"], +) +@pytest.mark.parametrize("sync_mode", [True, False]) +@pytest.mark.asyncio +async def test_reasoning_item_keeps_one_id_across_bridged_events_and_completed_output( + stream_chunks: StreamChunks, litellm_metadata: dict[str, object], origin: str | None, sync_mode: bool +): + events: Final = await _collect_events(_build_iterator(stream_chunks(), litellm_metadata), sync_mode) + + reasoning_ids: Final = _reasoning_item_ids(events) + assert len(reasoning_ids) == 1 + decoded: Final = ResponsesAPIRequestUtils.decode_encrypted_item_id(next(iter(reasoning_ids))) + assert (decoded or {}).get("model_id") == origin + message_ids: Final = {event.item.id for event in events if _is_message_item(event)} + assert message_ids + assert [ResponsesAPIRequestUtils.decode_encrypted_item_id(item_id) for item_id in message_ids] == [None] + + @pytest.mark.parametrize("sync_mode", [True, False]) @pytest.mark.asyncio async def test_reasoning_only_stream_lists_no_message_item_it_never_announced(sync_mode: bool): diff --git a/tests/unit/responses/mcp/test_tool_precheck.py b/tests/unit/responses/mcp/test_tool_precheck.py index bd37114ccea..04670f6b4ed 100644 --- a/tests/unit/responses/mcp/test_tool_precheck.py +++ b/tests/unit/responses/mcp/test_tool_precheck.py @@ -36,16 +36,6 @@ ANTHROPIC_FUNCTION_TOOL: Final = { "description": "No operation", "input_schema": {"type": "object", "properties": {}}, } -ANTHROPIC_MESSAGE_PAYLOAD: Final = { - "id": "msg_1", - "type": "message", - "role": "assistant", - "model": "claude-sonnet-5-5", - "content": [{"type": "text", "text": "ok"}], - "stop_reason": "end_turn", - "stop_sequence": None, - "usage": {"input_tokens": 1, "output_tokens": 1}, -} GATEWAY_MCP_TOOL: Final = {"type": "mcp", "server_label": "litellm", "server_url": "litellm_proxy"} GATEWAY_SERVER_MCP_TOOL: Final = {"type": "mcp", "server_label": "x", "server_url": "litellm_proxy/mcp/github"} GATEWAY_PATH_MCP_TOOL: Final = {"type": "mcp", "server_label": "x", "server_url": "https://gw.example.com/mcp/github"} @@ -193,23 +183,16 @@ def test_responses_with_gateway_mcp_tool_still_reaches_the_handler(): @pytest.mark.asyncio @pytest.mark.usefixtures("gateway_handler_unavailable") -async def test_anthropic_messages_with_function_tool_does_not_import_the_gateway_handler( - monkeypatch: pytest.MonkeyPatch, respx_mock: respx.MockRouter -): - monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) - upstream: Final = respx_mock.post("https://api.anthropic.com/v1/messages").mock( - return_value=httpx.Response(200, json=ANTHROPIC_MESSAGE_PAYLOAD) - ) - +async def test_anthropic_messages_with_function_tool_does_not_import_the_gateway_handler(): response: Final = await litellm.anthropic_interface.messages.acreate( model="anthropic/claude-sonnet-5-5", messages=[{"role": "user", "content": "hi"}], max_tokens=16, tools=[ANTHROPIC_FUNCTION_TOOL], api_key="sk-test", + mock_response="ok", ) - assert upstream.called assert response["content"][0]["text"] == "ok" diff --git a/tests/unit/responses/test_responses_websocket_all_providers.py b/tests/unit/responses/test_responses_websocket_all_providers.py index 9a73054b2e3..fe4ee0c4bbe 100644 --- a/tests/unit/responses/test_responses_websocket_all_providers.py +++ b/tests/unit/responses/test_responses_websocket_all_providers.py @@ -4692,6 +4692,22 @@ class TestNativeWebSocketEncryptedContentAffinity: backend_ws = MagicMock() backend_ws.recv = AsyncMock( side_effect=[ + json.dumps( + { + "type": "response.output_item.added", + "output_index": 0, + "item": {"type": "reasoning", "id": "rs_1", "summary": []}, + } + ), + json.dumps( + { + "type": "response.reasoning_summary_text.delta", + "item_id": "rs_1", + "output_index": 0, + "summary_index": 0, + "delta": "thinking", + } + ), json.dumps({"type": "response.output_item.done", "output_index": 0, "item": dict(reasoning_item)}), json.dumps( { @@ -4716,20 +4732,65 @@ class TestNativeWebSocketEncryptedContentAffinity: await handler.backend_to_client() wrapped_content = ResponsesAPIRequestUtils.wrap_encrypted_content_with_model_id("gAAAA-blob", "dep-1") - item_done = json.loads(websocket.send_text.await_args_list[0][0][0]) + added, summary_delta, item_done, completed = ( + json.loads(call[0][0]) for call in websocket.send_text.await_args_list[:4] + ) assert item_done["item"]["encrypted_content"] == wrapped_content - completed = json.loads(websocket.send_text.await_args_list[1][0][0]) assert completed["response"]["id"] == ResponsesAPIRequestUtils._build_responses_api_response_id( custom_llm_provider="openai", model_id="dep-1", response_id="resp_1" ) - assert completed["response"]["output"][0]["id"] == ResponsesAPIRequestUtils._build_encrypted_item_id( - "dep-1", "rs_1" - ) + assert { + added["item"]["id"], + summary_delta["item_id"], + item_done["item"]["id"], + completed["response"]["output"][0]["id"], + } == {ResponsesAPIRequestUtils._build_encrypted_item_id("dep-1", "rs_1")} assert completed["response"]["output"][0]["encrypted_content"] == wrapped_content await asyncio.sleep(0) logged = logging_obj.dispatch_success_handlers.await_args[0][0] assert logged[0]["response"]["id"] == completed["response"]["id"] + @pytest.mark.asyncio + @pytest.mark.parametrize( + "frame", + [ + {"note": "a frame without a type"}, + {"type": "response.output_text.delta", "item_id": "msg_1", "output_index": 1, "delta": "ok"}, + { + "type": "response.content_part.added", + "item_id": "msg_1", + "output_index": 1, + "content_index": 0, + "part": {"type": "output_text", "text": ""}, + }, + {"type": "response.output_item.done", "output_index": 1, "item": {"type": "message", "id": "msg_1"}}, + { + "type": "response.output_item.done", + "output_index": 0, + "item": {"type": "reasoning", "id": "encitem_bGl0ZWxsbTptb2RlbF9pZDpkZXAtMTtpdGVtX2lkOnJzXzE="}, + }, + ], + ids=["no-type", "message-delta", "message-content-part", "message-item", "already-encoded-reasoning"], + ) + async def test_backend_to_client_forwards_events_affinity_does_not_own_unchanged(self, frame: dict[str, object]): + import websockets.exceptions # noqa: F401 (lazy submodule must be importable) + + raw_frame: Final = json.dumps(frame) + websocket: Final = MagicMock() + websocket.send_text = AsyncMock() + backend_ws: Final = MagicMock() + backend_ws.recv = AsyncMock(side_effect=[raw_frame, Exception("stop")]) + handler: Final = _make_streaming( + websocket=websocket, + backend_ws=backend_ws, + request_data={"litellm_metadata": dict(_AFFINITY_METADATA)}, + custom_llm_provider="openai", + ) + + await handler.backend_to_client() + + assert websocket.send_text.await_args_list[0][0][0] == raw_frame + @pytest.mark.asyncio async def test_backend_to_client_wraps_only_response_id_without_affinity(self): from unittest.mock import AsyncMock diff --git a/tests/unit/responses/test_streaming_iterator.py b/tests/unit/responses/test_streaming_iterator.py index ec14f67ce17..7fa5d6bfa80 100644 --- a/tests/unit/responses/test_streaming_iterator.py +++ b/tests/unit/responses/test_streaming_iterator.py @@ -18,6 +18,7 @@ from unittest.mock import AsyncMock, MagicMock, Mock, patch import httpx import pytest import websockets.exceptions +from pydantic import BaseModel, TypeAdapter from pydantic_core import PydanticSerializationError import litellm @@ -43,6 +44,7 @@ from litellm.types.llms.openai import ( ) from contextlib import suppress from litellm.responses import streaming_iterator as streaming_module +from litellm.responses.utils import ResponsesAPIRequestUtils from litellm.types.utils import CallTypes from tests._vcr_conftest_common import install_live_call_probe, record_vcr_outcome from types import SimpleNamespace @@ -86,6 +88,7 @@ def _make_iterator( trailing_error: Optional[Exception] = None, config: Mock | None = None, request_data: dict | None = None, + litellm_metadata: dict[str, object] | None = None, ) -> ResponsesAPIStreamingIterator: async def aiter_bytes(): for evt in sse_events: @@ -102,7 +105,7 @@ def _make_iterator( model="gpt-4o-mini", responses_api_provider_config=config or _mock_config(), logging_obj=logging_obj, - litellm_metadata={}, + litellm_metadata=litellm_metadata or {}, custom_llm_provider="openai", request_data=request_data, ) @@ -561,6 +564,193 @@ async def test_event_without_a_type_reaches_the_caller_instead_of_ending_the_str assert untyped.model_extra == {"note": "hook output without a type"} +_REASONING_ITEM_ID: Final = "rs_affinity" +_MESSAGE_ITEM_ID: Final = "msg_affinity" +_STREAMED_REASONING_ITEM: Final = { + "id": _REASONING_ITEM_ID, + "type": "reasoning", + "summary": [{"type": "summary_text", "text": "thinking"}], + "encrypted_content": "ciphertext", +} +_STREAMED_MESSAGE_ITEM: Final = { + "id": _MESSAGE_ITEM_ID, + "type": "message", + "role": "assistant", + "status": "completed", + "content": [{"type": "output_text", "text": "ok", "annotations": []}], +} +_REASONING_SCOPED_EVENT_TYPES: Final = ( + ResponsesAPIStreamEvents.CONTENT_PART_ADDED, + "response.reasoning_text.delta", + ResponsesAPIStreamEvents.REASONING_SUMMARY_TEXT_DELTA, +) + + +def _reasoning_response_body(status: str, output: list[dict[str, object]]) -> dict[str, object]: + return { + "id": "resp_affinity", + "object": "response", + "created_at": 1, + "status": status, + "model": "gpt-5-mini", + "output": output, + "usage": {"input_tokens": 1, "output_tokens": 1, "total_tokens": 2}, + } + + +_REASONING_STREAM_EVENTS: Final = [ + _sse_event( + {"type": "response.created", "sequence_number": 0, "response": _reasoning_response_body("in_progress", [])} + ), + _sse_event( + { + "type": "response.output_item.added", + "sequence_number": 1, + "output_index": 0, + "item": {"id": _REASONING_ITEM_ID, "type": "reasoning", "summary": []}, + } + ), + _sse_event( + { + "type": "response.content_part.added", + "sequence_number": 2, + "item_id": _REASONING_ITEM_ID, + "output_index": 0, + "content_index": 0, + "part": {"type": "reasoning_text", "text": ""}, + } + ), + _sse_event( + { + "type": "response.reasoning_text.delta", + "sequence_number": 3, + "item_id": _REASONING_ITEM_ID, + "output_index": 0, + "content_index": 0, + "delta": "thinking", + } + ), + _sse_event( + { + "type": "response.reasoning_summary_text.delta", + "sequence_number": 4, + "item_id": _REASONING_ITEM_ID, + "output_index": 0, + "summary_index": 0, + "delta": "thinking", + } + ), + _sse_event( + {"type": "response.output_item.done", "sequence_number": 5, "output_index": 0, "item": _STREAMED_REASONING_ITEM} + ), + _sse_event( + { + "type": "response.output_text.delta", + "sequence_number": 6, + "item_id": _MESSAGE_ITEM_ID, + "output_index": 1, + "content_index": 0, + "delta": "ok", + } + ), + _sse_event( + {"type": "response.output_item.done", "sequence_number": 7, "output_index": 1, "item": _STREAMED_MESSAGE_ITEM} + ), + _sse_event( + { + "type": "response.completed", + "sequence_number": 8, + "response": _reasoning_response_body("completed", [_STREAMED_REASONING_ITEM, _STREAMED_MESSAGE_ITEM]), + } + ), +] + + +_ITEM_RECORD: Final = TypeAdapter(dict[str, object]) + + +def _item_record(item: object) -> dict[str, object]: + return _ITEM_RECORD.validate_python(item.model_dump(exclude_none=True) if isinstance(item, BaseModel) else item) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "litellm_metadata, origin", + [ + ({"encrypted_content_affinity_enabled": True, "model_info": {"id": "dep-1"}}, "dep-1"), + ({"encrypted_content_affinity_enabled": False, "model_info": {"id": "dep-1"}}, None), + ({"encrypted_content_affinity_enabled": True}, None), + ], + ids=["affinity-on", "affinity-off", "no-model-id"], +) +async def test_streamed_reasoning_item_keeps_one_id_and_replays_as_one_input_item( + litellm_metadata: dict[str, object], origin: str | None +): + iterator: Final = _make_iterator( + sse_events=_REASONING_STREAM_EVENTS, + logging_obj=_logging_obj_stub(), + config=OpenAIResponsesAPIConfig(), + litellm_metadata=litellm_metadata, + ) + + events: Final = [event async for event in iterator] + + item_events: Final = [ + _item_record(event.item) + for event in events + if event.type in (ResponsesAPIStreamEvents.OUTPUT_ITEM_ADDED, ResponsesAPIStreamEvents.OUTPUT_ITEM_DONE) + ] + completed: Final = next( + event.response for event in events if event.type == ResponsesAPIStreamEvents.RESPONSE_COMPLETED + ) + output_items: Final = [_item_record(item) for item in completed.output] + scoped_item_ids: Final = {event.type: event.item_id for event in events if getattr(event, "item_id", None)} + expected_reasoning_id: Final = ( + _REASONING_ITEM_ID + if origin is None + else ResponsesAPIRequestUtils._build_encrypted_item_id(origin, _REASONING_ITEM_ID) + ) + assert {item["id"] for item in [*item_events, *output_items] if item["type"] == "reasoning"} | { + scoped_item_ids[event_type] for event_type in _REASONING_SCOPED_EVENT_TYPES + } == {expected_reasoning_id} + assert {item["id"] for item in [*item_events, *output_items] if item["type"] == "message"} | { + scoped_item_ids[ResponsesAPIStreamEvents.OUTPUT_TEXT_DELTA] + } == {_MESSAGE_ITEM_ID} + + done_reasoning: Final = next(item for item in reversed(item_events) if item["type"] == "reasoning") + completed_reasoning: Final = next(item for item in output_items if item["type"] == "reasoning") + assert done_reasoning["encrypted_content"] == completed_reasoning["encrypted_content"] + assert ResponsesAPIRequestUtils.unwrap_encrypted_content_with_model_id( + str(done_reasoning["encrypted_content"]) + ) == (origin, "ciphertext") + + replayed: Final = list( + { + record["id"]: {key: record[key] for key in ("id", "type", "encrypted_content")} + for record in (done_reasoning, completed_reasoning) + }.values() + ) + assert ResponsesAPIRequestUtils.restore_encrypted_content_item_ids_in_input(replayed) == [ + {"id": _REASONING_ITEM_ID, "type": "reasoning", "encrypted_content": "ciphertext"} + ] + + +@pytest.mark.asyncio +async def test_output_item_added_without_an_item_streams_through_under_affinity(): + iterator: Final = _make_iterator( + sse_events=[ + _sse_event({"type": "response.output_item.added", "sequence_number": 0, "output_index": 0, "item": None}) + ], + logging_obj=_logging_obj_stub(), + config=OpenAIResponsesAPIConfig(), + litellm_metadata={"encrypted_content_affinity_enabled": True, "model_info": {"id": "dep-1"}}, + ) + + added: Final = await iterator.__anext__() + + assert (added.type, added.output_index, added.item) == (ResponsesAPIStreamEvents.OUTPUT_ITEM_ADDED, 0, None) + + @pytest.mark.parametrize("trailing_error", _TRAILING_ERRORS, ids=type) def test_sync_transport_error_before_any_output_raises_fallback_error(trailing_error): logging_obj: Final = _failure_tracking_logging_obj() diff --git a/tests/unit/router_strategy/complexity_router/test_context_compaction.py b/tests/unit/router_strategy/complexity_router/test_context_compaction.py index 850accf574b..3fed862ae50 100644 --- a/tests/unit/router_strategy/complexity_router/test_context_compaction.py +++ b/tests/unit/router_strategy/complexity_router/test_context_compaction.py @@ -503,3 +503,19 @@ async def test_retry_reuses_summary_or_terminal_cancellation(outcome: Literal["s assert calls.qsize() == 1 and stopped.is_set() finally: compaction_executor.reset(token) + + +@pytest.fixture(autouse=True) +def _python_messages(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.rust_bridge import catalog + from litellm.rust_bridge.configuration import Rollout + + monkeypatch.setattr( + catalog, + "RULES", + tuple( + rule + for rule in catalog.RULES + if not (rule.route is catalog.Route.MESSAGES and rule.rollout is Rollout.RUST_REQUIRED) + ), + ) diff --git a/tests/unit/router_strategy/test_complexity_router.py b/tests/unit/router_strategy/test_complexity_router.py index 054c48bbb5e..0190a7e929d 100644 --- a/tests/unit/router_strategy/test_complexity_router.py +++ b/tests/unit/router_strategy/test_complexity_router.py @@ -15783,6 +15783,21 @@ class TestModalityRouting: @pytest.mark.usefixtures("local_model_cost_map") class TestHealthFallbackDispatch: + @pytest.fixture(autouse=True) + def _python_messages(self, monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.rust_bridge import catalog + from litellm.rust_bridge.configuration import Rollout + + monkeypatch.setattr( + catalog, + "RULES", + tuple( + rule + for rule in catalog.RULES + if not (rule.route is catalog.Route.MESSAGES and rule.rollout is Rollout.RUST_REQUIRED) + ), + ) + @pytest.mark.asyncio @pytest.mark.parametrize("classifier", ("capability", "llm_v2")) @pytest.mark.parametrize("calibrated", (False, True), ids=("raw", "calibrated")) diff --git a/tests/unit/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py b/tests/unit/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py index e908481ca2b..ae5acffab31 100644 --- a/tests/unit/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py +++ b/tests/unit/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py @@ -3,7 +3,7 @@ Tests for encrypted_content_affinity pre-call check. The mechanism works without any cache and supports two encoding strategies: -1. **Items with IDs**: item IDs for output items with `encrypted_content` are rewritten to +1. **Items with IDs**: IDs of reasoning, compaction and other `encrypted_content` output items are rewritten to `encitem_{base64("litellm:model_id:{model_id};item_id:{original_id}")}`. 2. **Items without IDs** (Codex): encrypted_content itself is wrapped with model_id metadata: @@ -18,10 +18,12 @@ The mechanism works without any cache and supports two encoding strategies: import datetime import time from collections.abc import Mapping +from dataclasses import dataclass from typing import Final from unittest.mock import AsyncMock, patch import pytest +from pydantic import TypeAdapter import litellm from litellm.integrations.custom_secret_manager import CustomSecretManager @@ -132,6 +134,13 @@ class TestEncryptedItemIdCodec: assert decoded["item_id"] == original_item_id +@dataclass(frozen=True, slots=True) +class _ReadOnlyReasoningItem: + id: str + type: str + encrypted_content: str + + class TestUpdateEncryptedContentItemIds: def test_rewrites_encrypted_items_in_dict_response(self): model_id = "deployment-1" @@ -157,6 +166,52 @@ class TestUpdateEncryptedContentItemIds: result = ResponsesAPIRequestUtils._update_encrypted_content_item_ids_in_response(response, None) assert result["output"][0]["id"] == "rs_xyz" + @pytest.mark.parametrize( + "response", + [ + {"id": "resp_failed", "status": "failed", "error": {"code": "server_error", "message": "boom"}}, + { + "id": "resp_failed", + "status": "failed", + "error": {"code": "server_error", "message": "boom"}, + "output": None, + }, + ], + ids=["output-absent", "output-none"], + ) + def test_passes_a_response_without_output_through_unchanged(self, response: dict[str, object]): + expected: Final = {**response} + result: Final = ResponsesAPIRequestUtils._update_encrypted_content_item_ids_in_response( + response, "deployment-1" + ) + assert result == expected + + def test_leaves_read_only_output_items_as_returned(self): + result: Final = ResponsesAPIRequestUtils._update_encrypted_content_item_ids_in_response( + {"id": "resp_123", "output": [_ReadOnlyReasoningItem("rs_xyz", "reasoning", "secret")]}, "deployment-1" + ) + assert result["output"] == [_ReadOnlyReasoningItem("rs_xyz", "reasoning", "secret")] + + @pytest.mark.parametrize( + "item, encoded", + [ + ({"id": "rs_xyz", "type": "reasoning", "summary": []}, True), + ({"id": "cmp_xyz", "type": "compaction", "encrypted_content": "secret"}, True), + ({"id": "ws_xyz", "type": "web_search_call"}, False), + ({"id": ResponsesAPIRequestUtils._build_encrypted_item_id("dep-0", "rs_xyz"), "type": "reasoning"}, False), + ], + ids=["reasoning-before-ciphertext", "compaction", "non-reasoning", "already-encoded"], + ) + def test_encodes_reasoning_and_compaction_ids_by_type(self, item: dict[str, object], encoded: bool): + result: Final = ResponsesAPIRequestUtils._update_encrypted_content_item_ids_in_response( + {"id": "resp_123", "output": [dict(item)]}, "deployment-1" + ) + assert result["output"][0]["id"] == ( + ResponsesAPIRequestUtils._build_encrypted_item_id("deployment-1", str(item["id"])) + if encoded + else item["id"] + ) + class TestEncryptedContentWrapping: def test_wrap_and_unwrap_encrypted_content(self): @@ -219,10 +274,10 @@ class TestRestoreEncryptedContentItemIds: request_input = [ {"type": "message", "id": "msg_abc123", "role": "assistant"}, {"type": "reasoning", "id": encoded_id, "encrypted_content": "secret"}, + {"type": "item_reference", "id": encoded_id}, ] restored = ResponsesAPIRequestUtils.restore_encrypted_content_item_ids_in_input(request_input) - assert restored[0]["id"] == "msg_abc123" - assert restored[1]["id"] == original_id + assert [item["id"] for item in restored] == ["msg_abc123", original_id, original_id] def test_unwraps_encrypted_content(self): """Test that wrapped encrypted_content is unwrapped before forwarding.""" @@ -715,6 +770,32 @@ async def test_encrypted_content_affinity_does_not_create_litellm_metadata_for_c assert len(result) == 1 +@pytest.mark.asyncio +async def test_item_reference_to_a_reasoning_item_returned_without_ciphertext_pins_its_deployment(): + returned: Final = ResponsesAPIRequestUtils.update_responses_api_response_id_with_model_id( + {"id": "resp_stored", "output": [{"type": "reasoning", "id": "rs_stored", "summary": []}]}, + "openai", + {"model_info": {"id": "dep-2"}, "encrypted_content_affinity_enabled": True}, + ) + returned_output: Final = TypeAdapter(list[dict[str, object]]).validate_python(returned["output"]) + deployments: Final = [ + {"model_info": {"id": "dep-1"}, "litellm_params": {"model": "openai/gpt-5.1-codex"}}, + {"model_info": {"id": "dep-2"}, "litellm_params": {"model": "openai/gpt-5.1-codex"}}, + ] + + pinned: Final = await EncryptedContentAffinityCheck().async_filter_deployments( + model="gpt-5.1-codex", + healthy_deployments=deployments, + messages=None, + request_kwargs={ + "input": [{"type": "item_reference", "id": returned_output[0]["id"]}], + "litellm_metadata": {}, + }, + ) + + assert pinned == [deployments[1]] + + @pytest.mark.asyncio async def test_encrypted_content_affinity_preserves_litellm_metadata_for_responses(): """ diff --git a/tests/unit/router_utils/test_fallback_event_handlers.py b/tests/unit/router_utils/test_fallback_event_handlers.py index 47d58a3b869..1bfe88275c2 100644 --- a/tests/unit/router_utils/test_fallback_event_handlers.py +++ b/tests/unit/router_utils/test_fallback_event_handlers.py @@ -2630,3 +2630,19 @@ async def test_run_async_fallback_never_re_reserves_the_requested_model_group() with pytest.raises(Exception, match="model group 'primary' failed"): await router.acompletion(model="primary", messages=[{"role": "user", "content": "hi"}]) assert checked == ["fallback"] + + +@pytest.fixture(autouse=True) +def _python_messages(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.rust_bridge import catalog + from litellm.rust_bridge.configuration import Rollout + + monkeypatch.setattr( + catalog, + "RULES", + tuple( + rule + for rule in catalog.RULES + if not (rule.route is catalog.Route.MESSAGES and rule.rollout is Rollout.RUST_REQUIRED) + ), + ) diff --git a/tests/unit/rust_bridge/host/routes/test_messages.py b/tests/unit/rust_bridge/host/routes/test_messages.py index aa7dcc74841..ed60951002d 100644 --- a/tests/unit/rust_bridge/host/routes/test_messages.py +++ b/tests/unit/rust_bridge/host/routes/test_messages.py @@ -1,10 +1,29 @@ +import datetime +import functools +import json +from collections.abc import Iterator, Mapping, Sequence from types import MappingProxyType from typing import Final +import httpx import pytest +from pydantic import ValidationError import litellm +from litellm.caching.llm_caching_handler import LLMClientCache from litellm.constants import DEFAULT_REQUEST_TIMEOUT_SECONDS +from litellm.integrations.custom_logger import CustomLogger +from litellm.litellm_core_utils.litellm_logging import Logging +from litellm.litellm_core_utils.model_latest_aliases import get_model_latest_aliases +from litellm.llms.anthropic.messages.native import interceptors, mcp_handler +from litellm.llms.anthropic.messages.native.interceptors.base import MessagesInterceptor +from litellm.llms.custom_httpx.http_handler import ( + AsyncHTTPHandler, + HTTPHandler, + exclude_rsa_key_exchange_and_chacha20, + get_async_httpx_client, # pyright: ignore[reportUnknownVariableType] # its params dict is untyped +) +from litellm.rust_bridge.host import callbacks_legacy_python from litellm.rust_bridge.host.routes import messages as messages_host from litellm.rust_bridge.host.routes.messages import response @@ -30,11 +49,26 @@ def test_response_is_a_detached_public_messages_dict() -> None: assert "_hidden_params" not in native +@pytest.mark.parametrize( + ("disabled", "joined"), + [pytest.param("true", False, id="httpx_transport"), pytest.param("false", True, id="aiohttp_transport")], +) +def test_settings_join_buffered_stream_reads_only_on_the_aiohttp_transport( + monkeypatch: pytest.MonkeyPatch, disabled: str, joined: bool +) -> None: + monkeypatch.setattr(litellm, "disable_aiohttp_transport", False) + monkeypatch.setenv("DISABLE_AIOHTTP_TRANSPORT", disabled) + + assert messages_host.settings({})["joined_reads"] is joined + + def test_settings_project_caller_configuration_without_resolving_a_model(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(litellm, "drop_params", False) monkeypatch.setattr(litellm, "reasoning_auto_summary", True) monkeypatch.setattr(litellm, "request_timeout", 1800) monkeypatch.setattr(litellm, "request_timeout_explicitly_set", True) + monkeypatch.setattr(litellm, "disable_aiohttp_transport", False) + monkeypatch.delenv("DISABLE_AIOHTTP_TRANSPORT", raising=False) projected: Final = messages_host.settings({"drop_params": "true", "additional_drop_params": ["metadata.user_id"]}) @@ -43,9 +77,44 @@ def test_settings_project_caller_configuration_without_resolving_a_model(monkeyp "reasoning_auto_summary": True, "additional_drop_params": ("metadata.user_id",), "request_timeout": 1800.0, + "drops_unsupported_params": True, + "model": None, + "mock_response": None, + "stream_cost_model": None, + "extra_headers": None, + "mcp_gateway": False, + "ascii_response_headers": True, + "joined_reads": True, + "ascii_request_headers": True, } +@pytest.mark.parametrize( + ("global_drop_params", "kwargs", "drop_params", "drops_unsupported_params"), + [ + pytest.param(True, {}, True, True, id="global-true"), + pytest.param(1, {}, True, False, id="global-truthy-non-bool"), + pytest.param(False, {"drop_params": "True"}, True, True, id="kwarg-flag-string"), + pytest.param(False, {"drop_params": 1}, True, True, id="kwarg-one"), + pytest.param(False, {"drop_params": "maybe"}, False, False, id="kwarg-not-a-flag"), + pytest.param(False, {}, False, False, id="unset"), + ], +) +def test_strict_tools_retry_reads_drop_params_as_the_python_retry_check_does( + monkeypatch: pytest.MonkeyPatch, + global_drop_params: object, + kwargs: Mapping[str, object], + drop_params: bool, + drops_unsupported_params: bool, +) -> None: + monkeypatch.setattr(litellm, "drop_params", global_drop_params) + + projected: Final = messages_host.settings(kwargs) + + assert projected["drop_params"] is drop_params + assert projected["drops_unsupported_params"] is drops_unsupported_params + + @pytest.mark.parametrize( ("timeout", "explicitly_set", "expected"), [ @@ -170,7 +239,7 @@ def test_body_params_round_effort_to_the_levels_the_deployment_declares( "model_info": {"id": "deployment-1", "reasoning_effort_levels": levels}, } - assert messages_host.body_params(request)["output_config"] == {"effort": expected} + assert messages_host.body_params(request, asynchronous=True)["output_config"] == {"effort": expected} def test_body_params_keep_the_requested_effort_without_deployment_levels() -> None: @@ -181,7 +250,7 @@ def test_body_params_keep_the_requested_effort_without_deployment_levels() -> No "output_config": {"effort": "max"}, } - assert messages_host.body_params(request)["output_config"] == {"effort": "max"} + assert messages_host.body_params(request, asynchronous=True)["output_config"] == {"effort": "max"} @pytest.mark.parametrize( @@ -203,7 +272,28 @@ def test_body_params_derive_no_effort_from_a_param_the_deployment_lists( "model_info": {"id": "deployment-1", "reasoning_effort_levels": ["low", "medium", "high"]}, } - assert set(messages_host.body_params(request)).difference({"messages", "model"}) == expected_keys + assert set(messages_host.body_params(request, asynchronous=True)).difference({"messages", "model"}) == expected_keys + + +@pytest.mark.parametrize( + ("thread", "expected"), + [ + ({"type": "create"}, {"type": "create"}), + ({"type": "continue", "previous_message_id": "msg_1"}, {"type": "continue", "previous_message_id": "msg_1"}), + (None, None), + ], +) +def test_body_params_forward_the_thread_like_the_python_handler( + thread: dict[str, str] | None, expected: dict[str, str] | None +) -> None: + request: Final[dict[str, object]] = { + "model": "claude-sonnet-4-5", + "messages": [], + "max_tokens": 8, + "thread": thread, + } + + assert messages_host.body_params(request, asynchronous=True).get("thread") == expected def _marked(phase: str | None = None, *args: object) -> ValueError: @@ -213,13 +303,40 @@ def _marked(phase: str | None = None, *args: object) -> ValueError: return error -def test_a_stalled_stream_body_reaches_the_caller_as_the_transport_timeout() -> None: +@pytest.mark.parametrize( + ("disabled", "text"), ((None, "Timeout on reading data from socket"), ("true", "")), ids=("aiohttp", "httpx") +) +def test_a_stalled_stream_body_reaches_the_caller_as_the_transport_timeout( + monkeypatch: pytest.MonkeyPatch, disabled: str | None, text: str +) -> None: import httpx + monkeypatch.setattr(litellm, "disable_aiohttp_transport", False) + if disabled is None: + monkeypatch.delenv("DISABLE_AIOHTTP_TRANSPORT", raising=False) + else: + monkeypatch.setenv("DISABLE_AIOHTTP_TRANSPORT", disabled) + mapped: Final = messages_host.map_failure(_marked("Body"), {"model": _ADAPTIVE_OPUS}, "anthropic") assert isinstance(mapped, httpx.ReadTimeout) - assert str(mapped) == "Timeout on reading data from socket" + assert str(mapped) == text + + +@pytest.mark.parametrize( + ("value", "received", "text"), + ( + ("h\ud800".encode("utf-8", "surrogatepass"), False, "can't encode character '\\ud800' in position 1"), + ("caf\u00e9".encode(), True, "can't encode character '\\xe9' in position 3"), + (b"caf\xe9", True, "can't encode character '\\udce9' in position 3"), + ), + ids=("sent-surrogate", "received-utf-8", "received-latin-1"), +) +def test_an_unencodable_header_is_the_error_pythons_ascii_codec_raises(value: bytes, received: bool, text: str) -> None: + error: Final = messages_host.unencodable_header(value, received) + + assert isinstance(error, UnicodeEncodeError) + assert text in str(error) def test_a_native_read_timeout_maps_to_the_public_timeout_with_python_text() -> None: @@ -365,12 +482,47 @@ def test_a_stream_body_cut_reaches_the_caller_as_the_transport_raised_it( native: Final = RuntimeError("upstream network error") native.messages_body_cut = cut # pyright: ignore[reportAttributeAccessIssue] # marker the native host sets - mapped: Final = messages_host.map_failure(native, {"model": _ADAPTIVE_OPUS}, "anthropic") + mapped: Final = messages_host.map_failure(native, {"model": _ADAPTIVE_OPUS, "stream": True}, "anthropic") assert type(mapped) is getattr(httpx, error_class) assert str(mapped) == text +@pytest.mark.parametrize( + ("aiohttp", "cut", "text"), + ( + ( + True, + (19, 100, False), + "Response payload is not completed: ", + ), + ( + False, + (19, 100, False), + "peer closed connection without sending complete message body (received 19 bytes, expected 100)", + ), + ), +) +def test_a_complete_body_cut_is_a_synthesized_server_error( + monkeypatch: pytest.MonkeyPatch, + aiohttp: bool, + cut: tuple[int, int | None, bool], + text: str, +) -> None: + from litellm.rust_bridge.host import http_transport + + monkeypatch.setattr(http_transport, "uses_aiohttp_transport", lambda: aiohttp) + native: Final = RuntimeError("upstream network error") + native.messages_body_cut = cut # pyright: ignore[reportAttributeAccessIssue] # marker the native host sets + + mapped: Final = messages_host.map_failure(native, {"model": _ADAPTIVE_OPUS}, "anthropic") + + assert type(mapped) is litellm.InternalServerError + assert mapped.status_code == 500 + assert text in str(mapped) + + _TRANSPORT: Final = "error sending request: client error" @@ -445,3 +597,1153 @@ def test_a_failure_before_any_response_maps_like_the_python_transport_error( f"litellm.InternalServerError: AnthropicException - {text}. Handle with `litellm.InternalServerError`." ) assert "This looks like a bug in LiteLLM" not in str(mapped) + + +_CALL: Final = MappingProxyType({"messages": [{"role": "user", "content": "hi"}], "max_tokens": 8}) +_OPENCODE: Final = "https://opencode.ai/inference/go/anthropic/v1" +_COST_HEADER: Final = MappingProxyType({"headers": {"x-litellm-include-cost-in-streaming-usage": "true"}}) + + +@pytest.mark.parametrize( + ("model", "custom_llm_provider", "expected"), + [ + ( + "anthropic/claude-opus-latest", + None, + f"anthropic/{get_model_latest_aliases()['anthropic']['claude-opus-latest']}", + ), + ("claude-opus-latest", "anthropic", get_model_latest_aliases()["anthropic"]["claude-opus-latest"]), + ("anthropic/claude-sonnet-4-5", None, "anthropic/claude-sonnet-4-5"), + ], +) +def test_settings_resolve_a_latest_alias_keeping_the_provider_prefix( + model: str, custom_llm_provider: str | None, expected: str +) -> None: + settings: Final = messages_host.settings({}, {**_CALL, "model": model, "custom_llm_provider": custom_llm_provider}) + + assert settings["model"] == expected + + +@pytest.mark.parametrize( + ("extra", "expected"), + [ + ({"api_base": _OPENCODE, "session_id": "s-1"}, {"x-opencode-session": "s-1"}), + ( + {"api_base": _OPENCODE, "session_id": "s-1", "headers": {"x-trace": "t"}}, + {"x-trace": "t", "x-opencode-session": "s-1"}, + ), + ({"api_base": _OPENCODE, "session_id": "s-1", "extra_headers": {"x-opencode-session": "mine"}}, None), + ({"api_base": "https://other.example/v1", "session_id": "s-1"}, None), + ({"api_base": _OPENCODE, "session_id": "s-1", "mock_response": "hi"}, None), + ], +) +def test_settings_add_only_the_affinity_header_the_caller_did_not_send( + extra: dict[str, object], expected: dict[str, str] | None +) -> None: + settings: Final = messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", **extra}) + + assert settings["extra_headers"] == expected + + +@pytest.mark.parametrize("variable", ["ANTHROPIC_API_BASE", "ANTHROPIC_BASE_URL"]) +def test_settings_add_the_affinity_header_for_an_anthropic_base_from_the_environment( + monkeypatch: pytest.MonkeyPatch, variable: str +) -> None: + monkeypatch.delenv("ANTHROPIC_API_BASE", raising=False) + monkeypatch.delenv("ANTHROPIC_BASE_URL", raising=False) + monkeypatch.setenv(variable, _OPENCODE) + + settings: Final = messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", "session_id": "s-1"}) + + assert settings["extra_headers"] == {"x-opencode-session": "s-1"} + + +@pytest.mark.parametrize( + ("extra", "expected"), + [ + ({"stream": True, "proxy_server_request": dict(_COST_HEADER)}, "claude-sonnet-4-5"), + ({"proxy_server_request": dict(_COST_HEADER)}, None), + ({"stream": True}, None), + ({"stream": True, "proxy_server_request": dict(_COST_HEADER), "mock_response": "hi"}, None), + ], +) +def test_settings_name_the_cost_model_only_for_an_opted_in_stream( + extra: dict[str, object], expected: str | None +) -> None: + settings: Final = messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", **extra}) + + assert settings["stream_cost_model"] == expected + + +def test_settings_carry_the_mock_the_python_handler_returns() -> None: + settings: Final = messages_host.settings( + {}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", "mock_response": "hi"} + ) + + assert isinstance(settings["mock_response"], dict) + assert settings["mock_response"]["content"] == [{"type": "text", "text": "hi"}] + + +def test_settings_infer_no_provider_off_an_affinity_host(monkeypatch: pytest.MonkeyPatch) -> None: + def unexpected(model: str, api_base: str | None) -> str | None: + pytest.fail("the provider is only inferred for an affinity api_base") + + monkeypatch.setattr(messages_host, "inferred_provider", unexpected) + + settings: Final = messages_host.settings({}, {**_CALL, "model": "claude-sonnet-4-5"}) + + assert settings["model"] == "claude-sonnet-4-5" + assert settings["extra_headers"] is None + + +def test_body_params_leave_the_messages_to_the_route_for_a_call_without_prompt_caching( + monkeypatch: pytest.MonkeyPatch, +) -> None: + monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", False) + + fields: Final = messages_host.body_params( + { + "model": "anthropic/claude-sonnet-4-5", + "messages": [{"role": "user", "content": "hi"}], + "system": "Be terse.", + "enable_prompt_caching": False, + "cache_control_injection_points": [], + }, + asynchronous=True, + ) + + assert fields == {"system": "Be terse."} + + +@pytest.mark.parametrize("asynchronous", [True, False]) +def test_body_params_mark_the_turns_tools_and_deployment_the_handler_marks( + monkeypatch: pytest.MonkeyPatch, asynchronous: bool +) -> None: + monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", False) + gateway: Final[dict[str, object]] = {} + caller_metadata: Final = {"user_id": "u"} + tool: Final = {"name": "get_weather", "input_schema": {"type": "object"}} + + fields: Final = messages_host.body_params( + { + "model": "anthropic/claude-sonnet-4-5", + "messages": [ + {"role": "user", "content": "hi"}, + {"role": "assistant", "content": [{"type": "text", "text": ""}]}, + {"role": "user", "content": "again"}, + ], + "system": "Be terse.", + "tools": [tool], + "metadata": caller_metadata, + "litellm_metadata": gateway, + "model_info": {"id": "deployment-1"}, + "cache_control_injection_points": [ + {"location": "message", "role": "system"}, + {"location": "message", "index": -1, "control": {"type": "ephemeral", "ttl": "1h"}}, + {"location": "tool_config"}, + ], + }, + asynchronous=asynchronous, + ) + + assert fields == { + "messages": [ + {"role": "user", "content": [{"type": "text", "text": "hi"}]}, + { + "role": "user", + "content": [{"type": "text", "text": "again", "cache_control": {"type": "ephemeral", "ttl": "1h"}}], + }, + ], + "system": [{"type": "text", "text": "Be terse.", "cache_control": {"type": "ephemeral"}}], + "tools": [{**tool, "cache_control": {"type": "ephemeral"}}], + "metadata": caller_metadata, + } + assert gateway == {"litellm_gateway_injected_cache": "deployment-1"} + assert caller_metadata == {"user_id": "u"} + + +@pytest.mark.parametrize( + ("asynchronous", "expected_system"), + [ + (True, [{"type": "text", "text": "Be terse.", "cache_control": {"type": "ephemeral"}}]), + (False, "Be terse."), + ], +) +def test_body_params_prepare_prompt_caching_as_the_entry_that_ran( + monkeypatch: pytest.MonkeyPatch, asynchronous: bool, expected_system: object +) -> None: + monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) + + fields: Final = messages_host.body_params( + { + "model": "anthropic/claude-sonnet-4-5", + "messages": [{"role": "user", "content": "hi"}], + "system": "Be terse.", + "cache_control_injection_points": [{"location": "message", "role": "assistant"}], + }, + asynchronous=asynchronous, + ) + + assert fields["system"] == expected_system + + +@pytest.mark.parametrize( + ("modify_params", "args", "kwargs", "expected"), + [ + pytest.param(True, (), {"max_tokens": 200_000}, 64_000, id="clamped-to-model-output-limit"), + pytest.param(True, (), {"max_tokens": 1}, 1, id="under-the-limit"), + pytest.param(False, (), {"max_tokens": 200_000}, 200_000, id="modify-params-off"), + pytest.param("true", (), {"max_tokens": 200_000}, 200_000, id="truthy-but-not-true"), + pytest.param(True, (200_000,), {"max_tokens": 200_000}, 200_000, id="positional-model-is-not-a-model"), + ], +) +def test_modify_max_tokens_clamps_the_keyword_view_as_the_client_wrapper_does( + monkeypatch: pytest.MonkeyPatch, + modify_params: object, + args: tuple[object, ...], + kwargs: dict[str, object], + expected: int, +) -> None: + monkeypatch.setattr(litellm, "modify_params", modify_params) + model: Final = args[0] if args else "anthropic/claude-sonnet-4-5" + view: Final = {**kwargs, "messages": [{"role": "user", "content": "hi"}]} + + messages_host.modify_max_tokens(model, args, view) + + assert view["max_tokens"] == expected + + +def test_workload_identity_token_mints_with_the_params_python_validates(monkeypatch: pytest.MonkeyPatch) -> None: + minted: Final[list[tuple[dict[str, object], str | None, str]]] = [] + + def mint(litellm_params: dict[str, object], api_base: str | None, model: str) -> str: + federation = {name: value for name, value in litellm_params.items() if name.startswith("anthropic_")} + minted.append(({name: value for name, value in federation.items() if value is not None}, api_base, model)) + return "sk-ant-oat01-minted" + + monkeypatch.setattr(messages_host, "get_anthropic_wif_token", mint) + + token: Final = messages_host.workload_identity_token( + {"anthropic_federation_rule_id": "fdrl_1", "anthropic_issuer_ttl_seconds": "60"}, + "https://gateway.test", + ) + + assert (token, minted) == ( + "sk-ant-oat01-minted", + [({"anthropic_federation_rule_id": "fdrl_1", "anthropic_issuer_ttl_seconds": 60}, "https://gateway.test", "")], + ) + + +def test_workload_identity_token_is_none_without_a_federation_rule(monkeypatch: pytest.MonkeyPatch) -> None: + for name in ("ANTHROPIC_FEDERATION_RULE_ID", "ANTHROPIC_ORGANIZATION_ID", "ANTHROPIC_IDENTITY_TOKEN"): + monkeypatch.delenv(name, raising=False) + + assert messages_host.workload_identity_token({}, None) is None + + +def test_workload_identity_fields_are_the_federation_litellm_params() -> None: + assert set(messages_host.WORKLOAD_IDENTITY_FIELDS) >= { + "anthropic_federation_rule_id", + "anthropic_organization_id", + "anthropic_disable_workload_identity_federation", + } + + +class _Handler(AsyncHTTPHandler): + def __init__(self, answer: httpx.Response | Exception) -> None: + super().__init__() # pyright: ignore[reportUnknownMemberType] # the handler's untyped concurrent_limit + self.answer: Final = answer + self.posted: list[Mapping[str, object]] = [] + + async def post(self, url: str, **kwargs: object) -> httpx.Response: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: records the post's keywords + self.posted.append({"url": url, **kwargs}) + if isinstance(self.answer, Exception): + raise self.answer + return self.answer + + +_URL: Final = "https://api.anthropic.com/v1/messages" +_REQUEST: Final = httpx.Request("POST", _URL) + + +@pytest.fixture +def no_tls_settings(monkeypatch: pytest.MonkeyPatch) -> None: + for name in ("SSL_SECURITY_LEVEL", "SSL_ECDH_CURVE"): + monkeypatch.delenv(name, raising=False) + monkeypatch.setattr(litellm, "ssl_security_level", None) + monkeypatch.setattr(litellm, "ssl_ecdh_curve", None) + + +@pytest.mark.usefixtures("no_tls_settings") +@pytest.mark.parametrize( + "client", (None, object(), httpx.AsyncClient(), HTTPHandler()), ids=("none", "object", "httpx", "sync-handler") +) +def test_the_native_client_stands_in_for_any_client_python_ignores(client: object) -> None: + assert messages_host.transport_handler({"client": client}) is None + + +@pytest.mark.usefixtures("no_tls_settings") +def test_a_caller_async_handler_is_the_handler_python_posts_through() -> None: + client: Final = AsyncHTTPHandler() + + assert messages_host.transport_handler({"client": client}) is client + + +@pytest.mark.usefixtures("no_tls_settings") +@pytest.mark.parametrize( + "setting", ({"ssl_security_level": "DEFAULT@SECLEVEL=1"}, {"ssl_ecdh_curve": "secp521r1"}), ids=("level", "curve") +) +def test_tls_the_native_client_cannot_apply_posts_through_pythons_anthropic_handler( + monkeypatch: pytest.MonkeyPatch, setting: Mapping[str, str] +) -> None: + for name, value in setting.items(): + monkeypatch.setattr(litellm, name, value) + monkeypatch.setattr(litellm, "in_memory_llm_clients_cache", LLMClientCache()) + + handler: Final = messages_host.transport_handler({"client": object()}) + + assert handler is get_async_httpx_client(llm_provider=litellm.LlmProviders.ANTHROPIC) + assert callbacks_legacy_python.times_provider_exchange(object(), None) is False + + +@pytest.fixture +def fips_cipher_exclusion() -> Iterator[None]: + exclude_rsa_key_exchange_and_chacha20(True) + yield + exclude_rsa_key_exchange_and_chacha20(False) + + +@pytest.mark.usefixtures("no_tls_settings", "fips_cipher_exclusion") +def test_fips_cipher_exclusion_posts_through_pythons_anthropic_handler(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "in_memory_llm_clients_cache", LLMClientCache()) + + handler: Final = messages_host.transport_handler({"client": None}) + + assert handler is get_async_httpx_client(llm_provider=litellm.LlmProviders.ANTHROPIC) + assert callbacks_legacy_python.times_provider_exchange(None, None) is False + + +@pytest.mark.usefixtures("no_tls_settings") +def test_only_a_native_post_is_timed_by_the_native_call() -> None: + assert callbacks_legacy_python.times_provider_exchange(None, None) is True + assert callbacks_legacy_python.times_provider_exchange(None, 30.0) is True + assert callbacks_legacy_python.times_provider_exchange(AsyncHTTPHandler(), None) is False + + +@pytest.mark.usefixtures("no_tls_settings") +@pytest.mark.parametrize( + "timeout", + (-1.0, 0, -0.5, httpx.Timeout(10.0, connect=0)), + ids=("negative", "zero", "fraction", "httpx-zero-connect"), +) +def test_a_non_positive_timeout_posts_through_pythons_anthropic_handler( + monkeypatch: pytest.MonkeyPatch, timeout: object +) -> None: + monkeypatch.setattr(litellm, "in_memory_llm_clients_cache", LLMClientCache()) + + handler: Final = messages_host.transport_handler({"client": None, "timeout": timeout}) + + assert handler is get_async_httpx_client(llm_provider=litellm.LlmProviders.ANTHROPIC) + assert callbacks_legacy_python.times_provider_exchange(None, timeout) is False + + +@pytest.mark.usefixtures("no_tls_settings") +@pytest.mark.parametrize("timeout", (None, 0.5, httpx.Timeout(10.0)), ids=("unset", "positive", "httpx")) +def test_a_positive_timeout_keeps_the_native_client(timeout: object) -> None: + assert messages_host.transport_handler({"client": None, "timeout": timeout}) is None + + +@pytest.mark.asyncio +async def test_transport_send_posts_what_the_python_handler_posts() -> None: + logger: Final = object() + timeout: Final = httpx.Timeout(30.0, connect=2.0) + handler: Final = _Handler( + httpx.Response(200, json={"id": "msg_1"}, headers={"request-id": "req_1"}, request=_REQUEST) + ) + + sent: Final = await messages_host.transport_send( + handler, + {"litellm_logging_obj": logger, "timeout": timeout}, + _URL, + [("x-api-key", "sk-ant"), ("anthropic-version", "2023-06-01")], + {"model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "héllo"}]}, + False, + ) + + assert handler.posted == [ + { + "url": _URL, + "headers": {"x-api-key": "sk-ant", "anthropic-version": "2023-06-01"}, + "data": json.dumps({"model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "héllo"}]}), + "stream": False, + "logging_obj": logger, + "timeout": timeout, + } + ] + assert (sent.status, sent.text, sent.chunks, sent.rejection) == (200, '{"id":"msg_1"}', None, None) + assert ("request-id", "req_1") in sent.headers + + +@pytest.mark.asyncio +async def test_transport_send_hands_signed_bytes_on_unchanged() -> None: + handler: Final = _Handler(httpx.Response(200, json={}, request=_REQUEST)) + + await messages_host.transport_send(handler, {}, _URL, [], b'{"signed":true}', False) + + assert handler.posted[0]["data"] == b'{"signed":true}' + assert handler.posted[0]["timeout"] is None + + +@pytest.mark.asyncio +async def test_transport_send_leaves_a_stream_for_the_route_to_read() -> None: + handler: Final = _Handler( + httpx.Response(200, stream=httpx.ByteStream(b"event: message_stop\n\n"), request=_REQUEST) + ) + + sent: Final = await messages_host.transport_send(handler, {}, _URL, [], {}, True) + + assert sent.chunks is not None + assert sent.text is None + assert [chunk async for chunk in sent.chunks] == [b"event: message_stop\n\n"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("checked", (True, False), ids=("handler-raised", "status-checked")) +async def test_transport_send_reports_a_rejection_with_the_status_error(checked: bool) -> None: + rejected: Final = httpx.Response(429, text="slow down", headers={"retry-after": "7"}, request=_REQUEST) + error: Final = httpx.HTTPStatusError("rate limited", request=_REQUEST, response=rejected) + handler: Final = _Handler(error if checked else rejected) + + sent: Final = await messages_host.transport_send(handler, {}, _URL, [], {}, False) + + assert (sent.status, sent.text) == (429, "slow down") + assert ("retry-after", "7") in sent.headers + assert isinstance(sent.rejection, httpx.HTTPStatusError) + assert sent.rejection.response is rejected + + +@pytest.mark.asyncio +async def test_a_rejection_python_cannot_read_reaches_the_caller_as_raised() -> None: + unread: Final = httpx.Response(500, stream=httpx.ByteStream(b"unread"), request=_REQUEST) + + with pytest.raises(messages_host.RawTransportFailure) as raised: + await messages_host.transport_send(_Handler(unread), {}, _URL, [], {}, True) + + assert isinstance(raised.value.error, httpx.ResponseNotRead) + assert isinstance(raised.value.error.__context__, httpx.HTTPStatusError) + + +@pytest.mark.asyncio +async def test_a_handler_failure_is_raised_for_the_route_to_map() -> None: + failure: Final = httpx.ConnectError("refused") + + with pytest.raises(httpx.ConnectError) as raised: + await messages_host.transport_send(_Handler(failure), {}, _URL, [], {}, False) + + assert raised.value is failure + + +@pytest.mark.parametrize( + ("error", "expected", "status"), + ( + pytest.param( + litellm.Timeout( + message="Read timed out.", model="default-model-name", llm_provider="litellm-httpx-handler" + ), + litellm.Timeout, + 408, + id="timeout", + ), + pytest.param( + httpx.ConnectError("All connection attempts failed"), litellm.InternalServerError, 500, id="connect" + ), + pytest.param( + httpx.HTTPStatusError( + "unavailable", + request=_REQUEST, + response=httpx.Response(503, text="Unavailable", request=_REQUEST), + ), + litellm.ServiceUnavailableError, + 503, + id="status", + ), + ), +) +def test_a_handler_failure_maps_as_the_python_handler_maps_it( + error: Exception, expected: type[Exception], status: int +) -> None: + mapped: Final = messages_host.map_transport_failure( + error, {"model": "anthropic/claude-sonnet-4-5", "api_base": None}, "anthropic" + ) + + assert isinstance(mapped, expected) + assert getattr(mapped, "status_code", None) == status + assert mapped.__context__ is not None + assert mapped.__context__.__context__ is error + + +class _Hook(CustomLogger): + rewrite: Mapping[str, object] = MappingProxyType({}) + seen: tuple[tuple[str, list[dict[str, object]], dict[str, object]], ...] = () + + async def async_pre_request_hook( + self, model: str, messages: list[dict[str, object]], kwargs: dict[str, object] + ) -> dict[str, object] | None: + self.seen = (*self.seen, (model, list(messages), dict(kwargs))) + return {**kwargs, **self.rewrite} + + +def _hook(rewrite: Mapping[str, object]) -> _Hook: + hook: Final = _Hook() + hook.rewrite = rewrite + return hook + + +def _hook_request(**overrides: object) -> dict[str, object]: + return { + "max_tokens": 64, + "messages": [{"role": "user", "content": [{"type": "text", "text": ""}, {"type": "text", "text": "hi"}]}], + "model": "anthropic/claude-sonnet-4-5", + "metadata": None, + "stop_sequences": None, + "stream": False, + "system": None, + "temperature": None, + "thinking": None, + "tool_choice": None, + "tools": None, + "top_k": None, + "top_p": None, + "api_key": "sk-test", + "api_base": None, + "client": None, + "custom_llm_provider": None, + "litellm_call_id": "call-1", + **overrides, + } + + +def _instance_hook() -> CustomLogger: + logger: Final = CustomLogger() + logger.async_pre_request_hook = _hook({}).async_pre_request_hook # pyright: ignore[reportAttributeAccessIssue] # rebind-ok: an instance-level override + return logger + + +@pytest.mark.parametrize( + ("callbacks", "expected"), + [ + pytest.param([_hook({})], True, id="override"), + pytest.param([CustomLogger()], False, id="base-logger"), + pytest.param([_instance_hook()], True, id="instance-override"), + pytest.param(["not-a-logger"], False, id="not-a-logger"), + ], +) +def test_runs_pre_request_hooks_needs_a_global_override( + monkeypatch: pytest.MonkeyPatch, callbacks: list[object], expected: bool +) -> None: + monkeypatch.setattr(litellm, "callbacks", callbacks) + + assert messages_host.runs_pre_request_hooks() is expected + + +@pytest.mark.asyncio +async def test_pre_request_hooks_hand_the_handler_what_the_python_entry_hands_it( + monkeypatch: pytest.MonkeyPatch, +) -> None: + hook: Final = _hook({"temperature": 0.2, "tools": [{"name": "t"}], "extra_headers": {"x-hooked": "1"}}) + monkeypatch.setattr(litellm, "callbacks", [hook]) + + hooked: Final = await messages_host.pre_request_hooks(_hook_request(temperature=0.9)) + + assert hook.seen == ( + ( + "anthropic/claude-sonnet-4-5", + [{"role": "user", "content": [{"type": "text", "text": "hi"}]}], + { + "tools": None, + "stream": False, + "litellm_params": {"custom_llm_provider": "anthropic"}, + "tool_choice": None, + "litellm_call_id": "call-1", + }, + ), + ) + assert hooked["temperature"] == 0.2 + assert hooked["tools"] == [{"name": "t"}] + assert hooked["extra_headers"] == {"x-hooked": "1"} + assert hooked["messages"] == [{"role": "user", "content": [{"type": "text", "text": "hi"}]}] + assert hooked["custom_llm_provider"] is None + assert "litellm_params" not in hooked + + +@pytest.mark.asyncio +@pytest.mark.parametrize("name", ["model", "max_tokens", "messages", "api_key", "api_base", "custom_llm_provider"]) +async def test_pre_request_hooks_naming_a_handler_argument_raise_the_python_type_error( + monkeypatch: pytest.MonkeyPatch, name: str +) -> None: + monkeypatch.setattr(litellm, "callbacks", [_hook({name: "hooked"})]) + + with pytest.raises(TypeError, match=f"functools.partial\\(\\) got multiple values for keyword argument '{name}'"): + await messages_host.pre_request_hooks(_hook_request()) + + +@pytest.mark.asyncio +async def test_pre_request_hooks_refuse_a_route_to_another_provider(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "callbacks", [_hook({"litellm_params": {"custom_llm_provider": "openai"}})]) + + with pytest.raises(litellm.UnsupportedParamsError, match="routing the call to openai") as refused: + await messages_host.pre_request_hooks(_hook_request()) + + assert refused.value.llm_provider == "anthropic" + + +@pytest.mark.asyncio +async def test_pre_request_hooks_keep_the_callers_provider_over_the_hook(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr(litellm, "callbacks", [_hook({"litellm_params": {"custom_llm_provider": "openai"}})]) + + hooked: Final = await messages_host.pre_request_hooks(_hook_request(custom_llm_provider="anthropic")) + + assert hooked["custom_llm_provider"] == "anthropic" + + +def test_body_params_hand_hooked_messages_on_as_already_sanitized() -> None: + hooked: Final = [{"role": "user", "content": [{"type": "text", "text": ""}]}] + + fields: Final = messages_host.body_params( + {"model": "anthropic/claude-sonnet-4-5", "messages": hooked}, asynchronous=True, hooked=True + ) + + assert fields == {"messages": hooked} + + +class _Agentic(CustomLogger): + async def async_should_run_agentic_loop(self, *args: object, **kwargs: object) -> tuple[bool, dict[str, object]]: # pyright: ignore[reportIncompatibleMethodOverride] # test double only needs the override + return False, {} + + +def _agentic_logger(callbacks: Sequence[CustomLogger]) -> Logging: + logger: Final = Logging( + model="anthropic/claude-sonnet-4-5", + messages=[], + stream=False, + call_type="anthropic_messages", + start_time=datetime.datetime.now(), + litellm_call_id="agentic", + function_id="agentic", + dynamic_success_callbacks=list(callbacks), + ) + return logger + + +@pytest.mark.parametrize( + ("callbacks", "dynamic", "request_extra", "expected"), + [ + pytest.param([], [], {}, False, id="no-hook"), + pytest.param([_Agentic()], [], {}, True, id="global-hook"), + pytest.param([], [_Agentic()], {}, True, id="call-hook"), + pytest.param([], [], {"_websearch_interception_converted_stream": True}, True, id="converted-stream"), + ], +) +def test_runs_agentic_hooks_gates_as_the_python_handler_does( + monkeypatch: pytest.MonkeyPatch, + callbacks: list[object], + dynamic: Sequence[CustomLogger], + request_extra: Mapping[str, object], + expected: bool, +) -> None: + monkeypatch.setattr(litellm, "callbacks", callbacks) + request: Final = {"model": "anthropic/claude-sonnet-4-5", "litellm_logging_obj": _agentic_logger(dynamic)} + + assert messages_host.runs_agentic_hooks({**request, **request_extra}) is expected + assert messages_host.runs_agentic_hooks({"model": "anthropic/claude-sonnet-4-5"}) is False + + +def test_record_agentic_loop_names_the_requested_model_for_follow_up_calls() -> None: + logger: Final = _agentic_logger([]) + messages_host.record_agentic_loop( + { + "model": "anthropic/claude-sonnet-4-5", + "litellm_logging_obj": logger, + "_websearch_interception_converted_stream": True, + }, + "anthropic", + ) + + details: Final = logger.model_call_details + assert details["agentic_loop_params"] == { + "model": "anthropic/claude-sonnet-4-5", + "custom_llm_provider": "anthropic", + } + assert details["websearch_interception_converted_stream"] is True + + +def test_agentic_stream_tags_the_head_only_when_a_hook_runs(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.rust_bridge.messages.entrypoints import MessagesStreamHead + + request: Final = { + "model": "anthropic/claude-sonnet-4-5", + "messages": [ + {"role": "user", "content": [{"type": "text", "text": "hi", "provider_specific_fields": {"x": 1}}]} + ], + "tools": [{"name": "get_weather", "input_schema": {"type": "object"}}], + "api_key": "sk-test", + "litellm_call_id": "agentic", + "litellm_logging_obj": _agentic_logger([]), + } + sent: Final = { + "model": "claude-sonnet-4-5", + "messages": [{"role": "user", "content": "hi"}], + "max_tokens": 16, + "stream": True, + "tools": [{"name": "get_weather", "input_schema": {"type": "object"}}], + } + requested: Final = {"max_tokens": 16, "stream": True, "tools": request["tools"]} + head: Final = MessagesStreamHead() + + monkeypatch.setattr(litellm, "callbacks", []) + messages_host.agentic_stream(head, request, sent, "claude-sonnet-4-5", "anthropic", requested, hooked=False) + assert head.agentic is None + + monkeypatch.setattr(litellm, "callbacks", [_Agentic()]) + messages_host.agentic_stream(head, request, sent, "claude-sonnet-4-5", "anthropic", requested, hooked=False) + agentic: Final = head.agentic + assert isinstance(agentic, functools.partial) + bound: Final[Mapping[str, object]] = agentic.keywords + call: Final = bound["call"] + assert isinstance(call, messages_host._AgenticCall) # pyright: ignore[reportPrivateUsage] # the partial binds the handler call + assert call.messages == [{"role": "user", "content": [{"type": "text", "text": "hi"}]}] + assert call.params == {"stream": True, "tools": request["tools"]} + assert call.params["tools"] is request["tools"] + assert call.kwargs["api_key"] == "sk-test" + assert "tools" not in call.kwargs + + +_DANGEROUS_TOOL_USE: Final = [{"type": "dangerous_tool_use"}] +_CLASSIFIER_SETTINGS: Final = {"safeguards_classifier_model": "openai/classifier"} +_NO_TOOL_USES: Final[dict[str, object]] = {} +_AVAILABLE: Final = ({"type": "dangerous_tool_use", "status": {"type": "available", "tool_uses": _NO_TOOL_USES}},) + + +@pytest.mark.parametrize( + ("request_fields", "general_settings", "classifies"), + ( + pytest.param( + {"model": "anthropic/parity-tool-model", "safeguards": _DANGEROUS_TOOL_USE}, + _CLASSIFIER_SETTINGS, + True, + id="non-claude", + ), + pytest.param( + {"model": "anthropic/claude-sonnet-4-5", "safeguards": _DANGEROUS_TOOL_USE}, + _CLASSIFIER_SETTINGS, + False, + id="claude", + ), + pytest.param( + {"model": "anthropic/parity-tool-model", "safeguards": _DANGEROUS_TOOL_USE}, {}, False, id="unconfigured" + ), + pytest.param({"model": "anthropic/parity-tool-model"}, _CLASSIFIER_SETTINGS, False, id="not-requested"), + pytest.param( + {"model": "anthropic/parity-tool-model", "safeguards": [{"type": "other"}]}, + _CLASSIFIER_SETTINGS, + False, + id="other-safeguard", + ), + ), +) +def test_safeguards_classify_only_what_the_proxy_answers( + monkeypatch: pytest.MonkeyPatch, + request_fields: Mapping[str, object], + general_settings: Mapping[str, object], + classifies: bool, +) -> None: + from litellm.proxy import proxy_server + + monkeypatch.setattr(proxy_server, "general_settings", general_settings) + + assert (messages_host.safeguards(request_fields) is not None) is classifies + + +@pytest.mark.asyncio +async def test_safeguards_frames_split_and_stamp_like_the_python_stream(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.llms.anthropic.messages.safeguards import SafeguardsEvaluator + from litellm.proxy import proxy_server + + monkeypatch.setattr(proxy_server, "general_settings", _CLASSIFIER_SETTINGS) + evaluated: Final[list[object]] = [] + + async def evaluate(_evaluator: SafeguardsEvaluator, tool_uses: object) -> object: + evaluated.append(tool_uses) + return _AVAILABLE + + monkeypatch.setattr(SafeguardsEvaluator, "evaluate", evaluate) + classifier: Final = messages_host.safeguards( + { + "model": "anthropic/parity-tool-model", + "safeguards": _DANGEROUS_TOOL_USE, + "messages": [{"role": "user", "content": "hi"}], + } + ) + assert classifier is not None + assert await classifier.open_stream() + + opened: Final = await classifier.frames( + b'event: ping\ndata: {"type": "ping"}\n\nevent: message_delta\ndata: {"type": ' + ) + closed: Final = await classifier.frames(b'"message_delta", "delta": {"stop_reason": "end_turn"}}\n\ntail') + flushed: Final = await classifier.flush() + + assert opened == (b'event: ping\ndata: {"type": "ping"}\n\n',) + assert closed == ( + b'event: message_delta\ndata: {"type": "message_delta", "delta": {"stop_reason": "end_turn", ' + b'"safeguard_results": [{"type": "dangerous_tool_use", "status": {"type": "available", "tool_uses": {}}}]}}\n\n', + ) + assert flushed == (b"tail",) + assert evaluated == [()] + + +@pytest.mark.asyncio +async def test_safeguards_publish_the_results_python_stamped(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.llms.anthropic.messages.safeguards import SafeguardsEvaluator + from litellm.proxy import proxy_server + + monkeypatch.setattr(proxy_server, "general_settings", _CLASSIFIER_SETTINGS) + stamped: Final = ({"type": "dangerous_tool_use", "status": {"type": "unsupported"}},) + + async def evaluate(_evaluator: SafeguardsEvaluator, tool_uses: object) -> object: + return stamped + + monkeypatch.setattr(SafeguardsEvaluator, "evaluate", evaluate) + request: Final = { + "model": "anthropic/parity-tool-model", + "safeguards": _DANGEROUS_TOOL_USE, + "messages": [{"role": "user", "content": "hi"}], + } + unanswered: Final = messages_host.safeguards(request) + answered: Final = messages_host.safeguards(request) + assert unanswered is not None and answered is not None + + assert await unanswered.results({"content": [], "safeguard_results": []}) is None + assert unanswered.published({"id": "msg"}) == {"id": "msg"} + assert await answered.results({"content": []}) is stamped + assert answered.published({"id": "msg", "safeguard_results": [stamped[0]]}) == { + "id": "msg", + "safeguard_results": stamped, + } + + +class _Claims(MessagesInterceptor): + def __init__(self, provider: str) -> None: + self.provider = provider + self.asked: list[tuple[object, str | None]] = [] + + def can_handle(self, tools: Sequence[Mapping[str, object]] | None, custom_llm_provider: str | None) -> bool: + self.asked.append((tools, custom_llm_provider)) + return custom_llm_provider == self.provider + + async def handle(self, **kwargs: object) -> object: # pyright: ignore[reportIncompatibleMethodOverride] # kwargs-ok: the interceptor contract's keyword call + return kwargs + + +_TOOLS: Final = [{"type": "custom_tool", "name": "t"}] + + +@pytest.mark.parametrize( + ("request_fields", "provider"), + ( + pytest.param({"model": "anthropic/claude-sonnet-4-5"}, "anthropic", id="prefixed"), + pytest.param({"model": "claude-sonnet-4-5", "custom_llm_provider": "anthropic"}, "anthropic", id="explicit"), + pytest.param({"model": "not-a-known-model"}, None, id="unresolved"), + ), +) +def test_interceptor_asks_with_the_tools_and_the_provider_the_handler_resolves( + monkeypatch: pytest.MonkeyPatch, request_fields: Mapping[str, object], provider: str | None +) -> None: + declined: Final = _Claims("other") + claims: Final = _Claims("anthropic") + monkeypatch.setattr(interceptors, "_interceptors", [declined, claims]) + + chosen: Final = messages_host.interceptor({**request_fields, "tools": _TOOLS}) + + assert chosen is (claims if provider == "anthropic" else None) + assert declined.asked == [(_TOOLS, provider)] + + +@pytest.mark.asyncio +async def test_answer_hands_the_interceptor_the_call_as_the_handler_does() -> None: + owner: Final = _Claims("anthropic") + request: Final = { + "model": "anthropic/claude-sonnet-4-5", + "messages": [{"role": "user", "content": [{"type": "text", "text": "hi"}, {"type": "text", "text": ""}]}], + "max_tokens": 16, + "tools": _TOOLS, + "stream": None, + "system": None, + "client": object(), + "custom_llm_provider": None, + "litellm_call_id": "call-1", + } + + handed: Final = await messages_host.answer(owner, request, stream=False, hooked=False) + + assert isinstance(handed, dict) + assert handed["messages"] == [{"role": "user", "content": [{"type": "text", "text": "hi"}]}] + assert handed["custom_llm_provider"] == "anthropic" + assert handed["stream"] is False + assert handed["litellm_call_id"] == "call-1" + assert "client" not in handed + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("stream", "converted", "expected"), + ( + pytest.param(True, False, True, id="caller-stream"), + pytest.param(False, True, True, id="converted-stream"), + pytest.param(False, False, False, id="unary"), + ), +) +async def test_answer_hands_a_hooked_call_on_with_the_callers_stream( + stream: bool, converted: bool, expected: bool +) -> None: + hooked_messages: Final = [{"role": "user", "content": [{"type": "text", "text": ""}]}] + request: Final = { + "model": "anthropic/claude-sonnet-4-5", + "messages": hooked_messages, + "max_tokens": 16, + "tools": _TOOLS, + "stream": False, + "system": "hooked", + "custom_llm_provider": None, + **({"_websearch_interception_converted_stream": True} if converted else {}), + } + + handed: Final = await messages_host.answer(_Claims("anthropic"), request, stream=stream, hooked=True) + + assert isinstance(handed, dict) + assert handed["messages"] is hooked_messages + assert handed["system"] == "hooked" + assert handed["stream"] is expected + + +MCP_REFERENCE: Final = MappingProxyType( + {"type": "mcp", "server_label": "litellm", "server_url": "litellm_proxy/mcp/deepwiki", "require_approval": "never"} +) + + +@pytest.mark.parametrize( + ("extra", "expected"), + [ + pytest.param({"tools": [dict(MCP_REFERENCE)]}, True, id="gateway-reference"), + pytest.param({"tools": [{**MCP_REFERENCE, "server_url": "litellm_proxy"}]}, True, id="whole-gateway"), + pytest.param({"tools": [dict(MCP_REFERENCE)], "_skip_mcp_handler": True}, False, id="gateway-follow-up"), + pytest.param({"tools": [{"name": "a", "input_schema": {"type": "object"}}]}, False, id="native-tool"), + pytest.param({"tools": []}, False, id="no-tools"), + pytest.param({"tools": [dict(MCP_REFERENCE)], "mock_response": "hi"}, False, id="mock-answers-first"), + ], +) +def test_settings_hand_the_call_to_the_mcp_gateway_where_the_python_handler_does( + extra: dict[str, object], expected: bool +) -> None: + settings: Final = messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", **extra}) + + assert settings["mcp_gateway"] is expected + + +def test_gateway_is_none_for_a_call_the_handler_serves_itself() -> None: + assert messages_host.gateway({**_CALL, "model": "anthropic/claude-sonnet-4-5"}, True) is None + + +def _gateway_request() -> dict[str, object]: + return { + **_CALL, + "model": "anthropic/claude-sonnet-4-5", + "messages": [{"role": "user", "content": [{"type": "text", "text": ""}, {"type": "text", "text": "hi"}]}], + "tools": [dict(MCP_REFERENCE)], + "metadata": {"user_id": "u-1", "session": "dropped"}, + "stream": True, + "temperature": 0.2, + "litellm_metadata": {"tags": ["t1"]}, + } + + +def test_sync_gateway_hands_the_mcp_run_what_the_python_handler_hands_it(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.llms.anthropic.messages.native import handler + + sentinel: Final = object() + handed: Final[list[dict[str, object]]] = [] + + def run(**kwargs: object) -> object: + handed.append(kwargs) + return sentinel + + monkeypatch.setattr(mcp_handler, "anthropic_messages_with_mcp", run) + request: Final = _gateway_request() + + assert handler.anthropic_messages_handler(**_gateway_request()) is sentinel # noqa: TID251 # the Python handler under comparison + assert messages_host.gateway(request, False) is sentinel + assert handed[1] == handed[0] + assert handed[1]["model"] == "claude-sonnet-4-5" + assert handed[1]["custom_llm_provider"] == "anthropic" + assert handed[1]["metadata"] == {"user_id": "u-1"} + assert handed[1]["messages"] == [{"role": "user", "content": [{"type": "text", "text": "hi"}]}] + assert "_skip_mcp_handler" not in handed[1] + + +def test_async_gateway_tells_the_logger_the_agentic_loop_params_as_the_handler_does( + monkeypatch: pytest.MonkeyPatch, +) -> None: + from litellm.litellm_core_utils.litellm_logging import Logging + + sentinel: Final = object() + handed: Final[list[dict[str, object]]] = [] + + def run(**kwargs: object) -> object: + handed.append(kwargs) + return sentinel + + monkeypatch.setattr(mcp_handler, "anthropic_messages_with_mcp", run) + logger: Final = Logging( + model="anthropic/claude-sonnet-4-5", + messages=[], + stream=False, + call_type="aanthropic_messages", + start_time=None, + litellm_call_id="call-1", + function_id="fn", + ) + + assert messages_host.gateway({**_gateway_request(), "litellm_logging_obj": logger}, True) is sentinel + assert logger.model_call_details["agentic_loop_params"] == { + "model": "anthropic/claude-sonnet-4-5", + "custom_llm_provider": "anthropic", + } + assert logger.model_call_details["litellm_params"]["aanthropic_messages"] is True + assert "is_async" not in handed[0] + assert handed[0]["litellm_logging_obj"] is logger + + +def test_async_gateway_hands_hooked_messages_on_as_already_sanitized(monkeypatch: pytest.MonkeyPatch) -> None: + handed: Final[list[dict[str, object]]] = [] + + def run(**kwargs: object) -> object: + handed.append(kwargs) + return None + + monkeypatch.setattr(mcp_handler, "anthropic_messages_with_mcp", run) + hooked: Final = [ + {"role": "user", "content": [{"type": "text", "text": "hi", "cache_control": {"type": "ephemeral"}}]} + ] + + messages_host.gateway({**_gateway_request(), "messages": hooked}, True, hooked=True) + + assert handed[0]["messages"] == hooked + + +def test_sync_answer_serves_the_gateway_after_a_mock(monkeypatch: pytest.MonkeyPatch) -> None: + sentinel: Final = object() + + def run(**_: object) -> object: + return sentinel + + monkeypatch.setattr(mcp_handler, "anthropic_messages_with_mcp", run) + + served: Final = messages_host.sync_answer(_gateway_request()) + mocked: Final = messages_host.sync_answer({**_gateway_request(), "mock_response": "hi"}) + + assert served is not None and served.value is sentinel + assert mocked is not None and isinstance(mocked.value, dict) + assert messages_host.sync_answer({**_CALL, "model": "anthropic/claude-sonnet-4-5"}) is None + + +@pytest.mark.parametrize( + ("extra", "raised", "text"), + [ + pytest.param({"messages": None}, TypeError, "'NoneType' object is not iterable", id="messages-none"), + pytest.param({"messages": 5}, TypeError, "'int' object is not iterable", id="messages-int"), + pytest.param({"tools": {"name": "t"}}, AttributeError, "'str' object has no attribute 'get'", id="tools-map"), + pytest.param({"model_info": "not-a-mapping"}, ValidationError, "model_info", id="model-info-str"), + pytest.param({"custom_llm_provider": 5}, ValidationError, "custom_llm_provider", id="provider-int"), + ], +) +def test_settings_raise_what_the_python_handler_raises_for_arguments_of_the_wrong_type( + extra: dict[str, object], raised: type[Exception], text: str +) -> None: + with pytest.raises(raised, match=text): + messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", **extra}) + + +def test_settings_leave_well_typed_tools_to_the_interceptors_after_the_cache(monkeypatch: pytest.MonkeyPatch) -> None: + asked: Final[list[object]] = [] + + def can_handle(tools: object, custom_llm_provider: object) -> bool: + asked.append(tools) + return False + + advisor: Final = interceptors.get_messages_interceptors()[0] + monkeypatch.setattr(advisor, "can_handle", can_handle) + + messages_host.settings({}, {**_CALL, "model": "anthropic/claude-sonnet-4-5", "tools": [{"name": "t"}]}) + + assert asked == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("hook_params", "raised", "text"), + [ + pytest.param("not-a-mapping", AttributeError, "'str' object has no attribute 'get'", id="params-str"), + pytest.param({"custom_llm_provider": 5}, ValidationError, "custom_llm_provider", id="provider-int"), + ], +) +async def test_pre_request_hooks_raise_what_the_python_handler_raises_for_the_hooks_params( + monkeypatch: pytest.MonkeyPatch, hook_params: object, raised: type[Exception], text: str +) -> None: + monkeypatch.setattr(litellm, "callbacks", [_hook({"litellm_params": hook_params})]) + + with pytest.raises(raised, match=text): + await messages_host.pre_request_hooks(_hook_request(model="claude-sonnet-4-5")) + + +def test_a_provider_config_rejection_maps_as_the_python_http_handler_maps_it() -> None: + logger: Final = Logging( + model="anthropic/claude-sonnet-4-5", + messages=[], + stream=False, + call_type="anthropic_messages", + start_time=datetime.datetime.now(), + litellm_call_id="rejected", + function_id="rejected", + ) + rejected: Final = ValueError("missing required field: max_tokens") + rejected.messages_request_error = True # pyright: ignore[reportAttributeAccessIssue] # marker the native host sets + rejected.messages_provider_rejection = "max_tokens is required for Anthropic /v1/messages API" # pyright: ignore[reportAttributeAccessIssue] # marker the native host sets + + mapped: Final = messages_host.map_failure( + rejected, + {"model": "anthropic/claude-sonnet-4-5", "messages": [], "litellm_logging_obj": logger}, + "anthropic", + ) + + assert isinstance(mapped, litellm.BadRequestError) + assert str(mapped) == ( + "litellm.BadRequestError: AnthropicException - max_tokens is required for Anthropic /v1/messages API" + ) + assert mapped.model == "anthropic/claude-sonnet-4-5" # pyright: ignore[reportUnknownMemberType] # the public error leaves model untyped + assert mapped.llm_provider == "anthropic" # pyright: ignore[reportUnknownMemberType] # the public error leaves llm_provider untyped + assert logger.model_call_details["custom_llm_provider"] == "anthropic" + + +def test_short_circuits_needs_a_replaced_web_search_short_circuit(monkeypatch: pytest.MonkeyPatch) -> None: + from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger + + class _ShortCircuit(WebSearchInterceptionLogger): + async def try_short_circuit_search(self, *args: object, **kwargs: object) -> dict[str, object] | None: # pyright: ignore[reportIncompatibleMethodOverride] # test double only needs the override + return None + + monkeypatch.setattr(litellm, "callbacks", [CustomLogger()]) + assert not messages_host.short_circuits() + monkeypatch.setattr(litellm, "callbacks", [WebSearchInterceptionLogger()]) + assert not messages_host.short_circuits() + monkeypatch.setattr(litellm, "callbacks", [_ShortCircuit()]) + assert messages_host.short_circuits() diff --git a/tests/unit/rust_bridge/host/test_cache.py b/tests/unit/rust_bridge/host/test_cache.py index c2b87cca1dc..9b58524a444 100644 --- a/tests/unit/rust_bridge/host/test_cache.py +++ b/tests/unit/rust_bridge/host/test_cache.py @@ -1,12 +1,22 @@ import asyncio +import datetime +from collections.abc import AsyncIterator, Callable from typing import Final import pytest import litellm from litellm.caching.caching import Cache -from litellm.caching.caching_handler import _PENDING_CACHE_WRITES -from litellm.rust_bridge.host.cache import configured_cache, store_response +from litellm.caching.caching_handler import _PENDING_CACHE_WRITES, LLMCachingHandler +from litellm.litellm_core_utils.litellm_logging import Logging +from litellm.llms.anthropic.messages.native.response_cache import AnthropicMessagesStreamCacheWriter +from litellm.rust_bridge.host.cache import ( + caching_handler, + configured_cache, + store_response, + store_verbatim, + wrap_stream, +) from litellm.types.caching import LiteLLMCacheType @@ -26,9 +36,9 @@ def test_configured_cache_preserves_identity_and_observes_runtime_replacement(mo _REQUEST: Final = {"model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "hi"}]} -async def _stored(response: dict[str, object]) -> object: +async def _stored(response: dict[str, object], store: Callable[..., None] = store_response) -> object: cache: Final = Cache(type=LiteLLMCacheType.LOCAL) - store_response(cache, response, **_REQUEST) + store(cache, response, **_REQUEST) await asyncio.gather(*_PENDING_CACHE_WRITES) return await cache.async_get_cache(**_REQUEST) @@ -51,3 +61,104 @@ async def test_store_response_drops_only_the_rust_marker_header_from_the_cached_ async def test_store_response_keeps_an_entry_without_the_rust_marker_unchanged() -> None: response: Final = {"id": "msg_2", "_hidden_params": {"additional_headers": {"llm_provider-x": "1"}}} assert await _stored(response) == response + + +async def _events() -> AsyncIterator[bytes]: + yield b"event: message_stop\ndata: {}\n\n" + + +async def anthropic_messages() -> None: + return None + + +def _logging() -> Logging: + return Logging( + model="claude-sonnet-4-5", + messages=[], + stream=True, + call_type="anthropic_messages", + start_time=datetime.datetime.now(), + litellm_call_id="messages", + function_id="messages", + ) + + +def test_wrap_stream_hands_the_stream_to_the_cache_writer_the_client_wrapper_uses( + monkeypatch: pytest.MonkeyPatch, +) -> None: + cache: Final = Cache(type=LiteLLMCacheType.LOCAL, supported_call_types=["anthropic_messages"]) + monkeypatch.setattr(litellm, "cache", cache) + stream: Final = _events() + + wrapped: Final = wrap_stream(cache, anthropic_messages, stream, None, **_REQUEST, litellm_logging_obj=_logging()) + + assert isinstance(wrapped, AnthropicMessagesStreamCacheWriter) + assert wrapped.stream is stream + + +def test_wrap_stream_leaves_a_stream_the_cache_would_not_store(monkeypatch: pytest.MonkeyPatch) -> None: + cache: Final = Cache(type=LiteLLMCacheType.LOCAL, supported_call_types=["anthropic_messages"]) + monkeypatch.setattr(litellm, "cache", cache) + stream: Final = _events() + + assert ( + wrap_stream( + cache, + anthropic_messages, + stream, + None, + **_REQUEST, + cache={"no-store": True}, + litellm_logging_obj=_logging(), + ) + is stream + ) + + +@pytest.mark.asyncio +async def test_store_verbatim_keeps_the_rust_marker_header_in_the_cached_entry() -> None: + response: Final[dict[str, object]] = { + "id": "msg_3", + "_hidden_params": {"additional_headers": {"x-litellm-rust": "true", "llm_provider-x": "1"}}, + } + assert await _stored(response, store_verbatim) == response + + +@pytest.mark.asyncio +@pytest.mark.parametrize("store", [store_response, store_verbatim]) +@pytest.mark.parametrize("content", [[], [{"type": "text", "text": ""}]]) +async def test_a_message_without_output_is_never_stored( + store: Callable[..., None], content: list[dict[str, object]] +) -> None: + assert await _stored({"id": "msg_4", "type": "message", "content": content}, store) is None + + +def test_wrap_stream_writes_through_the_handler_that_read_the_cache_over_a_later_call_s( + monkeypatch: pytest.MonkeyPatch, +) -> None: + cache: Final = Cache(type=LiteLLMCacheType.LOCAL, supported_call_types=["anthropic_messages"]) + monkeypatch.setattr(litellm, "cache", cache) + logging_obj: Final = _logging() + read: Final = LLMCachingHandler( + original_function=anthropic_messages, request_kwargs=dict(_REQUEST), start_time=datetime.datetime.now() + ) + logging_obj.llm_caching_handler = LLMCachingHandler( + original_function=anthropic_messages, request_kwargs={}, start_time=datetime.datetime.now() + ) + + wrapped: Final = wrap_stream( + cache, anthropic_messages, _events(), read, **_REQUEST, litellm_logging_obj=logging_obj + ) + + assert isinstance(wrapped, AnthropicMessagesStreamCacheWriter) + assert wrapped.caching_handler is read + + +def test_caching_handler_is_the_one_the_logging_object_holds() -> None: + logging_obj: Final = _logging() + assert caching_handler(litellm_logging_obj=logging_obj) is None + handler: Final = LLMCachingHandler( + original_function=anthropic_messages, request_kwargs={}, start_time=datetime.datetime.now() + ) + logging_obj.llm_caching_handler = handler + assert caching_handler(litellm_logging_obj=logging_obj) is handler diff --git a/tests/unit/rust_bridge/host/test_callbacks_legacy_python.py b/tests/unit/rust_bridge/host/test_callbacks_legacy_python.py index cb594767908..2a448df6e5a 100644 --- a/tests/unit/rust_bridge/host/test_callbacks_legacy_python.py +++ b/tests/unit/rust_bridge/host/test_callbacks_legacy_python.py @@ -4,7 +4,7 @@ import inspect from collections.abc import Mapping from pathlib import Path from types import MappingProxyType -from typing import Final +from typing import Final, cast # noqa: TID251 # a duck-typed logger double stands in for Logging import httpx import pytest @@ -45,6 +45,20 @@ def test_native_stream_headers_reach_spend_callbacks() -> None: assert logger.model_call_details["response_headers"] == {"llm_provider-request-id": "req_native"} +def test_recorded_messages_stream_keeps_the_provider_header_names() -> None: + logger: Final = _supplied_logger() + sent: Final[tuple[str, Mapping[str, str], Mapping[str, object]]] = ( + "http://upstream/v1/messages", + {}, + {"stream": True}, + ) + legacy.record_response(logger, 200, [("request-id", "req_native")], "", sent) + legacy.stream_opened(logger, {"additional_headers": {"llm_provider-request-id": "req_native"}}) + + assert logger.stream is True + assert logger.model_call_details["response_headers"] == {"request-id": "req_native"} + + def test_setup_reuses_a_supplied_logger() -> None: supplied: Final = _supplied_logger() result: Final = setup( @@ -73,7 +87,7 @@ def test_cache_hit_finalization_preserves_execution_provider_attribution(explici ) prepared.logger.model_call_details.update({"cache_hit": True, "cache_key": "cached-response"}) response: Final = ModelResponse(model="cache-test-model") - legacy.finalize(response, prepared.logger, prepared.kwargs, now, now) + legacy.finalize(response, prepared.logger, prepared.kwargs, now, now, False) assert prepared.logger.model_call_details["custom_llm_provider"] == "azure" assert prepared.logger.model_call_details["model"] == "resolved-cache-model" assert prepared.logger.litellm_params["metadata"]["user_api_key"] == "key-hash" @@ -303,7 +317,7 @@ def _messages_logger() -> Logging: def test_native_provider_response_is_recorded_for_logging_replay() -> None: logger: Final = _messages_logger() - legacy.record_response(logger, 200, (("request-id", "req_native"),), '{"id": "msg_native"}') + legacy.record_response(logger, 200, (("request-id", "req_native"),), '{"id": "msg_native"}', None) recorded: Final[object] = logger.model_call_details["httpx_response"] assert isinstance(recorded, httpx.Response) @@ -312,6 +326,51 @@ def test_native_provider_response_is_recorded_for_logging_replay() -> None: assert logger.model_call_details["response_headers"]["request-id"] == "req_native" +def test_a_non_ascii_provider_header_is_recorded_as_httpx_decodes_it() -> None: + logger: Final = _messages_logger() + + legacy.record_response(logger, 200, (("x-fz-unicode", "caf\u00e9"),), '{"id": "msg_native"}', None) + + assert logger.model_call_details["response_headers"]["x-fz-unicode"] == "caf\u00e9" + + +_HTTPX_RESPONSE: Final = TypeAdapter(httpx.Response, config={"arbitrary_types_allowed": True}) +_SENT_HEADERS: Final = MappingProxyType({"x-api-key": "sk-ant", "anthropic-beta": "message-threads-2026-08-12"}) + + +def test_native_provider_response_carries_the_request_that_was_sent() -> None: + logger: Final = _messages_logger() + body: Final = {"model": "claude-sonnet-4-5", "thread": {"type": "create"}} + + legacy.record_response( + logger, 200, (), '{"id": "msg_native"}', ("https://api.anthropic.com/v1/messages", _SENT_HEADERS, body) + ) + + recorded: Final = _HTTPX_RESPONSE.validate_python(logger.model_call_details["httpx_response"]) + assert recorded.request.method == "POST" + assert str(recorded.request.url) == "https://api.anthropic.com/v1/messages" + assert recorded.request.headers["anthropic-beta"] == "message-threads-2026-08-12" + assert recorded.request.content == b'{"model": "claude-sonnet-4-5", "thread": {"type": "create"}}' + assert recorded.content == b'{"id": "msg_native"}' + + +def test_native_stream_response_is_recorded_unread_like_the_python_stream() -> None: + logger: Final = _messages_logger() + + legacy.record_response( + logger, + 200, + (("request-id", "req_native"),), + "", + ("https://api.anthropic.com/v1/messages", _SENT_HEADERS, {"stream": True}), + ) + + recorded: Final = _HTTPX_RESPONSE.validate_python(logger.model_call_details["httpx_response"]) + assert recorded.request.headers["anthropic-beta"] == "message-threads-2026-08-12" + with pytest.raises(httpx.ResponseNotRead): + _ = recorded.content + + def test_native_provider_exchange_window_is_recorded_like_the_timed_post() -> None: logger: Final = _messages_logger() logger.model_call_details["litellm_params"] = {"litellm_metadata": {"user_api_key": "hashed"}} @@ -323,6 +382,76 @@ def test_native_provider_exchange_window_is_recorded_like_the_timed_post() -> No assert metadata["llm_api_timing_windows"] == ((1_700_000_000.0, 1_700_000_000.25),) +@pytest.mark.asyncio +async def test_a_retried_request_rewrites_the_logged_body_in_place_like_the_python_retry_loop() -> None: + logger: Final = _messages_logger() + metadata: Final = {"user_id": "u-1"} + replayed: Final = [ + {"role": "assistant", "content": [{"type": "thinking", "thinking": "x", "signature": "s"}]}, + {"role": "user", "content": "again"}, + ] + logged: Final[dict[str, object]] = { + "model": "claude-sonnet-4-5", + "messages": replayed, + "metadata": metadata, + "thinking": {"type": "enabled", "budget_tokens": 1024}, + } + logger.model_call_details.update(logged) + retried: Final = { + "model": "claude-sonnet-4-5", + "messages": [{"role": "user", "content": "again"}], + "metadata": {"user_id": "u-1"}, + } + + await legacy.retried_request(logger, logged, retried, ({"kind": "thinking_signature"},)) + + assert logged == retried + assert logged["metadata"] is metadata + assert logger.model_call_details["messages"] == [{"role": "user", "content": "again"}] + assert logger.model_call_details["thinking"] == {"type": "enabled", "budget_tokens": 1024} + + +class _BaselineLogger: + def __init__(self) -> None: + self.baseline_cache_context: object = object() + self.model_call_details: dict[str, object] = {} + self.invalidated: list[str] = [] + + async def invalidate_baseline_cache_estimate(self, reason: str) -> None: + self.invalidated.append(reason) + + +@pytest.mark.asyncio +async def test_a_retried_request_invalidates_the_baseline_cache_estimate() -> None: + logger: Final = _BaselineLogger() + + await legacy.retried_request(cast(Logging, logger), {"messages": []}, {"messages": []}, ()) # cast-ok: duck-typed + + assert logger.invalidated == ["retried_request"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("reasons", "warned"), + [ + pytest.param(({"kind": "thinking_signature"},), [], id="thinking_signature"), + pytest.param(({"kind": "strict_tools", "dropped": 2},), [2], id="strict_tools"), + pytest.param(({"kind": "thinking_signature"}, {"kind": "strict_tools", "dropped": 3}), [3], id="both_reasons"), + ], +) +async def test_a_retry_that_dropped_strict_tools_warns_with_the_dropped_count( + monkeypatch: pytest.MonkeyPatch, reasons: tuple[Mapping[str, object], ...], warned: list[int] +) -> None: + from litellm.llms.anthropic import common_utils + + warnings: Final[list[int]] = [] + monkeypatch.setattr(common_utils, "warn_claude_strict_tools_dropped", warnings.append) + + await legacy.retried_request(_messages_logger(), {"messages": []}, {"messages": []}, reasons) + + assert warnings == warned + + def test_stream_head_is_stamped_in_place_with_the_call_hidden_params() -> None: logger: Final = _messages_logger() head: Final[dict[str, object]] = {"additional_headers": {"request-id": "req_native"}} @@ -334,6 +463,7 @@ def test_stream_head_is_stamped_in_place_with_the_call_hidden_params() -> None: {"model": "anthropic/claude-sonnet-4-5", "litellm_call_id": "messages"}, started, started + datetime.timedelta(milliseconds=5), + False, ) assert head["additional_headers"] == {"request-id": "req_native", "llm_provider-request-id": "req_native"} @@ -403,3 +533,22 @@ async def test_a_proxy_stream_abandoned_mid_cancel_bills_after_the_disconnect_cl await asyncio.sleep(0) assert events == ["disconnect recorded", "billed"] + + +@pytest.mark.parametrize( + ("requested", "keeps_requested", "expected"), + [ + pytest.param("false", True, "false", id="messages-keeps-a-truthy-string"), + pytest.param(1, True, 1, id="messages-keeps-a-truthy-int"), + pytest.param(False, True, True, id="messages-hook-streamed"), + pytest.param("false", False, True, id="other-routes-stream-true"), + ], +) +def test_a_stream_logs_the_flag_python_logs(requested: object, keeps_requested: bool, expected: object) -> None: + logger: Final = _supplied_logger() + logger.model_call_details["stream"] = requested + + legacy.stream_opened(logger, {}, keeps_requested) + + assert logger.model_call_details["stream"] == expected + assert logger.stream == expected diff --git a/tests/unit/rust_bridge/test_catalog.py b/tests/unit/rust_bridge/test_catalog.py index 1994dd00709..56fcad14851 100644 --- a/tests/unit/rust_bridge/test_catalog.py +++ b/tests/unit/rust_bridge/test_catalog.py @@ -20,16 +20,10 @@ from litellm.rust_bridge.public_call import NativeCall @pytest.mark.parametrize( - ("model", "expected"), - ( - ("anthropic/claude-opus-latest", Rollout.PYTHON_ONLY), - (f"anthropic/{get_model_latest_aliases()['anthropic']['claude-opus-latest']}", Rollout.RUST_OPT_IN), - ), + "model", + ("anthropic/claude-opus-latest", f"anthropic/{get_model_latest_aliases()['anthropic']['claude-opus-latest']}"), ) -def test_latest_alias_messages_falls_back_without_changing_the_pinned_model_rollout( - model: str, - expected: Rollout, -) -> None: +def test_latest_alias_messages_stays_native_like_the_pinned_model(model: str) -> None: request: Final = NativeCall(args=(), kwargs={"model": model}, base={}) context: Final = RouteContext( Route.MESSAGES, @@ -41,7 +35,7 @@ def test_latest_alias_messages_falls_back_without_changing_the_pinned_model_roll RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY, features=catalog.MESSAGES_PYTHON_FEATURES), RouteRule(Route.MESSAGES, Rollout.RUST_OPT_IN, providers=frozenset({"anthropic"})), ) - assert catalog.rollout(context, rules) is expected + assert catalog.rollout(context, rules) is Rollout.RUST_OPT_IN @pytest.fixture(autouse=True) @@ -74,7 +68,7 @@ def test_missing_rule_stays_on_python_even_when_rust_is_enabled(monkeypatch: pyt (RouteContext(Route.MESSAGES, target=Target.MESSAGES), Decision.RUST_REQUIRED), (RouteContext(Route.MESSAGES, target=Target.CHAT_COMPLETIONS), Decision.PYTHON), (RouteContext(Route.MESSAGES), Decision.PYTHON), - (RouteContext(Route.OCR, features=frozenset({Feature.SAFEGUARDS_CLASSIFIER})), Decision.PYTHON), + (RouteContext(Route.OCR, features=frozenset({Feature.STREAMING})), Decision.PYTHON), (RouteContext(Route.OCR), Decision.RUST_REQUIRED), ), ) @@ -88,7 +82,7 @@ def test_first_matching_rule_respects_every_constraint(context: RouteContext, ex ), RouteRule(Route.RESPONSES, Rollout.PYTHON_ONLY), RouteRule(Route.MESSAGES, Rollout.RUST_REQUIRED, targets=frozenset({Target.MESSAGES})), - RouteRule(Route.OCR, Rollout.PYTHON_ONLY, features=frozenset({Feature.SAFEGUARDS_CLASSIFIER})), + RouteRule(Route.OCR, Rollout.PYTHON_ONLY, features=frozenset({Feature.STREAMING})), RouteRule(Route.OCR, Rollout.RUST_REQUIRED), ) @@ -152,6 +146,7 @@ def test_empty_constraints_match_nothing() -> None: ) assert catalog.decision(RouteContext(Route.OCR), rules) is Decision.PYTHON - assert catalog.decision( - RouteContext(Route.OCR, features=frozenset({Feature.SAFEGUARDS_CLASSIFIER})), rules - ) is Decision.PYTHON + assert ( + catalog.decision(RouteContext(Route.OCR, features=frozenset({Feature.STREAMING})), rules) + is Decision.PYTHON + ) diff --git a/tests/unit/rust_bridge/test_detectors.py b/tests/unit/rust_bridge/test_detectors.py index fccc01dd8e6..7ad8069758e 100644 --- a/tests/unit/rust_bridge/test_detectors.py +++ b/tests/unit/rust_bridge/test_detectors.py @@ -1,4 +1,5 @@ from collections.abc import Callable, Mapping +import ssl from copy import deepcopy from datetime import datetime from functools import reduce @@ -14,10 +15,9 @@ from litellm.litellm_core_utils.litellm_logging import Logging from litellm.responses.utils import ResponsesAPIRequestUtils from litellm.rust_bridge import detectors from litellm.rust_bridge.chat_completions import detectors as chat_detectors -from litellm.rust_bridge.messages import detectors as messages_detectors from litellm.rust_bridge.public_call import NativeCall from litellm.rust_bridge.responses import detectors as responses_detectors -from litellm.types.llms.anthropic import ANTHROPIC_ADVISOR_TOOL_TYPE, ANTHROPIC_TOOL_SEARCH_TOOL_TYPES +from litellm.types.llms.anthropic import ANTHROPIC_TOOL_SEARCH_TOOL_TYPES GATEWAY_TOOL: Final = {"type": "mcp", "server_label": "gateway", "server_url": "litellm_proxy"} REMOTE_TOOL: Final = {"type": "mcp", "server_label": "docs", "server_url": "https://mcp.example.com/sse"} @@ -31,9 +31,6 @@ MAPPED_FILE: Final = { } MAPPED_FILE_INPUT: Final = [{"role": "user", "content": [{"type": "input_file", "file_id": "litellm-file"}]}] CACHED_TEXT: Final = {"type": "input_text", "text": "hi", "cache_control": {"type": "ephemeral"}} -THINKING_TURN: Final = {"role": "assistant", "content": [{"type": "thinking", "thinking": "x", "signature": "s"}]} -REDACTED: Final = {"type": "redacted_thinking", "data": "x"} -STRICT_TOOL: Final = {"name": "b", "input_schema": {"type": "object"}, "strict": True} TOOL_SEARCH_TYPE: Final = sorted(ANTHROPIC_TOOL_SEARCH_TOOL_TYPES)[0] @@ -63,25 +60,6 @@ def test_floating_alias_requires_python(model: str, provider: str | None, expect assert detectors.latest_alias(call(model=model, custom_llm_provider=provider)) is expected -@pytest.mark.parametrize( - ("model", "provider", "tools", "expected"), - ( - ("deepseek/test-model", None, [{"type": ANTHROPIC_ADVISOR_TOOL_TYPE}], True), - ("anthropic/test-model", None, [{"type": ANTHROPIC_ADVISOR_TOOL_TYPE}], False), - ("test-model", "anthropic", [{"type": ANTHROPIC_ADVISOR_TOOL_TYPE}], False), - ("unresolved-model", None, [{"type": ANTHROPIC_ADVISOR_TOOL_TYPE}], True), - ("deepseek/test-model", None, [{"type": "function", "name": "f"}], False), - ("deepseek/test-model", None, ["not-a-tool"], False), - ("deepseek/test-model", None, [], False), - ("deepseek/test-model", None, None, False), - ), -) -def test_messages_interception_matches_tools_and_resolved_provider( - model: str, provider: str | None, tools: object, expected: bool -) -> None: - assert messages_detectors.intercepted(call(model=model, custom_llm_provider=provider, tools=tools)) is expected - - def _wrap_nested_level(value: object, depth: int) -> object: return {"nested": value} if depth % 2 else [value] @@ -136,8 +114,6 @@ def _wrap_nested_level(value: object, depth: int) -> object: (responses_detectors.provider_affinity, {"provider_affinity_header": None, "session_id": "session-1"}, False), (responses_detectors.provider_affinity, {}, False), (responses_detectors.provider_affinity, {"api_base": "https://opencode.ai/inference/go/openai/v1"}, True), - (messages_detectors.provider_affinity, {"api_base": "https://opencode.ai/inference/go/anthropic/v1"}, True), - (messages_detectors.provider_affinity, {"api_base": "https://other.example/v1"}, False), (detectors.streaming, {"stream": True}, True), (detectors.streaming, {"stream": False}, False), (detectors.timeout_variants, {"request_timeout": 5}, True), @@ -196,36 +172,6 @@ def _wrap_nested_level(value: object, depth: int) -> object: (detectors.cache_control_injection, {"enable_prompt_caching": True}, True), (detectors.cache_control_injection, {"cache_control_injection_points": [{"location": "message"}]}, True), (detectors.cache_control_injection, {"cache_control_injection_points": []}, False), - (messages_detectors.thinking_signature_retry, {"messages": [THINKING_TURN]}, True), - ( - messages_detectors.thinking_signature_retry, - {"messages": [{"role": "assistant", "content": [REDACTED]}]}, - True, - ), - (messages_detectors.thinking_signature_retry, {"messages": [{"role": "assistant", "content": "done"}]}, False), - ( - messages_detectors.thinking_signature_retry, - {"messages": [{"role": "user", "content": [{"type": "text"}]}]}, - False, - ), - (messages_detectors.tool_custom_field, {"tools": [{"name": "a"}, {"name": "b", "custom": {}}]}, True), - (messages_detectors.tool_custom_field, {"tools": [{"name": "a", "defer_loading": True}]}, False), - (messages_detectors.tool_custom_field, {}, False), - (messages_detectors.strict_tools_retry, {"drop_params": True, "tools": [{"name": "a"}, STRICT_TOOL]}, True), - ( - messages_detectors.strict_tools_retry, - {"drop_params": True, "tools": [{**STRICT_TOOL, "strict": False}]}, - False, - ), - ( - messages_detectors.strict_tools_retry, - {"additional_drop_params": ["metadata.user_id"], "tools": [STRICT_TOOL]}, - False, - ), - (messages_detectors.strict_tools_retry, {"tools": [STRICT_TOOL]}, False), - (messages_detectors.strict_tools_retry, {"drop_params": False, "tools": [STRICT_TOOL]}, False), - (messages_detectors.strict_tools_retry, {"drop_params": True, "tools": [{"name": "a"}]}, False), - (messages_detectors.strict_tools_retry, {"drop_params": True}, False), (detectors.drop_params, {"drop_params": True}, True), (detectors.drop_params, {"drop_params": False}, False), (detectors.drop_params, {"drop_params": " True "}, True), @@ -323,8 +269,6 @@ def test_input_rewrite_preserves_caller_input(input_value: object, expected: boo (detectors.modify_params, "modify_params", True, {}), (detectors.retries_fallbacks, "num_retries", 3, {}), (detectors.cache_control_injection, "enable_anthropic_prompt_caching", True, {}), - (messages_detectors.stream_cost_injection, "include_cost_in_streaming_usage", True, {"stream": True}), - (messages_detectors.stream_cost_injection, "include_cost_in_streaming_usage", "true", {"stream": True}), (chat_detectors.chat_retries_fallbacks, "model_fallbacks", [{"gpt-5": ["gpt-5-mini"]}], {}), (chat_detectors.chat_retries_fallbacks, "num_retries", 3, {}), (chat_detectors.model_alias_map, "model_alias_map", {"gpt-5": "openai/gpt-5"}, {}), @@ -347,30 +291,6 @@ def test_global_settings_are_detected( assert detector(call(**kwargs)) -def test_stream_cost_injection_needs_a_stream(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(litellm, "include_cost_in_streaming_usage", True) - assert not messages_detectors.stream_cost_injection(call()) - - -def test_stream_cost_injection_reads_the_request_header_the_proxy_reads(monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(litellm, "include_cost_in_streaming_usage", False) - opted_in: Final = {"proxy_server_request": {"headers": {"x-litellm-include-cost-in-streaming-usage": "true"}}} - assert messages_detectors.stream_cost_injection(call(stream=True, **opted_in)) - assert not messages_detectors.stream_cost_injection(call(**opted_in)) - assert not messages_detectors.stream_cost_injection(call(stream=True, proxy_server_request={"headers": {}})) - - -def test_foundry_beta_row_reads_the_api_base_the_anthropic_handler_reads(monkeypatch: pytest.MonkeyPatch) -> None: - for name in ("ANTHROPIC_API_BASE", "ANTHROPIC_BASE_URL"): - monkeypatch.delenv(name, raising=False) - assert messages_detectors.foundry_beta_row(call(api_base="https://team.services.ai.azure.com/anthropic")) - assert messages_detectors.foundry_beta_row(call(base_url="https://team.cognitiveservices.azure.com/anthropic")) - assert not messages_detectors.foundry_beta_row(call(api_base="https://api.anthropic.com")) - assert not messages_detectors.foundry_beta_row(call()) - monkeypatch.setenv("ANTHROPIC_BASE_URL", "https://team.services.ai.azure.com/anthropic") - assert messages_detectors.foundry_beta_row(call()) - - def test_model_alias_map_applies_only_to_the_requested_model(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(litellm, "model_alias_map", {"fast": "openai/gpt-5-mini"}) assert chat_detectors.model_alias_map(call(model="fast")) @@ -413,20 +333,6 @@ def test_openai_workload_identity_applies_only_without_a_static_key(monkeypatch: assert not responses_detectors.openai_workload_identity(call()) -def test_anthropic_workload_identity_applies_only_without_a_static_key(monkeypatch: pytest.MonkeyPatch) -> None: - for name in ( - "ANTHROPIC_API_KEY", - "ANTHROPIC_AUTH_TOKEN", - "ANTHROPIC_FEDERATION_RULE_ID", - "ANTHROPIC_ORGANIZATION_ID", - ): - monkeypatch.delenv(name, raising=False) - federation: Final = {"anthropic_federation_rule_id": "rule-1", "anthropic_organization_id": "org-1"} - assert messages_detectors.anthropic_workload_identity(call(**federation)) - assert not messages_detectors.anthropic_workload_identity(call(**federation, api_key="sk-ant-static")) - assert not messages_detectors.anthropic_workload_identity(call(anthropic_federation_rule_id="rule-1")) - - class _Logger(CustomLogger): pass @@ -436,10 +342,6 @@ class _Rewrite(CustomLogger): return kwargs -class _InheritedRewrite(_Rewrite): - pass - - class _Agentic(CustomLogger): async def async_should_run_agentic_loop(self, *args: object, **kwargs: object) -> tuple[bool, dict]: # pyright: ignore[reportIncompatibleMethodOverride, reportMissingTypeArgument] # test double only needs the override return False, {} @@ -460,10 +362,6 @@ class _Deployment(CustomLogger): @pytest.mark.parametrize( ("detector", "callbacks", "expected"), ( - (messages_detectors.pre_request_hook, [_Rewrite()], True), - (messages_detectors.pre_request_hook, [_InheritedRewrite()], True), - (messages_detectors.pre_request_hook, [_Logger(), _Agentic()], False), - (messages_detectors.pre_request_hook, ["not-a-logger"], False), (detectors.agentic_loop_hook, [_Agentic()], True), (detectors.agentic_loop_hook, [_Logger(), _Rewrite()], False), (detectors.agentic_loop_hook, [_ChatAgentic()], False), @@ -501,7 +399,6 @@ def _logging_with(callback: CustomLogger) -> Logging: (detectors.agentic_loop_hook, {"success_callback": [_Agentic()]}, True), (detectors.agentic_loop_hook, {"litellm_logging_obj": _logging_with(_Agentic())}, True), (detectors.agentic_loop_hook, {"success_callback": [_Logger()]}, False), - (messages_detectors.pre_request_hook, {"success_callback": [_Rewrite()]}, False), (chat_detectors.chat_agentic_loop_hook, {"litellm_logging_obj": _logging_with(_ChatAgentic())}, True), (responses_detectors.deployment_hook, {"success_callback": [_Deployment()]}, True), ), @@ -509,7 +406,6 @@ def _logging_with(callback: CustomLogger) -> Logging: "success-callback", "logging-object", "plain-logger", - "pre-request-reads-globals-only", "chat-agentic-logging-object", "deployment-success-callback", ), @@ -524,15 +420,6 @@ def test_callback_detectors_read_the_request_callbacks_the_handler_reads( assert detector(call(**kwargs)) is expected -def test_websearch_interception_needs_the_interception_logger(monkeypatch: pytest.MonkeyPatch) -> None: - from litellm.integrations.websearch_interception.handler import WebSearchInterceptionLogger - - monkeypatch.setattr(litellm, "callbacks", [_Rewrite()]) - assert not messages_detectors.websearch_interception(call()) - monkeypatch.setattr(litellm, "callbacks", [WebSearchInterceptionLogger()]) - assert messages_detectors.websearch_interception(call()) - - @pytest.mark.parametrize( ("cache", "kwargs", "expected"), ( @@ -551,7 +438,14 @@ def test_response_cache_is_skipped_only_by_no_cache( @pytest.mark.parametrize( ("environment", "setting", "expected"), - ((None, None, False), ("DEFAULT@SECLEVEL=1", None, True), (None, "DEFAULT@SECLEVEL=1", True)), + ( + (None, None, False), + ("DEFAULT@SECLEVEL=1", None, True), + (None, "DEFAULT@SECLEVEL=1", True), + (None, "ECDHE-RSA-AES128-GCM-SHA256", False), + (None, "ECDHE-RSA-AES128-GCM-SHA256:RC4-SHA", True), + ("HIGH", None, False), + ), ) def test_tls_policy_reads_the_security_level_environment_then_the_setting( monkeypatch: pytest.MonkeyPatch, environment: str | None, setting: str | None, expected: bool @@ -567,7 +461,19 @@ def test_tls_policy_reads_the_security_level_environment_then_the_setting( @pytest.mark.parametrize( ("environment", "setting", "expected"), - ((None, "X25519", False), (None, " P-256 ", False), ("secp521r1", None, True), (None, "secp521r1", True)), + ( + (None, "X25519", False), + (None, "prime256v1", False), + (None, "secp384r1", False), + (None, " P-256 ", True), + (None, "P-384", True), + (None, "secp256r1", True), + (None, "x25519", True), + ("secp521r1", None, True), + (None, "secp521r1", True), + ("", "secp521r1", False), + (None, "", False), + ), ) def test_tls_policy_flags_only_curves_native_tls_lacks( monkeypatch: pytest.MonkeyPatch, environment: str | None, setting: str | None, expected: bool @@ -579,3 +485,24 @@ def test_tls_policy_flags_only_curves_native_tls_lacks( monkeypatch.setenv("SSL_ECDH_CURVE", environment) monkeypatch.setattr(litellm, "ssl_ecdh_curve", setting) assert detectors.tls_policy(call()) is expected + + +@pytest.mark.parametrize(("setting", "value"), (("ssl_security_level", 1), ("ssl_ecdh_curve", object()))) +def test_tls_policy_hands_an_undecodable_setting_to_python_without_raising( + monkeypatch: pytest.MonkeyPatch, setting: str, value: object +) -> None: + for name in ("SSL_SECURITY_LEVEL", "SSL_ECDH_CURVE"): + monkeypatch.delenv(name, raising=False) + monkeypatch.setattr(litellm, "ssl_security_level", None) + monkeypatch.setattr(litellm, "ssl_ecdh_curve", None) + monkeypatch.setattr(litellm, setting, value) + assert detectors.tls_policy(call()) is True + + +def test_tls_policy_ignores_a_live_ssl_context(monkeypatch: pytest.MonkeyPatch) -> None: + for name in ("SSL_SECURITY_LEVEL", "SSL_ECDH_CURVE"): + monkeypatch.delenv(name, raising=False) + monkeypatch.setattr(litellm, "ssl_security_level", None) + monkeypatch.setattr(litellm, "ssl_ecdh_curve", None) + monkeypatch.setattr(litellm, "ssl_verify", ssl.create_default_context()) + assert detectors.tls_policy(call()) is False diff --git a/tests/unit/rust_bridge/test_runtime.py b/tests/unit/rust_bridge/test_runtime.py index 75cdfde087b..548591a2903 100644 --- a/tests/unit/rust_bridge/test_runtime.py +++ b/tests/unit/rust_bridge/test_runtime.py @@ -216,9 +216,12 @@ async def test_python_fallback_does_not_claim_rust_execution(missing: bool) -> N @pytest.mark.parametrize("shape", ("model", "dict")) @pytest.mark.parametrize("asynchronous", (False, True)) @pytest.mark.parametrize("cache_key", (None, "test-cache-key")) +@pytest.mark.parametrize("route", (Route.MESSAGES, Route.OCR)) async def test_native_response_marker_reaches_caller_with_existing_metadata( - shape: str, asynchronous: bool, cache_key: str | None + shape: str, asynchronous: bool, cache_key: str | None, route: Route ) -> None: + context: Final = RouteContext(route, provider="anthropic", model="model") + required: Final = (RouteRule(route, Rollout.RUST_REQUIRED, providers=frozenset({"anthropic"})),) hidden: Final = { "additional_headers": {"x-request-id": "upstream"}, "response_cost": 0.01, @@ -232,6 +235,47 @@ async def test_native_response_marker_reaches_caller_with_existing_metadata( bound: Final[bindings.NativeBinding[Callable[[], object]]] = bindings.NativeBinding("ocr", validate=lambda _: None) bound.override(lambda: response) + def python() -> object: + pytest.fail("native success must not fall back") + + async def anative(fn: Callable[[], object]) -> object: + return fn() + + async def apython() -> object: + return python() + + result: Final = ( + await runtime.arun(context, binding=bound, native=anative, python=apython, rules=required) + if asynchronous + else runtime.run(context, binding=bound, native=lambda fn: fn(), python=python, rules=required) + ) + assert result is response + assert get_hidden_params_dict(result) == ( + { + "response_cost": 0.01, + "additional_headers": {"x-request-id": "upstream"}, + **({"cache_key": cache_key} if cache_key is not None else {}), + } + if shape == "dict" + else { + "response_cost": 0.01, + "additional_headers": { + "x-request-id": "upstream", + "x-litellm-rust": "true", + **({"x-litellm-cache-key": cache_key} if cache_key is not None and route is not Route.MESSAGES else {}), + }, + **({"cache_key": cache_key} if cache_key is not None else {}), + } + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("asynchronous", (False, True)) +async def test_native_dict_response_reaches_caller_without_hidden_params_key(asynchronous: bool) -> None: + response: Final[dict[str, object]] = {"content": "native"} + bound: Final[bindings.NativeBinding[Callable[[], object]]] = bindings.NativeBinding("ocr", validate=lambda _: None) + bound.override(lambda: response) + def python() -> object: pytest.fail("native success must not fall back") @@ -249,15 +293,7 @@ async def test_native_response_marker_reaches_caller_with_existing_metadata( ) ) assert result is response - assert get_hidden_params_dict(result) == { - "response_cost": 0.01, - "additional_headers": { - "x-request-id": "upstream", - "x-litellm-rust": "true", - **({"x-litellm-cache-key": cache_key} if cache_key is not None else {}), - }, - **({"cache_key": cache_key} if cache_key is not None else {}), - } + assert result == {"content": "native"} class ScriptedStreamExecution: diff --git a/tests/unit/test_assert_ci_coverage.py b/tests/unit/test_assert_ci_coverage.py index 87c56f1a42b..0a50bef385d 100644 --- a/tests/unit/test_assert_ci_coverage.py +++ b/tests/unit/test_assert_ci_coverage.py @@ -26,7 +26,25 @@ sys.modules[_spec.name] = coverage # @dataclass(slots=True) rebuilds via sys.mo _spec.loader.exec_module(coverage) -def test_integration_groups_require_exclusive_scheduled_circleci_owner(tmp_path: Path) -> None: +def _write_group_workflow(root: Path, suites: tuple[str, ...] = ("management",)) -> Path: + workflow: Final = root / ".github/workflows/test-integration.yml" + workflow.parent.mkdir(parents=True, exist_ok=True) + workflow.write_text( + yaml.safe_dump( + { + "jobs": { + "integration": { + "strategy": {"matrix": {"suite": list(suites)}}, + "steps": [{"run": "bash .github/scripts/ci/run_integration.sh $SUITE"}], + } + } + } + ) + ) + return workflow + + +def test_integration_groups_require_exclusive_scheduled_github_owner(tmp_path: Path) -> None: test_path: Final = "tests/integration/management/test_contract.py" test_file: Final = tmp_path / test_path test_file.parent.mkdir(parents=True) @@ -37,39 +55,18 @@ def test_integration_groups_require_exclusive_scheduled_circleci_owner(tmp_path: ) paths, findings = coverage._integration_ownership(tmp_path) assert not paths - assert [finding.detail for finding in findings] == ["dedicated CircleCI runner is missing"] - circle: Final = tmp_path / ".circleci/config.yml" - circle.parent.mkdir() - circle.write_text( - yaml.safe_dump( - { - "jobs": { - "integration_contracts": { - "steps": [{"run": {"command": "bash .circleci/scripts/run_integration.sh management"}}] - } - }, - "workflows": {"integration": {"jobs": [{"integration_contracts": {"suite": "management"}}]}}, - } - ) - ) + assert [finding.detail for finding in findings] == ["dedicated GitHub Actions runner is missing"] + _write_group_workflow(tmp_path) paths, findings = coverage._integration_ownership(tmp_path) assert paths == frozenset({test_path}) assert findings == () - configured: Final = yaml.safe_load(circle.read_text()) - configured["workflows"]["integration"]["jobs"] = [ - {"integration_contracts": {"matrix": {"parameters": {"suite": ["providers"]}}}} - ] - circle.write_text(yaml.safe_dump(configured)) + _write_group_workflow(tmp_path, ("providers",)) _, findings = coverage._integration_ownership(tmp_path) assert [(finding.subject, finding.detail) for finding in findings] == [ - ("management", "canonical integration group is not scheduled by CircleCI") + ("management", "canonical integration group is not scheduled by GitHub Actions") ] - configured["workflows"]["integration"]["jobs"][0]["integration_contracts"]["matrix"]["parameters"]["suite"] = [ - "management" - ] - circle.write_text(yaml.safe_dump(configured)) + _write_group_workflow(tmp_path) workflow: Final = tmp_path / ".github/workflows/test.yml" - workflow.parent.mkdir(parents=True) workflow.write_text(yaml.safe_dump({"jobs": {"tests": {"steps": [{"run": "pytest tests/integration"}]}}})) _, findings = coverage._integration_ownership(tmp_path) assert [(finding.subject, finding.detail) for finding in findings] == [ @@ -98,12 +95,9 @@ def test_integration_groups_require_exclusive_scheduled_circleci_owner(tmp_path: assert [(finding.subject, finding.detail) for finding in missing_invocation] == [ (github_path, "GitHub-owned integration contract has no invoking job") ] - circle_config: Final = yaml.safe_load(circle.read_text()) - circle_config["jobs"]["postgres_suite"] = {"parameters": {"test_path": {"type": "string"}}} - circle_config["workflows"]["integration"]["jobs"].append({"postgres_suite": {"test_path": github_path}}) - circle.write_text(yaml.safe_dump(circle_config)) - _, circle_invocation = coverage._integration_ownership(tmp_path) - assert circle_invocation == () + dedicated.write_text(yaml.safe_dump({"jobs": {"tests": {"steps": [{"run": f"pytest {github_path}"}]}}})) + _, restored_invocation = coverage._integration_ownership(tmp_path) + assert restored_invocation == () def _write_integration_tree(root: Path, github_path: str) -> None: @@ -117,20 +111,24 @@ def _write_integration_tree(root: Path, github_path: str) -> None: 'GROUPS: Final = MappingProxyType({"management": ("management",)})\n' f"GITHUB_FILES: Final = frozenset({{{github_path!r}}})\n" ) - (root / ".circleci").mkdir() - (root / ".circleci/config.yml").write_text( - yaml.safe_dump( - { - "jobs": { - "integration_contracts": { - "steps": [{"run": {"command": "bash .circleci/scripts/run_integration.sh management"}}] - } - }, - "workflows": {"integration": {"jobs": [{"integration_contracts": {"suite": "management"}}]}}, - } - ) - ) - (root / ".github/workflows").mkdir(parents=True) + _write_group_workflow(root) + + +@pytest.mark.parametrize( + ("matrix", "expected"), + ( + (["management", "database"], ("management", "database")), + ([], ()), + (None, ()), + ("${{ inputs.suite }}", ()), + ( + "${{ fromJSON(inputs.suite == 'all' && '[\"management\",\"database\"]' || format('[\"{0}\"]', inputs.suite)) }}", + ("management", "database"), + ), + ), +) +def test_integration_matrix_accounts_for_default_suites(matrix: object, expected: tuple[str, ...]) -> None: + assert coverage._matrix_suites(matrix) == expected @pytest.mark.parametrize( @@ -172,20 +170,18 @@ def test_an_integration_file_outside_every_group_cannot_run_on_a_github_shard(tm assert not [finding for finding in before if finding.subject == ungrouped] -def test_circleci_postgres_suites_count_their_test_path_as_invoked() -> None: +def test_workflow_matrices_count_their_test_paths_as_invoked() -> None: config: Final = { - "workflows": { - "integration": { - "jobs": [ - {"postgres_suite": {"name": "proxy-behavior", "test_path": "tests/proxy_behavior", "seed": True}}, - { - "postgres_suite": { - "name": "roi-database", - "test_path": "tests/integration/database/test_roi_observed.py", - "seed": False, - } - }, - ] + "jobs": { + "postgres": { + "strategy": { + "matrix": { + "include": [ + {"test-path": "tests/proxy_behavior"}, + {"test-path": "tests/integration/database/test_roi_observed.py"}, + ] + } + } } } } @@ -194,15 +190,27 @@ def test_circleci_postgres_suites_count_their_test_path_as_invoked() -> None: ) -def test_every_circleci_postgres_suite_is_credited_on_the_repo_as_it_stands() -> None: - circle: Final = yaml.safe_load(coverage.CIRCLECI_CONFIG.read_text()) - paths: Final = tuple( - job["postgres_suite"]["test_path"] - for job in circle["workflows"]["integration"]["jobs"] - if isinstance(job, dict) and "postgres_suite" in job +def test_allowlisting_an_unrun_integration_contract_does_not_claim_it_runs(tmp_path: Path) -> None: + path: Final = "tests/integration/database/test_roi_observed.py" + _write_integration_tree(tmp_path, path) + paths, findings = coverage._integration_ownership(tmp_path) + assert path not in paths + assert [(finding.subject, finding.detail) for finding in findings] == [ + (path, "GitHub-owned integration contract has no invoking job") + ] + allowlist: Final = coverage.Allowlist( + test_paths=(coverage.AllowEntry(paths=(path,), reason="ran only in CircleCI, removed"),), dockerfiles=() ) - assert paths == ("tests/integration/database/test_roi_observed.py",) - assert set(paths) <= coverage._invoked_test_tokens(coverage._all_scalars()) + allowed_paths, allowed_findings = coverage._integration_ownership(tmp_path, allowlist=allowlist) + assert path not in allowed_paths + assert allowed_findings == () + (tmp_path / ".github/workflows/test-unit.yml").write_text( + yaml.safe_dump({"jobs": {"tests": {"steps": [{"run": f"pytest {path}"}]}}}) + ) + _, wrong_owner = coverage._integration_ownership(tmp_path, allowlist=allowlist) + assert [(finding.subject, finding.detail) for finding in wrong_owner] == [ + (path, "GitHub-owned integration contract runs outside a dedicated integration workflow") + ] def test_an_ancestor_directory_covers_a_file_but_does_not_name_it(): @@ -335,6 +343,32 @@ def test_a_file_its_only_shard_ignores_is_not_covered_by_that_shards_glob() -> N assert selection.covers("tests/unit/proxy/test_update_spend.py") is False +def test_a_deselected_file_is_treated_like_an_ignored_one() -> None: + # --ignore is a no-op for a file the shell glob already expanded, --deselect is what drops it + scalars: Final = ( + coverage.Scalar( + key="test-path", + value="tests/unit/proxy/test_[q-z]*.py\n--deselect=tests/unit/proxy/test_update_spend.py", + ), + ) + assert coverage._invoked_test_tokens(scalars) == frozenset({"tests/unit/proxy/test_[q-z]*.py"}) + (selection,) = coverage._invoked_selections(scalars) + assert selection.covers("tests/unit/proxy/test_route_llm_request.py") is True + assert selection.covers("tests/unit/proxy/test_update_spend.py") is False + + +def test_a_character_class_glob_in_a_test_path_is_one_token_that_names_only_its_letters() -> None: + (selection,) = coverage._invoked_selections( + (coverage.Scalar(key="test-path", value="tests/unit/proxy/test_[_a-p]*.py"),) + ) + assert selection.included == frozenset({"tests/unit/proxy/test_[_a-p]*.py"}) + assert selection.covers("tests/unit/proxy/test__types.py") is True + assert selection.covers("tests/unit/proxy/test_caching_routes.py") is True + assert selection.covers("tests/unit/proxy/test_route_llm_request.py") is False + assert coverage._token_names("tests/unit/proxy/test_[_a-p]*.py", "tests/unit/proxy/test_admin_mcp.py") is True + assert coverage._token_names("tests/unit/proxy/test_[_a-p]*.py", "tests/unit/proxy/test_route_llm_request.py") is False + + def test_check_shards_passes_on_the_repo_as_it_stands(capsys): assert coverage._check_shards() == 0 @@ -419,7 +453,7 @@ def test_an_excluded_term_matching_only_an_inner_name_leaves_the_file_claimed(): assert slice_.claims("tests/x/test_router.py", frozenset({"test_cache_key"})) is True -def test_character_class_globs_match_the_letter_shards_circleci_uses(): +def test_character_class_globs_match_letter_shards(): # tests/local_testing is split by first letter; without character-class support every # file in it looks unglobbed, and the slice guard would report the whole directory. glob = "tests/local_testing/**/test_[a-mA-M]*.py" @@ -509,12 +543,15 @@ def test_a_workflow_that_names_a_file_clears_it_from_the_slice_check(): assert any(coverage._token_covers(token, "tests/unit/proxy/test_proxy_server_custom_logger.py") for token in named) -def test_the_slice_check_credits_only_workflows_never_the_circleci_config(): - named = coverage._workflow_named_tokens() - circleci_only = "tests/proxy_admin_ui_tests" - assert not any(coverage._token_covers(token, f"{circleci_only}/test_key_management.py") for token in named), ( - "a tree only CircleCI globs must not be credited to a workflow" - ) +def test_the_slice_check_ignores_configs_outside_the_workflow_directory( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + workflows: Final = tmp_path / "workflows" + workflows.mkdir() + (workflows / "test.yml").write_text("jobs:\n test:\n steps:\n - run: pytest tests/selected\n") + (tmp_path / "ignored.yml").write_text("jobs:\n test:\n steps:\n - run: pytest tests/unrun\n") + monkeypatch.setattr(coverage, "WORKFLOW_DIR", workflows) + assert coverage._workflow_named_tokens() == frozenset({"tests/selected"}) @pytest.mark.parametrize("selector", ("test_selected.py", "test_selected.py::test_redis_auth")) @@ -527,7 +564,6 @@ def test_a_workflow_does_not_credit_a_file_it_never_names( f"jobs:\n test:\n steps:\n - run: uv run pytest tests/local_testing/{selector}\n" ) monkeypatch.setattr(coverage, "WORKFLOW_DIR", workflows) - monkeypatch.setattr(coverage, "CIRCLECI_CONFIG", tmp_path / "circleci.yml") named: Final = coverage._workflow_named_tokens() assert named == frozenset({"tests/local_testing/test_selected.py"}) @@ -543,16 +579,14 @@ def test_slice_audit_rechecks_changed_and_new_files_between_calls( workflows.mkdir(parents=True) tests: Final = tmp_path / "tests/local_testing" tests.mkdir(parents=True) - circle: Final = tmp_path / ".circleci/config.yml" - circle.parent.mkdir() - circle.write_text( + (workflows / "test.yml").write_text( yaml.safe_dump( { "jobs": { selector: { "steps": [ { - "run": f'circleci tests glob "tests/local_testing/test_*.py" | xargs pytest -k "{selector}"' + "run": f'pytest tests/local_testing/test_*.py -k "{selector}"' } ] } @@ -564,7 +598,6 @@ def test_slice_audit_rechecks_changed_and_new_files_between_calls( monkeypatch.setattr(coverage, "REPO_ROOT", tmp_path) monkeypatch.setattr(coverage, "TESTS_ROOT", tmp_path / "tests") monkeypatch.setattr(coverage, "WORKFLOW_DIR", workflows) - monkeypatch.setattr(coverage, "CIRCLECI_CONFIG", circle) allowlist: Final = coverage.Allowlist((), ()) existing: Final = tests / "test_existing.py" existing.write_text("def test_selected(): pass\n") diff --git a/tests/unit/test_check_type_discipline.py b/tests/unit/test_check_type_discipline.py index abb8c0d6a9f..01dff0a8b13 100644 --- a/tests/unit/test_check_type_discipline.py +++ b/tests/unit/test_check_type_discipline.py @@ -1036,6 +1036,19 @@ def test_worker_count_never_exceeds_the_cap(): assert checker._worker_count(100_000) <= checker.MAX_WORKERS +def test_standalone_scanner_adapter_is_outside_the_package_lint_scope(tmp_path: Path) -> None: + adapter: Final = tmp_path / "litellm" / "proxy" / "discovery_endpoints" / "skill_scanner_adapter" + adapter.mkdir(parents=True) + server: Final = adapter / "server.py" + server.write_text("value = []\n") + proxy: Final = tmp_path / "proxy.py" + proxy.write_text("value = []\n") + + assert tuple(checker.collect_paths([str(tmp_path)])) == (proxy,) + assert tuple(checker.collect_paths([str(server)])) == () + assert checker.scan_paths(tuple(checker.collect_paths([str(tmp_path)]))) + + def test_scan_paths_below_the_threshold_returns_every_violation(tmp_path): paths = _corpus(tmp_path, 3) assert checker._worker_count(len(paths)) == 1 diff --git a/tests/unit/test_circleci_path_filter.py b/tests/unit/test_ci_path_filter.py similarity index 90% rename from tests/unit/test_circleci_path_filter.py rename to tests/unit/test_ci_path_filter.py index 9f695960517..1e110b62434 100644 --- a/tests/unit/test_circleci_path_filter.py +++ b/tests/unit/test_ci_path_filter.py @@ -1,6 +1,6 @@ -"""Regression tests for CircleCI change-based job gating. +"""Regression tests for change-based job gating. -`.circleci/scripts/classify_changes.sh` is the pure decision function behind +`.github/scripts/ci/classify_changes.sh` is the pure decision function behind `path_filter.sh`: given the list of files a PR changed (on stdin) and a job category, it prints `run` or `skip`. The gating contract we lock in here: @@ -24,7 +24,7 @@ from pathlib import Path import pytest -SCRIPTS_DIR = Path(__file__).resolve().parents[2] / ".circleci" / "scripts" +SCRIPTS_DIR = Path(__file__).resolve().parents[2] / ".github" / "scripts" / "ci" SCRIPT = SCRIPTS_DIR / "classify_changes.sh" PATH_FILTER = SCRIPTS_DIR / "path_filter.sh" @@ -56,7 +56,7 @@ CI = [".github/workflows/test-unit.yml"] ("mcp-dependencies", ["litellm-proxy-extras/pyproject.toml"], "run"), ("mcp-dependencies", ["scripts/check_mcp_sdk_install.py"], "run"), ("mcp-dependencies", [".github/workflows/test-mcp-dependency-resolution.yml"], "run"), - ("mcp-dependencies", [".circleci/scripts/classify_changes.sh"], "run"), + ("mcp-dependencies", [".github/scripts/ci/classify_changes.sh"], "run"), ("mcp-dependencies", ["litellm/llms/openai/chat/gpt_transformation.py"], "skip"), ("mcp-dependencies", DOCS + CLIENT, "skip"), ("windows-release", ["litellm-rust/crates/inference/src/lib.rs"], "run"), @@ -65,7 +65,7 @@ CI = [".github/workflows/test-unit.yml"] ("windows-release", ["pyproject.toml"], "run"), ("windows-release", ["uv.lock"], "run"), ("windows-release", ["tests/windows_tests/check_windows_wheel_install.py"], "run"), - ("windows-release", [".circleci/config.yml"], "run"), + ("windows-release", [".github/scripts/ci/classify_changes.sh"], "run"), ("windows-release", ["litellm/main.py"], "skip"), ("windows-release", ["tests/unit/test_utils.py"], "skip"), ("windows-release", ["ui/litellm-dashboard/src/App.tsx"], "skip"), @@ -126,7 +126,7 @@ def test_classify_decisions(category: str, changed: list[str], expected: str) -> (".github/workflows/test-unit.yml", "run"), ("tests/integration/run.py", "run"), ("uv.lock", "run"), - (".circleci/config.yml", "skip"), + (".github/workflows/test-integration.yml", "skip"), ("litellm/router.py", "skip"), ("docs/my-website/redis.md", "skip"), ), @@ -158,7 +158,7 @@ def test_markdown_under_dot_github_is_still_docs() -> None: def test_ui_and_client_diverge_on_a_backend_only_change() -> None: - """`client` gates CircleCI's dashboard end-to-end jobs, which drive a real + """`client` gates the dashboard end-to-end jobs, which drive a real proxy and so must run on backend changes. `ui` gates the dashboard build and its unit tests, which cannot see the backend at all.""" assert classify("client", BACKEND) == "run" @@ -202,16 +202,9 @@ def _pr_repo(tmp_path: Path, feature_files: dict[str, str]) -> Path: def _run_path_filter(work: Path, tmp_path: Path, category: str, scripts_dir: Path, is_pr: bool = True): - bin_dir = tmp_path / "bin" - bin_dir.mkdir(exist_ok=True) - stub = bin_dir / "circleci-agent" - stub.write_text("#!/usr/bin/env bash\necho \"[stub] circleci-agent $*\"\nexit 0\n") - stub.chmod(0o755) env = dict(os.environ) - env["PATH"] = f"{bin_dir}{os.pathsep}{env['PATH']}" - env.pop("CIRCLE_PULL_REQUEST", None) - if is_pr: - env["CIRCLE_PULL_REQUEST"] = "https://github.com/x/y/pull/1" + env["GITHUB_EVENT_NAME"] = "pull_request" if is_pr else "push" + env["GITHUB_OUTPUT"] = str(tmp_path / "output") return subprocess.run( ["bash", str(scripts_dir / "path_filter.sh"), category], cwd=work, @@ -221,11 +214,12 @@ def _run_path_filter(work: Path, tmp_path: Path, category: str, scripts_dir: Pat ) -def test_path_filter_halts_docs_only_pr(tmp_path: Path) -> None: +def test_path_filter_skips_docs_only_pr(tmp_path: Path) -> None: work = _pr_repo(tmp_path, {"README.md": "# docs\n"}) result = _run_path_filter(work, tmp_path, "backend", SCRIPTS_DIR) assert result.returncode == 0 - assert "circleci-agent step halt" in result.stdout + assert "decision=skip" in result.stdout + assert (tmp_path / "output").read_text() == "decision=skip\n" def test_path_filter_runs_backend_pr(tmp_path: Path) -> None: diff --git a/tests/unit/test_circleci_checkout.py b/tests/unit/test_circleci_checkout.py deleted file mode 100644 index 347024838f7..00000000000 --- a/tests/unit/test_circleci_checkout.py +++ /dev/null @@ -1,310 +0,0 @@ -import os -import shutil -import subprocess -from collections.abc import Iterator, Mapping -from dataclasses import dataclass -from pathlib import Path -from typing import Final - -import pytest -import yaml -from pydantic import BaseModel, ConfigDict - -CIRCLECI: Final = Path(__file__).resolve().parents[2] / ".circleci" -CONFIG: Final = CIRCLECI / "config.yml" -PUBLIC_REPO: Final = "https://github.com/BerriAI/litellm.git" -LINUX_SHELL: Final = ("bash", "-eo", "pipefail", "-c") -WINDOWS_SHELL: Final = ("bash", "-c") -PRODUCT_DIRS: Final = ("litellm", "enterprise", "litellm-proxy-extras") - - -class _Run(BaseModel): - model_config = ConfigDict(frozen=True) - command: str - - -class _Step(BaseModel): - model_config = ConfigDict(frozen=True) - run: _Run - - -class _Command(BaseModel): - model_config = ConfigDict(frozen=True) - steps: tuple[_Step] - - -class _Commands(BaseModel): - model_config = ConfigDict(frozen=True) - checkout_over_https: _Command - - -class _NamedRun(BaseModel): - model_config = ConfigDict(frozen=True) - name: str = "" - command: str - - -class _JobStep(BaseModel): - model_config = ConfigDict(frozen=True) - run: _NamedRun | str | None = None - - -class _Job(BaseModel): - model_config = ConfigDict(frozen=True) - steps: tuple[_JobStep | str, ...] - - -class _Jobs(BaseModel): - model_config = ConfigDict(frozen=True) - routing_parity: _Job - - -class _Config(BaseModel): - model_config = ConfigDict(frozen=True) - commands: _Commands - jobs: _Jobs - - -class _TraceEvent(BaseModel): - model_config = ConfigDict(frozen=True) - event: str - name: str = "" - - -@dataclass(frozen=True, slots=True) -class _Upstream: - url: str - older: str - newer: str - - -def _step_name(step: object) -> str: - if isinstance(step, str): - return step - if isinstance(step, dict) and len(step) == 1: - return str(next(iter(step))) - return "" - - -def _step_names(node: object) -> Iterator[str]: - if isinstance(node, dict): - for key, value in node.items(): - if key in ("steps", "pre-steps", "post-steps") and isinstance(value, list): - yield from map(_step_name, value) - yield from _step_names(value) - if isinstance(node, list): - for item in node: - yield from _step_names(item) - - -def _config() -> _Config: - return _Config.model_validate(yaml.safe_load(CONFIG.read_text())) - - -def _routing_parity_step(name: str) -> str: - return next( - step.run.command - for step in _config().jobs.routing_parity.steps - if isinstance(step, _JobStep) and isinstance(step.run, _NamedRun) and step.run.name == name - ) - - -def _fetches(trace: Path) -> int: - events: Final = tuple(map(_TraceEvent.model_validate_json, trace.read_text().splitlines())) - return sum(event.event == "cmd_name" and event.name == "fetch" for event in events) - - -def _git(cwd: Path, *args: str) -> str: - return subprocess.run(["git", *args], cwd=cwd, check=True, capture_output=True, text=True).stdout.strip() - - -def _commit(work: Path, files: Mapping[str, str], message: str) -> str: - for name, content in files.items(): - (work / name).parent.mkdir(parents=True, exist_ok=True) - (work / name).write_text(content) - _git(work, "add", "-A") - _git(work, "commit", "-q", "--allow-empty", "-m", message) - return _git(work, "rev-parse", "HEAD") - - -def _new_upstream(tmp_path: Path) -> tuple[Path, Path]: - remote: Final = tmp_path / "remote.git" - work: Final = tmp_path / "work" - work.mkdir() - _git(tmp_path, "init", "-q", "--bare", str(remote)) - _git(remote, "config", "uploadpack.allowFilter", "true") - _git(work, "init", "-q", "-b", "main") - _git(work, "config", "user.email", "t@t") - _git(work, "config", "user.name", "t") - return remote, work - - -def _publish_two_commits(tmp_path: Path) -> _Upstream: - remote, work = _new_upstream(tmp_path) - older: Final = _commit(work, {"app.py": "x = 1\n"}, "pipeline commit") - newer: Final = _commit(work, {"app.py": "x = 2\n"}, "main moved on") - _git(work, "push", "-q", str(remote), "main") - return _Upstream(url=remote.as_uri(), older=older, newer=newer) - - -def _publish_docs_only_pr(tmp_path: Path) -> _Upstream: - remote, work = _new_upstream(tmp_path) - main: Final = _commit(work, {"litellm_inference.py": "x\n"}, "base") - _git(work, "checkout", "-q", "-b", "litellm_feature") - head: Final = _commit(work, {"README.md": "# docs\n"}, "docs") - _git(work, "push", "-q", str(remote), "main", "litellm_feature") - return _Upstream(url=remote.as_uri(), older=main, newer=head) - - -def _product(version: str) -> dict[str, str]: - return {f"{directory}/code.py": f"{version} {directory}\n" for directory in PRODUCT_DIRS} - - -def _publish_parity_base(tmp_path: Path, base_on_main: bool) -> _Upstream: - remote, work = _new_upstream(tmp_path) - fork_point: Final = _commit(work, _product("fork point"), "fork point") - base: Final = _commit(work, _product("base"), "release") - _git(work, "branch", "-q", "stable") - _git(work, "reset", "-q", "--hard", base if base_on_main else fork_point) - head: Final = _commit(work, _product("head"), "pipeline commit") - _git(work, "push", "-q", str(remote), "main", "stable") - return _Upstream(url=remote.as_uri(), older=base, newer=head) - - -def _stub(bin_dir: Path, name: str, script: str) -> None: - bin_dir.mkdir(exist_ok=True) - (bin_dir / name).write_text(f"#!/usr/bin/env bash\n{script}\n") - (bin_dir / name).chmod(0o755) - - -def _job_env(tmp_path: Path, upstream: _Upstream) -> dict[str, str]: - return { - "PATH": f"{tmp_path / 'bin'}{os.pathsep}{os.environ['PATH']}", - "HOME": str(tmp_path), - "GIT_CONFIG_NOSYSTEM": "1", - "GIT_TERMINAL_PROMPT": "0", - "GIT_SSH_COMMAND": "false", - "GIT_CONFIG_COUNT": "1", - "GIT_CONFIG_KEY_0": f"url.{upstream.url}.insteadOf", - "GIT_CONFIG_VALUE_0": PUBLIC_REPO, - } - - -def _run_checkout( - tmp_path: Path, - upstream: _Upstream, - revisions: Mapping[str, str], - shell: tuple[str, ...] = LINUX_SHELL, -) -> subprocess.CompletedProcess[str]: - job: Final = tmp_path / "job" - job.mkdir() - command: Final = _config().commands.checkout_over_https - return subprocess.run( - [*shell, command.steps[0].run.command], - cwd=job, - env={**_job_env(tmp_path, upstream), **revisions}, - capture_output=True, - text=True, - ) - - -def test_every_clone_goes_over_https_so_no_job_needs_the_ssh_checkout_key() -> None: - names: Final = tuple(_step_names(yaml.safe_load(CONFIG.read_text()))) - assert "checkout_over_https" in names - assert "checkout" not in names - - -@pytest.mark.parametrize( - "revisions", - ( - {"CIRCLE_SHA1": "older"}, - {"CIRCLE_SHA1": "older", "REQUESTED_REVISION": ""}, - {"CIRCLE_SHA1": "newer", "REQUESTED_REVISION": "older"}, - ), -) -def test_a_job_checks_out_its_own_commit_from_the_public_https_url_after_main_moves( - tmp_path: Path, revisions: Mapping[str, str] -) -> None: - upstream: Final = _publish_two_commits(tmp_path) - shas: Final = {"older": upstream.older, "newer": upstream.newer, "": ""} - result: Final = _run_checkout(tmp_path, upstream, {name: shas[value] for name, value in revisions.items()}) - assert result.returncode == 0, result.stderr - assert _git(tmp_path / "job", "rev-parse", "HEAD") == upstream.older - - -@pytest.mark.parametrize("shell", (LINUX_SHELL, WINDOWS_SHELL), ids=("linux", "windows-bash-exe")) -def test_a_revision_that_is_not_a_full_sha_is_refused_before_git_runs(tmp_path: Path, shell: tuple[str, ...]) -> None: - upstream: Final = _publish_two_commits(tmp_path) - result: Final = _run_checkout( - tmp_path, upstream, {"CIRCLE_SHA1": upstream.newer, "REQUESTED_REVISION": "main"}, shell - ) - assert result.returncode != 0 - assert not (tmp_path / "job" / ".git").exists() - - -def test_a_docs_only_pr_job_still_skips_backend_work_after_the_checkout(tmp_path: Path) -> None: - upstream: Final = _publish_docs_only_pr(tmp_path) - _stub(tmp_path / "bin", "circleci-agent", 'echo "circleci-agent $*"') - checkout: Final = _run_checkout(tmp_path, upstream, {"CIRCLE_SHA1": upstream.newer}) - assert checkout.returncode == 0, checkout.stderr - path_filter: Final = subprocess.run( - ["bash", str(CIRCLECI / "scripts" / "path_filter.sh"), "backend"], - cwd=tmp_path / "job", - env={**_job_env(tmp_path, upstream), "CIRCLE_PULL_REQUEST": "https://github.com/BerriAI/litellm/pull/1"}, - capture_output=True, - text=True, - ) - assert path_filter.returncode == 0, path_filter.stderr - assert "circleci-agent step halt" in path_filter.stdout - - -@pytest.mark.parametrize("shell", (LINUX_SHELL, WINDOWS_SHELL), ids=("linux", "windows-bash-exe")) -@pytest.mark.parametrize( - ("failing_step", "failures", "checkouts", "checked_out"), - (("fetch", 2, 1, True), ("fetch", 3, 0, False), ("checkout", 2, 3, True), ("checkout", 3, 3, False)), -) -def test_a_failed_fetch_or_blob_download_is_retried_and_the_step_stops_on_its_error_once_retries_run_out( - tmp_path: Path, shell: tuple[str, ...], failing_step: str, failures: int, checkouts: int, checked_out: bool -) -> None: - upstream: Final = _publish_two_commits(tmp_path) - calls: Final = tmp_path / "calls" - _stub(tmp_path / "bin", "sleep", f'echo sleep >> "{calls}"') - _stub( - tmp_path / "bin", - "git", - f'''echo "$1" >> "{calls}" -if [ "$1" = {failing_step} ] && [ "$(grep -c '^{failing_step}$' "{calls}")" -le {failures} ]; then exit 128; fi -exec "{shutil.which("git")}" "$@"''', - ) - result: Final = _run_checkout(tmp_path, upstream, {"CIRCLE_SHA1": upstream.older}, shell) - assert (result.returncode == 0) is checked_out, result.stderr - steps: Final = calls.read_text().splitlines() - assert steps.count("fetch") == min(failures + 1, 3) - assert steps.count("sleep") == steps.count("fetch") - 1 - assert steps.count("checkout") == checkouts - head: Final = subprocess.run(["git", "rev-parse", "HEAD"], cwd=tmp_path / "job", capture_output=True, text=True) - assert (head.stdout.strip() == upstream.older) is checked_out - - -@pytest.mark.parametrize("base_on_main", (True, False), ids=("main-commit", "release-branch-commit")) -def test_routing_parity_downloads_the_base_files_in_one_fetch_instead_of_one_per_missing_file( - tmp_path: Path, base_on_main: bool -) -> None: - upstream: Final = _publish_parity_base(tmp_path, base_on_main) - checkout: Final = _run_checkout(tmp_path, upstream, {"CIRCLE_SHA1": upstream.newer}) - assert checkout.returncode == 0, checkout.stderr - job: Final = tmp_path / "job" - (job / "litellm" / "rust_bridge").mkdir() - (job / "litellm" / "rust_bridge" / "_native.abi3.so").write_text("built for this job\n") - trace: Final = tmp_path / "trace.json" - result: Final = subprocess.run( - [*LINUX_SHELL, _routing_parity_step("Check out base product code")], - cwd=job, - env={**_job_env(tmp_path, upstream), "ROUTING_PARITY_BASE": upstream.older, "GIT_TRACE2_EVENT": str(trace)}, - capture_output=True, - text=True, - ) - assert result.returncode == 0, result.stderr - assert tuple((job / name).read_text() for name in _product("base")) == tuple(_product("base").values()) - assert _fetches(trace) == 1 - assert _git(job, "rev-parse", "HEAD") == upstream.newer diff --git a/tests/unit/test_circleci_run_migration_tests.py b/tests/unit/test_circleci_run_migration_tests.py deleted file mode 100644 index 30fe7383c07..00000000000 --- a/tests/unit/test_circleci_run_migration_tests.py +++ /dev/null @@ -1,36 +0,0 @@ -import importlib.util -from pathlib import Path -from typing import Final - -import pytest - -SCRIPT: Final = Path(__file__).resolve().parents[2] / ".circleci/scripts/run_migration_tests.py" -SPEC: Final = importlib.util.spec_from_file_location("migration_ci", SCRIPT) -assert SPEC is not None and SPEC.loader is not None -MODULE: Final = importlib.util.module_from_spec(SPEC) -SPEC.loader.exec_module(MODULE) - - -@pytest.mark.parametrize( - "xml,expected,exit_code,passed", - ( - ('', 2, 0, True), - ('', 2, 0, False), - ("", 1, 0, False), - ("", 1, 0, False), - ("", 1, 0, False), - ("", 1, 1, False), - ("", 1, 5, False), - ("", 1, 0, False), - ("', 2, 0, False), - ), -) -def test_only_a_complete_passing_suite_can_certify_an_image( - tmp_path: Path, xml: str | None, expected: int, exit_code: int, passed: bool -) -> None: - path: Final = tmp_path / "results.xml" - if xml is not None: - path.write_text(xml) - assert MODULE.successful_junit(path, expected, exit_code) is passed diff --git a/tests/unit/test_circleci_rust_toolchain.py b/tests/unit/test_circleci_rust_toolchain.py deleted file mode 100644 index 562fb5db032..00000000000 --- a/tests/unit/test_circleci_rust_toolchain.py +++ /dev/null @@ -1,177 +0,0 @@ -"""Static guardrails for how CircleCI provisions Rust. - -The root package builds `litellm-rust` through maturin, so any job that runs -`uv sync` or `uv build` compiles the bridge. The `cimg/python` images ship no -Rust toolchain, and when cargo is missing maturin's `puccinialin` helper -quietly provisions one itself: it fetches `rustup-init` from the unversioned -`https://static.rust-lang.org/rustup/dist//` path with no checksum and -installs a floating `stable` toolchain. uv suppresses build-backend output on a -successful sync, so that happens with nothing in the job log to show for it, -and the compiler a job builds with changes whenever upstream publishes. - -Two invariants are pinned here: - - 1. No step list (job or reusable command) reaches a `uv sync` / `uv build` - without a Rust toolchain already provisioned ahead of it. That is the - `install_rust` command on Linux and `install_windows_toolchain` on Windows, - so the check accepts any command or step that installs a pinned rustup. A new job that syncs without one - falls back to the unpinned path, which is exactly the regression a static - check catches at PR time and a green CI run does not. - 2. Both installers pin what they download: an explicit rustup version, a - verified SHA-256, and the exact toolchain in `rust-toolchain.toml`. -""" - -from __future__ import annotations - -import re -from pathlib import Path -from typing import Final - -import pytest -import yaml - -REPO_ROOT = Path(__file__).resolve().parents[2] -CONFIG = REPO_ROOT / ".circleci" / "config.yml" -TOOLCHAIN: Final = REPO_ROOT / "rust-toolchain.toml" - -BUILDS_WORKSPACE = re.compile(r"\buv\s+(?:sync|build)\b") -RUSTUP_ARCHIVE_URL = re.compile(r"https://static\.rust-lang\.org/rustup/archive/\d+\.\d+\.\d+/") -EXACT_TOOLCHAIN = re.compile(r"--default-toolchain\s+\"?(\d+\.\d+\.\d+)\"?") -TOOLCHAIN_CHANNEL: Final = re.compile(r'^channel = "(\d+\.\d+\.\d+)"$', re.MULTILINE) - - -def _config() -> dict[str, object]: - return yaml.safe_load(CONFIG.read_text()) - - -def _step_text(step: object) -> str: - """Flatten one step into the shell text it runs, or '' for a command reference.""" - if isinstance(step, dict): - run = step.get("run") - if isinstance(run, str): - return run - if isinstance(run, dict): - command = run.get("command") - return command if isinstance(command, str) else "" - return "" - - -def _pinned_toolchain() -> str: - match: Final = TOOLCHAIN_CHANNEL.search(TOOLCHAIN.read_text()) - assert match is not None, "rust-toolchain.toml must pin an exact channel" - return match.group(1) - - -def _without_comments(text: str) -> str: - return "\n".join(line for line in text.splitlines() if not line.lstrip().startswith("#")) - - -def _installs_pinned_rustup(step: object) -> bool: - text = _step_text(step) - return "rustup-init" in text and ("sha256sum" in text or "SHA256" in text) - - -def _provisioning_commands() -> frozenset[str]: - return frozenset( - name.removeprefix("command ") - for name, steps in _step_lists().items() - if name.startswith("command ") and any(_installs_pinned_rustup(step) for step in steps) - ) - - -def _provisions_rust(step: object, provisioning_commands: frozenset[str]) -> bool: - return (isinstance(step, str) and step in provisioning_commands) or _installs_pinned_rustup(step) - - -def _step_lists() -> dict[str, list[object]]: - config = _config() - lists: dict[str, list[object]] = {} - for kind in ("jobs", "commands"): - section = config.get(kind) - if not isinstance(section, dict): - continue - for name, body in section.items(): - steps = body.get("steps") if isinstance(body, dict) else None - if isinstance(steps, list): - lists[f"{kind[:-1]} {name}"] = steps - return lists - - -def _first_unprovisioned_build(steps: list[object], provisioning_commands: frozenset[str]) -> str | None: - """Return the shell text of the first workspace build reached without Rust, if any.""" - rust_ready = False - for step in steps: - if _provisions_rust(step, provisioning_commands): - rust_ready = True - text = _step_text(step) - if BUILDS_WORKSPACE.search(_without_comments(text)) and not rust_ready: - return text - return None - - -def test_step_lists_exist() -> None: - lists = _step_lists() - assert "command install_rust" in lists - building = { - name - for name, steps in lists.items() - if any(BUILDS_WORKSPACE.search(_without_comments(_step_text(s))) for s in steps) - } - assert "command setup_litellm_test_deps" in building, f"found {sorted(building)}" - - -def test_no_workspace_build_without_a_provisioned_rust_toolchain() -> None: - provisioning_commands: Final = _provisioning_commands() - assert {"install_rust", "install_windows_toolchain"} <= provisioning_commands - offenders = { - name: build - for name, steps in _step_lists().items() - if (build := _first_unprovisioned_build(steps, provisioning_commands)) is not None - } - assert not offenders, ( - "these CircleCI step lists run `uv sync`/`uv build` with no Rust toolchain provisioned first, " - "so maturin will download an unpinned rustup and a floating toolchain instead: " - f"{ {name: build.strip().splitlines()[0] for name, build in offenders.items()} }" - ) - - -@pytest.fixture(name="install_rust_command") -def _install_rust_command() -> str: - steps = _step_lists()["command install_rust"] - return "\n".join(_step_text(step) for step in steps) - - -def test_install_rust_pins_the_rustup_version_in_the_url(install_rust_command: str) -> None: - assert RUSTUP_ARCHIVE_URL.search(install_rust_command), ( - "install_rust must download rustup-init from a version-pinned /rustup/archive// URL; " - "the /rustup/dist/ path always serves whatever rustup is current" - ) - assert "/rustup/dist/" not in install_rust_command - - -def test_install_rust_verifies_the_installer_checksum(install_rust_command: str) -> None: - assert "sha256sum -c" in install_rust_command - assert re.search(r"RUSTUP_SHA256=[0-9a-f]{64}\b", install_rust_command), ( - "install_rust must compare the downloaded installer against a hardcoded SHA-256 " - "taken from rust-lang's published .sha256 sidecar" - ) - checksum_index = install_rust_command.index("sha256sum -c") - execute_index = install_rust_command.index("/tmp/rustup-init -y") - assert checksum_index < execute_index, "the checksum must be verified before the installer is executed" - - -def test_install_rust_pins_an_exact_toolchain_version(install_rust_command: str) -> None: - match: Final = EXACT_TOOLCHAIN.search(install_rust_command) - assert match is not None, ( - "install_rust must pin an exact toolchain version (e.g. 1.98.0); a channel name like " - "stable/beta/nightly makes the compiler drift with whatever upstream published that day" - ) - assert match.group(1) == _pinned_toolchain() - - -def test_windows_installer_matches_the_repo_toolchain() -> None: - windows_steps: Final = _step_lists()["command install_windows_toolchain"] - windows_command: Final = "\n".join(_step_text(step) for step in windows_steps) - match: Final = EXACT_TOOLCHAIN.search(windows_command) - assert match is not None - assert match.group(1) == _pinned_toolchain() diff --git a/tests/unit/test_cost_calculator.py b/tests/unit/test_cost_calculator.py index ad1e15330d2..71efa1352e4 100644 --- a/tests/unit/test_cost_calculator.py +++ b/tests/unit/test_cost_calculator.py @@ -11900,3 +11900,39 @@ def test_per_call_custom_prices_keep_the_regional_and_speed_multipliers( ) assert response._hidden_params["response_cost"] == pytest.approx((1000 * 2e-06 + 1000 * 4e-06) * multiplier) + + +@pytest.mark.parametrize( + ("message_logging_off", "query_image", "echoes_response"), + [ + (True, None, False), + (False, None, True), + (False, {"type": "base64", "media_type": "image/jpeg", "data": "cXVlcnk="}, False), + ], +) +def test_cost_failure_for_an_unpriced_response_echoes_only_a_text_search_response_with_message_logging_on( + message_logging_off: bool, + query_image: Mapping[str, str] | None, + echoes_response: bool, + monkeypatch: pytest.MonkeyPatch, +) -> None: + monkeypatch.setattr(litellm, "turn_off_message_logging", message_logging_off) + image_data: Final = "c2VjcmV0LWltYWdlLWJ5dGVz" + logging_obj: Final = Logging( + model="", + messages=[], + stream=False, + call_type="avector_store_search", + start_time=datetime.datetime.now(), + litellm_call_id="unpriced-search", + function_id="f", + ) + logging_obj.model_call_details["query_image"] = query_image + + with pytest.raises(ValueError, match="Model is None") as exc_info: + completion_cost( + completion_response={"data": [{"content": [{"source": {"data": image_data}}]}]}, + litellm_logging_obj=logging_obj, + ) + + assert (image_data in str(exc_info.value)) is echoes_response diff --git a/tests/unit/test_cost_map_guard.py b/tests/unit/test_cost_map_guard.py index 2602149b623..ae3f2f6caa0 100644 --- a/tests/unit/test_cost_map_guard.py +++ b/tests/unit/test_cost_map_guard.py @@ -355,6 +355,35 @@ def test_checked_in_pins_hold_in_the_checked_in_cost_map() -> None: assert guard.pin_failures(pins, cost_map) == () +@pytest.mark.parametrize("pins_path", guard.PINS_PATHS) +@pytest.mark.parametrize("pins", (PINS, "", "not JSON")) +def test_relocated_pins_keep_the_same_validation(pins_path: str, pins: str) -> None: + cost_map: Final = _serialize(BASE_MAP) + blobs: Final = { + f"base:{guard.COST_MAP_PATH}": cost_map, + f"base:{guard.BACKUP_PATH}": cost_map, + f"head:{guard.COST_MAP_PATH}": cost_map, + f"head:{guard.BACKUP_PATH}": cost_map, + f"base:{guard.PINS_PATH}": PINS, + f"head:{pins_path}": pins, + } + + def read_git(_operation: str, blob: str) -> str | None: + return blobs.get(blob) + + base: Final = guard.snapshot("base", read_git=read_git) + head: Final = guard.snapshot("head", read_git=read_git) + assert base == _snapshot(BASE_MAP, pins=PINS) + assert head == _snapshot(BASE_MAP, pins=pins) + failures: Final = _failures(head, changed_files=(guard.PINS_PATH, pins_path), bot=False, base=base) + assert bool(failures) is (pins != PINS), failures + + +@pytest.mark.parametrize("pins_path", guard.PINS_PATHS) +def test_relocated_pins_cannot_be_changed_by_bots(pins_path: str) -> None: + assert guard.pin_author_failures("litellm_fix_pricing", "Bot", (pins_path,)) == (BOT_AUTHOR_PIN_FAILURE,) + + def _commit(repo: Path, cost_map: dict[str, object], message: str, pins: str | None = None) -> str: text = _serialize(cost_map) pins_file = repo / guard.PINS_PATH diff --git a/tests/unit/test_detect_changes.py b/tests/unit/test_detect_changes.py index 44a4bfdf448..8f41d6498f0 100644 --- a/tests/unit/test_detect_changes.py +++ b/tests/unit/test_detect_changes.py @@ -21,7 +21,7 @@ from pathlib import Path REPO_ROOT = Path(__file__).resolve().parents[2] SCRIPT = REPO_ROOT / ".github" / "scripts" / "detect_changes.sh" -CLASSIFIER = REPO_ROOT / ".circleci" / "scripts" / "classify_changes.sh" +CLASSIFIER = REPO_ROOT / ".github" / "scripts" / "ci" / "classify_changes.sh" UI_FILE = "ui/litellm-dashboard/src/components/Teams.tsx" BACKEND_FILE = "litellm/proxy/proxy_server.py" @@ -65,9 +65,9 @@ def _scripts_tree(tmp_path: Path, classifier_body: str | None = None) -> Path: """Copy the scripts into a throwaway tree, preserving their relative layout.""" root = tmp_path / "tree" (root / ".github" / "scripts").mkdir(parents=True) - (root / ".circleci" / "scripts").mkdir(parents=True) + (root / ".github" / "scripts" / "ci").mkdir(parents=True) shutil.copy(SCRIPT, root / ".github" / "scripts" / SCRIPT.name) - target = root / ".circleci" / "scripts" / CLASSIFIER.name + target = root / ".github" / "scripts" / "ci" / CLASSIFIER.name if classifier_body is None: shutil.copy(CLASSIFIER, target) else: diff --git a/tests/unit/test_main.py b/tests/unit/test_main.py index 97df9cdbfbf..ddecf43de91 100644 --- a/tests/unit/test_main.py +++ b/tests/unit/test_main.py @@ -52,6 +52,7 @@ from litellm.types.utils import ( Delta, ModelResponseStream, StandardCallbackDynamicParams, + StandardLoggingPayload, StreamingChoices, TextCompletionResponse, Usage, @@ -103,6 +104,63 @@ def preserve_litellm_completion_state(monkeypatch: pytest.MonkeyPatch) -> None: WHITE_PNG: Final = (Path(__file__).parents[1] / "white_100x100.png").read_bytes() +@pytest.mark.asyncio +@pytest.mark.parametrize("mode", ["image_generation", "embedding"]) +@pytest.mark.parametrize("deployment_id", [None, "health-deployment"]) +async def test_health_check_logs_the_same_cost_and_deployment_as_normal_calls( + mode: str, deployment_id: str | None, monkeypatch: pytest.MonkeyPatch +) -> None: + events: Final[asyncio.Queue[StandardLoggingPayload]] = asyncio.Queue() + monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) + monkeypatch.setitem( + litellm.model_cost, + "standard/1024-x-1024/health-image", + {"input_cost_per_image": 0.25, "litellm_provider": "openai", "mode": "image_generation"}, + ) + + class SpendCapture(CustomLogger): + async def async_log_success_event( + self, kwargs: dict[str, object], response_obj: object, start_time: datetime, end_time: datetime + ) -> None: + events.put_nowait(TypeAdapter(StandardLoggingPayload).validate_python(kwargs["standard_logging_object"])) + + monkeypatch.setattr(litellm, "_async_success_callback", [SpendCapture()]) + model: Final = "openai/health-image" if mode == "image_generation" else "openai/text-embedding-3-small" + payload: Final = ( + {"created": 1, "data": [{"url": "https://example.com/image.png"}]} + if mode == "image_generation" + else { + "object": "list", + "data": [{"object": "embedding", "embedding": [0.1], "index": 0}], + "model": "text-embedding-3-small", + "usage": {"prompt_tokens": 10, "total_tokens": 10}, + } + ) + params: Final = { + "model": model, + "api_base": "https://health-test.example/v1", + "api_key": "test-key", + **({"model_info": {"id": deployment_id}} if deployment_id else {}), + **({"size": "1024x1024", "quality": "standard", "n": 1} if mode == "image_generation" else {}), + } + with respx.mock: + respx.post(url__regex=r"https://health-test.example/v1/.*").mock(return_value=httpx.Response(200, json=payload)) + if mode == "image_generation": + await litellm.aimage_generation(**params, prompt="test") + else: + await litellm.aembedding(**params, input=["test"]) + normal: Final = await asyncio.wait_for(events.get(), timeout=10) + result: Final = await litellm.ahealth_check(model_params=params.copy(), mode=mode, prompt="test") + assert "error" not in result, result + health: Final = await asyncio.wait_for(events.get(), timeout=10) + + assert health["call_type"] == normal["call_type"] + assert health["model"] == normal["model"] + assert health["response_cost"] == normal["response_cost"] + assert health["response_cost"] > 0 + assert health["model_id"] == (deployment_id or "") + + @pytest.mark.parametrize("asynchronous", [False, True]) @pytest.mark.parametrize("stream", [False, True]) @pytest.mark.parametrize( diff --git a/tests/unit/test_private_usage_aliases.py b/tests/unit/test_private_usage_aliases.py index 6ceea94d843..44b5876a078 100644 --- a/tests/unit/test_private_usage_aliases.py +++ b/tests/unit/test_private_usage_aliases.py @@ -1223,6 +1223,13 @@ ALIAS_CASES: Final = ( False, ), ("litellm.caching.caching_handler", "LLMCachingHandler", "_async_get_cache", "async_get_cache", False), + ( + "litellm.caching.caching_handler", + "LLMCachingHandler", + "_async_log_cache_hit_on_callbacks", + "async_log_cache_hit_on_callbacks", + False, + ), ( "litellm.caching.caching_handler", "LLMCachingHandler", @@ -1957,7 +1964,13 @@ ALIAS_CASES: Final = ( "get_tags_from_request_kwargs", False, ), - ("litellm.litellm_core_utils.add_retry_fallback_headers", "HiddenParamsAsyncIteratorWrapper", "_inner", "inner", True), + ( + "litellm.litellm_core_utils.add_retry_fallback_headers", + "HiddenParamsAsyncIteratorWrapper", + "_inner", + "inner", + True, + ), ("litellm.litellm_core_utils.add_retry_fallback_headers", "", "_HiddenParamsHost", "HiddenParamsHost", False), ( "litellm.litellm_core_utils.batch_utils", @@ -2301,1837 +2314,1837 @@ LLMS_ALIAS_CASES: Final = ( ) PROXY_ALIAS_CASES: Final = ( ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - '', - '_is_mcp_admitted_user_subject', - 'is_mcp_admitted_user_subject', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "", + "_is_mcp_admitted_user_subject", + "is_mcp_admitted_user_subject", False, ), ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - 'MCPRequestHandler', - '_get_mcp_auth_header_from_headers', - 'get_mcp_auth_header_from_headers', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "MCPRequestHandler", + "_get_mcp_auth_header_from_headers", + "get_mcp_auth_header_from_headers", False, ), ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - 'MCPRequestHandler', - '_get_mcp_server_auth_headers_from_headers', - 'get_mcp_server_auth_headers_from_headers', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "MCPRequestHandler", + "_get_mcp_server_auth_headers_from_headers", + "get_mcp_server_auth_headers_from_headers", False, ), ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - 'MCPRequestHandler', - '_get_mcp_servers_from_access_groups', - 'get_mcp_servers_from_access_groups', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "MCPRequestHandler", + "_get_mcp_servers_from_access_groups", + "get_mcp_servers_from_access_groups", False, ), ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - 'MCPRequestHandler', - '_get_oauth2_headers_from_headers', - 'get_oauth2_headers_from_headers', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "MCPRequestHandler", + "_get_oauth2_headers_from_headers", + "get_oauth2_headers_from_headers", False, ), ( - 'litellm.proxy.mcp_server.auth.user_api_key_auth_mcp', - 'MCPRequestHandler', - '_safe_get_headers_from_scope', - 'safe_get_headers_from_scope', + "litellm.proxy.mcp_server.auth.user_api_key_auth_mcp", + "MCPRequestHandler", + "_safe_get_headers_from_scope", + "safe_get_headers_from_scope", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_bridge_mint_error_response', - 'bridge_mint_error_response', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_bridge_mint_error_response", + "bridge_mint_error_response", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_extract_user_id_from_request', - 'extract_user_id_from_request', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_extract_user_id_from_request", + "extract_user_id_from_request", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_finish_bridge_mint', - 'finish_bridge_mint', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_finish_bridge_mint", + "finish_bridge_mint", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_prepare_bridge_mint', - 'prepare_bridge_mint', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_prepare_bridge_mint", + "prepare_bridge_mint", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_prepare_bridge_refresh', - 'prepare_bridge_refresh', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_prepare_bridge_refresh", + "prepare_bridge_refresh", False, ), ( - 'litellm.proxy.mcp_server.bridge_token_flow', - '', - '_reload_active_user_by_id', - 'reload_active_user_by_id', + "litellm.proxy.mcp_server.bridge_token_flow", + "", + "_reload_active_user_by_id", + "reload_active_user_by_id", False, ), ( - 'litellm.proxy.mcp_server.byok_oauth_endpoints', - '', - '_user_id_from_session_cookie', - 'user_id_from_session_cookie', + "litellm.proxy.mcp_server.byok_oauth_endpoints", + "", + "_user_id_from_session_cookie", + "user_id_from_session_cookie", False, ), ( - 'litellm.proxy.mcp_server.db', - '', - '_decode_oauth_payload', - 'decode_oauth_payload', + "litellm.proxy.mcp_server.db", + "", + "_decode_oauth_payload", + "decode_oauth_payload", False, ), ( - 'litellm.proxy.mcp_server.discoverable_endpoints', - '', - '_raise_if_not_oauth2', - 'raise_if_not_oauth2', + "litellm.proxy.mcp_server.discoverable_endpoints", + "", + "_raise_if_not_oauth2", + "raise_if_not_oauth2", False, ), ( - 'litellm.proxy.mcp_server.mcp_context', - '', - '_mcp_active_toolset_id', - 'mcp_active_toolset_id', + "litellm.proxy.mcp_server.mcp_context", + "", + "_mcp_active_toolset_id", + "mcp_active_toolset_id", False, ), ( - 'litellm.proxy.mcp_server.mcp_context', - '', - '_mcp_gateway_initialize_instructions', - 'mcp_gateway_initialize_instructions', + "litellm.proxy.mcp_server.mcp_context", + "", + "_mcp_gateway_initialize_instructions", + "mcp_gateway_initialize_instructions", False, ), ( - 'litellm.proxy.mcp_server.mcp_context', - '', - '_mcp_gateway_server_name', - 'mcp_gateway_server_name', + "litellm.proxy.mcp_server.mcp_context", + "", + "_mcp_gateway_server_name", + "mcp_gateway_server_name", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - '', - '_UPSTREAM_OAUTH_DISCOVERY_AUTH_TYPES', - 'UPSTREAM_OAUTH_DISCOVERY_AUTH_TYPES', + "litellm.proxy.mcp_server.mcp_server_manager", + "", + "_UPSTREAM_OAUTH_DISCOVERY_AUTH_TYPES", + "UPSTREAM_OAUTH_DISCOVERY_AUTH_TYPES", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - '', - '_caller_authorization_fans_out', - 'caller_authorization_fans_out', + "litellm.proxy.mcp_server.mcp_server_manager", + "", + "_caller_authorization_fans_out", + "caller_authorization_fans_out", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - '', - '_client_forwarded_authorization_headers', - 'client_forwarded_authorization_headers', + "litellm.proxy.mcp_server.mcp_server_manager", + "", + "_client_forwarded_authorization_headers", + "client_forwarded_authorization_headers", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - '', - '_resolve_openapi_tool_auth', - 'resolve_openapi_tool_auth', + "litellm.proxy.mcp_server.mcp_server_manager", + "", + "_resolve_openapi_tool_auth", + "resolve_openapi_tool_auth", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - '', - '_should_strip_caller_authorization', - 'should_strip_caller_authorization', + "litellm.proxy.mcp_server.mcp_server_manager", + "", + "_should_strip_caller_authorization", + "should_strip_caller_authorization", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_build_mcp_server_table', - 'build_mcp_server_table', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_build_mcp_server_table", + "build_mcp_server_table", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_build_stdio_env', - 'build_stdio_env', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_build_stdio_env", + "build_stdio_env", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_create_mcp_client', - 'create_mcp_client', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_create_mcp_client", + "create_mcp_client", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_ensure_upstream_initialize_instructions_cached', - 'ensure_upstream_initialize_instructions_cached', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_ensure_upstream_initialize_instructions_cached", + "ensure_upstream_initialize_instructions_cached", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_extract_subject_token', - 'extract_subject_token', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_extract_subject_token", + "extract_subject_token", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_get_mcp_server_from_tool_name', - 'get_mcp_server_from_tool_name', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_get_mcp_server_from_tool_name", + "get_mcp_server_from_tool_name", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_get_tools_from_server', - 'get_tools_from_server', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_get_tools_from_server", + "get_tools_from_server", False, ), ( - 'litellm.proxy.mcp_server.mcp_server_manager', - 'MCPServerManager', - '_is_server_accessible_from_ip', - 'is_server_accessible_from_ip', + "litellm.proxy.mcp_server.mcp_server_manager", + "MCPServerManager", + "_is_server_accessible_from_ip", + "is_server_accessible_from_ip", False, ), ( - 'litellm.proxy.mcp_server.oauth2_token_cache', - '', - '_compute_per_user_token_ttl', - 'compute_per_user_token_ttl', + "litellm.proxy.mcp_server.oauth2_token_cache", + "", + "_compute_per_user_token_ttl", + "compute_per_user_token_ttl", False, ), ( - 'litellm.proxy.mcp_server.oauth_utils', - '', - '_redact_mcp_resource_url', - 'redact_mcp_resource_url', + "litellm.proxy.mcp_server.oauth_utils", + "", + "_redact_mcp_resource_url", + "redact_mcp_resource_url", False, ), ( - 'litellm.proxy.mcp_server.server', - '', - '_redact_mcp_resource_url', - 'redact_mcp_resource_url', + "litellm.proxy.mcp_server.server", + "", + "_redact_mcp_resource_url", + "redact_mcp_resource_url", False, ), ( - 'litellm.proxy.mcp_server.openapi_to_mcp_generator', - '', - '_OPENAPI_TOOL_NAME_MAX_LEN', - 'OPENAPI_TOOL_NAME_MAX_LEN', + "litellm.proxy.mcp_server.openapi_to_mcp_generator", + "", + "_OPENAPI_TOOL_NAME_MAX_LEN", + "OPENAPI_TOOL_NAME_MAX_LEN", False, ), ( - 'litellm.proxy.mcp_server.openapi_to_mcp_generator', - '', - '_request_auth_header', - 'request_auth_header', + "litellm.proxy.mcp_server.openapi_to_mcp_generator", + "", + "_request_auth_header", + "request_auth_header", False, ), ( - 'litellm.proxy.mcp_server.openapi_to_mcp_generator', - '', - '_request_extra_headers', - 'request_extra_headers', + "litellm.proxy.mcp_server.openapi_to_mcp_generator", + "", + "_request_extra_headers", + "request_extra_headers", False, ), ( - 'litellm.proxy.mcp_server.openapi_to_mcp_generator', - '', - '_request_resolved_auth_headers', - 'request_resolved_auth_headers', + "litellm.proxy.mcp_server.openapi_to_mcp_generator", + "", + "_request_resolved_auth_headers", + "request_resolved_auth_headers", False, ), ( - 'litellm.proxy.mcp_server.semantic_tool_filter', - 'SemanticMCPToolFilter', - '_extract_tool_info', - 'extract_tool_info', + "litellm.proxy.mcp_server.semantic_tool_filter", + "SemanticMCPToolFilter", + "_extract_tool_info", + "extract_tool_info", False, ), ( - 'litellm.proxy.mcp_server.server', - '', - '_apply_toolset_scope', - 'apply_toolset_scope', + "litellm.proxy.mcp_server.server", + "", + "_apply_toolset_scope", + "apply_toolset_scope", False, ), ( - 'litellm.proxy.mcp_server.server_resolution', - 'MCPServerRegistry', - '_build_mcp_server_table', - 'build_mcp_server_table', + "litellm.proxy.mcp_server.server_resolution", + "MCPServerRegistry", + "_build_mcp_server_table", + "build_mcp_server_table", False, ), ( - 'litellm.proxy.mcp_server.server_resolution', - 'MCPServerRegistry', - '_is_server_accessible_from_ip', - 'is_server_accessible_from_ip', + "litellm.proxy.mcp_server.server_resolution", + "MCPServerRegistry", + "_is_server_accessible_from_ip", + "is_server_accessible_from_ip", False, ), ( - 'litellm.proxy.anthropic_endpoints.claude_code_endpoints.claude_code_marketplace', - '', - '_get_prisma_client', - 'get_prisma_client', + "litellm.proxy.anthropic_endpoints.claude_code_endpoints.claude_code_marketplace", + "", + "_get_prisma_client", + "get_prisma_client", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_cache_access_object', - 'cache_access_object', + "litellm.proxy.auth.auth_checks", + "", + "_cache_access_object", + "cache_access_object", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_cache_key_object', - 'cache_key_object', + "litellm.proxy.auth.auth_checks", + "", + "_cache_key_object", + "cache_key_object", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_cache_team_object', - 'cache_team_object', + "litellm.proxy.auth.auth_checks", + "", + "_cache_team_object", + "cache_team_object", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_can_object_call_model', - 'can_object_call_model', + "litellm.proxy.auth.auth_checks", + "", + "_can_object_call_model", + "can_object_call_model", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_check_end_user_budget', - 'check_end_user_budget', + "litellm.proxy.auth.auth_checks", + "", + "_check_end_user_budget", + "check_end_user_budget", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_check_model_access_helper', - 'check_model_access_helper', + "litellm.proxy.auth.auth_checks", + "", + "_check_model_access_helper", + "check_model_access_helper", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_check_team_member_model_access', - 'check_team_member_model_access', + "litellm.proxy.auth.auth_checks", + "", + "_check_team_member_model_access", + "check_team_member_model_access", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_copy_user_api_key_auth_for_cache', - 'copy_user_api_key_auth_for_cache', + "litellm.proxy.auth.auth_checks", + "", + "_copy_user_api_key_auth_for_cache", + "copy_user_api_key_auth_for_cache", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_delete_cache_access_object', - 'delete_cache_access_object', + "litellm.proxy.auth.auth_checks", + "", + "_delete_cache_access_object", + "delete_cache_access_object", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_delete_cache_key_object', - 'delete_cache_key_object', + "litellm.proxy.auth.auth_checks", + "", + "_delete_cache_key_object", + "delete_cache_key_object", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_fetch_key_object_from_db_with_reconnect', - 'fetch_key_object_from_db_with_reconnect', + "litellm.proxy.auth.auth_checks", + "", + "_fetch_key_object_from_db_with_reconnect", + "fetch_key_object_from_db_with_reconnect", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_get_agent_ids_from_access_groups', - 'get_agent_ids_from_access_groups', + "litellm.proxy.auth.auth_checks", + "", + "_get_agent_ids_from_access_groups", + "get_agent_ids_from_access_groups", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_get_mcp_server_ids_from_access_groups', - 'get_mcp_server_ids_from_access_groups', + "litellm.proxy.auth.auth_checks", + "", + "_get_mcp_server_ids_from_access_groups", + "get_mcp_server_ids_from_access_groups", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_get_models_from_access_groups', - 'get_models_from_access_groups', + "litellm.proxy.auth.auth_checks", + "", + "_get_models_from_access_groups", + "get_models_from_access_groups", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_get_team_object_from_cache', - 'get_team_object_from_cache', + "litellm.proxy.auth.auth_checks", + "", + "_get_team_object_from_cache", + "get_team_object_from_cache", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_get_user_role', - 'get_user_role', + "litellm.proxy.auth.auth_checks", + "", + "_get_user_role", + "get_user_role", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_is_model_cost_zero', - 'is_model_cost_zero', + "litellm.proxy.auth.auth_checks", + "", + "_is_model_cost_zero", + "is_model_cost_zero", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_is_user_proxy_admin', - 'is_user_proxy_admin', + "litellm.proxy.auth.auth_checks", + "", + "_is_user_proxy_admin", + "is_user_proxy_admin", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_key_access_group_grants_model', - 'key_access_group_grants_model', + "litellm.proxy.auth.auth_checks", + "", + "_key_access_group_grants_model", + "key_access_group_grants_model", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_organization_max_budget_check', - 'organization_max_budget_check', + "litellm.proxy.auth.auth_checks", + "", + "_organization_max_budget_check", + "organization_max_budget_check", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_team_max_budget_check', - 'team_max_budget_check', + "litellm.proxy.auth.auth_checks", + "", + "_team_max_budget_check", + "team_max_budget_check", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_team_member_max_budget_alert_check', - 'team_member_max_budget_alert_check', + "litellm.proxy.auth.auth_checks", + "", + "_team_member_max_budget_alert_check", + "team_member_max_budget_alert_check", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_virtual_key_max_budget_alert_check', - 'virtual_key_max_budget_alert_check', + "litellm.proxy.auth.auth_checks", + "", + "_virtual_key_max_budget_alert_check", + "virtual_key_max_budget_alert_check", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_virtual_key_max_budget_check', - 'virtual_key_max_budget_check', + "litellm.proxy.auth.auth_checks", + "", + "_virtual_key_max_budget_check", + "virtual_key_max_budget_check", False, ), ( - 'litellm.proxy.auth.auth_checks', - '', - '_virtual_key_soft_budget_check', - 'virtual_key_soft_budget_check', + "litellm.proxy.auth.auth_checks", + "", + "_virtual_key_soft_budget_check", + "virtual_key_soft_budget_check", False, ), ( - 'litellm.proxy.auth.auth_checks_organization', - '', - '_user_is_org_admin', - 'user_is_org_admin', + "litellm.proxy.auth.auth_checks_organization", + "", + "_user_is_org_admin", + "user_is_org_admin", False, ), ( - 'litellm.proxy.auth.auth_exception_handler', - 'UserAPIKeyAuthExceptionHandler', - '_handle_authentication_error', - 'handle_authentication_error', + "litellm.proxy.auth.auth_exception_handler", + "UserAPIKeyAuthExceptionHandler", + "_handle_authentication_error", + "handle_authentication_error", False, ), ( - 'litellm.proxy.auth.auth_utils', - '', - '_get_request_ip_address', - 'get_request_ip_address', + "litellm.proxy.auth.auth_utils", + "", + "_get_request_ip_address", + "get_request_ip_address", False, ), ( - 'litellm.proxy.auth.resolvers.store', - 'IdentityStore', - '_principal_from_key', - 'principal_from_key', + "litellm.proxy.auth.resolvers.store", + "IdentityStore", + "_principal_from_key", + "principal_from_key", False, ), ( - 'litellm.proxy.auth.route_checks', - 'RouteChecks', - '_get_request_method', - 'get_request_method', + "litellm.proxy.auth.route_checks", + "RouteChecks", + "_get_request_method", + "get_request_method", False, ), ( - 'litellm.proxy.auth.route_checks', - 'RouteChecks', - '_is_assistants_api_request', - 'is_assistants_api_request', + "litellm.proxy.auth.route_checks", + "RouteChecks", + "_is_assistants_api_request", + "is_assistants_api_request", False, ), ( - 'litellm.proxy.auth.route_checks', - 'RouteChecks', - '_is_wildcard_pattern', - 'is_wildcard_pattern', + "litellm.proxy.auth.route_checks", + "RouteChecks", + "_is_wildcard_pattern", + "is_wildcard_pattern", False, ), ( - 'litellm.proxy.auth.user_api_key_auth', - '', - '_enforce_key_and_fallback_model_access', - 'enforce_key_and_fallback_model_access', + "litellm.proxy.auth.user_api_key_auth", + "", + "_enforce_key_and_fallback_model_access", + "enforce_key_and_fallback_model_access", False, ), ( - 'litellm.proxy.auth.user_api_key_auth', - '', - '_fetch_global_spend_with_event_coordination', - 'fetch_global_spend_with_event_coordination', + "litellm.proxy.auth.user_api_key_auth", + "", + "_fetch_global_spend_with_event_coordination", + "fetch_global_spend_with_event_coordination", False, ), ( - 'litellm.proxy.auth.user_api_key_auth', - '', - '_get_bearer_token', - 'get_bearer_token', + "litellm.proxy.auth.user_api_key_auth", + "", + "_get_bearer_token", + "get_bearer_token", False, ), ( - 'litellm.proxy.auth.user_api_key_auth', - '', - '_run_centralized_common_checks', - 'run_centralized_common_checks', + "litellm.proxy.auth.user_api_key_auth", + "", + "_run_centralized_common_checks", + "run_centralized_common_checks", False, ), ( - 'litellm.proxy.auth.user_api_key_auth', - '', - '_user_api_key_auth_builder', - 'user_api_key_auth_builder', + "litellm.proxy.auth.user_api_key_auth", + "", + "_user_api_key_auth_builder", + "user_api_key_auth_builder", False, ), ( - 'litellm.proxy.common_request_processing', - '', - '_is_azure_model_router_request', - 'is_azure_model_router_request', + "litellm.proxy.common_request_processing", + "", + "_is_azure_model_router_request", + "is_azure_model_router_request", False, ), ( - 'litellm.proxy.common_request_processing', - '', - '_should_return_raw_model_name', - 'should_return_raw_model_name', + "litellm.proxy.common_request_processing", + "", + "_should_return_raw_model_name", + "should_return_raw_model_name", False, ), ( - 'litellm.proxy.common_request_processing', - 'ProxyBaseLLMRequestProcessing', - '_finalize_streaming_generator_cleanup', - 'finalize_streaming_generator_cleanup', + "litellm.proxy.common_request_processing", + "ProxyBaseLLMRequestProcessing", + "_finalize_streaming_generator_cleanup", + "finalize_streaming_generator_cleanup", False, ), ( - 'litellm.proxy.common_request_processing', - 'ProxyBaseLLMRequestProcessing', - '_handle_llm_api_exception', - 'handle_llm_api_exception', + "litellm.proxy.common_request_processing", + "ProxyBaseLLMRequestProcessing", + "_handle_llm_api_exception", + "handle_llm_api_exception", False, ), ( - 'litellm.proxy.common_request_processing', - 'ProxyBaseLLMRequestProcessing', - '_process_chunk_with_cost_injection', - 'process_chunk_with_cost_injection', + "litellm.proxy.common_request_processing", + "ProxyBaseLLMRequestProcessing", + "_process_chunk_with_cost_injection", + "process_chunk_with_cost_injection", False, ), ( - 'litellm.proxy.common_utils.callback_utils', - '', - '_CALLBACK_VAR_ENCRYPTED_PREFIX', - 'CALLBACK_VAR_ENCRYPTED_PREFIX', + "litellm.proxy.common_utils.callback_utils", + "", + "_CALLBACK_VAR_ENCRYPTED_PREFIX", + "CALLBACK_VAR_ENCRYPTED_PREFIX", False, ), ( - 'litellm.proxy.common_utils.config_sync_pubsub', - '', - '_ConfigSyncPubSub', - 'ConfigSyncPubSub', + "litellm.proxy.common_utils.config_sync_pubsub", + "", + "_ConfigSyncPubSub", + "ConfigSyncPubSub", False, ), ( - 'litellm.proxy.common_utils.config_sync_pubsub', - '', - '_pubsub_capable_client', - 'pubsub_capable_client', + "litellm.proxy.common_utils.config_sync_pubsub", + "", + "_pubsub_capable_client", + "pubsub_capable_client", False, ), ( - 'litellm.proxy.common_utils.encrypt_decrypt_utils', - '', - '_ALGO_AES_GCM', - 'ALGO_AES_GCM', + "litellm.proxy.common_utils.encrypt_decrypt_utils", + "", + "_ALGO_AES_GCM", + "ALGO_AES_GCM", False, ), ( - 'litellm.proxy.common_utils.encrypt_decrypt_utils', - '', - '_ENCRYPTION_ALGORITHM_SETTING', - 'ENCRYPTION_ALGORITHM_SETTING', + "litellm.proxy.common_utils.encrypt_decrypt_utils", + "", + "_ENCRYPTION_ALGORITHM_SETTING", + "ENCRYPTION_ALGORITHM_SETTING", False, ), ( - 'litellm.proxy.common_utils.encrypt_decrypt_utils', - '', - '_V2_GCM_PREFIX', - 'V2_GCM_PREFIX', + "litellm.proxy.common_utils.encrypt_decrypt_utils", + "", + "_V2_GCM_PREFIX", + "V2_GCM_PREFIX", False, ), ( - 'litellm.proxy.common_utils.encrypt_decrypt_utils', - '', - '_get_salt_key', - 'get_salt_key', + "litellm.proxy.common_utils.encrypt_decrypt_utils", + "", + "_get_salt_key", + "get_salt_key", False, ), ( - 'litellm.proxy.common_utils.http_parsing_utils', - '', - '_read_request_body', - 'read_request_body', + "litellm.proxy.common_utils.http_parsing_utils", + "", + "_read_request_body", + "read_request_body", False, ), ( - 'litellm.proxy.common_utils.http_parsing_utils', - '', - '_safe_get_request_headers', - 'safe_get_request_headers', + "litellm.proxy.common_utils.http_parsing_utils", + "", + "_safe_get_request_headers", + "safe_get_request_headers", False, ), ( - 'litellm.proxy.common_utils.http_parsing_utils', - '', - '_safe_get_request_query_params', - 'safe_get_request_query_params', + "litellm.proxy.common_utils.http_parsing_utils", + "", + "_safe_get_request_query_params", + "safe_get_request_query_params", False, ), ( - 'litellm.proxy.common_utils.http_parsing_utils', - '', - '_safe_set_request_parsed_body', - 'safe_set_request_parsed_body', + "litellm.proxy.common_utils.http_parsing_utils", + "", + "_safe_set_request_parsed_body", + "safe_set_request_parsed_body", False, ), ( - 'litellm.proxy.common_utils.realtime_utils', - '', - '_realtime_request_body', - 'realtime_request_body', + "litellm.proxy.common_utils.realtime_utils", + "", + "_realtime_request_body", + "realtime_request_body", False, ), ( - 'litellm.proxy.db.db_spend_update_writer', - 'DBSpendUpdateWriter', - '_commit_daily_tag_spend_to_db', - 'commit_daily_tag_spend_to_db', + "litellm.proxy.db.db_spend_update_writer", + "DBSpendUpdateWriter", + "_commit_daily_tag_spend_to_db", + "commit_daily_tag_spend_to_db", False, ), ( - 'litellm.proxy.db.db_spend_update_writer', - 'DBSpendUpdateWriter', - '_commit_daily_tag_spend_to_db_with_redis', - 'commit_daily_tag_spend_to_db_with_redis', + "litellm.proxy.db.db_spend_update_writer", + "DBSpendUpdateWriter", + "_commit_daily_tag_spend_to_db_with_redis", + "commit_daily_tag_spend_to_db_with_redis", False, ), ( - 'litellm.proxy.db.db_spend_update_writer', - 'DBSpendUpdateWriter', - '_handle_spend_update_failure', - 'handle_spend_update_failure', + "litellm.proxy.db.db_spend_update_writer", + "DBSpendUpdateWriter", + "_handle_spend_update_failure", + "handle_spend_update_failure", False, ), ( - 'litellm.proxy.db.db_transaction_queue.redis_update_buffer', - 'RedisUpdateBuffer', - '_should_commit_spend_updates_to_redis', - 'should_commit_spend_updates_to_redis', + "litellm.proxy.db.db_transaction_queue.redis_update_buffer", + "RedisUpdateBuffer", + "_should_commit_spend_updates_to_redis", + "should_commit_spend_updates_to_redis", False, ), ( - 'litellm.proxy.db.log_db_metrics', - '', - '_is_exception_related_to_db', - 'is_exception_related_to_db', + "litellm.proxy.db.log_db_metrics", + "", + "_is_exception_related_to_db", + "is_exception_related_to_db", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.azure.base', - '', - '_RESPONSES_API_CALL_TYPES', - 'RESPONSES_API_CALL_TYPES', + "litellm.proxy.guardrails.guardrail_hooks.azure.base", + "", + "_RESPONSES_API_CALL_TYPES", + "RESPONSES_API_CALL_TYPES", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.cisco_ai_defense.cisco_ai_defense_mcp', - '', - '_CiscoAIDefenseMcpMixin', - 'CiscoAIDefenseMcpMixin', + "litellm.proxy.guardrails.guardrail_hooks.cisco_ai_defense.cisco_ai_defense_mcp", + "", + "_CiscoAIDefenseMcpMixin", + "CiscoAIDefenseMcpMixin", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base', - '', - '_compile_marker', - 'compile_marker', + "litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base", + "", + "_compile_marker", + "compile_marker", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base', - '', - '_count_signals', - 'count_signals', + "litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base", + "", + "_count_signals", + "count_signals", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base', - '', - '_word_boundary_match', - 'word_boundary_match', + "litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.competitor_intent.base", + "", + "_word_boundary_match", + "word_boundary_match", False, ), ( - 'litellm.proxy.guardrails.guardrail_hooks.presidio', - '', - '_OPTIONAL_PresidioPIIMasking', - 'OPTIONAL_PresidioPIIMasking', + "litellm.proxy.guardrails.guardrail_hooks.presidio", + "", + "_OPTIONAL_PresidioPIIMasking", + "OPTIONAL_PresidioPIIMasking", False, ), ( - 'litellm.proxy.health_check', - '', - '_clean_endpoint_data', - 'clean_endpoint_data', + "litellm.proxy.health_check", + "", + "_clean_endpoint_data", + "clean_endpoint_data", False, ), ( - 'litellm.proxy.health_check', - '', - '_update_litellm_params_for_health_check', - 'update_litellm_params_for_health_check', + "litellm.proxy.health_check", + "", + "_update_litellm_params_for_health_check", + "update_litellm_params_for_health_check", False, ), ( - 'litellm.proxy.health_endpoints._health_endpoints', - '', - '_convert_health_check_to_dict', - 'convert_health_check_to_dict', + "litellm.proxy.health_endpoints._health_endpoints", + "", + "_convert_health_check_to_dict", + "convert_health_check_to_dict", False, ), ( - 'litellm.proxy.health_endpoints._health_endpoints', - '', - '_save_background_health_checks_to_db', - 'save_background_health_checks_to_db', + "litellm.proxy.health_endpoints._health_endpoints", + "", + "_save_background_health_checks_to_db", + "save_background_health_checks_to_db", False, ), ( - 'litellm.proxy.hooks.azure_content_safety', - '', - '_PROXY_AzureContentSafety', - 'PROXY_AzureContentSafety', + "litellm.proxy.hooks.azure_content_safety", + "", + "_PROXY_AzureContentSafety", + "PROXY_AzureContentSafety", False, ), ( - 'litellm.proxy.hooks.batch_rate_limiter', - '', - '_PROXY_BatchRateLimiter', - 'PROXY_BatchRateLimiter', + "litellm.proxy.hooks.batch_rate_limiter", + "", + "_PROXY_BatchRateLimiter", + "PROXY_BatchRateLimiter", False, ), ( - 'litellm.proxy.hooks.batch_redis_get', - '', - '_PROXY_BatchRedisRequests', - 'PROXY_BatchRedisRequests', + "litellm.proxy.hooks.batch_redis_get", + "", + "_PROXY_BatchRedisRequests", + "PROXY_BatchRedisRequests", False, ), ( - 'litellm.proxy.hooks.cache_control_check', - '', - '_PROXY_CacheControlCheck', - 'PROXY_CacheControlCheck', + "litellm.proxy.hooks.cache_control_check", + "", + "_PROXY_CacheControlCheck", + "PROXY_CacheControlCheck", False, ), ( - 'litellm.proxy.hooks.dynamic_rate_limiter', - '', - '_PROXY_DynamicRateLimitHandler', - 'PROXY_DynamicRateLimitHandler', + "litellm.proxy.hooks.dynamic_rate_limiter", + "", + "_PROXY_DynamicRateLimitHandler", + "PROXY_DynamicRateLimitHandler", False, ), ( - 'litellm.proxy.hooks.dynamic_rate_limiter_v3', - '', - '_PROXY_DynamicRateLimitHandlerV3', - 'PROXY_DynamicRateLimitHandlerV3', + "litellm.proxy.hooks.dynamic_rate_limiter_v3", + "", + "_PROXY_DynamicRateLimitHandlerV3", + "PROXY_DynamicRateLimitHandlerV3", False, ), ( - 'litellm.proxy.hooks.max_budget_per_session_limiter', - '', - '_PROXY_MaxBudgetPerSessionHandler', - 'PROXY_MaxBudgetPerSessionHandler', + "litellm.proxy.hooks.max_budget_per_session_limiter", + "", + "_PROXY_MaxBudgetPerSessionHandler", + "PROXY_MaxBudgetPerSessionHandler", False, ), ( - 'litellm.proxy.hooks.max_iterations_limiter', - '', - '_PROXY_MaxIterationsHandler', - 'PROXY_MaxIterationsHandler', + "litellm.proxy.hooks.max_iterations_limiter", + "", + "_PROXY_MaxIterationsHandler", + "PROXY_MaxIterationsHandler", False, ), ( - 'litellm.proxy.hooks.model_max_budget_limiter', - '', - '_PROXY_VirtualKeyModelMaxBudgetLimiter', - 'PROXY_VirtualKeyModelMaxBudgetLimiter', + "litellm.proxy.hooks.model_max_budget_limiter", + "", + "_PROXY_VirtualKeyModelMaxBudgetLimiter", + "PROXY_VirtualKeyModelMaxBudgetLimiter", False, ), ( - 'litellm.proxy.hooks.parallel_request_limiter', - '', - '_PROXY_MaxParallelRequestsHandler', - 'PROXY_MaxParallelRequestsHandler', + "litellm.proxy.hooks.parallel_request_limiter", + "", + "_PROXY_MaxParallelRequestsHandler", + "PROXY_MaxParallelRequestsHandler", False, ), ( - 'litellm.proxy.hooks.parallel_request_limiter_v3', - '', - '_PROXY_MaxParallelRequestsHandler_v3', - 'PROXY_MaxParallelRequestsHandler_v3', + "litellm.proxy.hooks.parallel_request_limiter_v3", + "", + "_PROXY_MaxParallelRequestsHandler_v3", + "PROXY_MaxParallelRequestsHandler_v3", False, ), ( - 'litellm.proxy.hooks.parallel_request_limiter_v3', - '_PROXY_MaxParallelRequestsHandler_v3', - '_create_rate_limit_descriptors', - 'create_rate_limit_descriptors', + "litellm.proxy.hooks.parallel_request_limiter_v3", + "_PROXY_MaxParallelRequestsHandler_v3", + "_create_rate_limit_descriptors", + "create_rate_limit_descriptors", False, ), ( - 'litellm.proxy.hooks.prompt_injection_detection', - '', - '_OPTIONAL_PromptInjectionDetection', - 'OPTIONAL_PromptInjectionDetection', + "litellm.proxy.hooks.prompt_injection_detection", + "", + "_OPTIONAL_PromptInjectionDetection", + "OPTIONAL_PromptInjectionDetection", False, ), ( - 'litellm.proxy.hooks.proxy_track_cost_callback', - '', - '_ProxyDBLogger', - 'ProxyDBLogger', + "litellm.proxy.hooks.proxy_track_cost_callback", + "", + "_ProxyDBLogger", + "ProxyDBLogger", False, ), ( - 'litellm.proxy.hooks.sensitive_data_routing', - '', - '_PROXY_SensitiveDataRoutingHandler', - 'PROXY_SensitiveDataRoutingHandler', + "litellm.proxy.hooks.sensitive_data_routing", + "", + "_PROXY_SensitiveDataRoutingHandler", + "PROXY_SensitiveDataRoutingHandler", False, ), ( - 'litellm.proxy.litellm_pre_call_utils', - '', - '_add_guardrails_from_key_or_team_metadata', - 'add_guardrails_from_key_or_team_metadata', + "litellm.proxy.litellm_pre_call_utils", + "", + "_add_guardrails_from_key_or_team_metadata", + "add_guardrails_from_key_or_team_metadata", False, ), ( - 'litellm.proxy.litellm_pre_call_utils', - '', - '_get_dynamic_logging_metadata', - 'get_dynamic_logging_metadata', + "litellm.proxy.litellm_pre_call_utils", + "", + "_get_dynamic_logging_metadata", + "get_dynamic_logging_metadata", False, ), ( - 'litellm.proxy.litellm_pre_call_utils', - '', - '_get_metadata_variable_name', - 'get_metadata_variable_name', + "litellm.proxy.litellm_pre_call_utils", + "", + "_get_metadata_variable_name", + "get_metadata_variable_name", False, ), ( - 'litellm.proxy.litellm_pre_call_utils', - '', - '_get_validated_callback_metadata', - 'get_validated_callback_metadata', + "litellm.proxy.litellm_pre_call_utils", + "", + "_get_validated_callback_metadata", + "get_validated_callback_metadata", False, ), ( - 'litellm.proxy.litellm_pre_call_utils', - 'LiteLLMProxyRequestSetup', - '_merge_tags', - 'merge_tags', + "litellm.proxy.litellm_pre_call_utils", + "LiteLLMProxyRequestSetup", + "_merge_tags", + "merge_tags", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_check_disable_global_guardrails_caller_permission', - 'check_disable_global_guardrails_caller_permission', + "litellm.proxy.management_endpoints.common_utils", + "", + "_check_disable_global_guardrails_caller_permission", + "check_disable_global_guardrails_caller_permission", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_check_passthrough_routes_caller_permission', - 'check_passthrough_routes_caller_permission', + "litellm.proxy.management_endpoints.common_utils", + "", + "_check_passthrough_routes_caller_permission", + "check_passthrough_routes_caller_permission", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_set_object_metadata_field', - 'set_object_metadata_field', + "litellm.proxy.management_endpoints.common_utils", + "", + "_set_object_metadata_field", + "set_object_metadata_field", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_team_member_has_permission', - 'team_member_has_permission', + "litellm.proxy.management_endpoints.common_utils", + "", + "_team_member_has_permission", + "team_member_has_permission", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_update_metadata_fields', - 'update_metadata_fields', + "litellm.proxy.management_endpoints.common_utils", + "", + "_update_metadata_fields", + "update_metadata_fields", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_upsert_budget_and_membership', - 'upsert_budget_and_membership', + "litellm.proxy.management_endpoints.common_utils", + "", + "_upsert_budget_and_membership", + "upsert_budget_and_membership", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_user_has_admin_privileges', - 'user_has_admin_privileges', + "litellm.proxy.management_endpoints.common_utils", + "", + "_user_has_admin_privileges", + "user_has_admin_privileges", False, ), ( - 'litellm.proxy.management_endpoints.common_utils', - '', - '_user_has_admin_view', - 'user_api_key_has_admin_view', + "litellm.proxy.management_endpoints.common_utils", + "", + "_user_has_admin_view", + "user_api_key_has_admin_view", False, ), ( - 'litellm.proxy.management_endpoints.config_override_endpoints', - '', - '_clear_hashicorp_vault_state', - 'clear_hashicorp_vault_state', + "litellm.proxy.management_endpoints.config_override_endpoints", + "", + "_clear_hashicorp_vault_state", + "clear_hashicorp_vault_state", False, ), ( - 'litellm.proxy.management_endpoints.config_override_endpoints', - '', - '_get_current_env_values', - 'get_current_env_values', + "litellm.proxy.management_endpoints.config_override_endpoints", + "", + "_get_current_env_values", + "get_current_env_values", False, ), ( - 'litellm.proxy.management_endpoints.config_override_endpoints', - '', - '_parse_config_value', - 'parse_config_value', + "litellm.proxy.management_endpoints.config_override_endpoints", + "", + "_parse_config_value", + "parse_config_value", False, ), ( - 'litellm.proxy.management_endpoints.config_override_endpoints', - '', - '_set_env_vars', - 'set_env_vars', + "litellm.proxy.management_endpoints.config_override_endpoints", + "", + "_set_env_vars", + "set_env_vars", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_calculate_key_rotation_time', - 'calculate_key_rotation_time', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_calculate_key_rotation_time", + "calculate_key_rotation_time", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_check_permissions_caller_permission', - 'check_permissions_caller_permission', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_check_permissions_caller_permission", + "check_permissions_caller_permission", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_get_caller_team_role', - 'get_caller_team_role', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_get_caller_team_role", + "get_caller_team_role", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_list_key_helper', - 'list_key_helper', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_list_key_helper", + "list_key_helper", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_persist_deleted_verification_tokens', - 'persist_deleted_verification_tokens', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_persist_deleted_verification_tokens", + "persist_deleted_verification_tokens", False, ), ( - 'litellm.proxy.management_endpoints.key_management_endpoints', - '', - '_rotate_master_key', - 'rotate_master_key', + "litellm.proxy.management_endpoints.key_management_endpoints", + "", + "_rotate_master_key", + "rotate_master_key", False, ), ( - 'litellm.proxy.management_endpoints.mcp_management_endpoints', - '', - '_inherit_credentials_from_existing_server', - 'inherit_credentials_from_existing_server', + "litellm.proxy.management_endpoints.mcp_management_endpoints", + "", + "_inherit_credentials_from_existing_server", + "inherit_credentials_from_existing_server", False, ), ( - 'litellm.proxy.management_endpoints.model_management_endpoints', - '', - '_add_model_to_db', - 'add_model_to_db', + "litellm.proxy.management_endpoints.model_management_endpoints", + "", + "_add_model_to_db", + "add_model_to_db", False, ), ( - 'litellm.proxy.management_endpoints.model_management_endpoints', - '', - '_add_team_model_to_db', - 'add_team_model_to_db', + "litellm.proxy.management_endpoints.model_management_endpoints", + "", + "_add_team_model_to_db", + "add_team_model_to_db", False, ), ( - 'litellm.proxy.management_endpoints.model_management_endpoints', - '', - '_deduplicate_litellm_router_models', - 'deduplicate_litellm_router_models', + "litellm.proxy.management_endpoints.model_management_endpoints", + "", + "_deduplicate_litellm_router_models", + "deduplicate_litellm_router_models", False, ), ( - 'litellm.proxy.management_endpoints.organization_endpoints', - '', - '_verify_org_access', - 'verify_org_access', + "litellm.proxy.management_endpoints.organization_endpoints", + "", + "_verify_org_access", + "verify_org_access", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_all_names_per_competitor', - 'build_all_names_per_competitor', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_all_names_per_competitor", + "build_all_names_per_competitor", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_comparison_blocked_words', - 'build_comparison_blocked_words', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_comparison_blocked_words", + "build_comparison_blocked_words", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_competitor_guardrail_definitions', - 'build_competitor_guardrail_definitions', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_competitor_guardrail_definitions", + "build_competitor_guardrail_definitions", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_name_blocked_words', - 'build_name_blocked_words', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_name_blocked_words", + "build_name_blocked_words", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_recommendation_blocked_words', - 'build_recommendation_blocked_words', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_recommendation_blocked_words", + "build_recommendation_blocked_words", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_build_refinement_prompt', - 'build_refinement_prompt', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_build_refinement_prompt", + "build_refinement_prompt", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_clean_competitor_line', - 'clean_competitor_line', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_clean_competitor_line", + "clean_competitor_line", False, ), ( - 'litellm.proxy.management_endpoints.policy_endpoints.endpoints', - '', - '_parse_variations_response', - 'parse_variations_response', + "litellm.proxy.management_endpoints.policy_endpoints.endpoints", + "", + "_parse_variations_response", + "parse_variations_response", False, ), ( - 'litellm.proxy.management_endpoints.team_endpoints', - '', - '_cleanup_members_with_roles', - 'cleanup_members_with_roles', + "litellm.proxy.management_endpoints.team_endpoints", + "", + "_cleanup_members_with_roles", + "cleanup_members_with_roles", False, ), ( - 'litellm.proxy.management_endpoints.team_endpoints', - '', - '_refresh_cached_team', - 'refresh_cached_team', + "litellm.proxy.management_endpoints.team_endpoints", + "", + "_refresh_cached_team", + "refresh_cached_team", False, ), ( - 'litellm.proxy.management_endpoints.team_endpoints', - 'TeamMemberBudgetHandler', - '_clean_team_member_fields', - 'clean_team_member_fields', + "litellm.proxy.management_endpoints.team_endpoints", + "TeamMemberBudgetHandler", + "_clean_team_member_fields", + "clean_team_member_fields", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - '', - '_sso_return_to_redirect', - 'sso_return_to_redirect', + "litellm.proxy.management_endpoints.ui_sso", + "", + "_sso_return_to_redirect", + "sso_return_to_redirect", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - 'SSOAuthenticationHandler', - '_delete_pkce_verifier', - 'delete_pkce_verifier', + "litellm.proxy.management_endpoints.ui_sso", + "SSOAuthenticationHandler", + "_delete_pkce_verifier", + "delete_pkce_verifier", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - 'SSOAuthenticationHandler', - '_get_cli_state', - 'get_cli_state', + "litellm.proxy.management_endpoints.ui_sso", + "SSOAuthenticationHandler", + "_get_cli_state", + "get_cli_state", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - 'SSOAuthenticationHandler', - '_get_user_email_and_id_from_result', - 'get_user_email_and_id_from_result', + "litellm.proxy.management_endpoints.ui_sso", + "SSOAuthenticationHandler", + "_get_user_email_and_id_from_result", + "get_user_email_and_id_from_result", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - 'SSOAuthenticationHandler', - '_pkce_token_exchange', - 'pkce_token_exchange', + "litellm.proxy.management_endpoints.ui_sso", + "SSOAuthenticationHandler", + "_pkce_token_exchange", + "pkce_token_exchange", False, ), ( - 'litellm.proxy.management_endpoints.ui_sso', - 'SSOAuthenticationHandler', - '_validate_return_to', - 'validate_return_to', + "litellm.proxy.management_endpoints.ui_sso", + "SSOAuthenticationHandler", + "_validate_return_to", + "validate_return_to", False, ), ( - 'litellm.proxy.management_helpers.object_permission_utils', - '', - '_get_allow_all_keys_server_ids', - 'get_allow_all_keys_server_ids', + "litellm.proxy.management_helpers.object_permission_utils", + "", + "_get_allow_all_keys_server_ids", + "get_allow_all_keys_server_ids", False, ), ( - 'litellm.proxy.management_helpers.object_permission_utils', - '', - '_get_team_allowed_mcp_servers', - 'get_team_allowed_mcp_servers', + "litellm.proxy.management_helpers.object_permission_utils", + "", + "_get_team_allowed_mcp_servers", + "get_team_allowed_mcp_servers", False, ), ( - 'litellm.proxy.management_helpers.object_permission_utils', - '', - '_set_object_permission', - 'set_object_permission', + "litellm.proxy.management_helpers.object_permission_utils", + "", + "_set_object_permission", + "set_object_permission", False, ), ( - 'litellm.proxy.openai_files_endpoints.common_utils', - '', - '_is_base64_encoded_unified_file_id', - 'is_base64_encoded_unified_file_id', + "litellm.proxy.openai_files_endpoints.common_utils", + "", + "_is_base64_encoded_unified_file_id", + "is_base64_encoded_unified_file_id", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints', - '', - '_extract_model_from_bedrock_endpoint', - 'extract_model_from_bedrock_endpoint', + "litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints", + "", + "_extract_model_from_bedrock_endpoint", + "extract_model_from_bedrock_endpoint", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints', - 'BaseOpenAIPassThroughHandler', - '_base_openai_pass_through_handler', - 'base_openai_pass_through_handler', + "litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints", + "BaseOpenAIPassThroughHandler", + "_base_openai_pass_through_handler", + "base_openai_pass_through_handler", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler', - 'AnthropicPassthroughLoggingHandler', - '_build_complete_streaming_response', - 'build_complete_streaming_response', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler", + "AnthropicPassthroughLoggingHandler", + "_build_complete_streaming_response", + "build_complete_streaming_response", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler', - 'AnthropicPassthroughLoggingHandler', - '_build_usage_only_response_from_chunks', - 'build_usage_only_response_from_chunks', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler", + "AnthropicPassthroughLoggingHandler", + "_build_usage_only_response_from_chunks", + "build_usage_only_response_from_chunks", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler', - 'AnthropicPassthroughLoggingHandler', - '_handle_logging_anthropic_collected_chunks', - 'handle_logging_anthropic_collected_chunks', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler", + "AnthropicPassthroughLoggingHandler", + "_handle_logging_anthropic_collected_chunks", + "handle_logging_anthropic_collected_chunks", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler', - 'AssemblyAIPassthroughLoggingHandler', - '_get_assembly_base_url_from_region', - 'get_assembly_base_url_from_region', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler", + "AssemblyAIPassthroughLoggingHandler", + "_get_assembly_base_url_from_region", + "get_assembly_base_url_from_region", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler', - 'AssemblyAIPassthroughLoggingHandler', - '_get_assembly_region_from_url', - 'get_assembly_region_from_url', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler", + "AssemblyAIPassthroughLoggingHandler", + "_get_assembly_region_from_url", + "get_assembly_region_from_url", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler', - 'AssemblyAIPassthroughLoggingHandler', - '_should_log_request', - 'should_log_request', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler", + "AssemblyAIPassthroughLoggingHandler", + "_should_log_request", + "should_log_request", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.openai_passthrough_logging_handler', - '', - '_is_openai_compatible_url', - 'is_openai_compatible_url', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.openai_passthrough_logging_handler", + "", + "_is_openai_compatible_url", + "is_openai_compatible_url", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.openai_passthrough_logging_handler', - 'OpenAIPassthroughLoggingHandler', - '_handle_logging_openai_collected_chunks', - 'handle_logging_openai_collected_chunks', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.openai_passthrough_logging_handler", + "OpenAIPassthroughLoggingHandler", + "_handle_logging_openai_collected_chunks", + "handle_logging_openai_collected_chunks", False, ), ( - 'litellm.proxy.pass_through_endpoints.llm_provider_handlers.vertex_passthrough_logging_handler', - 'VertexPassthroughLoggingHandler', - '_handle_logging_vertex_collected_chunks', - 'handle_logging_vertex_collected_chunks', + "litellm.proxy.pass_through_endpoints.llm_provider_handlers.vertex_passthrough_logging_handler", + "VertexPassthroughLoggingHandler", + "_handle_logging_vertex_collected_chunks", + "handle_logging_vertex_collected_chunks", False, ), ( - 'litellm.proxy.pass_through_endpoints.pass_through_endpoints', - 'HttpPassThroughEndpointHelpers', - '_init_kwargs_for_pass_through_endpoint', - 'init_kwargs_for_pass_through_endpoint', + "litellm.proxy.pass_through_endpoints.pass_through_endpoints", + "HttpPassThroughEndpointHelpers", + "_init_kwargs_for_pass_through_endpoint", + "init_kwargs_for_pass_through_endpoint", False, ), ( - 'litellm.proxy.pass_through_endpoints.pass_through_endpoints', - 'HttpPassThroughEndpointHelpers', - '_update_stream_param_based_on_request_body', - 'update_stream_param_based_on_request_body', + "litellm.proxy.pass_through_endpoints.pass_through_endpoints", + "HttpPassThroughEndpointHelpers", + "_update_stream_param_based_on_request_body", + "update_stream_param_based_on_request_body", False, ), ( - 'litellm.proxy.pass_through_endpoints.streaming_handler', - 'PassThroughStreamingHandler', - '_route_streaming_logging_to_handler', - 'route_streaming_logging_to_handler', + "litellm.proxy.pass_through_endpoints.streaming_handler", + "PassThroughStreamingHandler", + "_route_streaming_logging_to_handler", + "route_streaming_logging_to_handler", False, ), ( - 'litellm.proxy.pass_through_endpoints.success_handler', - 'PassThroughEndpointLogging', - '_handle_logging', - 'handle_logging', + "litellm.proxy.pass_through_endpoints.success_handler", + "PassThroughEndpointLogging", + "_handle_logging", + "handle_logging", False, ), ( - 'litellm.proxy.policy_engine.policy_registry', - 'PolicyRegistry', - '_parse_policy', - 'parse_policy', + "litellm.proxy.policy_engine.policy_registry", + "PolicyRegistry", + "_parse_policy", + "parse_policy", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_apply_uvicorn_max_requests_jitter', - 'apply_uvicorn_max_requests_jitter', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_apply_uvicorn_max_requests_jitter", + "apply_uvicorn_max_requests_jitter", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_configure_dev_reload', - 'configure_dev_reload', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_configure_dev_reload", + "configure_dev_reload", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_echo_litellm_version', - 'echo_litellm_version', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_echo_litellm_version", + "echo_litellm_version", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_get_default_unvicorn_init_args', - 'get_default_unvicorn_init_args', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_get_default_unvicorn_init_args", + "get_default_unvicorn_init_args", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_get_loop_type', - 'get_loop_type', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_get_loop_type", + "get_loop_type", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_init_granian_server', - 'init_granian_server', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_init_granian_server", + "init_granian_server", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_init_hypercorn_server', - 'init_hypercorn_server', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_init_hypercorn_server", + "init_hypercorn_server", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_is_port_in_use', - 'is_port_in_use', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_is_port_in_use", + "is_port_in_use", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_maybe_setup_prometheus_multiproc_dir', - 'maybe_setup_prometheus_multiproc_dir', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_maybe_setup_prometheus_multiproc_dir", + "maybe_setup_prometheus_multiproc_dir", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_run_config_validation', - 'run_config_validation', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_run_config_validation", + "run_config_validation", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_run_gunicorn_server', - 'run_gunicorn_server', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_run_gunicorn_server", + "run_gunicorn_server", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_run_health_check', - 'run_health_check', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_run_health_check", + "run_health_check", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_run_ollama_serve', - 'run_ollama_serve', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_run_ollama_serve", + "run_ollama_serve", False, ), ( - 'litellm.proxy.proxy_cli', - 'ProxyInitializationHelpers', - '_run_test_chat_completion', - 'run_test_chat_completion', + "litellm.proxy.proxy_cli", + "ProxyInitializationHelpers", + "_run_test_chat_completion", + "run_test_chat_completion", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_build_redis_usage_cache', - 'build_redis_usage_cache', + "litellm.proxy.proxy_server", + "", + "_build_redis_usage_cache", + "build_redis_usage_cache", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_ensure_spend_counter_initialized', - 'ensure_spend_counter_initialized', + "litellm.proxy.proxy_server", + "", + "_ensure_spend_counter_initialized", + "ensure_spend_counter_initialized", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_ensure_window_spend_counter_initialized', - 'ensure_window_spend_counter_initialized', + "litellm.proxy.proxy_server", + "", + "_ensure_window_spend_counter_initialized", + "ensure_window_spend_counter_initialized", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_environment_has_redis_connection_target', - 'environment_has_redis_connection_target', + "litellm.proxy.proxy_server", + "", + "_environment_has_redis_connection_target", + "environment_has_redis_connection_target", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_get_model_group_info', - 'get_model_group_info', + "litellm.proxy.proxy_server", + "", + "_get_model_group_info", + "get_model_group_info", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_increment_spend_counter_cache', - 'increment_spend_counter_cache', + "litellm.proxy.proxy_server", + "", + "_increment_spend_counter_cache", + "increment_spend_counter_cache", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_initialize_shared_aiohttp_session', - 'initialize_shared_aiohttp_session', + "litellm.proxy.proxy_server", + "", + "_initialize_shared_aiohttp_session", + "initialize_shared_aiohttp_session", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_invalidate_spend_counter', - 'invalidate_spend_counter', + "litellm.proxy.proxy_server", + "", + "_invalidate_spend_counter", + "invalidate_spend_counter", False, ), ( - 'litellm.proxy.proxy_server', - '', - '_title', - 'title', + "litellm.proxy.proxy_server", + "", + "_title", + "title", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_add_deployment_locked', - 'add_deployment_locked', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_add_deployment_locked", + "add_deployment_locked", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_decrypt_and_set_db_env_variables', - 'decrypt_and_set_db_env_variables', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_decrypt_and_set_db_env_variables", + "decrypt_and_set_db_env_variables", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_decrypt_db_variables', - 'decrypt_db_variables', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_decrypt_db_variables", + "decrypt_db_variables", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_encrypt_env_variables', - 'encrypt_env_variables', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_encrypt_env_variables", + "encrypt_env_variables", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_encrypt_env_variables_for_db', - 'encrypt_env_variables_for_db', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_encrypt_env_variables_for_db", + "encrypt_env_variables_for_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_get_models_from_db', - 'get_models_from_db', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_get_models_from_db", + "get_models_from_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_init_cache', - 'init_cache', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_init_cache", + "init_cache", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_init_semantic_filter_settings_in_db', - 'init_semantic_filter_settings_in_db', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_init_semantic_filter_settings_in_db", + "init_semantic_filter_settings_in_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyConfig', - '_serve_pass_through_endpoints', - 'serve_pass_through_endpoints', + "litellm.proxy.proxy_server", + "ProxyConfig", + "_serve_pass_through_endpoints", + "serve_pass_through_endpoints", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_add_proxy_budget_to_db', - 'add_proxy_budget_to_db', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_add_proxy_budget_to_db", + "add_proxy_budget_to_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_attach_router_to_prompt_injection_detectors', - 'attach_router_to_prompt_injection_detectors', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_attach_router_to_prompt_injection_detectors", + "attach_router_to_prompt_injection_detectors", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_get_transaction_buffer_redis_cache', - 'get_transaction_buffer_redis_cache', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_get_transaction_buffer_redis_cache", + "get_transaction_buffer_redis_cache", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_init_coordination_redis_from_db', - 'init_coordination_redis_from_db', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_init_coordination_redis_from_db", + "init_coordination_redis_from_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_init_dd_tracer', - 'init_dd_tracer', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_init_dd_tracer", + "init_dd_tracer", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_init_pyroscope', - 'init_pyroscope', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_init_pyroscope", + "init_pyroscope", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_initialize_jwt_auth', - 'initialize_jwt_auth', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_initialize_jwt_auth", + "initialize_jwt_auth", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_initialize_semantic_tool_filter', - 'initialize_semantic_tool_filter', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_initialize_semantic_tool_filter", + "initialize_semantic_tool_filter", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_initialize_startup_logging', - 'initialize_startup_logging', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_initialize_startup_logging", + "initialize_startup_logging", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_setup_prisma_client', - 'setup_prisma_client', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_setup_prisma_client", + "setup_prisma_client", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_sync_ui_settings_to_general_settings', - 'sync_ui_settings_to_general_settings', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_sync_ui_settings_to_general_settings", + "sync_ui_settings_to_general_settings", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_update_default_team_member_budget', - 'update_default_team_member_budget', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_update_default_team_member_budget", + "update_default_team_member_budget", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_validate_redis_transaction_buffer_config', - 'validate_redis_transaction_buffer_config', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_validate_redis_transaction_buffer_config", + "validate_redis_transaction_buffer_config", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_warm_global_spend_cache', - 'warm_global_spend_cache', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_warm_global_spend_cache", + "warm_global_spend_cache", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_warn_budget_without_db', - 'warn_budget_without_db', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_warn_budget_without_db", + "warn_budget_without_db", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_warn_fail_closed_rate_limits_without_redis', - 'warn_fail_closed_rate_limits_without_redis', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_warn_fail_closed_rate_limits_without_redis", + "warn_fail_closed_rate_limits_without_redis", False, ), ( - 'litellm.proxy.proxy_server', - 'ProxyStartupEvent', - '_warn_if_mock_testing_params_enabled', - 'warn_if_mock_testing_params_enabled', + "litellm.proxy.proxy_server", + "ProxyStartupEvent", + "_warn_if_mock_testing_params_enabled", + "warn_if_mock_testing_params_enabled", False, ), ( - 'litellm.proxy.spend_tracking.spend_management_endpoints', - '', - '_get_spend_report_for_time_range', - 'get_spend_report_for_time_range', + "litellm.proxy.spend_tracking.spend_management_endpoints", + "", + "_get_spend_report_for_time_range", + "get_spend_report_for_time_range", False, ), ( - 'litellm.proxy.spend_tracking.spend_management_endpoints', - '', - '_is_admin_view_safe', - 'is_admin_view_safe', + "litellm.proxy.spend_tracking.spend_management_endpoints", + "", + "_is_admin_view_safe", + "is_admin_view_safe", False, ), ( - 'litellm.proxy.spend_tracking.spend_tracking_utils', - '', - '_is_master_key', - 'is_master_key', + "litellm.proxy.spend_tracking.spend_tracking_utils", + "", + "_is_master_key", + "is_master_key", False, ), ( - 'litellm.proxy.spend_tracking.spend_tracking_utils', - '', - '_sanitize_error_information_for_spend_logs', - 'sanitize_error_information_for_spend_logs', + "litellm.proxy.spend_tracking.spend_tracking_utils", + "", + "_sanitize_error_information_for_spend_logs", + "sanitize_error_information_for_spend_logs", False, ), ( - 'litellm.proxy.utils', - '', - '_cache_user_row', - 'cache_user_row', + "litellm.proxy.utils", + "", + "_cache_user_row", + "cache_user_row", False, ), ( - 'litellm.proxy.utils', - '', - '_check_and_merge_model_level_guardrails', - 'check_and_merge_model_level_guardrails', + "litellm.proxy.utils", + "", + "_check_and_merge_model_level_guardrails", + "check_and_merge_model_level_guardrails", False, ), ( - 'litellm.proxy.utils', - '', - '_get_docs_url', - 'get_docs_url', + "litellm.proxy.utils", + "", + "_get_docs_url", + "get_docs_url", False, ), ( - 'litellm.proxy.utils', - '', - '_get_openapi_url', - 'get_openapi_url', + "litellm.proxy.utils", + "", + "_get_openapi_url", + "get_openapi_url", False, ), ( - 'litellm.proxy.utils', - '', - '_get_projected_spend_over_limit', - 'get_projected_spend_over_limit', + "litellm.proxy.utils", + "", + "_get_projected_spend_over_limit", + "get_projected_spend_over_limit", False, ), ( - 'litellm.proxy.utils', - '', - '_get_redoc_url', - 'get_redoc_url', + "litellm.proxy.utils", + "", + "_get_redoc_url", + "get_redoc_url", False, ), ( - 'litellm.proxy.utils', - '', - '_hash_token_if_needed', - 'hash_token_if_needed', + "litellm.proxy.utils", + "", + "_hash_token_if_needed", + "hash_token_if_needed", False, ), ( - 'litellm.proxy.utils', - '', - '_is_projected_spend_over_limit', - 'is_projected_spend_over_limit', + "litellm.proxy.utils", + "", + "_is_projected_spend_over_limit", + "is_projected_spend_over_limit", False, ), ( - 'litellm.proxy.utils', - '', - '_is_valid_team_configs', - 'is_valid_team_configs', + "litellm.proxy.utils", + "", + "_is_valid_team_configs", + "is_valid_team_configs", False, ), ( - 'litellm.proxy.utils', - '', - '_monitor_spend_logs_queue', - 'monitor_spend_logs_queue', + "litellm.proxy.utils", + "", + "_monitor_spend_logs_queue", + "monitor_spend_logs_queue", False, ), ( - 'litellm.proxy.utils', - '', - '_premium_user_check', - 'premium_user_check', + "litellm.proxy.utils", + "", + "_premium_user_check", + "premium_user_check", False, ), ( - 'litellm.proxy.utils', - '', - '_raise_failed_update_spend_exception', - 'raise_failed_update_spend_exception', + "litellm.proxy.utils", + "", + "_raise_failed_update_spend_exception", + "raise_failed_update_spend_exception", False, ), ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_arelease_max_parallel_requests_on_disconnect', - 'arelease_max_parallel_requests_on_disconnect', + "litellm.proxy.utils", + "ProxyLogging", + "_arelease_max_parallel_requests_on_disconnect", + "arelease_max_parallel_requests_on_disconnect", False, ), ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_callback_capabilities', - 'callback_capabilities', + "litellm.proxy.utils", + "ProxyLogging", + "_callback_capabilities", + "callback_capabilities", False, ), ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_convert_mcp_hook_response_to_kwargs', - 'convert_mcp_hook_response_to_kwargs', + "litellm.proxy.utils", + "ProxyLogging", + "_convert_mcp_hook_response_to_kwargs", + "convert_mcp_hook_response_to_kwargs", False, ), ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_create_mcp_request_object_from_kwargs', - 'create_mcp_request_object_from_kwargs', + "litellm.proxy.utils", + "ProxyLogging", + "_create_mcp_request_object_from_kwargs", + "create_mcp_request_object_from_kwargs", False, ), ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_fire_deferred_stream_logging', - 'fire_deferred_stream_logging', + "litellm.proxy.utils", + "ProxyLogging", + "_fire_deferred_stream_logging", + "fire_deferred_stream_logging", False, ), ) @@ -5188,17 +5201,16 @@ LLMS_FORWARDER_CASES: Final = ( ) PROXY_FORWARDER_CASES: Final = ( ( - 'litellm.proxy.utils', - 'ProxyLogging', - '_convert_mcp_to_llm_format', - 'convert_mcp_to_llm_format', - 'instance', + "litellm.proxy.utils", + "ProxyLogging", + "_convert_mcp_to_llm_format", + "convert_mcp_to_llm_format", + "instance", False, ), ) - def _get_owner(module_path: str, owner_name: str) -> object: module: Final = import_module(module_path or "litellm") if module_path == "litellm.llms.openai_like.dynamic_config" and owner_name == "JSONProviderConfig": @@ -5292,14 +5304,10 @@ def _make_private_override( def recorded_args(args: tuple[object, ...]) -> tuple[object, ...]: return args[1:] if descriptor in ("instance", "classmethod") else args - def sync_override( - *args: object, **kwargs: object - ) -> tuple[object, tuple[object, ...], dict[str, object]]: + def sync_override(*args: object, **kwargs: object) -> tuple[object, tuple[object, ...], dict[str, object]]: return result, recorded_args(args), kwargs - async def async_override( - *args: object, **kwargs: object - ) -> tuple[object, tuple[object, ...], dict[str, object]]: + async def async_override(*args: object, **kwargs: object) -> tuple[object, tuple[object, ...], dict[str, object]]: return result, recorded_args(args), kwargs implementation: Final = async_override if is_async else sync_override diff --git a/tests/unit/test_router/core/test_endpoints_characterization_generic.py b/tests/unit/test_router/core/test_endpoints_characterization_generic.py index f7669bff80c..9a78f5d4fb1 100644 --- a/tests/unit/test_router/core/test_endpoints_characterization_generic.py +++ b/tests/unit/test_router/core/test_endpoints_characterization_generic.py @@ -431,6 +431,29 @@ async def test_a_plain_response_id_without_a_model_fails_with_type_error(make_co assert host.calls == [] +@pytest.mark.parametrize("retrieval_query_param", ["retrievalQuery", "retrieval_query"]) +@pytest.mark.parametrize("endpoint", ["avector_store_search", "vector_store_search"]) +async def test_a_deployments_raw_retrieval_query_never_reaches_a_routed_vector_store_search( + make_core: MakeCore, host: EndpointHost, endpoint: str, retrieval_query_param: str +): + from_deployment: Final = {"text": "from the deployment"} + core: Final = make_core( + model_list=[ + deployment( + "g", + "d1", + **{retrieval_query_param: from_deployment, "extra_body": {retrieval_query_param: from_deployment, "kept": 1}}, + ) + ] + ) + + await _call(core, endpoint, {"model": "g", "vector_store_id": "v", "query": "q"}) + + sent: Final = host.calls[0].kwargs + assert retrieval_query_param not in sent + assert sent["extra_body"] == {"kept": 1} + + # --- container ids ------------------------------------------------------------------------ ENCODED_CONTAINER_ID: Final = ResponsesAPIRequestUtils.build_container_id("azure", "d2", "cntr_upstream") diff --git a/tests/unit/test_router/core/test_registry_characterization_model_info.py b/tests/unit/test_router/core/test_registry_characterization_model_info.py index 578183d7f02..b613aed041d 100644 --- a/tests/unit/test_router/core/test_registry_characterization_model_info.py +++ b/tests/unit/test_router/core/test_registry_characterization_model_info.py @@ -8,6 +8,7 @@ import pytest import litellm from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap +from litellm.router_api import ChangeSet from litellm.router_core import RouterCore from litellm.types.router import Deployment, RouterCacheEnum from litellm.utils import get_utc_datetime @@ -481,6 +482,20 @@ async def test_group_usage_sums_each_deployments_counters_for_this_minute(make_c assert await core.health().usage("al") == (34, 3) +@pytest.mark.asyncio +async def test_group_usage_follows_deployments_added_and_removed_after_a_read(make_core: MakeCore) -> None: + core = _usage_core(make_core) + await _serve(core, "a", "openai/gpt-4o", 30) + assert await core.health().usage("gpt") == (30, 1) + + core.apply(ChangeSet(upsert=[typed("gpt", "c", model="openai/gpt-4o-mini", tpm=100, rpm=10)])) + await _serve(core, "c", "openai/gpt-4o-mini", 5) + assert await core.health().usage("gpt") == (35, 2) + + core.apply(ChangeSet(delete=["a"])) + assert await core.health().usage("gpt") == (5, 1) + + @pytest.mark.asyncio async def test_io_token_usage_sums_input_and_output_counters(make_core: MakeCore) -> None: core = _usage_core(make_core) diff --git a/tests/unit/test_router/test_router.py b/tests/unit/test_router/test_router.py index ba928bfb8c3..273bebd98e5 100644 --- a/tests/unit/test_router/test_router.py +++ b/tests/unit/test_router/test_router.py @@ -20104,11 +20104,13 @@ def test_router_sends_an_image_to_the_text_only_leg_when_the_vision_leg_is_cooli async def test_anthropic_caller_rate_limit_does_not_block_other_credentials( respx_mock: respx.MockRouter, monkeypatch: pytest.MonkeyPatch, surface: str, credential_kind: str ) -> None: + from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler from litellm.types.router import AllowedFailsPolicy monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) monkeypatch.setattr("time.time", lambda: 1767225600.0) + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) def upstream(request: httpx.Request) -> httpx.Response: credential: Final = request.headers.get("authorization", request.headers.get("x-api-key", "")) diff --git a/tests/unit/test_router/test_router_helper_utils.py b/tests/unit/test_router/test_router_helper_utils.py index 8a5d164fdff..d2b5d2b911b 100644 --- a/tests/unit/test_router/test_router_helper_utils.py +++ b/tests/unit/test_router/test_router_helper_utils.py @@ -750,9 +750,11 @@ async def test_retried_call_settles_deployment_io_tokens_to_the_successful_attem respx_mock: respx.MockRouter, ): from litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKER + from litellm.llms.anthropic.messages.native import handler as python_messages from litellm.responses.streaming_iterator import drain_logging_tasks monkeypatch.setattr(litellm, "disable_aiohttp_transport", True) + monkeypatch.setattr(litellm, "anthropic_messages", python_messages.anthropic_messages) litellm.in_memory_llm_clients_cache.flush_cache() provider: Final = respx_mock.post(provider_url).mock( side_effect=[ diff --git a/tests/unit/test_router/test_router_max_parallel_requests.py b/tests/unit/test_router/test_router_max_parallel_requests.py index 1b350f31f23..ef73e4983a9 100644 --- a/tests/unit/test_router/test_router_max_parallel_requests.py +++ b/tests/unit/test_router/test_router_max_parallel_requests.py @@ -1,11 +1,43 @@ from __future__ import annotations +import datetime from typing import Final +from unittest.mock import patch + +import pytest import litellm -import pytest from litellm.utils import calculate_max_parallel_requests +_ROUTER_CLOCK: Final = "litellm.router_strategy.lowest_tpm_rpm_v2.get_utc_datetime" +_FIRST_MINUTE: Final = datetime.datetime(2026, 1, 1, 12, 0, 59, tzinfo=datetime.timezone.utc) +_NEXT_MINUTE: Final = datetime.datetime(2026, 1, 1, 12, 1, 0, tzinfo=datetime.timezone.utc) + + +def _rpm_limited_router() -> litellm.Router: + return litellm.Router( + model_list=[ + { + "model_name": "limited", + "litellm_params": { + "model": "openai/gpt-4o-mini", + "api_key": "test-key", + "rpm": 1, + }, + } + ], + routing_strategy="usage-based-routing-v2", + enable_pre_call_checks=True, + num_retries=0, + ) + + +_RPM_LIMITED_REQUEST: Final = { + "model": "limited", + "messages": [{"role": "user", "content": "rate limit"}], + "mock_response": "response", +} + @pytest.mark.parametrize( ("max_parallel_requests", "tpm", "rpm", "default_max_parallel_requests", "expected"), @@ -37,32 +69,26 @@ def test_scenario( @pytest.mark.asyncio async def test_max_parallel_requests_rpm_rate_limiting() -> None: - router: Final = litellm.Router( - model_list=[ - { - "model_name": "limited", - "litellm_params": { - "model": "openai/gpt-4o-mini", - "api_key": "test-key", - "rpm": 1, - }, - } - ], - routing_strategy="usage-based-routing-v2", - enable_pre_call_checks=True, - num_retries=0, - ) - request: Final = { - "model": "limited", - "messages": [{"role": "user", "content": "rate limit"}], - "mock_response": "response", - } + router: Final = _rpm_limited_router() - first_response: Final = await router.acompletion(**request) + with patch(_ROUTER_CLOCK, return_value=_FIRST_MINUTE): + first_response: Final = await router.acompletion(**_RPM_LIMITED_REQUEST) - assert first_response.choices[0].message.content == "response" - with pytest.raises(litellm.RateLimitError): - await router.acompletion(**request) + assert first_response.choices[0].message.content == "response" + with pytest.raises(litellm.RateLimitError): + await router.acompletion(**_RPM_LIMITED_REQUEST) + + +@pytest.mark.asyncio +async def test_rpm_limit_resets_in_the_next_minute() -> None: + router: Final = _rpm_limited_router() + + with patch(_ROUTER_CLOCK, return_value=_FIRST_MINUTE): + await router.acompletion(**_RPM_LIMITED_REQUEST) + with patch(_ROUTER_CLOCK, return_value=_NEXT_MINUTE): + next_minute_response: Final = await router.acompletion(**_RPM_LIMITED_REQUEST) + + assert next_minute_response.choices[0].message.content == "response" @pytest.mark.asyncio diff --git a/tests/unit/test_vcr_conftest_common_banner.py b/tests/unit/test_vcr_conftest_common_banner.py index 30a65abba1d..515d031afa9 100644 --- a/tests/unit/test_vcr_conftest_common_banner.py +++ b/tests/unit/test_vcr_conftest_common_banner.py @@ -145,7 +145,7 @@ def test_banner_silent_when_vcr_disabled(monkeypatch, health_reset, patch_capaci # --------------------------------------------------------------------------- -# Diagnostic-log dedup + cap. CircleCI truncates step output to the last +# Diagnostic-log dedup + cap. GitHub Actions truncates step output to the last # ~400 KB; an unbounded diagnostic dump pushes the VCR classification summary # out of the retrievable window, so the dump must dedupe and cap. # --------------------------------------------------------------------------- diff --git a/tests/unit/vector_stores/test_main.py b/tests/unit/vector_stores/test_main.py index 21b1eee3a3e..b89806e6377 100644 --- a/tests/unit/vector_stores/test_main.py +++ b/tests/unit/vector_stores/test_main.py @@ -120,6 +120,147 @@ def test_search_forwards_top_level_user_context_to_bedrock_retrieve(): assert posted["retrievalQuery"] == {"text": "q"} +QUERY_IMAGE: Final = {"type": "base64", "media_type": "image/jpeg", "data": "/9j/4AAQSkZJRg=="} + + +def _search_with_recorded_post(**search_kwargs: object) -> MagicMock: + client: Final = MagicMock(spec=HTTPHandler) + client.post.return_value = MagicMock( + status_code=200, + json=MagicMock( + return_value=( + {"object": "vector_store.search_results.page", "search_query": "", "data": []} + if search_kwargs.get("custom_llm_provider") == "openai" + else {"retrievalResults": []} + ) + ), + ) + credentials: Final = ( + {"api_key": "sk-test"} + if search_kwargs.get("custom_llm_provider") == "openai" + else {"aws_region_name": "us-west-2", "aws_access_key_id": "test-key-id", "aws_secret_access_key": "secret"} + ) + search(vector_store_id="kb123", client=client, litellm_logging_obj=MagicMock(), **credentials, **search_kwargs) + return client + + +@pytest.mark.parametrize("query", [None, "", " ", ["", " "]]) +def test_search_by_query_image_sends_a_bedrock_image_retrieval_query(query: str | list[str] | None): + query_kwargs: Final = {} if query is None else {"query": query} + + client: Final = _search_with_recorded_post(custom_llm_provider="bedrock", query_image=QUERY_IMAGE, **query_kwargs) + + posted: Final = json.loads(client.post.call_args.kwargs["data"]) + assert posted["retrievalQuery"] == { + "type": "IMAGE", + "image": {"format": "jpeg", "inlineContent": "/9j/4AAQSkZJRg=="}, + } + + +@pytest.mark.parametrize( + ("search_kwargs", "message"), + [ + ( + {"custom_llm_provider": "bedrock", "query": "red circle", "query_image": QUERY_IMAGE}, + "Send either query or query_image, not both.", + ), + ({"custom_llm_provider": "bedrock"}, "query or query_image is required."), + ( + {"custom_llm_provider": "bedrock", "query": 5, "query_image": QUERY_IMAGE}, + "Send either query or query_image, not both.", + ), + ( + {"custom_llm_provider": "bedrock", "query": [1, 2], "query_image": QUERY_IMAGE}, + "Send either query or query_image, not both.", + ), + ( + {"custom_llm_provider": "openai", "query_image": QUERY_IMAGE}, + "openai vector stores do not support query_image. To drop it", + ), + ( + {"custom_llm_provider": "openai", "query": "red circle", "query_image": QUERY_IMAGE}, + "openai vector stores do not support query_image. To drop it", + ), + ( + {"custom_llm_provider": "openai", "query": "", "query_image": QUERY_IMAGE, "drop_params": True}, + "drop_params dropped it", + ), + ], +) +def test_search_rejects_an_unusable_query_with_a_bad_request(search_kwargs: dict[str, object], message: str): + with pytest.raises(litellm.BadRequestError) as exc_info: + _search_with_recorded_post(**search_kwargs) + + assert exc_info.value.status_code == 400 + assert message in str(exc_info.value) + + +def test_search_rejects_an_invalid_query_image_without_echoing_its_data(): + image_data: Final = "c2VjcmV0LWltYWdlLWJ5dGVz" + + with pytest.raises(litellm.BadRequestError) as exc_info: + _search_with_recorded_post( + custom_llm_provider="bedrock", + query_image={"type": "base64", "media_type": "image/tiff", "data": image_data}, + ) + + assert exc_info.value.status_code == 400 + assert "query_image.media_type" in str(exc_info.value) + assert image_data not in str(exc_info.value) + + +@pytest.mark.parametrize("data", ["not base64!", "/9j/4AAQ SkZJRg==", "/9j/4AAQ\tSkZJRg=="]) +def test_search_rejects_query_image_data_that_is_not_base64(data: str): + with pytest.raises(litellm.BadRequestError) as exc_info: + _search_with_recorded_post( + custom_llm_provider="bedrock", + query_image={"type": "base64", "media_type": "image/jpeg", "data": data}, + ) + + assert exc_info.value.status_code == 400 + assert "query_image.data: not valid base64" in str(exc_info.value) + assert data not in str(exc_info.value) + + +@pytest.mark.parametrize("line_break", ["\n", "\r\n"]) +def test_search_sends_line_wrapped_query_image_data_to_bedrock_as_sent(line_break: str): + data: Final = line_break.join(("/9j/4AAQ", "SkZJRg==")) + + client: Final = _search_with_recorded_post( + custom_llm_provider="bedrock", + query_image={"type": "base64", "media_type": "image/jpeg", "data": data}, + ) + + posted: Final = json.loads(client.post.call_args.kwargs["data"]) + assert posted["retrievalQuery"]["image"]["inlineContent"] == data + + +def test_search_by_a_query_image_sent_in_extra_body_sends_a_bedrock_image_retrieval_query(): + client: Final = _search_with_recorded_post(custom_llm_provider="bedrock", extra_body={"query_image": QUERY_IMAGE}) + + posted: Final = json.loads(client.post.call_args.kwargs["data"]) + assert posted["retrievalQuery"] == { + "type": "IMAGE", + "image": {"format": "jpeg", "inlineContent": "/9j/4AAQSkZJRg=="}, + } + + +@pytest.mark.parametrize("drop_params_source", ["request", "global"]) +def test_search_drops_query_image_for_a_provider_without_image_search_when_drop_params_is_on( + drop_params_source: str, monkeypatch: pytest.MonkeyPatch +): + monkeypatch.setattr(litellm, "drop_params", drop_params_source == "global") + drop_kwargs: Final = {"drop_params": True} if drop_params_source == "request" else {} + + client: Final = _search_with_recorded_post( + custom_llm_provider="openai", query="red circle", query_image=QUERY_IMAGE, **drop_kwargs + ) + + posted: Final = json.loads(client.post.call_args.kwargs["data"]) + assert posted["query"] == "red circle" + assert "query_image" not in posted + + PROXY_STAMPED_METADATA: Final = { "team": "llmproxy", "user_api_key": "hashed-key", diff --git a/tests/unit/vector_stores/test_vector_store_registry.py b/tests/unit/vector_stores/test_vector_store_registry.py index a6e28f258cb..588dbf35678 100644 --- a/tests/unit/vector_stores/test_vector_store_registry.py +++ b/tests/unit/vector_stores/test_vector_store_registry.py @@ -497,6 +497,29 @@ def test_vector_store_ids_to_run_reads_every_store_id_a_malformed_vector_store_i assert VectorStoreRegistry().get_vector_store_ids_to_run(non_default_params={}, tools=tools) == ["vs_requested"] +@pytest.mark.parametrize( + ("tool_field", "tool_value", "searched_params"), + [ + ("query_image", {"type": "base64", "media_type": "image/jpeg", "data": "/9j/"}, {"max_num_results": 3}), + ("rewrite_query", True, {"max_num_results": 3, "rewrite_query": True}), + ("rewrite_query", False, {"max_num_results": 3}), + ], +) +def test_file_search_tool_passes_its_store_only_the_fields_a_store_search_takes( + tool_field: str, tool_value: object, searched_params: dict[str, object] +) -> None: + now: Final = datetime.now(timezone.utc) + registry: Final = VectorStoreRegistry( + [LiteLLM_ManagedVectorStore(vector_store_id="vs_kb", created_at=now, updated_at=now)] + ) + tools: Final = [{"type": "file_search", "vector_store_ids": ["vs_kb"], "max_num_results": 3, tool_field: tool_value}] + + to_run: Final = registry.pop_vector_stores_to_run(non_default_params={}, tools=tools) + + assert [store["vector_store_id"] for store in to_run] == ["vs_kb"] + assert to_run[0]["litellm_params"] == searched_params + + @pytest.mark.parametrize( "vector_store_ids", ["vs_allowed", ["vs_allowed", 12345], [12345], ["vs_allowed"]], diff --git a/ui/litellm-dashboard/public/assets/logos/collieai.svg b/ui/litellm-dashboard/public/assets/logos/collieai.svg new file mode 100644 index 00000000000..dff072d0c30 --- /dev/null +++ b/ui/litellm-dashboard/public/assets/logos/collieai.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_configs.ts b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_configs.ts index e532b5bfd74..7a9060c5d02 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_configs.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_configs.ts @@ -393,4 +393,10 @@ export const GUARDRAIL_PRESETS: Record = { mode: ["pre_call", "post_call"], defaultOn: false, }, + collieai: { + provider: "Collieai", + guardrailNameSuggestion: "CollieAi", + mode: ["pre_call", "post_call"], + defaultOn: false, + }, }; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.test.ts b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.test.ts index 20725e73e37..9839db91376 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.test.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.test.ts @@ -6,6 +6,13 @@ import { LITELLM_CONTENT_FILTER_CARDS, PARTNER_GUARDRAIL_CARDS, } from "./guardrail_garden_data"; +import { + getGuardrailLogoAndName, + getGuardrailProviders, + guardrailLogoMap, + populateGuardrailProviderMap, + populateGuardrailProviders, +} from "./guardrail_info_helpers"; const EXPECTED_PARTNER_LOGO_FILES: Record = { presidio: "microsoft_azure.svg", @@ -39,6 +46,7 @@ const EXPECTED_PARTNER_LOGO_FILES: Record = { conduct: "conduct.png", wingback: "wingback.png", airia: "airia.svg", + collieai: "collieai.svg", }; describe("guardrail_garden_data logos", () => { @@ -100,3 +108,26 @@ describe("decision model presets", () => { } }); }); + +describe("collieai preset", () => { + it("opens the CollieAi card on both halves of the call, off until a request or Always On asks for it", () => { + const expectedPreset = { + provider: "Collieai", + guardrailNameSuggestion: "CollieAi", + mode: ["pre_call", "post_call"], + defaultOn: false, + }; + expect(GUARDRAIL_PRESETS["collieai"]).toEqual(expectedPreset); + }); + + it("uses the provider key the proxy's provider list generates, so saved guardrails keep their name and logo", () => { + const providerParams = { collieai: { ui_friendly_name: "CollieAi" } }; + populateGuardrailProviders(providerParams); + populateGuardrailProviderMap(providerParams); + const provider = GUARDRAIL_PRESETS["collieai"].provider; + + expect(getGuardrailLogoAndName("collieai")).toEqual({ logo: guardrailLogoMap.CollieAi, displayName: "CollieAi" }); + expect(Object.keys(getGuardrailProviders())).toContain(provider); + expect(PARTNER_GUARDRAIL_CARDS.find((card) => card.id === "collieai")?.providerKey).toBe(provider); + }); +}); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.ts b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.ts index dc6acffa13c..9cb9521bb9d 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_garden_data.ts @@ -717,6 +717,16 @@ export const PARTNER_GUARDRAIL_CARDS: GuardrailCardInfo[] = [ tags: ["Security", "Prompt Injection", "PII", "Secrets", "Redaction"], providerKey: "Airia", }, + { + id: "collieai", + name: "CollieAi", + description: + "CollieAi checks chat completion text against your CollieAi policy before and after the model call and records each finding in LiteLLM's guardrail log. It observes by default. Block mode refuses the calls the policy blocks and every call it cannot check.", + category: "partner", + logo: guardrailLogoMap["CollieAi"], + tags: ["Security", "Prompt Injection", "PII", "Policy", "Monitoring"], + providerKey: "Collieai", + }, ]; export const ALL_CARDS = [...LITELLM_CONTENT_FILTER_CARDS, ...DECISION_MODEL_CARDS, ...PARTNER_GUARDRAIL_CARDS]; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_info_helpers.tsx b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_info_helpers.tsx index d0253875735..bb773bbbb7f 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_info_helpers.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails/_components/guardrail_info_helpers.tsx @@ -9,6 +9,7 @@ import conductLogo from "../../../../../public/assets/logos/conduct.png"; import aporiaLogo from "../../../../../public/assets/logos/aporia.png"; import bedrockLogo from "../../../../../public/assets/logos/bedrock.svg"; import catoNetworksLogo from "../../../../../public/assets/logos/cato_networks.svg"; +import collieaiLogo from "../../../../../public/assets/logos/collieai.svg"; import ciscoLogo from "../../../../../public/assets/logos/cisco.png"; import deepkeepLogo from "../../../../../public/assets/logos/deepkeep.svg"; import enkryptAiLogo from "../../../../../public/assets/logos/enkrypt_ai.avif"; @@ -94,6 +95,7 @@ export const guardrail_provider_map: Record = { "LLM Shield Proxy": "llm_shield_proxy", Conduct: "conduct", DecisionModel: "decision_model", + Collieai: "collieai", }; // Search aliases matched alongside the provider label in the add-guardrail provider combobox @@ -332,6 +334,7 @@ export const guardrailLogoMap = { "Conduct Guard": conductLogo.src, Wingback: wingbackLogo.src, "Airia Guardrail": airiaLogo.src, + CollieAi: collieaiLogo.src, "Decision Model": litellmLogo.src, } satisfies Record; diff --git a/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx index b376a83f987..d99d754d206 100644 --- a/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTable.tsx @@ -56,6 +56,7 @@ const TABLE_OPTIONS: readonly FilterOption[] = [ { labelKey: "logs.audit.tableNames.organizations", value: "LiteLLM_OrganizationTable" }, { labelKey: "logs.audit.tableNames.models", value: "LiteLLM_ProxyModelTable" }, { labelKey: "logs.audit.tableNames.agents", value: "LiteLLM_AgentsTable" }, + { labelKey: "logs.audit.tableNames.guardrails", value: "LiteLLM_GuardrailsTable" }, ]; const ACTION_FILTER_ITEMS: readonly FilterOption[] = [ diff --git a/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx index 9d22d09daa7..b0dca4ed6af 100644 --- a/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx +++ b/ui/litellm-dashboard/src/components/logs/audit/AuditLogsTableColumns.tsx @@ -26,6 +26,7 @@ export const AUDIT_TABLE_NAME_DISPLAY: Record = { LiteLLM_OrganizationTable: "logs.audit.tableNames.organizations", LiteLLM_ProxyModelTable: "logs.audit.tableNames.models", LiteLLM_AgentsTable: "logs.audit.tableNames.agents", + LiteLLM_GuardrailsTable: "logs.audit.tableNames.guardrails", }; const ACTION_TONE: Record = { diff --git a/ui/litellm-dashboard/src/i18n/locales/en.json b/ui/litellm-dashboard/src/i18n/locales/en.json index 854a49fd546..8e15979afb1 100644 --- a/ui/litellm-dashboard/src/i18n/locales/en.json +++ b/ui/litellm-dashboard/src/i18n/locales/en.json @@ -14935,7 +14935,8 @@ "users": "Users", "organizations": "Organizations", "models": "Models", - "agents": "Agents" + "agents": "Agents", + "guardrails": "Guardrails" }, "drawer": { "notAvailable": "N/A", diff --git a/ui/litellm-dashboard/src/lib/logoTreatments.test.ts b/ui/litellm-dashboard/src/lib/logoTreatments.test.ts index 828ea72a57f..6ae74738b4d 100644 --- a/ui/litellm-dashboard/src/lib/logoTreatments.test.ts +++ b/ui/litellm-dashboard/src/lib/logoTreatments.test.ts @@ -14,6 +14,7 @@ describe("logoTreatmentFor", () => { it("marks a multicolor dark mark for a plate instead of inversion", () => { expect(logoTreatmentFor("/ui/assets/logos/fireworks.svg")).toBe("plate"); + expect(logoTreatmentFor("/ui/assets/logos/collieai.svg")).toBe("plate"); }); it("plates a dark mark with a light knockout, which inversion would flatten away", () => { diff --git a/ui/litellm-dashboard/src/lib/logoTreatments.ts b/ui/litellm-dashboard/src/lib/logoTreatments.ts index 4cd6f65a613..f8b4ecc05b1 100644 --- a/ui/litellm-dashboard/src/lib/logoTreatments.ts +++ b/ui/litellm-dashboard/src/lib/logoTreatments.ts @@ -36,6 +36,7 @@ const TREATMENT_BY_ASSET: Readonly> = { "aiml_api.svg": "plate", "akto.svg": "plate", "aws.svg": "plate", + "collieai.svg": "plate", "deepkeep.svg": "plate", "fireworks.svg": "plate", "llm_guard.png": "plate",