Acknowledgments: This project was hard forked from Open Webui on April 17th, 2025. See Open Webui for more info.
Before you begin, ensure your system meets these minimum requirements:
- Operating System: Linux (or WSL on Windows), Windows 11, or macOS. (Recommended for best compatibility)
- IDE (Recommended): We recommend using an IDE like VS Code for code editing, debugging, and integrated terminal access. Feel free to use your favorite IDE if you have one!
- [Optional] GitHub Desktop: For easier management of the Git repository, especially if you are less familiar with command-line Git, consider installing GitHub Desktop.
We'll set up both the frontend (user interface) and backend (API and server logic) of DPV AI Platform.
First, use git clone to download the DPV AI Platform repository to your local machine. This will create a local copy of the project on your computer.
- Open your terminal (or Git Bash if you're on Windows and using Git Bash).
- Navigate to the directory where you want to store the DPV AI Platform project.
- Clone the repository: Run the following command:
git clone https://github.com/digital-public-ventures/ai-platform.git
cd ai-platformThe git clone command downloads the project files from GitHub. The cd ai-platform command then navigates you into the newly created project directory.
Important
Use Node.js: Version 22.10 or higher. (Required for frontend development)
-
Install nvm and use Node.js v22.10 or higher:
- For managing Node versions, we recommend nvm. You can install nvm and tell it to use the Node version specified in this repo's
.nvmrclike so:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash- Open a new terminal or run
source ~/.bashrc(orsource ~/.zshrcif you use zsh), then:
nvm install # should automatically install version in .nvmrc, else specify 22.18.0 nvm use # should automatically use version in .nvmrc, else specify 22.18.0
- For managing Node versions, we recommend nvm. You can install nvm and tell it to use the Node version specified in this repo's
-
Configure Environment Variables:
-
Copy the example environment file to
.env:cp -RPp .env.example .env
This command copies the
.env.examplefile to a new file named.env. The.envfile is where you'll configure environment variables for the frontend. -
Customize
.env: Open the.envfile in your code editor (like VS Code). This file contains configuration variables for the frontend, such as API endpoints and other settings. For local development, the default settings in.env.exampleare usually sufficient to start with. However, you can customize them if needed.
-
Important
Do not commit sensitive information to .env. Always ensure that .env is listed in your .gitignore file.
-
Install Frontend Dependencies:
-
Navigate to the frontend directory: If you're not already in the project root (
ai-platformdirectory), ensure you are there.# If you are not yet in the project root, run: cd ai-platform
-
Install the required JavaScript packages:
npm install
This will install all frontend dependencies listed in
package.json.Note: Depending on your DPV AI Platform version, you might see compatibility warnings or errors. If so, just run:
npm install --force
Some setups need this to get around version issues.
-
-
Start the Frontend Development Server:
- In your terminal, run:
npm run dev
- This command launches the frontend development server. If the steps were followed successfully, it will usually indicate the server is running and provide a local URL.
🎉 Access the Frontend: Open your web browser and go to http://localhost:5173. You should see a message indicating that DPV AI Platform's frontend is running and is waiting for the backend to be available. Don't worry about that message yet! Let's set up the backend next. Keep this terminal running – it's serving your frontend!
Once you’ve verified that the frontend development server (npm run dev) is running correctly and you can see DPV AI Platform at http://localhost:5173, it's a good practice to also build the frontend assets. This step simulates the production environment and can help catch build-time errors that don't show up during development.
In the same frontend terminal:
npm run build- This command generates an optimized, production-ready build of the frontend and places the static files in the
builddirectory. - If the build completes successfully (without errors), you're ready! If there are errors, address them before proceeding.
- You don't need to do anything more with
buildfor local development, but building ensures your code will not break in production or during deployment.
Important
Python: Version 3.11 or higher. (Required for backend services)
For managing Python versions, we recommend uv. You can install uv and tell it to use Python 3.11 like so:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.11This application requires you to use separate terminal instances for your frontend and backend processes. This keeps your workflows organized and makes it easier to manage each part of the application independently.
Using VS Code Integrated Terminals:
VS Code's integrated terminal feature makes managing multiple terminals easy. Here's how to leverage it for frontend and backend separation:
-
Frontend Terminal (You likely already have this): If you followed the Frontend Setup steps, you probably already have a terminal open in VS Code at the project root (
ai-platformdirectory). This is where you'll run your frontend commands (npm run dev, etc.). Ensure you are in theai-platformdirectory for the next steps if you are not already. -
Backend Terminal (Open a New One):
- In VS Code, go to Terminal > New Terminal (or use the shortcut
Ctrl+Shift+on Windows/Linux orCmd+Shift+on macOS). This will open a new integrated terminal panel. - Navigate to the
backenddirectory: In this new terminal, use thecd backendcommand to change the directory to thebackendfolder within your project. This ensures all backend-related commands are executed in the correct context.
Now you have two separate terminal instances within VS Code: one for the frontend (likely in the
ai-platformdirectory) and one specifically for the backend (inside thebackenddirectory). You can easily switch between these terminals within VS Code to manage your frontend and backend processes independently. This setup is highly recommended for a cleaner and more efficient development workflow. - In VS Code, go to Terminal > New Terminal (or use the shortcut
Backend Setup Steps (in your backend terminal):
-
Navigate to the Backend Directory: (You should already be in the
backenddirectory in your new terminal from the previous step). If not, run:cd backend -
Create and Activate a uv Virtual Environment (Recommended):
-
We highly recommend using Astral’s uv to manage Python dependencies and isolate your project environment. It is significantly faster than Conda or pip, handles both virtual environments and dependency resolution, and ensures you have the correct Python version and libraries.
uv venv --python 3.11 .venv source .venv/bin/activateuv venv --python 3.11 .venv: This command creates a new virtual environment named.venvusing Python version 3.11. If you chose a different Python 3.11.x version, that’s fine.source .venv/bin/activate: This command activates the newly created uv environment. Once activated, your terminal prompt will usually change to indicate you are in the.venvenvironment (e.g., it might show(.venv)at the beginning of the line).
Make sure you activate the environment in your backend terminal before proceeding.
(Using uv is optional but strongly recommended for managing Python dependencies and avoiding conflicts.) If you choose not to use uv, ensure you are using Python 3.11 or higher and proceed to the next step, but be aware of potential dependency conflicts.
-
-
Install Backend Dependencies:
- In your backend terminal (and with the uv environment activated if you are using uv), run:
uv pip install -r requirements.txt -U
This command uses uv's accelerated version of
pip(Python Package Installer) to read therequirements.txtfile in thebackenddirectory.requirements.txtlists all the Python libraries that the backend needs to run.pip installdownloads and installs these libraries into your active Python environment (your uv environment if you are using it, or your system-wide Python environment otherwise). The-Uflag ensures you get the latest compatible versions of the libraries. -
Make an AI model available to your backend: In order to chat with a model immediately, you can either provide an
OPENAI_API_KEYenvironment variable in your.envfile or download and run Ollama.To use Ollama, download and install Ollama, then open a terminal and run:
ollama run gemma
This will download and install the Gemma open source model by Google, which will run on most laptops.
To use OpenAI or Azure OpenAI, you can add the following to your
.envfile:OPENAI_API_KEY='your_openai_api_key_here' OPENAI_API_BASE_URL='https://api.openai.com/v1' # or your Azure OpenAI endpoint
If using Azure OpenAI, your base URL should look like:
https://my-resource-name.openai.azure.com/openai/v1. To work out of the box, you must use default deployment names, likegpt-4.1,gpt-5-mini-2025-08-07. See expected names here.
Note
When using an Azure base url, the models dropdown will show all models, but only the models you have created deployments for will work. You can turn off the other models by clicking your profile icon > admin panel > settings > models.
-
Start the Backend Development Server:
- In your backend terminal, run:
bash dev.sh
This command executes the
dev.shscript. This script contains the command to start the backend development server. (You can open and examine thedev.shfile in your code editor to see the exact command being run if you are curious.) The backend server will usually start and print some output to the terminal.📄 Explore the API Documentation: Once the backend is running, you can access the automatically generated API documentation in your web browser at http://localhost:8080/docs. This documentation is incredibly valuable for understanding the backend API endpoints, how to interact with the backend, and what data it expects and returns. Keep this documentation handy as you develop!
-
Start the Backend Production Server: (Skip for local development)
- Ensure that your dev server or any other processes listening on
8080are stopped (seePort Conflictsbelow), then in your backend terminal, run:
bash start.sh
This command executes the
start.shscript. This script contains the command to start the backend production server. (You can open and examine thebackend/start.shfile in your code editor to see the exact commands being run if you are curious.) The backend server will start and print some output to the terminal. - Ensure that your dev server or any other processes listening on
🎉 Congratulations! If you have followed all the steps, you should now have both the frontend and backend development servers running locally. Go back to your browser tab where you accessed the frontend (usually http://localhost:5173). Refresh the page. You should now see the full DPV AI Platform application running in your browser, connected to your local backend!
- Make sure to choose "sign up" and not "sign in" when creating your first user account. The first user to sign up will automatically become an admin.
- Env vars don't override settings stored in the database. If you change an env var and it doesn't seem to have any effect, check the admin panel settings page to see if that setting has a value and change it there if needed.
- If you use a function pipe to provide models, admins don't have permission by default, so you'll need to either make the models public in admin panel > settings > models, or create a user group and make the models available to that group.
To set up postgres and redis locally, see the Local Postgres and Redis Setup Guide.
For help with common issues, see the Troubleshooting Guide.