Skip to content

Conversation

timothymeyers
Copy link

@timothymeyers timothymeyers commented Jan 21, 2025

Purpose

The following PR addresses an issue I found will troubleshooting #35.

Originally, it was assumed that the Azure OpenAI Model Name and Deployment Name were the same because this is how the accelerator deploys its resources. However, when doing a local deployment, it may be desirable to use an existing Azure Open AI resource and model deployment due to resource and quota constraints.

In my case, my Model name (gpt-4o) was not the same as my model deployment name (gpt4o, no dash). This was resulting in 400 errors when trying to connect to the model.

This PR introduces a new optional configuration value, AZURE_OPENAI_MODEL_NAME to config.py. It will default to using AZURE_OPENAI_DEPLOYMENT_NAME if not present.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
  • Test the code

    • Deploy another model within your Azure OpenAI instance where the deployment name (e.g. gpt-4o-testing) and model name (e.g., gpt-4o) do not match.
    • Update .env to include AZURE_OPENAI_MODEL_NAME
    • Start/Restart app.py server

What to Check

Verify that the following are valid

  • In the original code, you will see 400 ERRORs due to model not being found, as it is looking for gpt-4o-testing rather than gpt-4o.
  • In my updated code, it should work normally.

@timothymeyers timothymeyers changed the title Separate out config for AZURE_OPENAI_MODEL_NAME and AZURE_OPENAI_DEPLOYMENT_NAME - Fixes #35 fix: Separate out config for AZURE_OPENAI_MODEL_NAME and AZURE_OPENAI_DEPLOYMENT_NAME - Fixes #35 Jan 21, 2025
@Roopan-Microsoft Roopan-Microsoft changed the base branch from main to hotfix January 27, 2025 08:20
@Roopan-Microsoft Roopan-Microsoft added the duplicate This issue or pull request already exists label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants