Problem
When using Ollama as the provider, the application reports the following error:
Could not get usage: Unsupported provider: Ollama_llm
Steps to Reproduce
- Configure the project to use Ollama as the LLM provider.
- Send a chat/LLM request (normal usage).
Root Cause Analysis
- The code calls:
usage = get_usage_from_response(self.llm.class_name(), response)
# self.llm.class_name() actually returns "Ollama_llm"
- 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
Problem
When using Ollama as the provider, the application reports the following error:
Steps to Reproduce
Root Cause Analysis
get_usage_from_responsecontains a provider check like: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:
Expected Behavior
class_name()returns "Ollama" or "Ollama_llm".class_name()so it matches the expected provider string.Environment