Skip to content

feat: Add IBM WatsonX AI client integration#161

Open
injusticescorpio wants to merge 3 commits into
alexzhang13:mainfrom
injusticescorpio:watsonx_client
Open

feat: Add IBM WatsonX AI client integration#161
injusticescorpio wants to merge 3 commits into
alexzhang13:mainfrom
injusticescorpio:watsonx_client

Conversation

@injusticescorpio

@injusticescorpio injusticescorpio commented May 11, 2026

Copy link
Copy Markdown

Summary

This PR adds support for IBM WatsonX AI as a new backend for RLM, enabling users to run language models through IBM's WatsonX AI platform. The integration uses LangChain's ChatWatsonx client, providing tool calling support, streaming capabilities, and structured output handling.

Implemented:

  • Complete WatsonX client implementation with sync and async support
  • Message format conversion (string, dict, and multi-turn conversations)
  • Usage tracking (tokens and call counts)
  • Environment variable configuration support
  • Comprehensive test suite with 100% coverage of core functionality
  • Working example demonstrating usage
  • Integration into RLM's backend routing system

Note: WatsonX API doesn't provide cost information in responses hence it returns None.

Test Plan

  • Unit tests added covering:
    • Message format conversion (string, dict, list)
    • Sync and async completion methods
    • Error handling for invalid inputs
  • All tests pass with mocked WatsonX client
  • Example code provided for manual testing with real credentials
  • Integration follows existing client patterns (OpenAI, Anthropic, Gemini)

Breaking Changes

None. This is a purely additive change.

@injusticescorpio injusticescorpio changed the title Watsonx client feat: Add IBM WatsonX AI client integration May 11, 2026
@injusticescorpio

Copy link
Copy Markdown
Author

@alexzhang13 could you please review and merge this PR?

1 similar comment
@injusticescorpio

Copy link
Copy Markdown
Author

@alexzhang13 could you please review and merge this PR?

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