simonw / simonw/llm

Bad file descriptor

Open
#978 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
3d 13h
Merged PRs (30d)
10

Description

Hi,

I installed llm via Homebrew, it's v0.25 and gpt4all v0.4.

I keep getting the error:

llm 'Wer bist du, wie heißt du und wo wohnst du?' --model Nous-Hermes-2-Mistral-7B-DPO

Ich bin ein künstlicher Intelligenz-Assistent und gehe nicht auf persönliche Informationen ein. Ich bin da, um Ihnen zu helfen und Antworten auf Ihre Fragen zu geben. Mein Wohnort ist in Ihrem Kopf oder an einem Serverzentrum, je nachdem wie Sie mich verwendet haben.Exception ignored in: <_io.TextIOWrapper name=6 mode='w' encoding='UTF-8'>
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/llm/0.25/libexec/lib/python3.13/site-packages/llm_gpt4all.py", line 294, in __exit__
    sys.stderr = self.original_stderr
OSError: [Errno 9] Bad file descriptor

Is there anything I can do do about this?

Contributor guide

Open the contributing guide

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 by reproducing the exact command with the reported Homebrew llm 0.25 and gpt4all 0.4 versions. Inspect llm_gpt4all.py around line 294 and trace the stderr handling shown in the traceback; done means the command no longer ends with the Bad file descriptor exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.