Summary
openkb add works with local Ollama models, but openkb query does not reliably complete the tool-calling loop. This remains reproducible on OpenKB v0.5.0-rc1, even with the litellm.drop_params configuration introduced for Ollama compatibility.
The models can emit tool calls, but the CLI either:
- prints raw tool-call JSON instead of executing the tool and continuing;
- returns
{};
- returns an incomplete/raw response;
- or times out without a final answer.
Environment
- Linux x86_64
- OpenKB
v0.5.0-rc1
openai-agents==0.17.3
- Ollama running as a separate local service
- Ollama accessed through its OpenAI-compatible/LiteLLM route
- Knowledge base containing indexed Markdown summaries
- Query executed through the normal CLI:
openkb --kb-dir <kb-dir> query "What topics are discussed in these messages?"
No cloud API, private endpoint, API key, token, or other credential is required to reproduce the local-backend behavior.
Configuration
The KB configuration was equivalent to:
model: ollama/llama3.1:8b-instruct-q8_0
api_base: http://ollama-host:11434
language: en
pageindex_threshold: 20
parallel_tool_calls: false
litellm:
drop_params: true
The hostname above is intentionally a placeholder. The real endpoint is private and is not part of this report.
Reproduction
- Create or use a KB with several indexed Markdown documents.
- Configure the KB for a local Ollama model as shown above.
- Run:
openkb --kb-dir <kb-dir> query "What topics are discussed in these messages?"
- Observe that the query does not produce a normal final answer grounded in the KB.
Observed result with llama3.1:8b-instruct-q8_0
The CLI returned raw JSON similar to:
{
"reqId": "<redacted>",
"message": "<a requested wiki path was not found>",
"toolCalls": [
{
"id": "<redacted>",
"type": "function",
"name": "read_file",
"arguments": {"path": "summaries/index.md"}
}
]
}
The tool call was not followed by a normal final answer.
The same model was also tested through the non-streaming Runner.run path. In that path it attempted to call a tool named search_strategy, which was not one of the tools registered by OpenKB:
ModelBehaviorError: Tool search_strategy not found in agent wiki-query
Additional local-model results
Using the same KB, question, and OpenKB v0.5.0-rc1 CLI:
| Model |
Result |
llama3.1:8b-instruct-q8_0 |
raw tool-call JSON; no final answer |
qwen3:14b |
{} |
qwen3.5:9b |
empty output |
gemma4:12b |
timed out |
deepseek-r1:14b |
{} |
qwen2.5-coder:14b |
raw/incomplete response claiming that index.md was unavailable |
llama3.2:1b |
raw function-call JSON |
openkb add had previously completed successfully on the same type of KB, including document summaries. The failure is specific to the query/chat agent path and tool-loop completion, not basic LiteLLM connectivity.
Expected behavior
For an Ollama-compatible model that returns a valid structured tool call, OpenKB should:
- parse the tool call;
- execute the registered OpenKB tool;
- append the tool result to the agent conversation using the correct Chat Completions/LiteLLM format;
- continue the agent loop;
- return a final natural-language answer.
If a model returns an unsupported or malformed tool call, OpenKB should report a clear actionable error rather than emitting raw JSON or returning {}.
Investigation notes
Request
Could the maintainers please confirm:
- which Ollama/LiteLLM model and version combinations are officially supported for
query/chat;
- whether OpenKB expects OpenAI Responses API semantics or Chat Completions semantics for the LiteLLM provider;
- whether the streaming path is expected to support Ollama tool calls;
- whether a non-streaming fallback should be used for LiteLLM/Ollama providers;
- whether malformed model-emitted tool names should be handled with a clearer validation error.
A small regression test covering one structured Ollama tool call, tool execution, and a final answer would help prevent this from recurring.
Summary
openkb addworks with local Ollama models, butopenkb querydoes not reliably complete the tool-calling loop. This remains reproducible on OpenKB v0.5.0-rc1, even with thelitellm.drop_paramsconfiguration introduced for Ollama compatibility.The models can emit tool calls, but the CLI either:
{};Environment
v0.5.0-rc1openai-agents==0.17.3No cloud API, private endpoint, API key, token, or other credential is required to reproduce the local-backend behavior.
Configuration
The KB configuration was equivalent to:
The hostname above is intentionally a placeholder. The real endpoint is private and is not part of this report.
Reproduction
Observed result with
llama3.1:8b-instruct-q8_0The CLI returned raw JSON similar to:
{ "reqId": "<redacted>", "message": "<a requested wiki path was not found>", "toolCalls": [ { "id": "<redacted>", "type": "function", "name": "read_file", "arguments": {"path": "summaries/index.md"} } ] }The tool call was not followed by a normal final answer.
The same model was also tested through the non-streaming
Runner.runpath. In that path it attempted to call a tool namedsearch_strategy, which was not one of the tools registered by OpenKB:Additional local-model results
Using the same KB, question, and OpenKB
v0.5.0-rc1CLI:llama3.1:8b-instruct-q8_0qwen3:14b{}qwen3.5:9bgemma4:12bdeepseek-r1:14b{}qwen2.5-coder:14bindex.mdwas unavailablellama3.2:1bopenkb addhad previously completed successfully on the same type of KB, including document summaries. The failure is specific to the query/chat agent path and tool-loop completion, not basic LiteLLM connectivity.Expected behavior
For an Ollama-compatible model that returns a valid structured tool call, OpenKB should:
If a model returns an unsupported or malformed tool call, OpenKB should report a clear actionable error rather than emitting raw JSON or returning
{}.Investigation notes
litellm:config block #138 address theparallel_tool_callsparameter rejected by Ollama. Settingparallel_tool_calls: falseandlitellm.drop_params: trueavoids that specific parameter error, but does not solve this issue.Runner.run_streamed(...)for the streaming path.Request
Could the maintainers please confirm:
query/chat;A small regression test covering one structured Ollama tool call, tool execution, and a final answer would help prevent this from recurring.