Find answers from the community

Updated 6 months ago

new_issue

At a glance
#new_issue

Hello team llama-index as the use mentioned above I'm creating the index from the documents(text) then I'm Storing that index and then creating engine from that index to ask my queries in that process I am using chat gpt model 3.5 turbo but i want to use model gpt-4o-mini but as the method give exception shared below

code:-

llm = OpenAI(temperature=0.8, model="gpt-4o-mini")
service_context = ServiceContext.from_defaults(llm=llm)



exception


traceback (most recent call last):
File "C:\Users\ajinkya\Desktop\ISP_Qual_Pro\isp_qual_pro_api\src\nlp\gpt.py", line 94, in get_chat_engine_on_stimuli
service_context = ServiceContext.from_defaults(llm=llm)
File "C:\Users\ajinkya\Desktop\ISP_Qual_Pro\isp_qual_pro_api\env\lib\site-packages\llama_index\service_context.py", line 195, in from_defaults
llm_metadata=llm_predictor.metadata,
File "C:\Users\ajinkya\Desktop\ISP_Qual_Pro\isp_qual_pro_api\env\lib\site-packages\llama_index\llm_predictor\base.py", line 153, in metadata
return self._llm.metadata
File "C:\Users\ajinkya\Desktop\ISP_Qual_Pro\isp_qual_pro_api\env\lib\site-packages\llama_index\llms\openai.py", line 222, in metadata
context_window=openai_modelname_to_contextsize(self._get_model_name()),
File "C:\Users\ajinkya\Desktop\ISP_Qual_Pro\isp_qual_pro_api\env\lib\site-packages\llama_index\llms\openai_utils.py", line 195, in openai_modelname_to_contextsize
raise ValueError(
ValueError: Unknown model 'gpt-4o-mini'. Please provide a valid OpenAI model name in: gpt-4, gpt-4-32k, gpt-4-1106-preview, gpt-4-vision-preview, 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-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-1106, gpt-35-turbo-0613, gpt-35-turbo-16k-0613
W
A
2 comments
Update the openai package:
pip install -U llama-index-llms-openai
Thank you so much @WhiteFang_Jr that helped lot
Add a reply
Sign up and join the conversation on Discord