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
Copy file name to clipboardExpand all lines: docs/localdev.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# RAG chat: Local development of chat app
2
2
3
+
After deploying the app to Azure, you may want to continue development locally. This guide explains how to run the app locally, including hot reloading and debugging.
4
+
5
+
*[Running development server from the command line](#running-development-server-from-the-command-line)
6
+
*[Hot reloading frontend and backend files](#hot-reloading-frontend-and-backend-files)
7
+
*[Using VS Code "Run and Debug"](#using-vs-code-run-and-debug)
8
+
*[Using a local OpenAI-compatible API](#using-a-local-openai-compatible-api)
## Running development server from the command line
13
+
3
14
You can only run locally **after** having successfully run the `azd up` command. If you haven't yet, follow the steps in [Azure deployment](../README.md#azure-deployment) above.
4
15
5
16
1. Run `azd auth login`
@@ -40,6 +51,16 @@ Navigate to the URL shown in the terminal (in this case, `http://localhost:5173/
40
51
41
52
Then, whenever you make changes to frontend files, the changes will be automatically reloaded, without any browser refresh needed.
42
53
54
+
## Using VS Code "Run and Debug"
55
+
56
+
This project includes configurations defined in `.vscode/launch.json` that allow you to run and debug the app directly from VS Code:
57
+
58
+
* "Backend (Python)": Starts the Python backend server, defaulting to port 50505.
59
+
* "Frontend": Starts the frontend server using Vite, typically at port 5173.
60
+
* "Frontend & Backend": A compound configuration that starts both the frontend and backend servers.
61
+
62
+
When you run these configurations, you can set breakpoints in your code and debug as you would in a normal VS Code debugging session.
63
+
43
64
## Using a local OpenAI-compatible API
44
65
45
66
You may want to save costs by developing against a local LLM server, such as
@@ -60,9 +81,9 @@ You should now be able to use the "Ask" tab.
60
81
61
82
⚠️ Limitations:
62
83
63
-
- The "Chat" tab will only work if the local language model supports function calling.
64
-
- Your search mode must be text only (no vectors), since the search index is only populated with OpenAI-generated embeddings, and the local OpenAI host can't generate those.
65
-
- The conversation history will be truncated using the GPT tokenizers, which may not be the same as the local model's tokenizer, so if you have a long conversation, you may end up with token limit errors.
84
+
* The "Chat" tab will only work if the local language model supports function calling.
85
+
* Your search mode must be text only (no vectors), since the search index is only populated with OpenAI-generated embeddings, and the local OpenAI host can't generate those.
86
+
* The conversation history will be truncated using the GPT tokenizers, which may not be the same as the local model's tokenizer, so if you have a long conversation, you may end up with token limit errors.
66
87
67
88
> [!NOTE]
68
89
> You must set `OPENAI_HOST` back to a non-local value ("azure", "azure_custom", or "openai")
0 commit comments