Skip to content

Unsupported provider 'Ollama_llm' causes error when using Ollama #332

@ecshoper

Description

@ecshoper

Problem

When using Ollama as the provider, the application reports the following error:

Could not get usage: Unsupported provider: Ollama_llm

Steps to Reproduce

  1. Configure the project to use Ollama as the LLM provider.
  2. Send a chat/LLM request (normal usage).

Root Cause Analysis

  1. The code calls:
    usage = get_usage_from_response(self.llm.class_name(), response)
    # self.llm.class_name() actually returns "Ollama_llm"
  2. The function get_usage_from_response contains a provider check like:
    def get_usage_from_response(provider: str, chat_rsp: ChatResponse):
        if provider == "Ollama":
            ...
    Because class_name() returns "Ollama_llm", the condition does not match and the provider is treated as unsupported, resulting in the error.

Temporary Workaround

Updating the provider check to accept both values fixes the problem:

elif provider == "Ollama" or provider == "Ollama_llm":
    ...

Expected Behavior

  • The code should accept and correctly handle the Ollama provider regardless of whether class_name() returns "Ollama" or "Ollama_llm".
  • Suggested fixes:
    • Make the provider matching logic more robust (accept both "Ollama" and "Ollama_llm"), or
    • Normalize/standardize the value returned by class_name() so it matches the expected provider string.

Environment

  • Repository: droidrun/mobilerun
  • Context: Using Ollama provider
  • Reporter: @ecshoper

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    📨 Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions