ollama / ollama/ollama-python

Running without network error: ollama._types.ResponseError

Open
#85 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

Really helpful project! However, I met some problem When I turn off WI-FI connection.

  • OS: Windows10 LTSC
  • cpu: R7-7840H
  • Language: Python
Traceback (most recent call last):
  File "c:\Users\gloridust\Documents\GitHub\LocalChatLLM\start.py", line 117, in <module>
    main_loop()
  File "c:\Users\gloridust\Documents\GitHub\LocalChatLLM\start.py", line 99, in main_loop
    output_text, received_message = get_response(message_history)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\gloridust\Documents\GitHub\LocalChatLLM\start.py", line 63, in get_response
    response = ollama.chat(
               ^^^^^^^^^^^^
  File "C:\Users\gloridust\AppData\Local\Programs\Python\Python312\Lib\site-packages\ollama\_client.py", line 177, in chat        
    return self._request_stream(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gloridust\AppData\Local\Programs\Python\Python312\Lib\site-packages\ollama\_client.py", line 97, in _request_stream
    return self._stream(*args, **kwargs) if stream else self._request(*args, **kwargs).json()
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gloridust\AppData\Local\Programs\Python\Python312\Lib\site-packages\ollama\_client.py", line 73, in _request     
    raise ResponseError(e.response.text, e.response.status_code) from None
ollama._types.ResponseError

All of my program can work well with internet connection. But when I turn off the wifi switch, it totally error.
U can see my project at:https://github.com/Gloridust/LocalChatLLM
I really need it to run completely offline, any solutions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LocalChatLLM/start.py, especially main_loop and get_response, and reproduce the failure with Wi-Fi disabled. Trace the ollama.chat call shown in the report and determine whether the problem belongs in the example project or ollama-python. Done means the offline behavior is resolved or its limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.