Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make readme file more beginner friendly #153

Merged
merged 6 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 114 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,16 +1,125 @@
# Pyris V2
## With local environment
Pyris is an intermediary system that links the [Artemis](https://github.com/ls1intum/Artemis) platform with various Large Language Models (LLMs). It provides a REST API that allows Artemis to interact with different pipelines based on specific tasks.

### Setup
## Features
- **Modular Design**: Pyris is built to be modular, allowing for integration of new models and pipelines. This design helps the system adapt to different requirements.
- **RAG Support**: Pyris implements Retrieval-Augmented Generation (RAG) using [Weaviate](https://weaviate.io/), a vector database. This feature enables the generation of responses based on retrieved context, potentially improving the relevance of outputs.
- **Flexible Pipelines**: The system supports various pipelines that can be selected depending on the task at hand, providing versatility in handling different types of requests.

Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtual AI Tutor that helps students with their programming exercises on Artemis in a didactically meaningful way.

## Setup
### With local environment
> **⚠️ Warning:** To change the local Weaviate vector database setup, please refer to [Weaviate Docs](https://weaviate.io/developers/weaviate/quickstart).
- Check python version: `python --version` (should be 3.12)
- Install packages: `pip install -r requirements.txt`
- Create an `application.local.yml` file in the root directory. This file includes configurations that can be used by the application.
- Example `application.local.yml`:
```yaml
api_keys:
- token: "secret"

weaviate:
host: "localhost"
port: "8001"
grpc_port: "50051"

env_vars:
test: "test"
```
- Create an `llm-config.local.yml` file in the root directory. This file includes a list of models with their configurations that can be used by the application.
- Example `llm-config.local.yml`:
```yaml
- id: "<model-id>"
name: "<custom-model-name>"
description: "<model-description>"
type: "<model-type>, e.g. azure-chat, ollama"
endpoint: "<your-endpoint>"
api_version: "<your-api-version>"
azure_deployment: "<your-azure-deployment-name>"
model: "<model>, e.g. gpt-3.5-turbo"
api_key: "<your-api-key>"
tools: []
capabilities:
input_cost: 0.5
output_cost: 1.5
gpt_version_equivalent: 3.5
context_length: 16385
vendor: "<your-vendor>"
privacy_compliance: True
self_hosted: False
image_recognition: False
json_mode: True
```
- Each model configuration in the `llm-config.local.yml` file also include capabilities that will be used by the application to select the best model for a specific task.

### Run server
#### Run server
- Run server:
```[bash]
APPLICATION_YML_PATH=<path-to-your-application-yml-file> LLM_CONFIG_PATH=<path-to-your-llm-config-yml> uvicorn app.main:app --reload
```
- Access API docs: http://localhost:8000/docs
-
### Getting Started with Docker

Deploying Pyris using Docker is a straightforward way to set up the application in a consistent environment. Here's how you can do it:

**Build and Run the Containers**

The essential part of setting up Pyris with Docker is building and running the containers. Docker Compose is used to manage the different services, including Pyris, Weaviate, and Nginx, for both development and production environments.

- **For Development:**

To start the development environment, run:

```bash
docker-compose -f docker-compose/pyris-dev.yml up --build
```

This command will:
- Build the Pyris application.
- Start the Pyris application along with Weaviate in development mode.
- Mount local configuration files for easy modification.
yassinsws marked this conversation as resolved.
Show resolved Hide resolved

The application will be available at `http://localhost:8000`.

- **For Production:**

To start the production environment, run:

```bash
docker-compose -f docker-compose/pyris-production.yml up -d
```

This command will:
- Pull the latest Pyris image from the GitHub Container Registry.
- Start Pyris along with Weaviate and Nginx in production mode.
- Nginx will handle SSL and serve as a reverse proxy.

The application will be available at `https://<your-domain>`.

#### Additional Steps (Optional)

If you need to stop the containers, use:

```bash
docker-compose -f docker-compose/pyris-dev.yml down
```

or

```bash
docker-compose -f docker-compose/pyris-production.yml down
```

You can also customize the configuration for Weaviate, Pyris, and Nginx by editing their respective configuration files. However, the default setup should work fine for most users.

For development, access the API documentation at `http://localhost:8000/docs`. For production, access the application at your domain (e.g., `https://<your-domain>`).

If you need to view logs or debug, you can check the logs of specific services using:

```bash
docker-compose -f docker-compose/pyris-dev.yml logs pyris-app
```

## With docker
TBD
This guide should help you quickly get Pyris running with Docker. The first step—building and running the containers—is all you need to get started!
1 change: 1 addition & 0 deletions app/pipeline/prompts/iris_exercise_chat_prompts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
iris_initial_system_prompt = """You're Iris, the AI programming tutor integrated into Artemis, the online learning
platform of the Technical University of Munich (TUM).

Expand Down