Skip to content

[MISC] Bump litellm 1.85.1 → 1.90.3 for MiniMax-M3 cost support#2169

Merged
chandrasekharan-zipstack merged 4 commits into
mainfrom
misc/bump-litellm-1903
Jul 14, 2026
Merged

[MISC] Bump litellm 1.85.1 → 1.90.3 for MiniMax-M3 cost support#2169
chandrasekharan-zipstack merged 4 commits into
mainfrom
misc/bump-litellm-1903

Conversation

@chandrasekharan-zipstack

Copy link
Copy Markdown
Contributor

What

Bumps litellm from 1.85.1 to 1.90.3 in unstract/sdk1 and re-locks all consuming services (backend, workers, platform-service, tool-registry, workflow-execution, connectors, filesystem, root).

Why

litellm 1.85.1 has no minimax/MiniMax-M3 entry in its cost map, so native MiniMax-M3 usage silently bills $0 (the prefixed model string isn't found → the bare except in the cost path records zero). litellm 1.90.0 added the model along with its long-context pricing tier — input/output/cache_read_*_cost_per_token_above_512k_tokens — so the standard litellm cost path prices M3 correctly, including the >512k flat-rate switch. 1.90.3 is the settled patch on that minor.

This unblocks the MiniMax adapter PR (#2166) to drop its bespoke local pricing engine and rely on litellm like every other adapter.

Safety review (1.85.1 → 1.90.3)

  • No new dependency floors. requires-dist is byte-identical across the range (openai>=2.20, pydantic>=2.10, httpx>=0.28, requires-python>=3.10,<3.14) — all already satisfied.
  • No in-scope breaking changes to completion(), cost_per_token, generic_cost_per_token, model_cost, get_model_info, register_model, or token_counter.
  • Bonus fix: the 1.90.0 register_model change now preserves built-in cache pricing when registering custom overrides.
  • Lock diff is litellm-only — no transitive package moved (verified).

Verification

minimax/MiniMax-M3 priced: base=$0.0300 (<512k, @3e-7), tier=$0.6000 (1M prompt, @6e-7 above-512k)

(On 1.85.1 the model was absent → $0.)

Note

This is a bump PR raised separately so the team owns the regression check. Full regression coverage relies on CI + the SDK test suite on this branch.

🤖 Generated with Claude Code

1.85.1 has no `minimax/MiniMax-M3` entry in litellm's cost map, so
native MiniMax-M3 usage bills $0. 1.90.0 added the model with its
long-context pricing tier (input/output/cache `_above_512k_tokens`),
letting the standard litellm cost path price it correctly.

1.90.3 is the settled patch on that minor. No new dependency floors and
no in-scope breaking changes to `completion`/`cost_per_token`/
`register_model`/`token_counter` between 1.85.1 and 1.90.3; the 1.90.0
`register_model` fix (preserves built-in cache pricing on override) is a
bonus. Re-locked all consuming services so the running images pick up
the new version rather than staying pinned at 1.85.1 transitively.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 51d4973a-c35c-4810-95c3-24194390e8cd

📥 Commits

Reviewing files that changed from the base of the PR and between c00f082 and 9a0100c.

📒 Files selected for processing (1)
  • unstract/sdk1/src/unstract/sdk1/patches/litellm_cohere_timeout.py

Summary by CodeRabbit

  • Chores
    • Updated the LiteLLM integration to a newer version, ensuring compatibility with the latest improvements and fixes.
    • Adjusted the LiteLLM timeout-related behavior so it applies based on the new LiteLLM version pin.

Walkthrough

The SDK’s litellm dependency and Cohere timeout patch version guard are updated from 1.85.1 to 1.90.3.

Changes

LiteLLM version alignment

Layer / File(s) Summary
Update dependency and patch guard
unstract/sdk1/pyproject.toml, unstract/sdk1/src/unstract/sdk1/patches/litellm_cohere_timeout.py
The SDK dependency, verified-version comment, and _PATCHED_LITELLM_VERSION constant now target litellm version 1.90.3 instead of 1.85.1.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers What, Why, safety impact, and testing, but it does not follow several required template sections. Add the missing template sections or mark them N/A, especially How, breakage impact, database migrations, env config, dependencies versions, and checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the LiteLLM version bump and its MiniMax-M3 cost-support motivation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch misc/bump-litellm-1903

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chandrasekharan-zipstack chandrasekharan-zipstack marked this pull request as ready for review July 13, 2026 09:40
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR upgrades LiteLLM to add native MiniMax-M3 pricing support. The main changes are:

  • Pins LiteLLM 1.90.3 in the SDK.
  • Regenerates lockfiles for all consuming services.
  • Retargets the Cohere timeout workaround to LiteLLM 1.90.3.

Confidence Score: 5/5

This looks safe to merge.

  • The Cohere timeout workaround remains enabled for the upgraded LiteLLM version.
  • No blocking issue was confirmed in the updated code.

Important Files Changed

Filename Overview
unstract/sdk1/src/unstract/sdk1/patches/litellm_cohere_timeout.py Updates the strict version guard so the Cohere timeout workaround applies to LiteLLM 1.90.3.
unstract/sdk1/pyproject.toml Updates the SDK dependency pin from LiteLLM 1.85.1 to 1.90.3.
unstract/sdk1/uv.lock Locks LiteLLM 1.90.3 with updated package hashes and metadata.

Reviews (4): Last reviewed commit: "Merge branch 'main' into misc/bump-litel..." | Re-trigger Greptile

Comment thread unstract/sdk1/pyproject.toml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
unstract/sdk1/pyproject.toml (1)

30-30: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the LiteLLM upgrade.

The SDK directly uses completion, acompletion, token_counter, and cost_per_token. Please cover MiniMax-M3 pricing below and above 512k tokens, cache pricing for custom overrides, and sync/async response parsing so future LiteLLM changes cannot silently record zero cost.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@unstract/sdk1/pyproject.toml` at line 30, Add regression tests covering the
LiteLLM upgrade: validate MiniMax-M3 pricing below and above 512k tokens, cache
pricing with custom overrides, and sync/async response parsing through
completion and acompletion. Exercise token_counter and cost_per_token so
successful responses record nonzero, expected costs and remain protected against
future LiteLLM changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@unstract/sdk1/pyproject.toml`:
- Line 30: Add regression tests covering the LiteLLM upgrade: validate
MiniMax-M3 pricing below and above 512k tokens, cache pricing with custom
overrides, and sync/async response parsing through completion and acompletion.
Exercise token_counter and cost_per_token so successful responses record
nonzero, expected costs and remain protected against future LiteLLM changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7493fef4-7fe8-4d54-98a9-87b85448ca1a

📥 Commits

Reviewing files that changed from the base of the PR and between c8c7ea8 and c00f082.

⛔ Files ignored due to path filters (9)
  • backend/uv.lock is excluded by !**/*.lock
  • platform-service/uv.lock is excluded by !**/*.lock
  • unstract/connectors/uv.lock is excluded by !**/*.lock
  • unstract/filesystem/uv.lock is excluded by !**/*.lock
  • unstract/sdk1/uv.lock is excluded by !**/*.lock
  • unstract/tool-registry/uv.lock is excluded by !**/*.lock
  • unstract/workflow-execution/uv.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
  • workers/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • unstract/sdk1/pyproject.toml

The patch is version-guarded to the exact litellm pin; the 1.85.1 -> 1.90.3
bump left it skipped, so `_patched_async_embedding` was never defined and
its test failed to import. The bug is still present in 1.90.3 (cohere
`async_embedding`/`embedding` still don't forward `timeout` to
`client.post()`) and the copied bodies still match upstream, so only the
version constant needed updating.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@pk-zipstack pk-zipstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Unstract test results

Per-group results

Status Group Tier Passed Failed Errors Skipped Duration (s)
e2e-login e2e 2 0 0 0 2.0
e2e-smoke e2e 2 0 0 0 1.1
integration-backend integration 56 0 0 27 46.3
integration-connectors integration 1 0 0 7 8.0
unit-backend unit 126 0 0 0 21.8
unit-connectors unit 63 0 0 0 10.0
unit-core unit 27 0 0 0 1.3
unit-platform-service unit 15 0 0 0 2.7
unit-rig unit 69 0 0 0 3.5
unit-sdk1 unit 435 0 0 0 26.1
unit-workers unit 0 0 0 0 28.6
TOTAL 796 0 0 34 151.4

Critical paths

⚠️ Critical paths not yet covered

  • workflow-create-execute — Create a workflow, configure source+destination, execute, poll, fetch result. (entry: POST /api/v1/workflow/{id}/execute/; declared coverage: e2e-workflow)
  • api-deployment-run — Deploy a workflow as an API, POST a document, receive structured JSON. (entry: POST /deployment/api/{org}/{name}/; declared coverage: e2e-api-deployment)
  • prompt-studio-fetch-response — Prompt Studio: create project, add prompt, run single-pass, get response. (entry: POST /api/v1/prompt-studio/prompt-studio-tool/{id}/fetch_response/; declared coverage: e2e-prompt-studio)
  • pipeline-etl-execute — Run an ETL pipeline from source connector to destination. (entry: POST /api/v1/pipeline/{id}/execute/; declared coverage: no groups declared)
  • usage-token-tracking — Per-execution token usage is recorded and retrievable. (entry: GET /api/v1/usage/get_token_usage/; declared coverage: no groups declared)
  • workflow-execution-fan-out — Multi-file workflow execution fans out to file-processing workers and rejoins. (entry: internal: backend → rabbitmq → workers/file_processing; declared coverage: no groups declared)
  • callback-result-delivery — Async results are posted back via the callback worker. (entry: internal: workers/callback → backend /internal endpoints; declared coverage: no groups declared)
✅ Covered critical paths
  • auth-login — covered by e2e-login
  • adapter-register-llm — covered by integration-backend

@chandrasekharan-zipstack chandrasekharan-zipstack merged commit 72b4c77 into main Jul 14, 2026
12 checks passed
@chandrasekharan-zipstack chandrasekharan-zipstack deleted the misc/bump-litellm-1903 branch July 14, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants