-
Notifications
You must be signed in to change notification settings - Fork 106
docs: Add documentation for deploying with limited Azure OpenAI quota #468
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
Open
Kanchan-Microsoft
wants to merge
1
commit into
dev
Choose a base branch
from
kn-quota-doc
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # Deploying with Limited OpenAI Quota | ||
|
|
||
| This document provides guidance on deploying the Document Knowledge Mining Solution Accelerator when you have limited Azure OpenAI model quota available. | ||
|
|
||
| ## Overview | ||
|
|
||
| By default, the solution requires: | ||
| - **GPT model**: 100,000 Tokens Per Minute (TPM) | ||
| - **Embedding model**: 200,000 TPM | ||
|
|
||
| If your Azure OpenAI service has lower quota limits, you can modify the deployment to work with reduced capacity. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before proceeding, ensure you have: | ||
| - Azure Developer CLI (azd) installed | ||
| - Access to your Azure OpenAI service quota settings | ||
| - Knowledge of your current TPM limits | ||
|
|
||
| ## Deployment Options | ||
|
|
||
| You have two approaches to deploy with less quota: | ||
|
|
||
| ### Option 1: Remove Quota Validation | ||
|
|
||
| Remove the metadata section (lines 94-102) from the [`infra/main.bicep`](../infra/main.bicep) file: | ||
|
|
||
| ```bicep | ||
| @metadata({ | ||
| azd: { | ||
| type: 'location' | ||
| usageName: [ | ||
| 'OpenAI.GlobalStandard.gpt4.1-mini,150' | ||
| 'OpenAI.GlobalStandard.text-embedding-3-large,100' | ||
| ] | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ### Option 2: Modify Quota Thresholds (Recommended) | ||
|
|
||
| Update the values on lines 98-99 in [`infra/main.bicep`](../infra/main.bicep) to match your available quota: | ||
|
|
||
| ```bicep | ||
| @metadata({ | ||
| azd: { | ||
| type: 'location' | ||
| usageName: [ | ||
| 'OpenAI.GlobalStandard.gpt4.1-mini, 50' // Changed from 150 | ||
| 'OpenAI.GlobalStandard.text-embedding-3-large, 50' // Changed from 100 | ||
| ] | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| ## Configuration Steps | ||
|
|
||
| After modifying the Bicep file, configure your deployment capacity: | ||
|
|
||
| ```powershell | ||
| azd env set AZURE_ENV_MODEL_CAPACITY="50" | ||
| azd env set AZURE_ENV_EMBEDDING_MODEL_CAPACITY="50" | ||
| ``` | ||
|
|
||
| > **Note**: Adjust the values (50) to match your actual available quota. | ||
|
|
||
| ## Deploy the Solution | ||
|
|
||
| Once configured, proceed with deployment: | ||
|
|
||
| ```powershell | ||
| azd up | ||
| ``` | ||
|
|
||
| ## Performance Considerations | ||
|
|
||
| ⚠️ **Important**: Using reduced TPM limits may impact application performance: | ||
|
|
||
| For optimal performance, we recommend maintaining at least 200,000 TPM for GPT models when possible. | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| For more detailed information, refer to: | ||
|
|
||
| - [Deployment Guide](DeploymentGuide.md) - Complete deployment instructions | ||
| - [Customizing azd Parameters](CustomizingAzdParameters.md) - Advanced configuration options | ||
| - [Quota Check](QuotaCheck.md) - Script for checking Azure OpenAI quota limits | ||
|
|
||
| ## Why we need to do this? | ||
| - The solution uses built-in Azure Developer CLI (azd) quota validation to prevent deployment failures. Specifically, azd performs pre-deployment checks to ensure sufficient quota is available i.e. 200k TPM for gpt model and 80k TPM for embedding model. | ||
|
|
||
| - These quota thresholds are hardcoded in the infrastructure file because azd's quota checking mechanism doesn't currently support parameterized values. If your Azure OpenAI service has quota below these thresholds, the deployment will fail during the validation phase rather than proceeding and failing later in the process. | ||
|
|
||
| - By following the steps above, you can either: | ||
| 1. **Bypass quota validation entirely** by removing the metadata block | ||
| 2. **Lower the validation thresholds** to match your available quota (e.g., 50,000 TPM) | ||
|
|
||
| - This ensures successful deployment while working within your quota constraints. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommended option should be on top