Skip to content

Commit

Permalink
Adding docker build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 16, 2024
1 parent 52ef111 commit 814f751
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 24 deletions.
121 changes: 121 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Docker Setup

This document provides instructions for building and running the `srt-agent-api` application using Docker.

## Prerequisites

- Docker installed on your machine.
- Docker Compose installed.

## Building the Docker Image

To build the Docker image, run the following command from the root of the repository:

```bash
docker build -t srt-agent-api .
```

## Running the Docker Container

To run the Docker container, use the following command:

```bash
docker run -d -p 8000:8000 -e PERSONA='Default' -e PORT=8000 -e SERVER_NAME='0.0.0.0' --name srt-agent-api srt-agent-api
```

## Using Docker Compose

A `docker-compose.yml` file is provided for easier management of multiple services. To use Docker Compose, run:

```bash
docker-compose up -d
```

### Example `docker-compose.yml`

```yaml
version: '3.8'

services:
api:
build: .
container_name: srt-agent-api
ports:
- "8000:8000"
environment:
- PERSONA=Default
- PORT=8000
- SERVER_NAME=0.0.0.0

search_module:
build: .
container_name: srt-agent-search
ports:
- "8001:8001"
environment:
- PERSONA=Search
- PORT=8001
- SERVER_NAME=0.0.0.0

wiki_summary_module:
build: .
container_name: srt-agent-wiki-summary
ports:
- "8002:8002"
environment:
- PERSONA=WikiSummary
- PORT=8002
- SERVER_NAME=0.0.0.0

wikipedia_query_module:
build: .
container_name: srt-agent-wikipedia-query
ports:
- "8003:8003"
environment:
- PERSONA=WikipediaQuery
- PORT=8003
- SERVER_NAME=0.0.0.0
```
## Accessing the API
Once the containers are running, you can access the API endpoints as described in the [README](README.md) file.
### Health Check
To check if the API service is running, use the health check endpoint:
```bash
curl -X GET "http://127.0.0.1:8000/"
```

## Stopping the Containers

To stop the containers, use the following command:

```bash
docker-compose down
```

## Logging

Logs can be accessed using the Docker logs command:

```bash
docker logs srt-agent-api
```

For Docker Compose, you can specify the service name:

```bash
docker-compose logs api
```

## Contributing

Feel free to open issues or submit pull requests on the [GitHub repository](https://github.com/SolidRusT/srt-agent-api).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Overview

`srt-agent-api` is a modular application that provides chat functionality using the `llama-cpp-agent` framework and various other features like API fetching, Wikipedia summaries, and more.
`srt-agent-api` is a modular application that provides chat functionality using the `llama-cpp-agent` framework and various other features like API fetching and Wikipedia summaries.

## Installation

Expand Down Expand Up @@ -121,6 +121,10 @@ If the `wikipedia_query_module` dependencies are installed, you can query Wikipe
Summary: {summary}
```

## Dockerization

You can build and run the application using Docker. For detailed instructions, see [DOCKER.md](DOCKER.md).

## API Endpoints

### Health Check
Expand Down Expand Up @@ -149,7 +153,7 @@ curl -X GET "http://127.0.0.1:8000/fetch-list?url=https://jsonplaceholder.typico

### Web Search

To perform a web search, use the search endpoint:
To get a summary of a Web Search, use the web search endpoint:

```bash
curl -X GET "http://127.0.0.1:8000/search?query=how%20to%20search%20the%20web"
Expand All @@ -165,7 +169,7 @@ curl -X GET "http://127.0.0.1:8000/wiki-summary/Python_(programming_language)"

### Wikipedia Query

To query a Wikipedia page, use the Wikipedia query endpoint:
To query a Wikipedia page, use the wikipedia query endpoint:

```bash
curl -X GET "http://127.0.0.1:8000/wikipedia-query?page_url=Synthetic_diamond&query=What%20is%20a%20BARS%20apparatus%3F"
Expand All @@ -183,4 +187,4 @@ For detailed information on running tests and the CI workflow, see the [Workflow

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
26 changes: 6 additions & 20 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ The project currently supports the following functionalities:
- API endpoints for fetching data, wiki summaries, Wikipedia queries, and web searches.
- Configurable via `config.yaml`.
- CI/CD pipeline set up for automated testing.
- Dockerization with Docker and Docker Compose support.

## Future Objectives

### New Module Ideas
### New

1. **Translation Module**
Module Ideas

1. **Translation Module**
- Implement a tool to translate text using an LLM provider.

2. **Sentiment Analysis Module**

- Create a tool to analyze the sentiment of text inputs.

3. **Summarization Module**

- Develop a module for text summarization, different from the wiki summary.

4. **Entity Recognition Module**
Expand All @@ -33,11 +33,9 @@ The project currently supports the following functionalities:
### Reviewing Examples from `llama-cpp-agent` Repository

1. **Incorporate More Tools**

- Explore additional tools provided by the `llama-cpp-agent` and see how they can be integrated.

2. **Refine Existing Modules**

- Use examples to refine and enhance current modules, improving their functionality and performance.

3. **New Functionality**
Expand All @@ -46,11 +44,9 @@ The project currently supports the following functionalities:
### Improve Documentation and Developer Experience

1. **API Documentation**

- Create detailed API documentation using tools like Swagger.

2. **Example Use Cases**

- Provide more example use cases and code snippets for developers.

3. **Tutorials and Guides**
Expand All @@ -59,28 +55,20 @@ The project currently supports the following functionalities:
### Enhance Testing and CI/CD

1. **Increase Test Coverage**

- Write more unit and integration tests to cover all functionalities.

2. **Automate Deployment**

- Set up CI/CD pipelines to automate deployment to a cloud service.

3. **Mocking External Services**
- Ensure tests don't rely on external services by mocking them.

### Performance, Concurrency, and Accuracy

1. **Dockerization**

- Support running the API in Docker.
- Create Docker Compose files to run API modules individually for scaling and performance.

2. **Distributed Architecture**

1. **Distributed Architecture**
- Enable modules to run on different machines or ports for better control over dependencies and scaling.

3. **Prometheus Integration**
2. **Prometheus Integration**
- Utilize `prometheus-node-exporter` for additional monitoring of the Ubuntu Server 24.04 machines.

## Prioritization and Phases
Expand All @@ -100,8 +88,6 @@ The project currently supports the following functionalities:
- Sentiment Analysis Module.
- **Enhance Testing and CI/CD**
- Increase test coverage.
- **Dockerization**
- Implement Docker support and create Docker Compose files.

### Phase 3: Long-term Goals

Expand Down

0 comments on commit 814f751

Please sign in to comment.