Possible bug with kimi-k2-thinking☁️ ollama._types.ResponseError: unmarshal: invalid character 'I' looking for beginning of value (status code: 500))` #305

Closed
opened 2026-02-15 16:29:47 -05:00 by yindo · 1 comment
Owner

Originally created by @asmith26 on GitHub (Nov 8, 2025).

Hi, I'm trying to use kimi-k2-thinking:cloud with:

from ollama import chat

response = chat(
  model='kimi-k2-thinking:cloud',
  messages=[{'role': 'user', 'content': 'How many letter r are in strawberry?'}],
  think=True,
  stream=False,
)

print('Thinking:\n', response.message.thinking)
print('Answer:\n', response.message.content)

But I'm getting:

    response = chat(
      model='kimi-k2-thinking:cloud',
    ...<2 lines>...
      stream=False,
    )
  File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 351, in chat
    return self._request(
           ~~~~~~~~~~~~~^
      ChatResponse,
      ^^^^^^^^^^^^^
    ...<12 lines>...
      stream=stream,
      ^^^^^^^^^^^^^^
    )
    ^
  File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 189, in _request
    return cls(**self._request_raw(*args, **kwargs).json())
                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 133, in _request_raw
    raise ResponseError(e.response.text, e.response.status_code) from None
ollama._types.ResponseError: unmarshal: invalid character 'I' looking for beginning of value (status code: 500)

Thanks!

Originally created by @asmith26 on GitHub (Nov 8, 2025). Hi, I'm trying to use `kimi-k2-thinking:cloud` with: ```python from ollama import chat response = chat( model='kimi-k2-thinking:cloud', messages=[{'role': 'user', 'content': 'How many letter r are in strawberry?'}], think=True, stream=False, ) print('Thinking:\n', response.message.thinking) print('Answer:\n', response.message.content) ``` But I'm getting: ```python response = chat( model='kimi-k2-thinking:cloud', ...<2 lines>... stream=False, ) File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 351, in chat return self._request( ~~~~~~~~~~~~~^ ChatResponse, ^^^^^^^^^^^^^ ...<12 lines>... stream=stream, ^^^^^^^^^^^^^^ ) ^ File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 189, in _request return cls(**self._request_raw(*args, **kwargs).json()) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "~/miniforge3/envs/ollama_env/lib/python3.13/site-packages/ollama/_client.py", line 133, in _request_raw raise ResponseError(e.response.text, e.response.status_code) from None ollama._types.ResponseError: unmarshal: invalid character 'I' looking for beginning of value (status code: 500) ``` Thanks!
yindo closed this issue 2026-02-15 16:29:47 -05:00
Author
Owner

@jmorganca commented on GitHub (Nov 8, 2025):

Hi @asmith26, sorry about this. It should be fixed now

@jmorganca commented on GitHub (Nov 8, 2025): Hi @asmith26, sorry about this. It should be fixed now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#305