Chat with your documents offline using AI.
Project description
ChatDocs
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 and has more features.
Features
- Supports many GGML models via C Transformers
- Supports 🤗 Transformers
- GPU support
- Highly configurable via
chatdocs.yml
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 chat
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.
C Transformers
To change the C Transformers model, add and change the following in your chatdocs.yml
:
ctransformers:
model: TheBloke/Wizard-Vicuna-7B-Uncensored-GGML
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, 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.
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.
C Transformers
Note: Currently only LLaMA GGML models have GPU support.
To enable GPU (CUDA) support for the C Transformers model, add the following to your chatdocs.yml
:
ctransformers:
config:
gpu_layers: 50
You should also reinstall the ctransformers
package with CUDA enabled:
pip uninstall ctransformers --yes
CT_CUBLAS=1 pip install ctransformers --no-binary ctransformers
Show commands for Windows
On Windows PowerShell run:
$env:CT_CUBLAS=1
pip uninstall ctransformers --yes
pip install ctransformers --no-binary ctransformers
On Windows Command Prompt run:
set CT_CUBLAS=1
pip uninstall ctransformers --yes
pip install ctransformers --no-binary ctransformers
🤗 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.
UI
Coming Soon
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chatdocs-0.2.0.tar.gz
.
File metadata
- Download URL: chatdocs-0.2.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e49303e93f24b3b9ce7ab967f262fafb9cdb027a65e2559d7e9b592f6fa5514 |
|
MD5 | bd75037fd9f2bcc734d59f9f55c69fac |
|
BLAKE2b-256 | eeb48104b87b531b3ef2337662b1534ab9cf3f2124a2a010d21430115cb54777 |
File details
Details for the file chatdocs-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: chatdocs-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7e33cf2ef35f2d1c7599a66b18f3a9042cecda3c50828532cd9270cbec48980 |
|
MD5 | 552c9f3df5c4c697f11099e2889b6c6c |
|
BLAKE2b-256 | 67ff3a1618c283984f570d60bf76ca49348a222a3043e52eec7144c3201b9f6d |