You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add safe __repr__ to WatsonxBackend and LiteLLMBackend #1317
PR #1262 added a __repr__ / __str__ to OpenAIBackend that shows model_id and base_url while masking the API key as ***. During review, @jakelorocco noted that the other backends should be handled too.
Backends to update
Backend
Credential exposure risk
Notes
WatsonxBackend
Yes
Stores self._creds = Credentials(url=..., api_key=...) — if Credentials.__repr__ surfaces the key, it leaks into logs/debug output
LiteLLMBackend
Low
No credential stored on the instance, but has no informative repr today
BedrockBackend is not a class (module-level functions only) — nothing to do there.
What to do
For each backend, add __repr__ / __str__ following the pattern from OpenAIBackend:
Show model_id and base_url so the repr is useful for debugging
Mask any credential field as '***' (or omit it entirely if not stored on the instance)
Acceptance criteria
repr(WatsonxBackend(..., api_key="secret")) does not contain "secret"
repr(LiteLLMBackend(...)) returns something more useful than <LiteLLMBackend object at 0x...>
Unit tests added for each (following the pattern in test/backends/test_openai_unit.py)
Activity
cptnm3 commentedon Jun 30, 2026
Hi team, I would like to contribute to fix this issue.
feat: add safe repr implementations for watsonx and litellm backends (g…