Ollama API Connection Failure (404 Not Found) at api.llm.gestaltservers.com #30

Closed
opened 2025-05-04 12:49:41 +02:00 by Rusfort · 0 comments
Owner

The asset processor tool's Python script (Asset-Frameworker/gui/llm_prediction_handler.py) is unable to connect to the self-hosted Ollama instance expected at https://api.llm.gestaltservers.com. Attempts to use standard Ollama API endpoints result in HTTP 404 errors.

Environment:

Client: Python script using requests library.
Target Service: Ollama instance hosted at https://api.llm.gestaltservers.com.
Other: Base domain api.llm.gestaltservers.com might be reachable. Connections to unrelated services (e.g., LM Studio) from the same client environment work correctly.

Steps Tried & Observations:

Attempted Endpoint /api/generate:
    Script sends request to https://api.llm.gestaltservers.com/api/generate.
    Result: Consistently receives requests.exceptions.HTTPError: 404 Client Error: Not Found.
    Log Snippet:

    2025-05-04 12:25:55 [ERROR  ] gui.llm_prediction_handler: Error calling LLM API.
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.llm.gestaltservers.com/api/generate

Attempted Endpoint /v1/chat/completions (OpenAI compatible):
    Initial curl test (with https:/ typo and no data: curl -D - -X POST https:/api.llm.gestaltservers.com/v1/chat/completions) resulted in HTTP/2 400 Bad Request, suggesting the path was recognized at that moment.
    Script updated to target https://api.llm.gestaltservers.com/v1/chat/completions.
    Result: Script still receives requests.exceptions.HTTPError: 404 Client Error: Not Found.
    Log Snippet:

    2025-05-04 12:45:45 [ERROR  ] gui.llm_prediction_handler: Error calling LLM API.
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.llm.gestaltservers.com/v1/chat/completions

Issue:
There is conflicting information. The script consistently gets 404 errors for all tested Ollama API paths (/api/generate, /v1/chat/completions), indicating the server isn't finding these resources when requested via the script. However, an initial (malformed) curl test suggested /v1/chat/completions might be configured, as it returned a 400 instead of 404. It's unclear if the issue lies purely in the server-side configuration (reverse proxy, Ollama service) or if there's a subtle difference in how the script's requests are formed compared to curl.

Next Diagnostic Steps:

Definitive curl Test: Execute the following command from the client machine to check the current status of the /v1/chat/completions endpoint:
Bash

curl -v -X POST https://api.llm.gestaltservers.com/v1/chat/completions \
     -H "Content-Type: application/json" \
     -d '{"model": "your-model-name", "messages": [{"role": "user", "content": "Test prompt"}], "stream": false}'

(Replace your-model-name with a valid model). Record the exact HTTP status code (e.g., 200, 400, 404, 5xx) and any response body.

Analyze curl Result:
    If curl gets 200 OK or 400 Bad Request: The server path is likely correct. Debug the Python script (_call_llm function): verify exact URL string, ensure POST method is used, check Content-Type header, verify JSON payload structure.
    If curl gets 404 Not Found (or 5xx Server Error): The issue is likely server-side. The administrator for api.llm.gestaltservers.com needs to investigate:
        Reverse proxy configuration (Nginx, Caddy, etc.): Are requests to /api/* and /v1/* being correctly forwarded to the Ollama service (e.g., http://localhost:11434)? Check proxy logs.
        Ollama service status: Is the Ollama service running correctly on the server? Check ollama logs.
        Firewall rules.

Action Items:

[ ] Perform the definitive curl test described above and record results.
[ ] Based on curl results, either debug the Python script's request formation or escalate to the server administrator to check Ollama/proxy configuration.
The asset processor tool's Python script (Asset-Frameworker/gui/llm_prediction_handler.py) is unable to connect to the self-hosted Ollama instance expected at https://api.llm.gestaltservers.com. Attempts to use standard Ollama API endpoints result in HTTP 404 errors. Environment: Client: Python script using requests library. Target Service: Ollama instance hosted at https://api.llm.gestaltservers.com. Other: Base domain api.llm.gestaltservers.com might be reachable. Connections to unrelated services (e.g., LM Studio) from the same client environment work correctly. Steps Tried & Observations: Attempted Endpoint /api/generate: Script sends request to https://api.llm.gestaltservers.com/api/generate. Result: Consistently receives requests.exceptions.HTTPError: 404 Client Error: Not Found. Log Snippet: 2025-05-04 12:25:55 [ERROR ] gui.llm_prediction_handler: Error calling LLM API. requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.llm.gestaltservers.com/api/generate Attempted Endpoint /v1/chat/completions (OpenAI compatible): Initial curl test (with https:/ typo and no data: curl -D - -X POST https:/api.llm.gestaltservers.com/v1/chat/completions) resulted in HTTP/2 400 Bad Request, suggesting the path was recognized at that moment. Script updated to target https://api.llm.gestaltservers.com/v1/chat/completions. Result: Script still receives requests.exceptions.HTTPError: 404 Client Error: Not Found. Log Snippet: 2025-05-04 12:45:45 [ERROR ] gui.llm_prediction_handler: Error calling LLM API. requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.llm.gestaltservers.com/v1/chat/completions Issue: There is conflicting information. The script consistently gets 404 errors for all tested Ollama API paths (/api/generate, /v1/chat/completions), indicating the server isn't finding these resources when requested via the script. However, an initial (malformed) curl test suggested /v1/chat/completions might be configured, as it returned a 400 instead of 404. It's unclear if the issue lies purely in the server-side configuration (reverse proxy, Ollama service) or if there's a subtle difference in how the script's requests are formed compared to curl. Next Diagnostic Steps: Definitive curl Test: Execute the following command from the client machine to check the current status of the /v1/chat/completions endpoint: Bash curl -v -X POST https://api.llm.gestaltservers.com/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model": "your-model-name", "messages": [{"role": "user", "content": "Test prompt"}], "stream": false}' (Replace your-model-name with a valid model). Record the exact HTTP status code (e.g., 200, 400, 404, 5xx) and any response body. Analyze curl Result: If curl gets 200 OK or 400 Bad Request: The server path is likely correct. Debug the Python script (_call_llm function): verify exact URL string, ensure POST method is used, check Content-Type header, verify JSON payload structure. If curl gets 404 Not Found (or 5xx Server Error): The issue is likely server-side. The administrator for api.llm.gestaltservers.com needs to investigate: Reverse proxy configuration (Nginx, Caddy, etc.): Are requests to /api/* and /v1/* being correctly forwarded to the Ollama service (e.g., http://localhost:11434)? Check proxy logs. Ollama service status: Is the Ollama service running correctly on the server? Check ollama logs. Firewall rules. Action Items: [ ] Perform the definitive curl test described above and record results. [ ] Based on curl results, either debug the Python script's request formation or escalate to the server administrator to check Ollama/proxy configuration.
Rusfort added the
bug
label 2025-05-04 12:49:41 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rusfort/Asset-Frameworker#30
No description provided.