Skip to content

fix(openrouter): support llama-index-llms-openai-like 0.7 - #21891

Merged
logan-markewich merged 2 commits into
run-llama:mainfrom
gaurav0107:fix/21860-update-llama-index-llms-openrouter-to-su
Jun 9, 2026
Merged

logan-markewich merged 2 commits into
run-llama:mainfrom
gaurav0107:fix/21860-update-llama-index-llms-openrouter-to-su

Conversation

@gaurav0107

Copy link
Copy Markdown
Contributor

Summary

llama-index-llms-openrouter 0.5.0 caps llama-index-llms-openai-like<0.7, which transitively pins llama-index-llms-openai<0.6 and blocks upgrading llama-index in environments that pull the openrouter integration (#21860).

This PR widens the cap to >=0.7.0,<0.8 (matching the current 0.7.x release line of openai-like, which itself requires llama-index-llms-openai>=0.7.0,<0.8) and bumps the llama-index-core lower bound to >=0.14.3 to match openai-like's floor. The package version is patched from 0.5.0 to 0.5.1.

OpenRouter is a thin OpenAILike subclass that only sets a default API base and a few additional_kwargs for provider routing. The OpenAILike.__init__ keyword arguments used here are stable across the 0.5 → 0.7 jump, so no code changes are required.

Fixes #21860

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New Integration

How Has This Been Tested?

  • uv sync resolves cleanly with the new constraints in llama-index-integrations/llms/llama-index-llms-openrouter.
  • uv run --group dev -- pytest tests/ — both existing tests pass (test_embedding_class, test_provider_routing_settings_injected); the latter exercises the inherited OpenAILike constructor end-to-end.
  • uv run --group dev -- ruff check . — clean.

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have made corresponding changes to the documentation (n/a — dependency-only change)
  • I have added tests that prove my fix is effective (existing tests cover the integration; no new behavior introduced)
  • New and existing unit tests pass locally with my changes

Version Bump?

  • Yes — llama-index-llms-openrouter 0.5.0 → 0.5.1 (patch, dependency-only).

New Package?

  • No.

The openrouter integration capped llama-index-llms-openai-like at <0.7,
which transitively pinned llama-index-llms-openai<0.6 and blocked
upgrading llama-index in environments that pull openrouter.

Bump the openai-like cap to >=0.7.0,<0.8 (matching the current 0.7.x
release line, which depends on llama-index-llms-openai>=0.7.0,<0.8)
and the core lower bound to >=0.14.3 to match openai-like's floor.
OpenRouter is a thin OpenAILike subclass; the OpenAILike constructor
kwargs used here (api_base, api_key, model, additional_kwargs, etc.)
are stable across the 0.5 -> 0.7 jump, so no code changes are needed.

Patch the package version to 0.5.1.

Fixes run-llama#21860
Companion to the previous commit: refresh the package's uv.lock so the
locked transitive resolution matches the new dependency cap. The locked
versions are llama-index-llms-openai-like==0.7.2 and
llama-index-llms-openai==0.7.9, both already on PyPI.
@gaurav0107
gaurav0107 marked this pull request as ready for review June 5, 2026 22:19
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 5, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 9, 2026
@logan-markewich
logan-markewich merged commit c9a4e9e into run-llama:main Jun 9, 2026
12 checks passed
Ricardo-M-L pushed a commit to Ricardo-M-L/llama_index that referenced this pull request Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Update llama-index-llms-openrouter to support llama-index-llms-openai-like 0.7

2 participants