OpenRouter model definition helpers #1067
mgalgs
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use OpenRouter for most of my gptel usage but have been missing the pricing and other info from the built-in
gptel--openai-models
models plist, but I didn't want to maintain a hard-coded version for my OpenRouter models.OpenRouter actually has an API that supplies this information, so I vibe-coded up a helper function to augment my OpenRouter models list with this information automatically:
My models list is still just a bare list of models, no need to manually maintain model metadata:
Only lightly tested but seems to be working well so far!
Without further ado, here's the code:
Beta Was this translation helpful? Give feedback.
All reactions