Closed Gayathri-Gobinathan closed 4 months ago
routellm version - 0.2.0 Python 3.10.14
import os
os.environ["OPENAI_API_KEY"] = "XXX" os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller( routers=["mf"], strong_model="gpt-3.5-turbo", weak_model="llama3-8b-8192" )
response = client.chat.completions.create(
model="router-mf-0.11593", messages=[ {"role": "user", "content": "hi, how are you"} ] )
message_content = response['choices'][0]['message']['content'] model_name = response['model']
print(f"Message content: {message_content}") print(f"Model name: {model_name}")
Error:
HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/routellm/mf_gpt4_augmented/resolve/main/pytorch_model.bin
The above exception was the direct cause of the following exception:
EntryNotFoundError Traceback (most recent call last) Cell In[1], line 8 4 os.environ["GROQ_API_KEY"] = "XX" 6 from routellm.controller import Controller ----> 8 client = Controller( 9 routers=["mf"], 10 strong_model="gpt-3.5-turbo", 11 weak_model="llama3-8b-8192" 12 ) 14 response = client.chat.completions.create( ... 285 )
EntryNotFoundError: 404 Client Error. (Request ID: Root=1-66ab5a67-46661bc90bdf3b0f6b75110c;8df487c1-691d-4d82-af40-8eee63fd32ff)
you can run pip install --upgrade huggingface_hub to solve this problem
@fengshichen , thanks it worked!
Thank you @fengshichen!
routellm version - 0.2.0 Python 3.10.14
import os
os.environ["OPENAI_API_KEY"] = "XXX" os.environ["GROQ_API_KEY"] = "YYY"
from routellm.controller import Controller
client = Controller( routers=["mf"], strong_model="gpt-3.5-turbo", weak_model="llama3-8b-8192" )
response = client.chat.completions.create(
This tells RouteLLM to use the MF router with a cost threshold of 0.11593
model="router-mf-0.11593", messages=[ {"role": "user", "content": "hi, how are you"} ] )
message_content = response['choices'][0]['message']['content'] model_name = response['model']
print(f"Message content: {message_content}") print(f"Model name: {model_name}")
Error:
HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/routellm/mf_gpt4_augmented/resolve/main/pytorch_model.bin
The above exception was the direct cause of the following exception:
EntryNotFoundError Traceback (most recent call last) Cell In[1], line 8 4 os.environ["GROQ_API_KEY"] = "XX" 6 from routellm.controller import Controller ----> 8 client = Controller( 9 routers=["mf"], 10 strong_model="gpt-3.5-turbo", 11 weak_model="llama3-8b-8192" 12 ) 14 response = client.chat.completions.create( ... 285 )
EntryNotFoundError: 404 Client Error. (Request ID: Root=1-66ab5a67-46661bc90bdf3b0f6b75110c;8df487c1-691d-4d82-af40-8eee63fd32ff)