-
Notifications
You must be signed in to change notification settings - Fork 1
Setup and Installation
This guide provides instructions for setting up and running Chat-Service.
- Python 3.x
- Docker (recommended for ease of deployment)
- Other dependencies as listed in
requirements.txt
The service can be built and run using Docker and Docker Compose.
-
Build the Docker image:
docker-compose build
-
Run the service:
The service should now be accessible based on the port mappings in
docker-compose up
docker-compose.yml.
- Clone the repository (if not already done).
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
Set up any necessary environment variables (e.g., API keys for LLMs, database connections). Refer to
config.pyor a sample.envfile if available. -
Run the application:
The command to run the application will depend on the web server/framework used (e.g., Uvicorn for FastAPI). This is typically defined in
main.pyor a run script.# Example for FastAPI with Uvicorn # uvicorn src.main:app --reload
To ensure a consistent development environment and accurately track project dependencies, it's crucial to manage the requirements.txt file correctly. For a detailed guide, refer to the Updating requirements.txt document in the main repository.
Here’s a summary of the process:
-
Create and Activate a Virtual Environment:
- Always work within a virtual environment to isolate project dependencies.
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
- Always work within a virtual environment to isolate project dependencies.
-
Install Existing Dependencies (if any):
- When starting on the project or a new environment, install dependencies from the existing
requirements.txt:pip install -r requirements.txt
- When starting on the project or a new environment, install dependencies from the existing
-
Install New or Update Packages:
- If you add new libraries or need to update existing ones, use
pip install:pip install package_name pip install package_name==1.2.3 # To install a specific version pip install --upgrade package_name # To upgrade a package
- If you add new libraries or need to update existing ones, use
-
Update
requirements.txt:- After installing or updating packages, regenerate the
requirements.txtfile to reflect these changes:pip freeze > requirements.txt - This command captures all packages currently installed in your virtual environment along with their exact versions.
- After installing or updating packages, regenerate the
-
Commit
requirements.txt:- Add the updated
requirements.txtto your Git commit so that other developers and deployment processes use the correct set of dependencies.
- Add the updated
-
Deactivate Virtual Environment (when done):
deactivate
Following these steps helps prevent dependency conflicts and ensures that the application behaves consistently across different setups.
Key configuration options can be found in src/config.py. This may include:
- LLM model selection
- API keys
- Database URIs
- Service ports
- Paths for RAG data
Ensure these are correctly set for your environment.
Authors:
Peter Olai Johnsen
Tobias Fremming
Erik Le Blanc Pleym
About Chat-Service
Core Components
Development
Codebase Details
- Codebase Architecture
- Routes
- Command-py
- Config-py
- Context Upload-py
- LLM-py
- Main-py
- Pipeline-py
- Streaming WS-py
- Transcribe-py
Deployment and Operations