Keeping model information up to date with open router #7729
AkshatGiri
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using litellm with openrouter so it's easy to switch between different models. I noticed that there is a json file
model_prices_and_context_window_backup.json
file that contains information about the model context size and pricing, however information for several models ( especially openrouter ones ) is out of date. Some models are missing out right.Missing eg - Llama 3.1 8b instruct ( created a pr to add it to the json #7725 )
Out of date eg - Mistral 7b instruct ( the context size is listed at 8k which is correct for the free version, however the paid one is 32k token context size ).
Although this information doesn't affect the api calls, I think it's is important especially when trying to make sure that the inputs don't run over the models context limit. I think we should try to keep it fairly accurate.
Openrouter has an api that lists all the models and information about them.
Here's the link - https://openrouter.ai/api/v1/models
For my script I've added the following code to update all the open router models automatically at the beginning of the script.
I also did notice that litellm has a way to load custom json files for model information perhaps and it might be making a api call to get the latest models from the proxy server anyways ( didn't look too deep yet ).
I'd be happy to propose a few solutions and create prs to potentially make this better if yall are down.
Beta Was this translation helpful? Give feedback.
All reactions