Skip to content

Conversation

@jwlee64
Copy link
Contributor

@jwlee64 jwlee64 commented Feb 5, 2026

Description

Removes trailing slashes from base-urls of custom providers

was causing issues like wandb.ai//model when sending to litellm

Testing

adds some unit tests

@jwlee64 jwlee64 requested a review from a team as a code owner February 5, 2026 18:29
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
weave/trace_server/llm_completion.py 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wandbot-3000
Copy link

wandbot-3000 bot commented Feb 5, 2026

extra_headers: dict[str, str] | None = None,
return_type: str | None = None,
) -> tsi.CompletionsCreateRes:
# Normalize base_url to prevent issues with trailing slashes causing redirects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that this fixes the issue makes me wonder if we have brittle url-creation code elsewhere. Is that other code something that we can change? If so, a more durable and holistic fix would be to make the other code more resilient to trailing slashes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mscavezze-cw Yes unfortunately I believe this issue is on the litellm side of the url construction, we just send them the base url inputted by the user here.

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.

2 participants