-
Notifications
You must be signed in to change notification settings - Fork 131
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
feat: add support for o1 models in openai and azure #368
Conversation
Add support for OpenAI o1 models by using `max_completion_tokens` instead of `max_tokens`. * **mods.go** - Add a check in the `startCompletionCmd` function to determine if the model is an o1 model and set the `max_completion_tokens` parameter accordingly. * **config.go** - Add a new field `MaxCompletionTokens` to the `Config` struct to store the value for the `max_completion_tokens` parameter. * **config_template.yml** - Add entries for `o1-preview` and `o1-mini` models under the `openai` section with `max-input-chars` set to 128000. - Add aliases for `o1-preview` and `o1-mini` models. - Add entries for `o1-preview` and `o1-mini` models under the `azure` section with `max-input-chars` set to 128000. - Add aliases for `o1-preview` and `o1-mini` models under the `azure` section.
Note, this is placeholder PR to jump start via github workspaces spec, but I haven't gone through and changed 32768 as max tokens and some other steps. Figured I'd get it up as a draft to get it on the radar and can improve soon. So take this as a true draft for investigating fix for #367 |
@caarlos0 so overall this seemed correct as long as I fix tokens? I generated this and didn't have time to come back round then noticed your feedback was applied. I can try and get this wrapped up today the. If you have no issues with approach. |
yes, seems correct to me, at least at first sight. Happy to help test/etc or if you need anything 🙏🏻 |
Add support for OpenAI o1 models by using `max_completion_tokens` instead of `max_tokens`. * **mods.go** - Add a check in the `startCompletionCmd` function to determine if the model is an o1 model and set the `max_completion_tokens` parameter accordingly. * **config.go** - Add a new field `MaxCompletionTokens` to the `Config` struct to store the value for the `max_completion_tokens` parameter. * **config_template.yml** - Add entries for `o1-preview` and `o1-mini` models under the `openai` section with `max-input-chars` set to 128000. - Add aliases for `o1-preview` and `o1-mini` models. - Add entries for `o1-preview` and `o1-mini` models under the `azure` section with `max-input-chars` set to 128000. - Add aliases for `o1-preview` and `o1-mini` models under the `azure` section.
Trying to
I tried copying part of meta/goreleaser config for just the build in and still running into it. Is there standard approach for no pro members to be able to jump into these and build using goreleaser? I tried just go build directly and also didn't work. Once I stripped all those out and pasted directly here I could run edit: just ran into:
Fixed by just putting in |
mods goreleaser config requires goreleaser pro that said, you can still build it with |
@caarlos0 Ok, I needed |
Looking further, running local test I get:
Attempting with |
roles is a bit confusing because it has a different meaning in mods. run there you can define custom roles and their instructions, e.g.: roles:
"dwight":
- act as dwight shrute, assistant to the regional manager, from the "The Office" TV show and then you can: $ mods -R dwight "whats your evil plan?"
Ah, so you want to know my evil plan, do you? Well, a true master never reveals
all his secrets. However, rest assured, I have several contingency plans in
place for any scenario that might arise within the office. Whether it's ensuring
total loyalty to Dunder Mifflin, winning "Salesman of the Year," or
outperforming Jim in all aspects of office warfare, I've got things well under
control.
But remember, as Assistant to the Regional Manager, my primary duty is to serve
and protect the branch, uphold the standards set by Michael Scott (and now, of
course, David Wallace), and ensure that paper sales at Dunder Mifflin's Scranton
branch continue to soar. Anything else you need to know, like how I manage the
Schrute Farms beet harvest? |
Yes, I updated comment to reflect that so thanks for confirming I got it right. Do you want this to stay in draft till I can run against azure openai (no ETA), or proceed with what we have already? |
I also don't have access to the azure thing. I think if it works on openai we can probably merge it. BTW have a new release of mods coming soon so if we merge this it'll be in it as well :) |
I can't test it as currently it doesn't support system messages, so I'd have to remap. How would you want to handle this? Just wait until released or merge as is and then remove after all the previews are done? I see Google create stream has this handled, but that seems to be a permanent part, not a beta part. I also see some other references to o1. Lines 95 to 110 in 34d8469
|
I pushed a change for review that does this based on the pattern in Google stream. cat .artifacts/input.txt | go run ./... --api openai --model o1-mini -p "1.) Analyze the input text and generate 5 essential questions that, when answered, capture the main points and core meaning of the text. 2.) When formulating your questions: a. Address the central theme or argument b. Identify key supporting ideas c. Highlight important facts or evidence d. Reveal the author's purpose or perspective e. Explore any significant implications or conclusions. 3.) Answer all of your generated questions one-by-one in detail. *** What do you think?" --format markdown | gum format |
it seems that we actually need to unset max tokens for it to work. pushed that change in c394fff, tested here and seemed to work fine 🙏🏻 |
Add support for OpenAI o1 models by using
max_completion_tokens
instead ofmax_tokens
.mods.go
startCompletionCmd
function to determine if the model is an o1 model and set themax_completion_tokens
parameter accordingly.config.go
MaxCompletionTokens
to theConfig
struct to store the value for themax_completion_tokens
parameter.config_template.yml
o1-preview
ando1-mini
models under theopenai
section withmax-input-chars
set to 128000.o1-preview
ando1-mini
models.o1-preview
ando1-mini
models under theazure
section withmax-input-chars
set to 128000.o1-preview
ando1-mini
models under theazure
section.