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 a model named "openai" and "--model_list" option #392

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

TimelyToga
Copy link
Contributor

@TimelyToga TimelyToga commented Apr 4, 2024

This is in response to #390.

Solution

# Specific model 
--model openai --model_list gpt-4-1106-preview
# Multiple models 
--model openai --model_list gpt-4-1106-preview,gpt-3.5-turbo-0125

Currently this openai model alias is only for this behavior, but I think it should be expanded to be the defacto way to use the OpenAI API. The current approach is a bit messy because chatgptapi and gpt-4 are two separate top-level models.

I opted to add a new model to preserve backwards compatibility, but also paves a path for future CLI improvements.

Edge cases

No --model_list with openai:

image

First model is not valid

image

We should probably include some automatic checking to make sure all the models you specify are valid, but since we're using cycle(), this failure should be found within the first N paragraphs.

@yihong0618
Copy link
Owner

nice and clean code, thanks very much. will check tonight (utc+8)

@TimelyToga
Copy link
Contributor Author

I just noticed there are some issues with unnecessary whitespace changes in README. Let me fix that.

@yihong0618
Copy link
Owner

very nice solution and did not make any break change,
I think with your solution we had support openai like api like grog or others.

image

@yihong0618 yihong0618 merged commit 2f92e3d into yihong0618:main Apr 4, 2024
2 checks passed
@TimelyToga
Copy link
Contributor Author

@yihong0618 wow that's cool! Didn't even realize you had that feature. Thanks for the merge.

@rafaelobo
Copy link

Can someone upload an example of using with Groq and Llama3? I would be thankful.

@yihong0618
Copy link
Owner

Can someone upload an example of using with Groq and Llama3? I would be thankful.

OK

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

3 participants