Skip to content

Basic RAG service using fastapi, ollama and docker

Notifications You must be signed in to change notification settings

iosuslov/basic-rag

Repository files navigation

Basic RAG Service

A Retrieval-Augmented Generation (RAG) web service built with FastAPI, following modern Python best practices.

Features

  • FastAPI-based REST API for RAG operations
  • Configuration management with pydantic
  • Logging with loguru
  • Testing with pytest
  • Code quality tools (black, flake8, mypy)
  • CI/CD ready
  • Pre-commit hooks
  • Docker support

Requirements

  • Python 3.8+
  • Poetry

Installation

  1. Clone the repository:
git clone <repository-url>
cd basic-rag
  1. Install dependencies:
poetry install
  1. Set up pre-commit hooks:
poetry run pre-commit install
  1. Create .env file:
cp .env.example .env

Development

  1. Run the development server:
poetry run uvicorn app.main:app --reload
  1. Visit the API documentation:

Testing

Run tests:

poetry run pytest

Run tests with coverage:

poetry run pytest --cov=app tests/

Project Structure

.
├── app/
│   ├── api/             # API routes
│   ├── core/            # Core functionality
│   ├── schemas/         # Pydantic models
│   └── services/        # Business logic
├── tests/               # Test files
├── docs/                # Documentation
├── .env                 # Environment variables
├── .pre-commit-config.yaml
├── pyproject.toml       # Project dependencies
└── README.md

License

This project is licensed under the terms of the MIT license.

About

Basic RAG service using fastapi, ollama and docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published