agent-zero icon indicating copy to clipboard operation
agent-zero copied to clipboard

LLM Provider NOT provided - when using only local ollama models

Open coderinsg opened this issue 7 months ago • 3 comments

After installed agent-zero and running some examples successfully, I decided to use it in air-gapped environment with my local ollama.

I docker exec into my agent-zero container and curl to make sure the ollama is reachable.

Then I switch the main model, utility model and embedding model to use Other OpenAI compatible. the base_url was correctly defined which shows when searching for model, a drop-down list of models in my ollama appears.

However, in a new chat, a simple "Hello" results in LLM Provider NOT provided

Image Image
litellm.exceptions.BadRequestError: litellm.BadRequestErr...
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=all-minilm:l6-v2

Traceback (most recent call last):
Traceback (most recent call last):
  File "/[a0](http://localhost:5080/#)/[helpers](http://localhost:5080/#)/[extension.py](http://localhost:5080/#)", line 176, in _run_async
    data["result"] = await data["result"]
                     ^^^^^^^^^^^^^^^^^^^^
  File "/[a0](http://localhost:5080/#)/[agent.py](http://localhost:5080/#)", line 596, in handle_exception
    raise exception # exception handling is done by extensions
    ^^^^^^^^^^^^^^^
  File "/[a0](http://localhost:5080/#)/[agent.py](http://localhost:5080/#)", line 379, in monologue
    await extension.call_extensions_async(
  File "/[a0](http://localhost:5080/#)/[helpers](http://localhost:5080/#)/[extension.py](http://localhost:5080/#)", line 235, in call_extensions_async
    await result
  File "/[a0](http://localhost:5080/#)/[plugins](http://localhost:5080/#)/[_memory](http://localhost:5080/#)/[extensions](http://localhost:5080/#)/[python](http://localhost:5080/#)/[monologue_start](http://localhost:5080/#)/[_10_memory_init.py](http://localhost:5080/#)", line 14, in execute
    db = await memory.Memory.get(self.agent)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/[a0](http://localhost:5080/#)/[plugins](http://localhost:5080/#)/[_memory](http://localhost:5080/#)/[helpers](http://localhost:5080/#)/[memory.py](http://localhost:5080/#)", line 76, in get
    db, created = Memory.initialize(
                  ^^^^^^^^^^^^^^^^^^
  File "/[a0](http://localhost:5080/#)/[plugins](http://localhost:5080/#)/[_memory](http://localhost:5080/#)/[helpers](http://localhost:5080/#)/[memory.py](http://localhost:5080/#)", line 214, in initialize
    index = faiss.IndexFlatIP(len(embedder.embed_query("example")))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[langchain](http://localhost:5080/#)/[embeddings](http://localhost:5080/#)/[cache.py](http://localhost:5080/#)", line 194, in embed_query
    return self.underlying_embeddings.embed_query(text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/[a0](http://localhost:5080/#)/[models.py](http://localhost:5080/#)", line 623, in embed_query
    resp = embedding(model=self.model_name, input=[text], **self.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[litellm](http://localhost:5080/#)/[utils.py](http://localhost:5080/#)", line 1377, in wrapper
    raise e
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[litellm](http://localhost:5080/#)/[utils.py](http://localhost:5080/#)", line 1246, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[litellm](http://localhost:5080/#)/[main.py](http://localhost:5080/#)", line 4047, in embedding
    model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(
                                                            ^^^^^^^^^^^^^^^^^
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[litellm](http://localhost:5080/#)/[litellm_core_utils](http://localhost:5080/#)/[get_llm_provider_logic.py](http://localhost:5080/#)", line 421, in get_llm_provider
    raise e
  File "/[opt](http://localhost:5080/#)/[venv-a0](http://localhost:5080/#)/[lib](http://localhost:5080/#)/[python3.12](http://localhost:5080/#)/[site-packages](http://localhost:5080/#)/[litellm](http://localhost:5080/#)/[litellm_core_utils](http://localhost:5080/#)/[get_llm_provider_logic.py](http://localhost:5080/#)", line 398, in get_llm_provider
    raise litellm.exceptions.BadRequestError(  # type: ignore
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

Any advise will be greatly appreciated.

coderinsg avatar Apr 14 '26 06:04 coderinsg

Choose LM Studio in the drop down and leave the API Key blank. That's the only way I could get it to work with my self-hosted llama.cpp setup. I haven't had any issues since setting it that way. I use Gemma 4 31B with a llama.cpp backend, a very similar setup to yours so it would likely work for you too.

Also, unless you are using Ollama for other LLM related projects or need the Ollama GUI for something, llama.cpp would likely be faster and definitely more lightweight for use with Agent0.

GozerZeGozerian avatar Apr 15 '26 07:04 GozerZeGozerian

Thanks @GozerZeGozerian , i tried by didn't help.

SOLVED: CONFIGURATION ERROR I re-cofigured model settings and the models worked.

Wrong: Provider: Other OpenAI compatible

Right: Provider: ollama.

coderinsg avatar Apr 16 '26 02:04 coderinsg

Glad to hear you found a working solution! Good luck with your agent 😊

GozerZeGozerian avatar Apr 17 '26 07:04 GozerZeGozerian