Skip to content

ollama: attaching a file does not work/results in error 500/400 Bad request #11

@nodiscc

Description

@nodiscc

Steps to reproduce:

  • llms --serve 8080 --verbose, access web UI
  • select ollama provider (tested with multiple models)
  • attach a file (tested with multiple text files/shell/python scripts) with a promt su chas Please summarize this document and submit the query
  • the web UI displays an error and not response is returned
HTTP 500 Internal Server Error
{
  "error": "HTTP 400 Bad Request"
}

Logs:

provider: ollama OllamaProvider
POST http://localhost:11434/v1/chat/completions
{
  "model": "deepseek-r1:14b",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "file",
          "file": {
            "filename": "test.xml",
            "file_data": "data:text/xml;base64,(1325)"
          }
        },
        {
          "type": "text",
          "text": "Summarize the file\n\n[\ud83d\udcce test.xml]"
        }
      ]
    }
  ],
  "enable_thinking": true,
  "metadata": {
    "threadId": "1765739448549"
  },
  "stream": false
}
Provider ollama failed: HTTP 400 Bad Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions