Completion returns either a 404 or 500 server error #1439

Closed
opened 2025-11-11 14:45:17 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @jkirkcaldy on GitHub (Jul 5, 2024).

Bug Report

Description

Bug Summary:
When using Complete with VSCode, using the apiBase as "https://< url >/ollama/v1" returns an error 404 in the open-webui logs

using "https://< url >/ollama/v1/chat" gives a 500 server error.

Chat functions in Continue work fine, it's just the completions that give the error.

Steps to Reproduce:
Follow the quick setup guide to install and set up continue in vscode.

Environment

  • Open WebUI Version: 0.3.7
  • Ollama (if applicable): latest
  File "/app/backend/main.py", line 523, in dispatch
    prompt = get_last_user_message(data["messages"])
                                   ~~~~^^^^^^^^^^^^
KeyError: 'messages'
INFO:     :0 - "POST /ollama/v1/chat/completions HTTP/1.1" 500 Internal Server Error

vscode config:

{
  "models": [
    {
      "title": "Deepseek-Coder",
      "model": "deepseek-coder:latest",
      "apiBase": "https://ollama<url>/ollama/v1",
      "apiKey": "sk-<key>",
      "provider": "openai"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Deepseek-Coder",
    "model": "deepseek-coder:latest",
    "apiBase": "https://ollama.<url>/ollama/v1",
    "apiKey": "sk-<key>",
    "provider": "openai"
  }
}
Originally created by @jkirkcaldy on GitHub (Jul 5, 2024). # Bug Report ## Description **Bug Summary:** When using Complete with VSCode, using the apiBase as "https://< url >/ollama/v1" returns an error 404 in the open-webui logs using "https://< url >/ollama/v1/chat" gives a 500 server error. Chat functions in Continue work fine, it's just the completions that give the error. **Steps to Reproduce:** Follow the quick setup guide to install and set up continue in vscode. ## Environment - **Open WebUI Version:** 0.3.7 - **Ollama (if applicable):** latest ``` File "/app/backend/main.py", line 523, in dispatch prompt = get_last_user_message(data["messages"]) ~~~~^^^^^^^^^^^^ KeyError: 'messages' INFO: :0 - "POST /ollama/v1/chat/completions HTTP/1.1" 500 Internal Server Error ``` vscode config: ``` { "models": [ { "title": "Deepseek-Coder", "model": "deepseek-coder:latest", "apiBase": "https://ollama<url>/ollama/v1", "apiKey": "sk-<key>", "provider": "openai" } ], "customCommands": [ { "name": "test", "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", "description": "Write unit tests for highlighted code" } ], "tabAutocompleteModel": { "title": "Deepseek-Coder", "model": "deepseek-coder:latest", "apiBase": "https://ollama.<url>/ollama/v1", "apiKey": "sk-<key>", "provider": "openai" } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1439