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

Azure Openai still doesn't work #1010

Closed
robertobalestri opened this issue Dec 8, 2024 · 7 comments
Closed

Azure Openai still doesn't work #1010

robertobalestri opened this issue Dec 8, 2024 · 7 comments

Comments

@robertobalestri
Copy link

Using what's told in the Docs, and also tried everything else. It's month that it is not working.

AZURE_OPENAI_API_KEY=[Your Key]
AZURE_OPENAI_ENDPOINT=https://{your-endpoint}.openai.azure.com/
OPENAI_API_VERSION=2024-05-01-preview

note that the deployment name must be the same as the model name

FAST_LLM=azure_openai:gpt-4o-mini
SMART_LLM=azure_openai:gpt-4o
STRATEGIC_LLM=azure_openai:o1-preview

EMBEDDING="azure_openai:text-embedding-ada-002"

@ElishaKay
Copy link
Collaborator

ElishaKay commented Dec 9, 2024

Welcome @robertobalestri,

Great persistence!

Can you try this and let us know if it works:

AZURE_OPENAI_API_KEY=xxxxxx
AZURE_OPENAI_ENDPOINT=https://xxxxxxx.openai.azure.com/openai/
AZURE_OPENAI_API_VERSION=2024-08-01-preview


FAST_LLM=azure_openai:gpt-4o-mini
SMART_LLM=azure_openai:gpt-4o
STRATEGIC_LLM=azure_openai:gpt-4o

The model name and deployment name must be similar, ie gpt-4o for gpt-4o model.

This user in the discord says: "I actually looked at all tickets that mentioned azure_openai and tried all the different variations of .env, and finally noticed that there was /openai/ at the end of the base url for most of them who made it work.
I don't think it is isolated to my use case as I used a vanilla fresh install."

If it works for you, you can go for the PR.

@robertobalestri
Copy link
Author

I still got the problem, it's exactly what I already pass to the program. Sending it without OPENAI_API_VERSION it gives a pydantic error because it miss a field OPENAI_API_VERSION, so i decided to try to circumnavigate this adding both API VERSION:

AZURE_OPENAI_API_KEY=37f05a9d-696e-4c92-8651-31e76ffa6750
AZURE_OPENAI_ENDPOINT=https://nead3.openai.azure.com/
AZURE_OPENAI_API_VERSION=2024-08-01-preview
OPENAI_API_VERSION=2024-08-01-preview

@ElishaKay
Copy link
Collaborator

ElishaKay commented Dec 12, 2024

What error do you get back when you run this test script:

Test your LLM

That test script is probably the fastest way to iterate towards a solution - since it leverages just the underlying chat api helper function of GPTR

@Aadhithya-D
Copy link

I created the same .env file as @robertobalestri (with AZURE_OPENAI_API_VERSION=2024-08-01-preview and OPENAI_API_VERSION=2024-08-01-preview). While this resolved the previous issue, I am now encountering an embedding rate limit, which is preventing further progress. Could you please provide guidance on how to proceed? Thank you!

@ElishaKay
Copy link
Collaborator

ElishaKay commented Jan 10, 2025

add an env var EMBEDDING_PROVIDER=azure_openai

If that doesnt work try reverting back to version 0.10.3 of the gptr pip package

@danieldekay
Copy link
Contributor

It is working for me, as described in #1061 (comment)

@ElishaKay
Copy link
Collaborator

@danieldekay 's fix is now in the docs

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

No branches or pull requests

4 participants