Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Ollama local API getting 404 #252

Description

@couryrr

Issue

I can run this in interactive with debug or with an inline prompt but no matter which way it is ran I get no response and the following error:

Error: agent processing failed: failed to process events: POST "http://localhost:11434/chat/completions": 404 Not Found

Nothing in the ollam doc https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion suggest this http://localhost:11434/chat/completions is an endpoint.

Config

Add the env:

export LOCAL_ENDPOINT=http://localhost:11434

I have a config like so:

~/.config/opencode/.opencode.json

{
  "data": {
    "directory": ".opencode"
  },
  "providers": {
  },
  "lsp": {
    "go": {
      "enabled": false,
      "command": "/home/couryrr/go/bin/gopls",
      "args": null,
      "options": null
    }
  },
  "agents": {
    "coder": {
      "model": "local.llama3.1:8b",
      "maxTokens": 5000,
      "reasoningEffort": "high"
    },
    "summarizer": {
      "model": "local.llama3.1:8b",
      "maxTokens": 80,
      "reasoningEffort": "medium"
    },
    "task": {
      "model": "local.llama3.1:8b",
      "maxTokens": 5000,
      "reasoningEffort": "high"
    },
    "title": {
      "model": "local.llama3.1:8b",
      "maxTokens": 80,
      "reasoningEffort": "medium"
    }
  },
  "tui": {
    "theme": "opencode"
  },
  "shell": {
    "path": "/bin/bash",
    "args": [
      "-l"
    ]
  },
  "autoCompact": true
}

Activity

  1. andreanidouglas commented on Jun 21, 2025

    @andreanidouglas

    use
    LOCAL_ENDPOINT=http://127.0.0.1:11434/v1/ opencode

  2. couryrr commented on Jun 21, 2025

    @couryrr
    Author

    LOCAL_ENDPOINT=http://127.0.0.1:11434/v1/

    That did the trick but I do not see that documented anywhere.

  3. vladaman commented on Jun 22, 2025

    @vladaman

    I tried that too, with LOCAL_ENDPOINT=http://127.0.0.1:11434/v1/ opencode and I get

    failed to generate title: POST "https://api.anthropic.com/v1/messages": 400 Bad Request {"t
    
    {
      "data": {},
      "mcpServers": {
        "example": {
          "command": "path/to/mcp-server",
          "env": [],
          "args": [],
          "type": "stdio",
          "url": "",
          "headers": null
        }
      },
      "providers": {
        "anthropic": {
          "apiKey": "sk-ant-xxxxxxxxxxxxxx",
          "disabled": false
        },
        "gemini": {
          "apiKey": "AIzaxxxxxxxxxxxxxxxx",
          "disabled": false
        },
        "groq": {
          "apiKey": "gsk_itxxxxxxxxxxxxxxxx",
          "disabled": false
        },
        "ollama": {
          "apiKey": "KEY",
          "disabled": false
        },
        "openai": {
          "apiKey": "sk-Cxxxxxxxxxxxxxxxx",
          "disabled": false
        },
        "openrouter": {
          "apiKey": "sk-or-v1-exxxxxxxxxxxxxxxx",
          "disabled": false
        }
      },
      "lsp": {
        "go": {
          "enabled": false,
          "command": "gopls",
          "args": null,
          "options": null
        }
      },
      "agents": {
        "coder": {
          "model": "deepseek-r1:8b",
          "maxTokens": 4096,
          "reasoningEffort": "high"
        },
        "summarizer": {
          "model": "deepseek-r1:8b",
          "maxTokens": 80,
          "reasoningEffort": "medium"
        },
        "task": {
          "model": "deepseek-r1:8b",
          "maxTokens": 5000,
          "reasoningEffort": "high"
        },
        "title": {
          "model": "deepseek-r1:8b",
          "maxTokens": 4096,
          "reasoningEffort": "high"
        }
      },
      "tui": {
        "theme": "opencode"
      },
      "shell": {
        "path": "/bin/bash",
        "args": [
          "-l"
        ]
      },
      "autoCompact": true
    }

    The config is unclear and quite difficult to configure. My proposal is to simplify the config setup. it's not clear whats needed.

    Do I use local.deepseek-r1:8b or deepseek-r1:8b ?. What are agent options for? What are possible values. What do they mean?

  4. omtodkar commented on Jul 7, 2025

    @omtodkar

    @vladaman use local.deepseek-r1:8b or local.deepseek-r1:latest

    Check by running ollama list and use tag accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions