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

Add method to print TLM model name #284

Merged
merged 5 commits into from
Aug 2, 2024
Merged

Add method to print TLM model name #284

merged 5 commits into from
Aug 2, 2024

Conversation

huiwengoh
Copy link
Contributor

@huiwengoh huiwengoh commented Aug 1, 2024

Adds new method get_model_name() to easily know which model the TLM is using.

I've also explicitly specified which default model is being used in the client API call to the backend. Currently, if no model is specified from the client, we use the default in the backend but this get_model_name() method can get outdated if someone uses an older version of the client library against an updated backend.

Sample usage:

tlm = studio.TLM()
tlm.get_model_name()

>> 'gpt-4o-mini'
tlm = studio.TLM(options={"model": "claude-3-haiku"})
tlm.get_model_name()

>> 'claude-3-haiku'
tlm_hybrid = studio.TLMHybrid()
tlm_hybrid.get_model_names()

>> {'response_model': 'gpt-4o', 'score_model': 'gpt-4o-mini'}

Copy link
Member

@jwmueller jwmueller left a comment

Choose a reason for hiding this comment

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

LGTM, just had minor suggestion

@huiwengoh huiwengoh merged commit 49e9e3f into main Aug 2, 2024
25 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.

None yet

2 participants