simonw / simonw/llm

Better handling for empty extra-openai-models.yaml file

Open
#505 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
6d 12h
Merged PRs (30d)
15

Description

I made a extra-openai-models.yaml file thinking I would work on getting Azure OpenAI working with llm Then I learned that that's not quite as straightforward as I thought, so I left the empty file there and moved on to other things.

later, I forgot that was there, and I tried to use llm with regular OpenAI and got this

…
  File "/Users/germuska/.virtualenvs/data/lib/python3.8/site-packages/llm/default_plugins/openai_models.py", line 45, in register_models
    for extra_model in extra_models:
TypeError: 'NoneType' object is not iterable

Deleting the empty extra-openai-models.yaml got me back to using llm but it seems like it would be easy enough to handle this error so logging, and maybe i'll even add a PR if that would be helpful

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 reading llm/default_plugins/openai_models.py at line 45 and reproduce the failure with an empty extra-openai-models.yaml file. Verify that using llm with regular OpenAI no longer raises the reported TypeError and that the empty file is handled appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.