Skip to content

Remove hardcoded model list from OpenAIProvider file #8649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 14, 2025

Conversation

chenmoneygithub
Copy link
Collaborator

Following discussion in #8589. This PR is a continuation of #8589 because I need to rebase the main branch.

Litellm is not strictly enforcing the rule that the model name must follow {provider_name}/{model_name}, e.g., openai finetuned model is specified as response = completion(model="ft:gpt-4-0613", messages=messages), this makes it hard to validate model name at constructing time, but need to rely on the actual call to validate the model name.

For this specifc problem, we can rely on checking the prefix of openai/ and ft:. The only case we are missing is users do dspy.LM("gpt-4.1") and didn't specify provider arg in dspy.LM. For this case, we just raise an explicit error message.

@okhat okhat merged commit d836fd8 into stanfordnlp:main Aug 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants