Skip to content

refactor(ollama): update base URL handling to automatically append /v1 suffix for OpenAI SDK compatibility#31

Merged
RaghavChamadiya merged 1 commit intorepowise-dev:mainfrom
gtkacz:30-correct_ollama_endpoint
Apr 4, 2026
Merged

refactor(ollama): update base URL handling to automatically append /v1 suffix for OpenAI SDK compatibility#31
RaghavChamadiya merged 1 commit intorepowise-dev:mainfrom
gtkacz:30-correct_ollama_endpoint

Conversation

@gtkacz
Copy link
Copy Markdown
Contributor

@gtkacz gtkacz commented Apr 3, 2026

Summary

  • The provider owns the contract with the OpenAI SDK. It should handle the URL format it needs, not push that responsibility onto every caller (CLI, server, tests, future integrations).
  • _normalize_base_url is safe to call on URLs that already have /v1 as it won't double-append. This means callers who were already passing /v1 (if any) won't break.
  • OLLAMA_BASE_URL=http://localhost:11434 is the natural, documented convention that matches Ollama's own docs. The /v1 is an implementation detail of the OpenAI compatibility layer.

Related Issues

Closes #30

Test Plan

  • Tests pass (pytest)
  • Lint passes (ruff check .) (Has errors but not from my changes)
  • Web build passes (npm run build) (if frontend changes)

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed

Copy link
Copy Markdown
Collaborator

@swati510 swati510 left a comment

Choose a reason for hiding this comment

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

nit: PR title says "OpenAPI" but should be "OpenAI"

@swati510 swati510 changed the title refactor(ollama): update base URL handling to automatically append /v1 suffix for OpenAPI SDK compatibility refactor(ollama): update base URL handling to automatically append /v1 suffix for OpenAI SDK compatibility Apr 4, 2026
@RaghavChamadiya RaghavChamadiya merged commit 1c70792 into repowise-dev:main Apr 4, 2026
2 of 6 checks passed
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.

[Bug] Cannot point LLM to local oLLaMa instance

3 participants