[GH-ISSUE #14928] lfm2:24b cannot call tools #71667

Closed
opened 2026-05-05 02:18:23 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @sbe-arg on GitHub (Mar 18, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14928

What is the issue?

I cannot find any relevant logs.
Tested this on mac and linux model responds

do you have any available tools? list them

I can assist with a variety of tasks using the following tools:

Bash: Execute shell commands for tasks like file management, running programs, and system operations.
Git Operations: Handle Git commands for version control tasks such as committing, pushing, pulling, and creating branches.
OpenAPI: Interact with APIs using OpenAPI specifications for querying and testing endpoints.
File Search Tools:
Glob: Search for files using patterns, similar to shell globbing.
Grep: Search within files for specific patterns or text.
Web Fetching:
WebFetch: Retrieve content from URLs, converting it to markdown, text, or HTML as needed.
Task Management: Organize and manage tasks with a structured todo list system.
These tools enable me to perform a wide range of programming and system-related tasks efficiently. If you have a specific task in mind, let me know how I can assist you with it!

list files in repo

To list the files in the repository, I will use the ls command in the current working directory, which is the repository root. This will provide a list of files and directories.

<function=bash> <parameter=command> ls

The <function=bash> <parameter=command> ls consistent on vscode, opencode, claudecode 🤷

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @sbe-arg on GitHub (Mar 18, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14928 ### What is the issue? I cannot find any relevant logs. Tested this on mac and linux model responds ``` do you have any available tools? list them I can assist with a variety of tasks using the following tools: Bash: Execute shell commands for tasks like file management, running programs, and system operations. Git Operations: Handle Git commands for version control tasks such as committing, pushing, pulling, and creating branches. OpenAPI: Interact with APIs using OpenAPI specifications for querying and testing endpoints. File Search Tools: Glob: Search for files using patterns, similar to shell globbing. Grep: Search within files for specific patterns or text. Web Fetching: WebFetch: Retrieve content from URLs, converting it to markdown, text, or HTML as needed. Task Management: Organize and manage tasks with a structured todo list system. These tools enable me to perform a wide range of programming and system-related tasks efficiently. If you have a specific task in mind, let me know how I can assist you with it! list files in repo To list the files in the repository, I will use the ls command in the current working directory, which is the repository root. This will provide a list of files and directories. <function=bash> <parameter=command> ls ``` The <function=bash> <parameter=command> ls consistent on vscode, opencode, claudecode 🤷 ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-05 02:18:23 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 18, 2026):

It can call tools, it's just not very good at it. The model can only support a maximum context of 32K, and it seems that the more context that is used, the less often the model emits a properly formed tool call. For example, simple tool use is pretty reliable:

$ ollama run lfm2:24b --experimental --experimental-yolo

This experimental version of Ollama has the bash tool enabled.
Models can read files on your computer, or run commands (after you allow them).

warning: yolo mode - all tool approvals will be skipped
>>> what is the time?

running: Bash: date
  Wed Mar 18 11:44:27 AM CET 2026


The current time is **Wed Mar 18 11:44:27 AM CET 2026**.

But using a coding assistant that loads up the context with instructions and tools often results in malformed tool calls like the one in the OP. It will sometimes get it right:

$ ollama launch opencode --model lfm2:24b --yes -- run "create a python script that prints 'hello world'"
This will modify your OpenCode configuration:
  /home/rick/.config/opencode/opencode.json
  /home/rick/.local/state/opencode/model.json
Backups will be saved to /tmp/ollama-backups/


Launching OpenCode with lfm2:24b...

> build · lfm2:24b

← Write hello_world.py
Wrote file successfully.

I have created a Python script at `/home/rick/ollama/issues/14928/hello_world.py` that prints 'hello world'.

To run it, you can use the command:
```bash
python hello_world.py
```

Let me know if you need any modifications or have other requests!

$ ls
hello_world.py
$ cat hello_world.py
print('hello world')

It seems that this model is not suitable for use with a coding assistant.

<!-- gh-comment-id:4081535738 --> @rick-github commented on GitHub (Mar 18, 2026): It can call tools, it's just not very good at it. The model can only support a maximum context of 32K, and it seems that the more context that is used, the less often the model emits a properly formed tool call. For example, simple tool use is pretty reliable: ```console $ ollama run lfm2:24b --experimental --experimental-yolo This experimental version of Ollama has the bash tool enabled. Models can read files on your computer, or run commands (after you allow them). warning: yolo mode - all tool approvals will be skipped >>> what is the time? running: Bash: date Wed Mar 18 11:44:27 AM CET 2026 The current time is **Wed Mar 18 11:44:27 AM CET 2026**. ``` But using a coding assistant that loads up the context with instructions and tools often results in malformed tool calls like the one in the OP. It will sometimes get it right: ````console $ ollama launch opencode --model lfm2:24b --yes -- run "create a python script that prints 'hello world'" This will modify your OpenCode configuration: /home/rick/.config/opencode/opencode.json /home/rick/.local/state/opencode/model.json Backups will be saved to /tmp/ollama-backups/ Launching OpenCode with lfm2:24b... > build · lfm2:24b ← Write hello_world.py Wrote file successfully. I have created a Python script at `/home/rick/ollama/issues/14928/hello_world.py` that prints 'hello world'. To run it, you can use the command: ```bash python hello_world.py ``` Let me know if you need any modifications or have other requests! $ ls hello_world.py $ cat hello_world.py print('hello world') ```` It seems that this model is not suitable for use with a coding assistant.
Author
Owner

@sbe-arg commented on GitHub (Mar 18, 2026):

Very insightful. Thanks for the tests.

<!-- gh-comment-id:4084907306 --> @sbe-arg commented on GitHub (Mar 18, 2026): Very insightful. Thanks for the tests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71667