You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it possible to deploy on free App Service and free Search Service tier (#1166)
* Draft of freer deployment
* Update readme
* Finsh docs
* Clean up prepdocs
* Set semanticSearch accordingly
* Making the UI honor semantic search being turned off
* Use azd env vars for vectors, PDF
* Tests
* Honor vectors and search in deployed version
* Fix dependency issues with keyvault, provide details for free account deployment
* Preamble re free accts
* Adding environment variable for semantic ranker level, default to free
* Fix conditional deployment issue
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,8 @@ However, you can try the [Azure pricing calculator](https://azure.com/e/8ffbe5b1
95
95
- Azure Blob Storage: Standard tier with ZRS (Zone-redundant storage). Pricing per storage and read operations. [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/)
96
96
- Azure Monitor: Pay-as-you-go tier. Costs based on data ingested. [Pricing](https://azure.microsoft.com/pricing/details/monitor/)
97
97
98
-
To reduce costs, you can switch to free SKUs for Azure App Service and Azure AI Document Intelligence by changing the parameters file under the `infra` folder. There are some limits to consider; for example, the free Azure AI Document Intelligence resource only analyzes the first 2 pages of each document. You can also reduce costs associated with the Azure AI Document Intelligence by reducing the number of documents in the `data` folder, or by removing the postprovision hook in `azure.yaml` that runs the `prepdocs.py` script.
98
+
To reduce costs, you can switch to free SKUs for various services, but those SKUs have limitations.
99
+
See this guide on [deploying with minimal costs](docs/deploy_lowcost.md) for more details.
99
100
100
101
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
101
102
either by deleting the resource group in the Portal or running `azd down`.
# If you encounter a blocking error during a DefaultAzureCredential resolution, you can exclude the problematic credential by using a parameter (ex. exclude_shared_token_cache_credential=True)
This AI RAG chat application is designed to be easily deployed using the Azure Developer CLI, which provisions the infrastructure according to the Bicep files in the `infra` folder. Those files describe each of the Azure resources needed, and configures their SKU (pricing tier) and other parameters. Many Azure services offer a free tier, but the infrastructure files in this project do *not* default to the free tier as there are often limitations in that tier.
4
+
5
+
However, if your goal is to minimize costs while prototyping your application, follow these steps below _before_ deploying the application.
6
+
7
+
1. Use the free tier of App Service:
8
+
9
+
```shell
10
+
azd env set AZURE_APP_SERVICE_SKU F1
11
+
```
12
+
13
+
Limitation: You are only allowed a certain number of free App Service instances per region. If you have exceeded your limit in a region, you will get an error during the provisioning stage. If that happens, you can run `azd down`, then`azd env new` to create a new environment with a new region.
14
+
15
+
2. Use the free tier of Azure AI Search:
16
+
17
+
```shell
18
+
azd env set AZURE_SEARCH_SERVICE_SKU free
19
+
```
20
+
21
+
Limitations:
22
+
1. You are only allowed one free search service across all regions.
23
+
If you have one already, either delete that service or follow instructions to
24
+
reuse your [existing search service](../README.md#existing-azure-ai-search-resource).
25
+
2. The free tier does not support semantic ranker, so the app UI will no longer display
26
+
the option to use the semantic ranker. Note that will generally result in [decreased search relevance](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167).
27
+
3. The free tier does not support Managed Identity (keyless API access),
28
+
so the Bicep will use Azure Key Vault to securely store the key instead.
29
+
30
+
3. Use the free tier of Azure Document Intelligence (used in analyzing PDFs):
31
+
32
+
```shell
33
+
azd env set AZURE_FORMRECOGNIZER_SKU F0
34
+
```
35
+
36
+
Limitation: The free tier will only scan the first two pages of each PDF.
37
+
In our sample documents, those first two pages are just title pages,
38
+
so you won't be able to get answers from the documents.
39
+
You can either use your own documents that are only 2-pages long,
40
+
or you can use a local Python package for PDF parsing by setting:
41
+
42
+
```shell
43
+
azd env set USE_LOCAL_PDF_PARSER true
44
+
```
45
+
46
+
3. Turn off Azure Monitor (Application Insights):
47
+
48
+
```shell
49
+
azd env set AZURE_USE_APPLICATION_INSIGHTS false
50
+
```
51
+
52
+
Application Insights is quite inexpensive already, so turning this off may not be worth the costs saved,
53
+
but it is an option for those who want to minimize costs.
54
+
55
+
4. Disable vector search:
56
+
57
+
```shell
58
+
azd env set USE_VECTORS false
59
+
```
60
+
61
+
By default, the application computes vector embeddings for documents during the data ingestion phase,
62
+
and then computes a vector embedding for user questions asked in the application.
63
+
Those computations require an embedding model, which incurs costs per tokens used. The costs are fairly low,
64
+
so the benefits of vector search would typically outweigh the costs, but it is possible to disable vector support.
65
+
If you do so, the application will fall back to a keyword search, which is less accurate.
66
+
67
+
5. Once you've made the desired customizations, follow the steps in [to run `azd up`](../README.md#deploying-from-scratch).
68
+
69
+
## Deploying from an Azure free account
70
+
71
+
There are additional limitations for Azure free accounts (as opposed to "Pay-as-you-go" accounts which have billing enabled).
72
+
73
+
As of January 2024, Azure free accounts cannot sign up for Azure OpenAI access.
74
+
You can instead sign up for an openai.com account. Follow these [directions to specify your OpenAI host and key](../README.md#openaicom-openai).
75
+
76
+
## Reducing costs locally
77
+
78
+
To save costs forlocal development, you could use an OpenAI-compatible model.
79
+
Follow steps in [local development guide](localdev.md#using-a-local-openai-compatible-api).
0 commit comments