Skip to content

Conversation

@gcardoso2314
Copy link

Title

Correctly map context exceeded errors for Claude models in Vertex AI

Relevant issues

We've been getting the following error returned from LiteLLM Proxy when using Claude models in Vertex AI:

{"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 195261 + 12288 > 204650, decrease input length or `max_tokens` and try again"},"request_id":"<REDACTED>"}

Pre-Submission checklist

New test passing:
Screenshot 2025-10-23 at 11 15 21

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix
✅ Test

Changes

Added a new string that should map to context window exceeded error to allow the context fallbacks to kick in.

@vercel
Copy link

vercel bot commented Oct 23, 2025

@gcardoso2314 is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant