refactor: replace LiteLLM with OpenAI mixin for WatsonX provider (backport #5133) - #6329
Open
are-ces wants to merge 3 commits into
Open
refactor: replace LiteLLM with OpenAI mixin for WatsonX provider (backport #5133)#6329are-ces wants to merge 3 commits into
are-ces wants to merge 3 commits into
Conversation
…-ai#5133) - Replace `LiteLLMOpenAIMixin` with `OpenAIMixin` for the WatsonX inference provider — WatsonX has an OpenAI-compatible `/v1/chat/completions` endpoint, making LiteLLM unnecessary - Use `AsyncOpenAI` client directly with IAM token authentication (API key → IAM token exchange with caching) - Inject `project_id` via `extra_body` on every request (WatsonX requires it in the request body) - Remove `litellm` from `pip_packages` in provider registry - Raise `NotImplementedError` for `/v1/completions` (unsupported by WatsonX) - Add watsonx provider + model (`meta-llama/llama-3-3-70b-instruct`) to ci-tests distribution - Add watsonx-specific test skips for unsupported features - Remove false file search filter skips (those failures were due to missing local `sentence_transformers`, not WatsonX) This removes ~130 lines of LiteLLM workarounds (stream normalization, usage injection, missing attribute patching). - [x] Run responses suite with `--setup watsonx --inference-mode live`: 77 passed, 0 failures - [x] Run base suite with `--setup watsonx --inference-mode live`: 187 passed, all failures unrelated to WatsonX (missing local deps, missing providers) - [x] Verify IAM token exchange and caching works - [x] Verify `project_id` injection via `extra_body` reaches WatsonX API - [x] Verify tool calling works with `llama-3-3-70b-instruct` - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Sébastien Han <seb@redhat.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
are-ces
requested review from
bbrowning,
cdoern,
franciscojavierarceo,
leseb,
mattf and
raghotham
as code owners
July 21, 2026 12:31
The cherry-pick from main brought in the inline::transformers provider entry which does not exist on the release-0.6.x branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These tests were part of the cherry-pick but test server-side features (service_tier, stream_options) that are not available on release-0.6.x. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #5133 to
release-0.6.x.This cherry-picks the refactor that replaces LiteLLM with the OpenAI mixin for the WatsonX inference provider.
Why this backport is needed: We are shipping llama-stack 0.6 and need WatsonX as an inference provider. The current WatsonX provider (via LiteLLM) does not work with the Responses API due to a mismatch between how LiteLLM returns packets and how Llama Stack expects them. LCORE needs WatsonX support with a working Responses API, which this refactor fixes by removing the LiteLLM dependency.
Merge conflicts were resolved during cherry-pick — all resolutions accept the incoming PR changes in full.
Changes
Test plan
release-0.6.xbranch