Commit daabe1a
## Summary
- Strip trailing `/v1` from the vLLM base URL before constructing
Anthropic Messages API paths, fixing a double `/v1/v1/` that caused 404s
- Add `_get_base_url_without_version()` helper matching the existing
Ollama adapter pattern, and use it in `anthropic_messages()`,
`anthropic_count_tokens()`, and `rerank()`
- Add 6 regression tests covering URL construction with various base URL
formats
Closes #6290
## Test plan
- [x] Existing vLLM unit tests pass (33/33)
- [x] New `TestBaseUrlVersionStripping` parametrized tests verify `/v1`
stripping for base URLs with/without trailing `/v1` and trailing slash
- [x] New integration-style tests verify `anthropic_messages()` and
`anthropic_count_tokens()` construct `http://localhost:8000/v1/messages`
(not `/v1/v1/messages`) when `base_url=http://localhost:8000/v1`
- [x] Pre-commit hooks pass (ruff, mypy, all project checks)
```bash
uv run pytest tests/unit/providers/inference/test_remote_vllm.py -v --tb=short
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)<hr>This
is an automatic backport of pull request #6294 done by
[Mergify](https://mergify.com).
---------
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Co-authored-by: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6762882 commit daabe1a
2 files changed
Lines changed: 90 additions & 3 deletions
File tree
- src/ogx/providers/remote/inference/vllm
- tests/unit/providers/inference
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
243 | | - | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
| |||
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
285 | | - | |
| 292 | + | |
286 | 293 | | |
287 | 294 | | |
288 | 295 | | |
| |||
367 | 374 | | |
368 | 375 | | |
369 | 376 | | |
370 | | - | |
| 377 | + | |
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
628 | 708 | | |
629 | 709 | | |
630 | 710 | | |
| |||
0 commit comments