Skip to content

fix: keep requests within provider image limits - #68

Merged
Im-Beast merged 5 commits into
mainfrom
mateusz/image-limits
Nov 9, 2026
Merged

Im-Beast merged 5 commits into
mainfrom
mateusz/image-limits

Conversation

@Im-Beast

@Im-Beast Im-Beast commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
  • Requests over a provider's image limit keep the most recent images and send each older one as a short text placeholder in its place
    • Uploaded files and images returned by tools both count; PDF pages do not
    • Tool calls and their results keep their pairing
    • Images are omitted in batches of a fifth of the limit, so the prompt prefix stays cacheable across turns
  • Limits per adapter:
    • Azure OpenAI: 50
    • OpenAI: 1,500
    • Anthropic: 100 on 200k-context models, 600 on the rest
    • Gemini and Vertex: none, since their 3,000+ is out of reach
  • openrouterModel and openAICompletionsModel take a maxImages option, because OpenRouter applies whichever limit its upstream provider has

@Im-Beast
Im-Beast merged commit d46832c into main Nov 9, 2026
1 check passed
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