Hey, has anyone else noticed that Qwen3-Coder is n...
# questions
c
Hey, has anyone else noticed that Qwen3-Coder is nearly silent in Open Hands when run locally from llama.cpp?
r
What size of quant are you running?
c
Q4_K_XL
You can see what I mean here:

https://youtu.be/eCapGtOHG6I?si=0-Eo_X71AVmpWvac&t=1918▾

r
interesting, Using it via API was quite regular. wouldn't expect any side effects at q4.
c
I'm going to run mitmproxy and see if it's using
reasoning_content
and it's getting dumped.
r
cool vid btw, will watch later 🙂
c
yeah, sorry, I'm not trying to advertise. I just noticed the issue when I was recording it last night.
nope... it's just silent:
Copy code
{
                "role": "assistant",
                "content": "<function=execute_bash>\n<parameter=command>pwd && ls -la</parameter>\n</function>"
            },
            {
                "role": "user",
                "content": "EXECUTION RESULT of [execute_bash]:\n/workspace\ntotal 4\ndrwxrwxr-x  5 openhands root  160 Jul 27 22:38 .\ndrwxr-xr-x  1 root      root 4096 Jul 28 14:01 ..\ndrwxr-xr-x 10 openhands root  320 Jul 28 14:02 .git\ndrwxr-xr-x  3 openhands root   96 May  8 02:24 .vscode\ndrwxr-xr-x 58 openhands root 1856 Jul 28 13:56 llama.cpp\n[The command completed with exit code 0.]\n[Current working directory: /workspace]\n[Python interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.12/bin/python]\n[Command finished with exit code 0]"
            },
            {
                "role": "assistant",
                "content": "<function=execute_bash>\n<parameter=command>cd llama.cpp && ls -la</parameter>\n</function>"
            },
chat template issue maybe?
let me try it without
--jinja
and see if it's more talkative.
r
does it support tool calling? you can try enabling tool calling on OH.
c
I've never gotten that feature to work with llama.cpp. I'm curious too though.
same result without
--jinja
. Maybe it's just been trained to be as quiet as possible.
l
this PR from yesterday added function calling support https://github.com/All-Hands-AI/OpenHands/pull/9929
🎉 1
r
because it is not using tool calling it has to send the tool calls in the messages, maybe it is adhering too strictly to the prompt... maybe you can try prompting it to talk. "You should always add a short explanation to the user when calling functions"
c
While I'm recording sessions, how do I turn on tool calling again in Open Hands? I might as well try this.
r
it is enabled automatically based if the last name after a / matches any name on the tool calling compatible models. So basically you just switch to this branch that was shared above and have the same name on the model.
l
if you don't want to change the model name there's a config setting/env var to enable it I think
c
ah... I'll have pull the latest then. did you guys remove
make docker-dev
or anything else that would likely give me fits recently? lol
l
no. it's still there, broken as usual
🤣 1
r
oh is there? I could use that :))) , I usually run from a custom branch when I need to test tool calling.
c
I'll give it a try
l
Found it
Copy code
# Whether to use native tool calling if supported by the model. Can be true, false, or None by default, which chooses the model's default behavior based on the evaluation.
# ATTENTION: Based on evaluation, enabling native function calling may lead to worse results
# in some scenarios. Use with caution and consider testing with your specific use case.
# https://github.com/All-Hands-AI/OpenHands/pull/4711
#native_tool_calling = None
ty 1
r
TIL
l
the matching env var should be
LLM_NATIVE_TOOL_CALLING=true
✅ 1
c
i'll try that without updating
currently running commit 70ad469 from probably 0.46 days
uhhh... what should I be using locally for the LLM name? I just tried it with
deepseek/Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL
and that did not work.
I'm in advanced settings
l
If you don't update the code it won't work. You can check the right name in the diff of the PR I linked above
✅ 1
c
haha. fair
r
wont LLM_NATIVE_TOOL_CALLING=true force it?
l
Copy code
Qwen3-Coder-480B-A35B-Instruct
c
so, no prefix at all
r
prefix is irrelevant, you can use whatever is necessary.
l
the prefix won't be checked
r
it does a .split("/") [-1] , so it always get the last name after a
/
c
Is it irrelevant? This is what I'm getting:
Copy code
litellm.exceptions.InternalServerError: litellm.InternalServerError: InternalServerError: DeepseekException - {"error":{"code":500,"message":"Unknown method: keys at row 57, column 46:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n                                             ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 57, column 81:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n                                                                                ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 57, column 13:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n            ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 46, column 80:\n        {{- '\\n<parameters>' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n                                                                               ^\n            {{- '\\n<parameter>' }}\n at row 46, column 9:\n        {{- '\\n<parameters>' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n        ^\n            {{- '\\n<parameter>' }}\n at row 39, column 29:\n    {{- \"<tools>\" }}\n    {%- for tool in tools %}\n                            ^\n        {%- if tool.function is defined %}\n at row 39, column 5:\n    {{- \"<tools>\" }}\n    {%- for tool in tools %}\n    ^\n        {%- if tool.function is defined %}\n at row 36, column 51:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n                                                  ^\n    {{- \"\\n\\nYou have access to the following functions:\\n\\n\" }}\n at row 36, column 1:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n^\n    {{- \"\\n\\nYou have access to the following functions:\\n\\n\" }}\n at row 1, column 1:\n{% macro render_item_list(item_list, tag_name='required') %}\n^\n    {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}\n","type":"server_error"}}
r
irrelevant for the tool use. you still need it correctly set so it ends up on the right place.
c
so.. no prefix?
r
Rename the model on llama.cpp so it matches Qwen3-Coder-480B-A35B-Instruct use the same prefix as you had before so it reaches llama.cpp
l
litellm won't work without a prefix. I also checked and it looks like it's a partial match so it should already be fine with that name.
are you sure you need to use deepseek/ for qwen?
c
yeah, with no prefix I get:
Copy code
BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen3-Coder-480B-A35B-Instruct Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
so, use the same
deepseek
prefix?
I haven't updated the code btw
l
you need a prefix for litellm. if you're using llama.cpp try with openai/modelname
c
I guess I need to try the latest code:
Copy code
litellm.llms.openai.common_utils.OpenAIError: Error code: 500 - {'error': {'code': 500, 'message': 'Unknown method: keys at row 57, column 46:\n            {%- set handled_keys = [\'type\', \'description\', \'enum\', \'required\'] %}\n            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}\n                                             ^\n                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}\n at row 57, column 81:\n            {%- set handled_keys = [\'type\', \'description\', \'enum\', \'required\'] %}\n            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}\n                                                                                ^\n                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}\n at row 57, column 13:\n            {%- set handled_keys = [\'type\', \'description\', \'enum\', \'required\'] %}\n            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}\n            ^\n                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}\n at row 46, column 80:\n        {{- \'\\n<parameters>\' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n                                                                               ^\n            {{- \'\\n<parameter>\' }}\n at row 46, column 9:\n        {{- \'\\n<parameters>\' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n        ^\n            {{- \'\\n<parameter>\' }}\n at row 39, column 29:\n    {{- "<tools>" }}\n    {%- for tool in tools %}\n                            ^\n        {%- if tool.function is defined %}\n at row 39, column 5:\n    {{- "<tools>" }}\n    {%- for tool in tools %}\n    ^\n        {%- if tool.function is defined %}\n at row 36, column 51:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n                                                  ^\n    {{- "\\n\\nYou have access to the following functions:\\n\\n" }}\n at row 36, column 1:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n^\n    {{- "\\n\\nYou have access to the following functions:\\n\\n" }}\n at row 1, column 1:\n{% macro render_item_list(item_list, tag_name=\'required\') %}\n^\n    {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}\n', 'type': 'server_error'}}
l
that looks like a template?
c
erm... where's the dev setup document again? I can never find it.
c
my llama.cpp is from yesterday
l
no idea. I can't find anything relevant. check if --jinja is enabled and check whether you need to provide a newer chat template file
c
I updated the code to head. Now I'm getting this:
Copy code
14:50:27 - openhands:ERROR: retry_mixin.py:99 - litellm.InternalServerError: InternalServerError: OpenAIException - Unknown method: keys at row 57, column 46:
            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}
            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}
                                             ^
                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}
 at row 57, column 81:
            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}
            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}
                                                                                ^
                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}
 at row 57, column 13:
            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}
            {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}
            ^
                {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}
 at row 46, column 80:
        {{- '\n<parameters>' }}
        {%- for param_name, param_fields in tool.parameters.properties|items %}
                                                                               ^
            {{- '\n<parameter>' }}
 at row 46, column 9:
        {{- '\n<parameters>' }}
        {%- for param_name, param_fields in tool.parameters.properties|items %}
        ^
            {{- '\n<parameter>' }}
 at row 39, column 29:
    {{- "<tools>" }}
    {%- for tool in tools %}
                            ^
        {%- if tool.function is defined %}
 at row 39, column 5:
    {{- "<tools>" }}
    {%- for tool in tools %}
    ^
        {%- if tool.function is defined %}
 at row 36, column 51:
{%- endif %}
{%- if tools is iterable and tools | length > 0 %}
                                                  ^
    {{- "\n\nYou have access to the following functions:\n\n" }}
 at row 36, column 1:
{%- endif %}
{%- if tools is iterable and tools | length > 0 %}
^
    {{- "\n\nYou have access to the following functions:\n\n" }}
 at row 1, column 1:
{% macro render_item_list(item_list, tag_name='required') %}
^
    {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
. Attempt #3 | You can customize retry values in the configuration.
Like I said... I've never gotten native tool calling to work between open hands and llama.cpp. I'd be interested to hear from anyone who has.
I've tried several models at this point
For posterity, this was my llama.cpp startup command for the above error:
Copy code
./build/bin/llama-server \
    --model /data/Qwen3-Coder-480B-A35B-Instruct-GGUF/UD-Q4_K_XL/Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00001-of-00006.gguf \
    --alias Qwen3-Coder-480B-A35B-Instruct \
    --no-webui \
    --numa numactl \
    --threads 32 \
    --ctx-size 131072 \
    --n-gpu-layers 63 \
    -ot "blk\.(3|4|5|6|7|8|9|10|11|12|13|14)\.ffn_.*=CUDA0" \
    -ot exps=CPU \
    -ub 4096 -b 4096 \
    --seed 3407 \
    --prio 3 \
    --temp 0.7 \
    --top-p 0.8 \
    --top-k 20 \
    --repeat-penalty 1.05 \
    --min-p 0.0 \
    --log-colors \
    --flash-attn \
    --host 0.0.0.0 \
    --jinja \
    --port 11434
I'm running llama.cpp commit
7f9759
from Jul 27th
l
c
@little-architect-38123 it runs locally fine. I just have to turn off native tool calling in open hands
My model is from Jul 24th:
Copy code
(base) jesse@larry:~/llama.cpp$ ls -alh /data/Qwen3-Coder-480B-A35B-Instruct-GGUF/UD-Q4_K_XL/
total 257G
drwxrwxr-x 2 jesse jesse 4.0K Jul 24 16:59 .
drwxrwxr-x 5 jesse jesse 4.0K Jul 24 15:07 ..
-rw-rw-r-- 1 jesse jesse  707 Jul 24 15:07 added_tokens.json
-rw-rw-r-- 1 jesse jesse 1.1K Jul 24 15:07 config.json
-rw-rw-r-- 1 jesse jesse  180 Jul 24 15:07 generation_config.json
-rw-rw-r-- 1 jesse jesse  46G Jul 24 15:29 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00001-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  46G Jul 24 15:52 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00002-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  47G Jul 24 16:14 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00003-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  46G Jul 24 16:36 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00004-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  47G Jul 24 16:59 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00005-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  28G Jul 24 17:12 Qwen3-Coder-480B-A35B-Instruct-UD-Q4_K_XL-00006-of-00006.gguf
-rw-rw-r-- 1 jesse jesse  29K Jul 24 15:07 qwen3_xml_tool_parser.py
-rw-rw-r-- 1 jesse jesse  614 Jul 24 15:07 special_tokens_map.json
-rw-rw-r-- 1 jesse jesse  13K Jul 24 15:07 tokenizer_config.json
-rw-rw-r-- 1 jesse jesse  11M Jul 24 15:07 tokenizer.json
-rw-rw-r-- 1 jesse jesse 2.7M Jul 24 15:07 vocab.json
(base) jesse@larry:~/llama.cpp$
r
looks like a chat template issue... thinky spin can you try making a manual request?
Copy code
curl http://localhost:8080/v1/chat/completions -d '{
    "model": "Qwen3-Coder-480B-A35B-Instruct",
    "tools": [
        {
        "type":"function",
        "function":{
            "name":"python",
            "description":"Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.",
            "parameters":{
            "type":"object",
            "properties":{
                "code":{
                "type":"string",
                "description":"The code to run in the ipython interpreter."
                }
            },
            "required":["code"]
            }
        }
        }
    ],
    "messages": [
        {
        "role": "user",
        "content": "Print a hello world message with python."
        }
    ]
}'
👍 1
c
throws an error:
Copy code
(base) jesse@Jesses-MacBook-Pro 07_27_2025_agentic_audit_video % curl http://larry:11434/v1/chat/completions -d '{
    "model": "Qwen3-Coder-480B-A35B-Instruct",
    "tools": [
        {
        "type":"function",
        "function":{
            "name":"python",
            "description":"Runs code in an ipython interpreter and returns the result of the execution after 60 seconds.",
            "parameters":{
            "type":"object",
            "properties":{
                "code":{
                "type":"string",
                "description":"The code to run in the ipython interpreter."
                }
            },
            "required":["code"]
            }
        }
        }
    ],
    "messages": [
        {
        "role": "user",
        "content": "Print a hello world message with python."
        }
    ]
}'
{"error":{"code":500,"message":"Unknown method: keys at row 57, column 46:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n                                             ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 57, column 81:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n                                                                                ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 57, column 13:\n            {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n            {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n            ^\n                {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n at row 46, column 80:\n        {{- '\\n<parameters>' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n                                                                               ^\n            {{- '\\n<parameter>' }}\n at row 46, column 9:\n        {{- '\\n<parameters>' }}\n        {%- for param_name, param_fields in tool.parameters.properties|items %}\n        ^\n            {{- '\\n<parameter>' }}\n at row 39, column 29:\n    {{- \"<tools>\" }}\n    {%- for tool in tools %}\n                            ^\n        {%- if tool.function is defined %}\n at row 39, column 5:\n    {{- \"<tools>\" }}\n    {%- for tool in tools %}\n    ^\n        {%- if tool.function is defined %}\n at row 36, column 51:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n                                                  ^\n    {{- \"\\n\\nYou have access to the following functions:\\n\\n\" }}\n at row 36, column 1:\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n^\n    {{- \"\\n\\nYou have access to the following functions:\\n\\n\" }}\n at row 1, column 1:\n{% macro render_item_list(item_list, tag_name='required') %}\n^\n    {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}\n","type":"server_error"}}%
l
Maybe there is a newer template? In case you can't get it working, I saw unsloth has a discord, maybe they can help?
c
Frankly, it's easier to just turn off native function calling. 🤷 I've never seen it work so I don't know what I'm missing.
Whatever context length it saves... I've got plenty. I don't really need it.
I'm not paying per token. I pay for electricity.
r
you can try the chatml template.
Or just use the qwen2.5
@creamy-angle-16764 you can try
--chat-template chatml
Copy code
I don't know what I'm missing.
Probably 3-5% improvement, and faster executions.
c
yeah, probably not worth my time
sorry, I've got something I have to do for work. Have to keep the lights on.
l
If you want to try again, try asking on unsloth discord. They should know I hope.