Merged
Conversation
Merged
Ptah-CT
pushed a commit
to DerAuctor/ct-cipher
that referenced
this pull request
Oct 2, 2025
Fix the Ollama Endpoint 404 Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Ollama 404 Connection Errors with Incorrect URL Endpoints
Summary
Resolves #159 - Fixes persistent 404 errors when connecting to Ollama API by correcting URL endpoint handling for both LLM and embedding services.
Problem
Users experienced 404 "page not found" errors when setting
OLLAMA_BASE_URL=http://localhost:11434. The root cause was inconsistent URL endpoint handling across different services:/v1endpoints (e.g.,/v1/chat/completions)/apiendpoints (e.g.,/api/embeddings)Changes Made
1. Fixed LLM Service URL Handling (factory.ts)
llmConfig.baseURL)env.OLLAMA_BASE_URL)/v1suffix for OpenAI-compatible endpoints2. Fixed Embedding Service URL Handling (service-initializer.ts)
/v1suffix when present for embedding fallback/api/embeddingsendpointTest Cases Now Working
OLLAMA_BASE_URL=http://localhost:11434http://localhost:11434/v1http://localhost:11434OLLAMA_BASE_URL=http://localhost:11434/v1http://localhost:11434/v1http://localhost:11434OLLAMA_BASE_URL=http://localhost:11434/apihttp://localhost:11434/apihttp://localhost:11434/apihttp://localhost:11434/v1http://localhost:11434Impact
Testing
Fixes #159