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

Can't get this to work with Azure OpenAI gpt-4o model #194

Open
andreasstavrousatalia opened this issue Feb 12, 2025 · 1 comment
Open

Comments

@andreasstavrousatalia
Copy link

Hello, I'm trying to get this to work but for some reason I get {"error":{"code":"404","message": "Resource not found"}}

We have a gpt-4o deployment on Azure AI Studio

https://azure-openai-[XXXXXX].openai.azure.com/openai/deployments/[DEPLOYMENT_NAME]/chat/completions?api-version=[API_VERSION]

Looking at your azure_provider.py, trying to reverse engineer the way you construct the base url but still I get either resource not found.

ai.Client({
    "azure":{
        "base_url": "https://azure-openai-[XXXXX].openai.azure.com/", # I've tried with /openai/deployments/[DEPLOYMENT_NAME] as well
        "api_key": [API_KEY],
        "api_version": [API_VERSION]
        }}
)

model = "azure:[DEPLOYMENT_NAME]" 

I've verified my credentials are valid, we have been using them in our application for sometime now.

Do I do something wrong in here or is gpt-4o not supported through azure provider? (Line 18-37 azure_provider.py doesn't mention it in the comment)

Thanks!

@Valkea
Copy link

Valkea commented Mar 4, 2025

I had the same problem, so I forked and solved the problem (the openai models and the other models hosted on Azure doesn't call the same type of URL).

The work is available here : https://github.com/Valkea/aisuite/tree/valkea/azure_openai_fix

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

2 participants