Skip to content
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

Added default llm name to the config #48

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Added default llm name to the config #48

merged 3 commits into from
Jan 28, 2025

Conversation

maykcaldas
Copy link
Collaborator

Fixed a bug where the default LiteLLMModel.name was not actually being used. Not LiteLLMModel.config['model_list'] is correctly populated if the used creates the llm with LiteLLMModel()
Also, if only a config is passed (LiteLLMModel(config=config)), it checks if there's a name inside the config to be used.

@maykcaldas maykcaldas self-assigned this Jan 28, 2025
@maykcaldas maykcaldas requested a review from a team January 28, 2025 20:59
if "config" not in data:
data["config"] = {}
if "name" in data and "model_list" not in data["config"]:
if "name" not in data:
data["name"] = data["config"].get("name", CommonLLMNames.GPT_4O.value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data["name"] = data["config"].get("name", CommonLLMNames.GPT_4O.value)
data["name"] = data["config"].get("name", cls.model_fields["name"].default)

Can we do something like this, to avoid the repetition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I tried cls.name and it didn't work. Will try the model_fields

Copy link
Contributor

@jamesbraza jamesbraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick review, looks good. Thanks for adding tests

@maykcaldas maykcaldas merged commit 96bbce5 into main Jan 28, 2025
7 checks passed
@maykcaldas maykcaldas deleted the llm-default branch January 28, 2025 21:42
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.

2 participants