Skip to content

fix: set dummy OPENAI_API_KEY fallback for custom providers and correct Ollama endpoint#60

Merged
CalebAbhulimhen merged 1 commit into
mainfrom
fix/ollama-custom-provider-api-key
Jun 15, 2026
Merged

fix: set dummy OPENAI_API_KEY fallback for custom providers and correct Ollama endpoint#60
CalebAbhulimhen merged 1 commit into
mainfrom
fix/ollama-custom-provider-api-key

Conversation

@CalebAbhulimhen

Copy link
Copy Markdown
Collaborator

When using --provider custom without --token, the OpenAI SDK raises an error because OPENAI_API_KEY is unset even though local servers like Ollama don't require authentication. Sets a dummy fallback value so the SDK initialises cleanly.

Also corrects the README Ollama example from --endpoint /api/generate to --endpoint /v1 — Pydantic-AI uses the OpenAI SDK which appends /chat/completions to the base URL, so the OpenAI-compatible path (/v1) is required, not Ollama's native generate endpoint.

Fixes #59

…ct Ollama endpoint

When using --provider custom without --token, the OpenAI SDK raises an error
because OPENAI_API_KEY is unset even though local servers like Ollama don't
require authentication. Sets a dummy fallback value so the SDK initialises cleanly.

Also corrects the README Ollama example from --endpoint /api/generate to
--endpoint /v1 — Pydantic-AI uses the OpenAI SDK which appends /chat/completions
to the base URL, so the OpenAI-compatible path (/v1) is required, not Ollama's
native generate endpoint.

Fixes #59
@CalebAbhulimhen
CalebAbhulimhen merged commit c5defc7 into main Jun 15, 2026
9 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] - Can't seem to use codescan with ollama

1 participant