This section primarily recommends two browser-based integrated development environments for environment configuration. Whether you're using a phone, tablet, or computer, you can log in and run code anytime. Although the experience on phones and tablets might not be ideal, they are still usable.
To use the large language model services provided by Deepseek, you first need an API Key. Here are the application steps:
-
Visit Deepseek Open Platform Open your browser and visit Deepseek Open Platform.
-
Login or Register Account If you already have an account, please log in directly. If not, click the register button on the page and complete registration using your email or phone number.
-
Create New API Key After successful login, find and click
API Keysin the left navigation bar. On the API management page, click theCreate API keybutton. Enter a name that doesn't duplicate other API keys and click create. -
Save API Key The system will generate a new API key for you. Please copy immediately and save it in a secure place.
Note: For security reasons, this key will only be displayed in full once. You won't be able to see it again after closing the popup.
First, ensure you have a network environment that can smoothly access GitHub. If you cannot access it smoothly, please use Cloud Studio below.
GitHub Codespaces is a service provided by GitHub that allows developers to create, edit, and run code in the cloud. It provides a pre-configured development environment including code editor, terminal, debugging tools, etc., which can be used directly in the browser.
-
Visit Project Address
Open your browser and visit all-in-rag
-
Create New Fork In the upper right corner of the project page, click the
Forkbutton to create a new fork. Wait a moment for successful creation. -
Create Codespaces In the upper right corner of the project page, click the
Codebutton, then select theCodespacestab. Click theNew codespacebutton and wait for the new Codespaces environment to be created successfully. -
Re-enter Codespaces After closing the webpage, find the newly created repository and click the content in the red box to re-enter the codespace environment.
-
Quota Settings Find the codespace settings in GitHub's account settings. It's recommended to adjust the suspend time according to your situation (too long will waste quota, free accounts provide 120 hours of single-core quota).
After entering the IDE, first select the terminal below.
-
Update System Packages
Enter the following command in the terminal:
sudo apt update sudo apt upgrade -y
-
Install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh bash ~/miniconda.sh
- Press Enter to read the license agreement
- Enter
yesto agree to the agreement - Press Enter directly when prompted for installation path (use default path /home/ubuntu/miniconda3)
- Whether to initialize Miniconda: Enter
yesto add Miniconda to your PATH environment variable.
source ~/.bashrc conda --version
If the version number is displayed, the installation is successful.
-
Use the
vimeditor to open your shell configuration file.vim ~/.bashrc -
Enter
ito enter edit mode, add the following line at the end of the file, replacing[Your Deepseek API Key]with your own key:export DEEPSEEK_API_KEY=[Your Deepseek API Key] -
Save and exit. In vim, press Esc to enter command mode, then type
:wqand press Enter to save the file and exit. -
Make configuration effective. Execute the following command to immediately load the updated configuration and make the environment variable effective:
source ~/.bashrc
-
Create Virtual Environment
conda create --name all-in-rag python=3.12.7
Press Enter directly when options appear.
-
Activate Virtual Environment
Use the following command to activate the virtual environment:
conda activate all-in-rag
-
Dependency Installation If you strictly follow the above process, you should currently be in the project root directory. Enter the code directory to install dependency libraries.
cd code pip install -r requirements.txtIf there are version errors about grpcio, you can ignore them.
Cloud Studio is a browser-based integrated development environment (IDE) launched by Tencent Cloud. It supports access to both CPU and GPU.
I heard there's a free quota of 50 hours per month 🤔
-
Visit Cloud Studio Open your browser and visit Cloud Studio.
-
Login or Register Account Click the
Register/Loginbutton in the upper right corner of the page and complete login using WeChat or other methods. -
Create Application Find and click
Create Applicationin the navigation bar at the top of the page. SelectImport from Git Repository, enterhttps://github.com/datawhalechina/all-in-rag.gitin the project address bar and press Enter. It will automatically create a title and description for you. -
Re-enter Later, find the previously created application on the Application Management Page, click on it and select "Write Code" in the upper right corner to re-enter.
After entering the IDE, first select the terminal on the right.
-
Update System Packages
Enter the following command in the terminal:
sudo apt update sudo apt upgrade -y
-
Switch to Regular User
su ubuntu
-
Install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh bash ~/miniconda.sh
- Press Enter to read the license agreement
- Enter
yesto agree to the agreement - Press Enter directly when prompted for installation path (use default path /home/ubuntu/miniconda3)
- Whether to initialize Miniconda: Enter
yesto add Miniconda to your PATH environment variable.
source ~/.bashrc conda --version
If the version number is displayed, the installation is successful.
-
Use the
vimeditor to open your shell configuration file.vim ~/.bashrc -
Enter
ito enter edit mode, add the following line at the end of the file, replacing[Your Deepseek API Key]with your own key:export DEEPSEEK_API_KEY=[Your Deepseek API Key] -
Save and exit. In vim, press Esc to enter command mode, then type
:wqand press Enter to save the file and exit. -
Make configuration effective. Execute the following command to immediately load the updated configuration and make the environment variable effective:
source ~/.bashrc
-
Create Virtual Environment
conda create --name all-in-rag python=3.12.7
Press Enter directly when options appear.
-
Configure File Permissions
sudo chown -R ubuntu:ubuntu code models
-
Activate Virtual Environment
Use the following command to activate the virtual environment:
conda activate all-in-rag
-
Dependency Installation If you strictly follow the above process, you should currently be in the project root directory. Enter the code directory to install dependency libraries.
cd code pip install -r requirements.txtIf there are version errors about grpcio, you can ignore them.
-
Right-click "Computer" or "This PC", then click "Properties".
-
In the left menu, click "Advanced system settings".
-
In the "System Properties" dialog box, click the "Advanced" tab, then click the "Environment Variables" button below.
-
In the "Environment Variables" dialog box, click "New" (under the "User variables" section), then enter the following information:
- Variable name: DEEPSEEK_API_KEY
- Variable value: [Your Deepseek API Key]
-
Download Installer
It's recommended to visit Tsinghua University Open Source Software Mirror for faster download speeds. Choose the latest
Windows-x86_64.exeversion according to your system.You can also download from the Miniconda Official Website.
-
Run Installation Wizard
After downloading, double-click the
.exefile to start installation. Follow the wizard prompts:- Welcome: Click
Next. - License Agreement: Click
I Agree. - Installation Type: Select
Just Me, clickNext. - Choose Install Location: It's recommended to keep the default path, or choose a path without Chinese characters and spaces. Click
Next. - Advanced Installation Options: Do not check "Add Miniconda3 to my PATH environment variable". We will manually configure environment variables later. Click
Install. - Installation Complete: After installation is complete, click
Next, then uncheck "Learn more" and clickFinishto complete installation.
- Welcome: Click
-
Manually Configure Environment Variables
To use the
condacommand in any terminal window, you need to manually configure environment variables.- Search for "Edit the system environment variables" in the Windows search bar and open it.
- In the "System Properties" window, click "Environment Variables".
- In the "Environment Variables" window, find the
Pathvariable under "System variables", select it and click "Edit". - In the "Edit Environment Variable" window, create three new paths pointing to the corresponding folders under your Miniconda installation directory. If your installation path is
D:\Miniconda3, you need to add:D:\Miniconda3 D:\Miniconda3\Scripts D:\Miniconda3\Library\bin - After completion, click "OK" all the way to save changes.
- Search for "Edit the system environment variables" in the Windows search bar and open it.
To speed up subsequent package installations using conda, it's strongly recommended to configure domestic mirror sources. Open a new terminal or Anaconda Prompt and run the following commands:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yesAfter configuration, you can view the added sources using the conda config --show channels command.
If you haven't installed Git yet, please follow these steps to install it.
-
Windows System: Visit the Git Official Website, download and run the installer, complete installation with default settings.
-
macOS System: Open terminal and enter the following command to install Git:
brew install git
-
Linux System (Ubuntu example): Open terminal and enter the following commands to install Git:
sudo apt-get update sudo apt-get install git
After installation, verify that Git is installed successfully by entering the following command:
git --versionIf successful, it will display Git's version number.
-
Choose Directory for Project Open terminal (or Git Bash in Windows), navigate to the directory where you want to store the project:
cd [path where you want to store the project] -
Clone Repository Use the following command to pull the
all-in-ragrepository:git clone https://github.com/datawhalechina/all-in-rag.git
Wait for the download to complete. The project code will be stored in the
all-in-ragfolder in the current directory. -
Enter Project Directory After pulling the code, enter the project directory:
cd all-in-rag
In the project directory, it's recommended to use the previously configured Miniconda to create a Python virtual environment.
-
Create Virtual Environment
conda create --name all-in-rag python=3.12.7
-
Activate Virtual Environment
All systems use the following command to activate the virtual environment:
conda activate all-in-rag
-
Dependency Installation If you strictly follow the above process, you should currently be in the project root directory. Enter the code directory to install dependency libraries.
cd code pip install -r requirements.txt













