Skip to main content

Retrieval-Augmented Generation - (RAG)

Project description

ecdallm

PyPI version Python versions License

ecdallm is a lightweight Retrieval-Augmented Generation (RAG) application that lets you chat with your own documents using either a local LLM or an external OpenAI-compatible provider.

It combines:

  • FastAPI web interface
  • Local embedding pipeline (FastEmbed)
  • Persistent vector storage (ChromaDB)
  • Document ingestion (PDF, TXT, DOCX)
  • CLI launcher
  • Local LLM support (e.g., LM Studio)
  • External LLM support (OpenAI-compatible APIs)

The goal is to provide a simple, reproducible environment for document-grounded LLM interaction with flexible model connectivity.


Overview

ecdallm allows you to:

  1. Upload documents
  2. Index them into a vector database
  3. Run semantic retrieval
  4. Query an LLM with grounded context

All embeddings and vector storage run locally.

The chat model can run:

  • locally (LM Studio, Ollama, etc.)
  • externally (OpenRouter or OpenAI-compatible APIs)

This makes the system suitable for:

  • research environments
  • private document analysis
  • offline experimentation
  • RAG prototyping
  • hybrid local/cloud workflows

Installation

Install from PyPI:

pip install ecdallm

Running the application

Start the CLI:

ecdallm

The CLI will:

  • find a free port (starting from 8000)
  • start the FastAPI server
  • open the browser automatically

Example output:

ecdallm running at http://127.0.0.1:8000/
INFO: Uvicorn running on http://127.0.0.1:8000

LLM Configuration

When the application starts, click Continue and choose:

  • Local LLM
  • External LLM

Configuration is stored in the browser session.

Embeddings always run locally using FastEmbed with:

nomic-embed-text-v1.5

Using a local LLM

ecdallm expects an OpenAI-compatible endpoint.

For example, with LM Studio:

  1. Start LM Studio server
  2. Load a chat model
  3. Enable the local API server

Typical endpoint:

http://localhost:1234/v1

Default configuration:

Base URL: http://localhost:1234/v1
API Key: lm-studio

The backend automatically detects the available chat model via:

GET /models

Using an external LLM

ecdallm can connect to any OpenAI-compatible API provider.

Examples include:

  • OpenRouter
  • OpenAI-compatible gateways
  • Self-hosted inference APIs

Example configuration (OpenRouter):

Base URL: https://openrouter.ai/api/v1
Model: openrouter/aurora-alpha
API Key: sk-or-...

Steps:

  1. Create an account with the provider
  2. Generate an API key
  3. Choose a chat model
  4. Enter the configuration in the web interface

When validating, ecdallm:

  • checks connectivity
  • performs a test chat completion
  • stores configuration in session storage

Your API key is sent only to your backend for validation and is not used directly in the browser.

Embeddings remain local.


Supported document types

  • PDF
  • TXT
  • DOCX

Workflow

1. Upload documents

Use the Upload page to add files.

2. Index documents

Files are automatically indexed into ChromaDB using FastEmbed.

3. Chat with documents

Open the Chat page and ask questions.

The assistant will:

  • retrieve relevant chunks
  • build a grounded prompt
  • query the configured LLM
  • return a concise answer

Project structure

ecdallm/
├── cli.py
└── app/
    ├── main.py
    ├── rag.py
    ├── paths.py
    ├── search_engine.py
    ├── vector.py
    ├── templates/
    ├── static/
    ├── uploads/
    └── rag_store/

Notes

Embeddings and retrieval always run locally.

The chat model can be:

  • local (LM Studio, Ollama, etc.)
  • external (OpenAI-compatible providers)

This keeps the system flexible while maintaining local document processing.


Erasmus Data Collaboratory

Developed by the Erasmus Data Collaboratory (ECDA).

  • Zaman Ziabakhshganji --- creator and maintainer
  • Farshad Radman --- co-author and contributor
  • Jos van Dongen --- co-author and contributor

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecdallm-0.2.9.tar.gz (709.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecdallm-0.2.9-py3-none-any.whl (712.3 kB view details)

Uploaded Python 3

File details

Details for the file ecdallm-0.2.9.tar.gz.

File metadata

  • Download URL: ecdallm-0.2.9.tar.gz
  • Upload date:
  • Size: 709.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.0 Darwin/25.3.0

File hashes

Hashes for ecdallm-0.2.9.tar.gz
Algorithm Hash digest
SHA256 75a4037f680b22da82075cf629f7f746e8a8021f294a368e791bd04093a5df2b
MD5 a662fcfac8b9a93f7cc6a00c1e0d2f2b
BLAKE2b-256 a9f6d1274f6a8c65933b6d1943a41eafd15ef2238aa68e4281daef3c6bd6906c

See more details on using hashes here.

File details

Details for the file ecdallm-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: ecdallm-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 712.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.0 Darwin/25.3.0

File hashes

Hashes for ecdallm-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3777973a90c19944ffbde7c522d6fa8e8c06b00c6e965e7e2a601d566ed0bf
MD5 506b3efb2a6eca7bb6358c5cbcb11e0f
BLAKE2b-256 3224ab8f1025437db93c99947cada9633fa05a13fa4771fd9d6502fafc75b712

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page