Skip to main content

Chat with your documents offline using AI.

Project description

ChatDocs PyPI tests

Chat with your documents offline using AI. No data leaves your system. Internet connection is only required to install the tool and download the AI models. It is based on PrivateGPT but has more features.

Web UI

Contents

Features

  • Supports GGML/GGUF models via CTransformers
  • Supports 🤗 Transformers models
  • Supports GPTQ models
  • Web UI
  • GPU support
  • Highly configurable via chatdocs.yml
Show supported document types
Extension Format
.csv CSV
.docx, .doc Word Document
.enex EverNote
.eml Email
.epub EPub
.html HTML
.md Markdown
.msg Outlook Message
.odt Open Document Text
.pdf Portable Document Format (PDF)
.pptx, .ppt PowerPoint Document
.txt Text file (UTF-8)

Installation

Install the tool using:

pip install chatdocs

Download the AI models using:

chatdocs download

Now it can be run offline without internet connection.

Usage

Add a directory containing documents to chat with using:

chatdocs add /path/to/documents

The processed documents will be stored in db directory by default.

Chat with your documents using:

chatdocs ui

Open http://localhost:5000 in your browser to access the web UI.

It also has a nice command-line interface:

chatdocs chat
Show preview

Demo

Configuration

All the configuration options can be changed using the chatdocs.yml config file. Create a chatdocs.yml file in some directory and run all commands from that directory. For reference, see the default chatdocs.yml file.

You don't have to copy the entire file, just add the config options you want to change as it will be merged with the default config. For example, see tests/fixtures/chatdocs.yml which changes only some of the config options.

Embeddings

To change the embeddings model, add and change the following in your chatdocs.yml:

embeddings:
  model: hkunlp/instructor-large

Note: When you change the embeddings model, delete the db directory and add documents again.

CTransformers

To change the CTransformers (GGML/GGUF) model, add and change the following in your chatdocs.yml:

ctransformers:
  model: TheBloke/Wizard-Vicuna-7B-Uncensored-GGML
  model_file: Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin
  model_type: llama

Note: When you add a new model for the first time, run chatdocs download to download the model before using it.

You can also use an existing local model file:

ctransformers:
  model: /path/to/ggml-model.bin
  model_type: llama

🤗 Transformers

To use 🤗 Transformers models, add the following to your chatdocs.yml:

llm: huggingface

To change the 🤗 Transformers model, add and change the following in your chatdocs.yml:

huggingface:
  model: TheBloke/Wizard-Vicuna-7B-Uncensored-HF

Note: When you add a new model for the first time, run chatdocs download to download the model before using it.

To use GPTQ models with 🤗 Transformers, install the necessary packages using:

pip install chatdocs[gptq]

GPU

Embeddings

To enable GPU (CUDA) support for the embeddings model, add the following to your chatdocs.yml:

embeddings:
  model_kwargs:
    device: cuda

You may have to reinstall PyTorch with CUDA enabled by following the instructions here.

CTransformers

To enable GPU (CUDA) support for the CTransformers (GGML/GGUF) model, add the following to your chatdocs.yml:

ctransformers:
  config:
    gpu_layers: 50

You may have to install the CUDA libraries using:

pip install ctransformers[cuda]

🤗 Transformers

To enable GPU (CUDA) support for the 🤗 Transformers model, add the following to your chatdocs.yml:

huggingface:
  device: 0

You may have to reinstall PyTorch with CUDA enabled by following the instructions here.

License

MIT

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

chatdocs-0.2.6.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

chatdocs-0.2.6-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file chatdocs-0.2.6.tar.gz.

File metadata

  • Download URL: chatdocs-0.2.6.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for chatdocs-0.2.6.tar.gz
Algorithm Hash digest
SHA256 c716dc7fa4c2fe389b654b0b06dc541400b801b8f7058aafd6da7b48feac0bcb
MD5 a39dbab3cb06a794b15fb810d30071bc
BLAKE2b-256 29c6917ef0b56736a36e208e29a98c1701db3ad3862204781fe0f5d8e90c9c1a

See more details on using hashes here.

File details

Details for the file chatdocs-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: chatdocs-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for chatdocs-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e4804316b21bc2b7057d9722b4b2cef880c59678b5001fd0694724b42fc26b3d
MD5 e9944b24b96ad4dacba08a56878d26f1
BLAKE2b-256 e4b156b826fc503bcbd027bea9bf05dd8d60cf8d3b3321f1a7b0bdf29400a75d

See more details on using hashes here.

Supported by

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