Skip to content

Bug: Ollama provider incorrectly requires an API key for classification #46

Description

@xrauphoenix

What happened?

I configured Metadata Auto Classifier with the built-in Ollama provider for a local Ollama installation.

Configuration:

  • Provider: Ollama
  • API URL: http://localhost:11434/api/chat
  • Model: qwen3:4b-instruct
  • Ollama is running locally on Windows
  • No API key is configured or required by the local Ollama API

The OpenAI provider and GPT-4.1 Mini model are still present in the plugin configuration, but GPT-4.1 Mini is NOT selected as the active model.

Qwen3 4B Instruct (Ollama) IS selected as the active model.

The Qwen3 model test works correctly: clicking the model test button successfully communicates with qwen3:4b-instruct and the test finishes without an error.

However, when I use the classification command ("Fetch all frontmatter using current provider"), the plugin returns:

"No API key configured for provider Ollama."

This appears inconsistent with the Ollama provider preset, which declares that an API key is not required.

Image

Steps to reproduce

CRTL+P > Metadata Autoclassifier : fetch frontmatter : Fetch all frontmatter using current provider

Expected behavior

The Ollama provider should be usable for local classification without an API key.

Plugin version

1.12.10

Obsidian version

1;13.7

Operating system

Windows

Additional context

Environment:

  • Ollama local
  • Model: qwen3:4b-instruct

The OpenAI provider remains configured, but its model is not selected. The selected model is Qwen3 4B Instruct using the Ollama provider.

Looking at the current source code, ClassificationService.hasValidAuth() appears to require provider.apiKey for providers using apiKey authentication, without taking into account that the Ollama preset declares apiKeyRequired: false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions