Find answers from the community

Updated 9 months ago

Anyone know how to set llm to gpt-4o?

At a glance

A community member is trying to set the LLM (Large Language Model) to "gpt-4o" but is encountering an error stating that the model name is unknown. The community member has updated the llama-index-llms-openai package but is still facing the issue. Another community member suggests trying to reinstall the package, but the original poster still encounters the error and wonders if they need to relaunch their Jupyter Notebook for the changes to take effect. There is no explicitly marked answer in the comments.

Anyone know how to set llm to gpt-4o?
I updated the llm package: Successfully installed llama-index-llms-openai-0.1.21

llm = OpenAI(model="gpt-4o")
node_parser = MarkdownElementNodeParser(llm=llm)

ValueError: Unknown model 'gpt-4o'. Please provide a valid OpenAI model name in: gpt-4, gpt-4-32k, gpt-4-1106-preview, gpt-4-0125-preview, gpt-4-turbo-preview, gpt-4-vision-preview, gpt-4-1106-vision-preview, gpt-4-turbo-2024-04-09, gpt-4-turbo, gpt-4-0613, gpt-4-32k-0613, gpt-4-0314, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-16k, gpt-3.5-turbo-0125, gpt-3.5-turbo-1106, gpt-3.5-turbo-0613, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, gpt-3.5-turbo-instruct, text-ada-001, text-babbage-001, text-curie-001, ada, babbage, curie, davinci, gpt-35-turbo-16k, gpt-35-turbo, gpt-35-turbo-0125, gpt-35-turbo-1106, gpt-35-turbo-0613, gpt-35-turbo-16k-0613
L
S
2 comments
pip install -U llama-index-llms-openai
Thanks. I tried that but still got the error. Maybe I need to relaunch my jupyter notebook for it to take effect.
Add a reply
Sign up and join the conversation on Discord