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

fix: adjust regex in ModelService to recognize o1- models returned from OpenAI-API query #1

Closed
wants to merge 1 commit into from

Conversation

juwalter
Copy link
Owner

@juwalter juwalter commented Oct 4, 2024

Summary

API query for OpenAI returns list of models. Their names are filtered using a regex. The regex did not yet account for model names starting with o1- - with this change, model names starting with "o1-" are also recognized and will be shown in UI.

closes danny-avila#4339

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)

Testing

performed docker build with this change and tested manually

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • A pull request for updating the documentation has been submitted.

…om OpenAI-API query

API query for OpenAI returns list of models. Their names are filtered using a regex. The regex did not yet account for model names starting with o1-
@juwalter juwalter closed this Oct 4, 2024
@juwalter juwalter deleted the fix/o1-regex-modelservice branch October 8, 2024 08:03
@weipienlee
Copy link

weipienlee commented Oct 9, 2024

Tnx @juwalter, that works. However, I still get the message using an o1 model. Do you know what's going on?

Something went wrong. Here's the specific error message we encountered: An error occurred while processing your request. Please contact the Admin.

I have access to the model, checked by api call (langchain) and OpenAI playground.

@juwalter
Copy link
Owner Author

Hello @weipienlee - just checked again. I am now using latest container ghcr.io/danny-avila/librechat-dev:latest (just did docker exec -ti <container id> ash and confirmed that the change is in api/server/services/ModelService.js)

I have also made sure to comment out #OPENAI_MODELS=gpt-4o,... and indeed it works as intended.

If the models show in the drop-down like so:

image

then it might be that you do not have API access to o1-type models yet (I had it first in my chatgpt plus subscription, but not API access, and just last week it started to work via API as well).

can you try using e.g. https://github.com/simonw/llm to see if API access really works for you?

@weipienlee
Copy link

weipienlee commented Oct 11, 2024

I already did almost the same:

  • ghcr.io/danny-avila/librechat-dev:latest is defined in the docker compose file (rebuild after checkout bdc2fd3, 1 after your merge)
  • commented the model list
  • did extra container check as describe
    • found const regex = /(text-davinci-003|gpt-|o1-)/;
    • the models were already listed in the app, though

I already checked API access and is working fine (only accepts t=1):

model = "o1-mini"; temperature=1
llm = ChatOpenAI(model=model, temperature=temperature)

So, not sure what's going. It would help if there was more feedback like a log or something

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.

[Bug]: regex for list of models in api/server/services/ModelService does not include OPENAI o1 models
2 participants