lauraparra28 commited on
Commit
6d27d90
1 Parent(s): f5d549e

upload files

Browse files
.dockerignore ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .venv
2
+ models
3
+ .github
4
+ .vscode
5
+ .DS_Store
6
+ .mypy_cache
7
+ .ruff_cache
8
+ local_data
9
+ terraform
10
+ tests
11
+ Dockerfile
12
+ Dockerfile.*
.gitignore ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .venv
2
+ .env
3
+ venv
4
+
5
+ settings-me.yaml
6
+
7
+ .ruff_cache
8
+ .pytest_cache
9
+ .mypy_cache
10
+
11
+ # byte-compiled / optimized / DLL files
12
+ __pycache__/
13
+ *.py[cod]
14
+
15
+ # unit tests / coverage reports
16
+ /tests-results.xml
17
+ /.coverage
18
+ /coverage.xml
19
+ /htmlcov/
20
+
21
+ # pyenv
22
+ /.python-version
23
+
24
+ # IDE
25
+ .idea/
26
+ .vscode/
27
+ /.run/
28
+ .fleet/
29
+
30
+ # macOS
31
+ .DS_Store
.pre-commit-config.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_install_hook_types:
2
+ # Mandatory to install both pre-commit and pre-push hooks (see https://pre-commit.com/#top_level-default_install_hook_types)
3
+ # Add new hook types here to ensure automatic installation when running `pre-commit install`
4
+ - pre-commit
5
+ - pre-push
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v4.3.0
9
+ hooks:
10
+ - id: trailing-whitespace
11
+ - id: end-of-file-fixer
12
+ - id: check-yaml
13
+ - id: check-json
14
+ - id: check-added-large-files
15
+
16
+ - repo: local
17
+ hooks:
18
+ - id: black
19
+ name: Formatting (black)
20
+ entry: black
21
+ language: system
22
+ types: [python]
23
+ stages: [commit]
24
+ - id: ruff
25
+ name: Linter (ruff)
26
+ entry: ruff
27
+ language: system
28
+ types: [python]
29
+ stages: [commit]
30
+ - id: mypy
31
+ name: Type checking (mypy)
32
+ entry: make mypy
33
+ pass_filenames: false
34
+ language: system
35
+ types: [python]
36
+ stages: [commit]
37
+ - id: test
38
+ name: Unit tests (pytest)
39
+ entry: make test
40
+ pass_filenames: false
41
+ language: system
42
+ types: [python]
43
+ stages: [push]
CHANGELOG.md ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ ## [0.6.2](https://github.com/zylon-ai/private-gpt/compare/v0.6.1...v0.6.2) (2024-08-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add numpy issue to troubleshooting ([#2048](https://github.com/zylon-ai/private-gpt/issues/2048)) ([4ca6d0c](https://github.com/zylon-ai/private-gpt/commit/4ca6d0cb556be7a598f7d3e3b00d2a29214ee1e8))
9
+ * auto-update version ([#2052](https://github.com/zylon-ai/private-gpt/issues/2052)) ([7fefe40](https://github.com/zylon-ai/private-gpt/commit/7fefe408b4267684c6e3c1a43c5dc2b73ec61fe4))
10
+ * publish image name ([#2043](https://github.com/zylon-ai/private-gpt/issues/2043)) ([b1acf9d](https://github.com/zylon-ai/private-gpt/commit/b1acf9dc2cbca2047cd0087f13254ff5cda6e570))
11
+ * update matplotlib to 3.9.1-post1 to fix win install ([b16abbe](https://github.com/zylon-ai/private-gpt/commit/b16abbefe49527ac038d235659854b98345d5387))
12
+
13
+ ## [0.6.1](https://github.com/zylon-ai/private-gpt/compare/v0.6.0...v0.6.1) (2024-08-05)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * add built image from DockerHub ([#2042](https://github.com/zylon-ai/private-gpt/issues/2042)) ([f09f6dd](https://github.com/zylon-ai/private-gpt/commit/f09f6dd2553077d4566dbe6b48a450e05c2f049e))
19
+ * Adding azopenai to model list ([#2035](https://github.com/zylon-ai/private-gpt/issues/2035)) ([1c665f7](https://github.com/zylon-ai/private-gpt/commit/1c665f7900658144f62814b51f6e3434a6d7377f))
20
+ * **deploy:** generate docker release when new version is released ([#2038](https://github.com/zylon-ai/private-gpt/issues/2038)) ([1d4c14d](https://github.com/zylon-ai/private-gpt/commit/1d4c14d7a3c383c874b323d934be01afbaca899e))
21
+ * **deploy:** improve Docker-Compose and quickstart on Docker ([#2037](https://github.com/zylon-ai/private-gpt/issues/2037)) ([dae0727](https://github.com/zylon-ai/private-gpt/commit/dae0727a1b4abd35d2b0851fe30e0a4ed67e0fbb))
22
+
23
+ ## [0.6.0](https://github.com/zylon-ai/private-gpt/compare/v0.5.0...v0.6.0) (2024-08-02)
24
+
25
+
26
+ ### Features
27
+
28
+ * bump dependencies ([#1987](https://github.com/zylon-ai/private-gpt/issues/1987)) ([b687dc8](https://github.com/zylon-ai/private-gpt/commit/b687dc852413404c52d26dcb94536351a63b169d))
29
+ * **docs:** add privategpt-ts sdk ([#1924](https://github.com/zylon-ai/private-gpt/issues/1924)) ([d13029a](https://github.com/zylon-ai/private-gpt/commit/d13029a046f6e19e8ee65bef3acd96365c738df2))
30
+ * **docs:** Fix setup docu ([#1926](https://github.com/zylon-ai/private-gpt/issues/1926)) ([067a5f1](https://github.com/zylon-ai/private-gpt/commit/067a5f144ca6e605c99d7dbe9ca7d8207ac8808d))
31
+ * **docs:** update doc for ipex-llm ([#1968](https://github.com/zylon-ai/private-gpt/issues/1968)) ([19a7c06](https://github.com/zylon-ai/private-gpt/commit/19a7c065ef7f42b37f289dd28ac945f7afc0e73a))
32
+ * **docs:** update documentation and fix preview-docs ([#2000](https://github.com/zylon-ai/private-gpt/issues/2000)) ([4523a30](https://github.com/zylon-ai/private-gpt/commit/4523a30c8f004aac7a7ae224671e2c45ec0cb973))
33
+ * **llm:** add progress bar when ollama is pulling models ([#2031](https://github.com/zylon-ai/private-gpt/issues/2031)) ([cf61bf7](https://github.com/zylon-ai/private-gpt/commit/cf61bf780f8d122e4057d002abf03563bb45614a))
34
+ * **llm:** autopull ollama models ([#2019](https://github.com/zylon-ai/private-gpt/issues/2019)) ([20bad17](https://github.com/zylon-ai/private-gpt/commit/20bad17c9857809158e689e9671402136c1e3d84))
35
+ * **llm:** Support for Google Gemini LLMs and Embeddings ([#1965](https://github.com/zylon-ai/private-gpt/issues/1965)) ([fc13368](https://github.com/zylon-ai/private-gpt/commit/fc13368bc72d1f4c27644677431420ed77731c03))
36
+ * make llama3.1 as default ([#2022](https://github.com/zylon-ai/private-gpt/issues/2022)) ([9027d69](https://github.com/zylon-ai/private-gpt/commit/9027d695c11fbb01e62424b855665de71d513417))
37
+ * prompt_style applied to all LLMs + extra LLM params. ([#1835](https://github.com/zylon-ai/private-gpt/issues/1835)) ([e21bf20](https://github.com/zylon-ai/private-gpt/commit/e21bf20c10938b24711d9f2c765997f44d7e02a9))
38
+ * **recipe:** add our first recipe `Summarize` ([#2028](https://github.com/zylon-ai/private-gpt/issues/2028)) ([8119842](https://github.com/zylon-ai/private-gpt/commit/8119842ae6f1f5ecfaf42b06fa0d1ffec675def4))
39
+ * **vectordb:** Milvus vector db Integration ([#1996](https://github.com/zylon-ai/private-gpt/issues/1996)) ([43cc31f](https://github.com/zylon-ai/private-gpt/commit/43cc31f74015f8d8fcbf7a8ea7d7d9ecc66cf8c9))
40
+ * **vectorstore:** Add clickhouse support as vectore store ([#1883](https://github.com/zylon-ai/private-gpt/issues/1883)) ([2612928](https://github.com/zylon-ai/private-gpt/commit/26129288394c7483e6fc0496a11dc35679528cc1))
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * "no such group" error in Dockerfile, added docx2txt and cryptography deps ([#1841](https://github.com/zylon-ai/private-gpt/issues/1841)) ([947e737](https://github.com/zylon-ai/private-gpt/commit/947e737f300adf621d2261d527192f36f3387f8e))
46
+ * **config:** make tokenizer optional and include a troubleshooting doc ([#1998](https://github.com/zylon-ai/private-gpt/issues/1998)) ([01b7ccd](https://github.com/zylon-ai/private-gpt/commit/01b7ccd0648be032846647c9a184925d3682f612))
47
+ * **docs:** Fix concepts.mdx referencing to installation page ([#1779](https://github.com/zylon-ai/private-gpt/issues/1779)) ([dde0224](https://github.com/zylon-ai/private-gpt/commit/dde02245bcd51a7ede7b6789c82ae217cac53d92))
48
+ * **docs:** Update installation.mdx ([#1866](https://github.com/zylon-ai/private-gpt/issues/1866)) ([c1802e7](https://github.com/zylon-ai/private-gpt/commit/c1802e7cf0e56a2603213ec3b6a4af8fadb8a17a))
49
+ * ffmpy dependency ([#2020](https://github.com/zylon-ai/private-gpt/issues/2020)) ([dabf556](https://github.com/zylon-ai/private-gpt/commit/dabf556dae9cb00fe0262270e5138d982585682e))
50
+ * light mode ([#2025](https://github.com/zylon-ai/private-gpt/issues/2025)) ([1020cd5](https://github.com/zylon-ai/private-gpt/commit/1020cd53288af71a17882781f392512568f1b846))
51
+ * **LLM:** mistral ignoring assistant messages ([#1954](https://github.com/zylon-ai/private-gpt/issues/1954)) ([c7212ac](https://github.com/zylon-ai/private-gpt/commit/c7212ac7cc891f9e3c713cc206ae9807c5dfdeb6))
52
+ * **llm:** special tokens and leading space ([#1831](https://github.com/zylon-ai/private-gpt/issues/1831)) ([347be64](https://github.com/zylon-ai/private-gpt/commit/347be643f7929c56382a77c3f45f0867605e0e0a))
53
+ * make embedding_api_base match api_base when on docker ([#1859](https://github.com/zylon-ai/private-gpt/issues/1859)) ([2a432bf](https://github.com/zylon-ai/private-gpt/commit/2a432bf9c5582a94eb4052b1e80cabdb118d298e))
54
+ * nomic embeddings ([#2030](https://github.com/zylon-ai/private-gpt/issues/2030)) ([5465958](https://github.com/zylon-ai/private-gpt/commit/54659588b5b109a3dd17cca835e275240464d275))
55
+ * prevent to ingest local files (by default) ([#2010](https://github.com/zylon-ai/private-gpt/issues/2010)) ([e54a8fe](https://github.com/zylon-ai/private-gpt/commit/e54a8fe0433252808d0a60f6a08a43c9f5a42f3b))
56
+ * Replacing unsafe `eval()` with `json.loads()` ([#1890](https://github.com/zylon-ai/private-gpt/issues/1890)) ([9d0d614](https://github.com/zylon-ai/private-gpt/commit/9d0d614706581a8bfa57db45f62f84ab23d26f15))
57
+ * **settings:** enable cors by default so it will work when using ts sdk (spa) ([#1925](https://github.com/zylon-ai/private-gpt/issues/1925)) ([966af47](https://github.com/zylon-ai/private-gpt/commit/966af4771dbe5cf3fdf554b5fdf8f732407859c4))
58
+ * **ui:** gradio bug fixes ([#2021](https://github.com/zylon-ai/private-gpt/issues/2021)) ([d4375d0](https://github.com/zylon-ai/private-gpt/commit/d4375d078f18ba53562fd71651159f997fff865f))
59
+ * unify embedding models ([#2027](https://github.com/zylon-ai/private-gpt/issues/2027)) ([40638a1](https://github.com/zylon-ai/private-gpt/commit/40638a18a5713d60fec8fe52796dcce66d88258c))
60
+
61
+ ## [0.5.0](https://github.com/zylon-ai/private-gpt/compare/v0.4.0...v0.5.0) (2024-04-02)
62
+
63
+
64
+ ### Features
65
+
66
+ * **code:** improve concat of strings in ui ([#1785](https://github.com/zylon-ai/private-gpt/issues/1785)) ([bac818a](https://github.com/zylon-ai/private-gpt/commit/bac818add51b104cda925b8f1f7b51448e935ca1))
67
+ * **docker:** set default Docker to use Ollama ([#1812](https://github.com/zylon-ai/private-gpt/issues/1812)) ([f83abff](https://github.com/zylon-ai/private-gpt/commit/f83abff8bc955a6952c92cc7bcb8985fcec93afa))
68
+ * **docs:** Add guide Llama-CPP Linux AMD GPU support ([#1782](https://github.com/zylon-ai/private-gpt/issues/1782)) ([8a836e4](https://github.com/zylon-ai/private-gpt/commit/8a836e4651543f099c59e2bf497ab8c55a7cd2e5))
69
+ * **docs:** Feature/upgrade docs ([#1741](https://github.com/zylon-ai/private-gpt/issues/1741)) ([5725181](https://github.com/zylon-ai/private-gpt/commit/572518143ac46532382db70bed6f73b5082302c1))
70
+ * **docs:** upgrade fern ([#1596](https://github.com/zylon-ai/private-gpt/issues/1596)) ([84ad16a](https://github.com/zylon-ai/private-gpt/commit/84ad16af80191597a953248ce66e963180e8ddec))
71
+ * **ingest:** Created a faster ingestion mode - pipeline ([#1750](https://github.com/zylon-ai/private-gpt/issues/1750)) ([134fc54](https://github.com/zylon-ai/private-gpt/commit/134fc54d7d636be91680dc531f5cbe2c5892ac56))
72
+ * **llm - embed:** Add support for Azure OpenAI ([#1698](https://github.com/zylon-ai/private-gpt/issues/1698)) ([1efac6a](https://github.com/zylon-ai/private-gpt/commit/1efac6a3fe19e4d62325e2c2915cd84ea277f04f))
73
+ * **llm:** adds serveral settings for llamacpp and ollama ([#1703](https://github.com/zylon-ai/private-gpt/issues/1703)) ([02dc83e](https://github.com/zylon-ai/private-gpt/commit/02dc83e8e9f7ada181ff813f25051bbdff7b7c6b))
74
+ * **llm:** Ollama LLM-Embeddings decouple + longer keep_alive settings ([#1800](https://github.com/zylon-ai/private-gpt/issues/1800)) ([b3b0140](https://github.com/zylon-ai/private-gpt/commit/b3b0140e244e7a313bfaf4ef10eb0f7e4192710e))
75
+ * **llm:** Ollama timeout setting ([#1773](https://github.com/zylon-ai/private-gpt/issues/1773)) ([6f6c785](https://github.com/zylon-ai/private-gpt/commit/6f6c785dac2bbad37d0b67fda215784298514d39))
76
+ * **local:** tiktoken cache within repo for offline ([#1467](https://github.com/zylon-ai/private-gpt/issues/1467)) ([821bca3](https://github.com/zylon-ai/private-gpt/commit/821bca32e9ee7c909fd6488445ff6a04463bf91b))
77
+ * **nodestore:** add Postgres for the doc and index store ([#1706](https://github.com/zylon-ai/private-gpt/issues/1706)) ([68b3a34](https://github.com/zylon-ai/private-gpt/commit/68b3a34b032a08ca073a687d2058f926032495b3))
78
+ * **rag:** expose similarity_top_k and similarity_score to settings ([#1771](https://github.com/zylon-ai/private-gpt/issues/1771)) ([087cb0b](https://github.com/zylon-ai/private-gpt/commit/087cb0b7b74c3eb80f4f60b47b3a021c81272ae1))
79
+ * **RAG:** Introduce SentenceTransformer Reranker ([#1810](https://github.com/zylon-ai/private-gpt/issues/1810)) ([83adc12](https://github.com/zylon-ai/private-gpt/commit/83adc12a8ef0fa0c13a0dec084fa596445fc9075))
80
+ * **scripts:** Wipe qdrant and obtain db Stats command ([#1783](https://github.com/zylon-ai/private-gpt/issues/1783)) ([ea153fb](https://github.com/zylon-ai/private-gpt/commit/ea153fb92f1f61f64c0d04fff0048d4d00b6f8d0))
81
+ * **ui:** Add Model Information to ChatInterface label ([f0b174c](https://github.com/zylon-ai/private-gpt/commit/f0b174c097c2d5e52deae8ef88de30a0d9013a38))
82
+ * **ui:** add sources check to not repeat identical sources ([#1705](https://github.com/zylon-ai/private-gpt/issues/1705)) ([290b9fb](https://github.com/zylon-ai/private-gpt/commit/290b9fb084632216300e89bdadbfeb0380724b12))
83
+ * **UI:** Faster startup and document listing ([#1763](https://github.com/zylon-ai/private-gpt/issues/1763)) ([348df78](https://github.com/zylon-ai/private-gpt/commit/348df781b51606b2f9810bcd46f850e54192fd16))
84
+ * **ui:** maintain score order when curating sources ([#1643](https://github.com/zylon-ai/private-gpt/issues/1643)) ([410bf7a](https://github.com/zylon-ai/private-gpt/commit/410bf7a71f17e77c4aec723ab80c233b53765964))
85
+ * unify settings for vector and nodestore connections to PostgreSQL ([#1730](https://github.com/zylon-ai/private-gpt/issues/1730)) ([63de7e4](https://github.com/zylon-ai/private-gpt/commit/63de7e4930ac90dd87620225112a22ffcbbb31ee))
86
+ * wipe per storage type ([#1772](https://github.com/zylon-ai/private-gpt/issues/1772)) ([c2d6948](https://github.com/zylon-ai/private-gpt/commit/c2d694852b4696834962a42fde047b728722ad74))
87
+
88
+
89
+ ### Bug Fixes
90
+
91
+ * **docs:** Minor documentation amendment ([#1739](https://github.com/zylon-ai/private-gpt/issues/1739)) ([258d02d](https://github.com/zylon-ai/private-gpt/commit/258d02d87c5cb81d6c3a6f06aa69339b670dffa9))
92
+ * Fixed docker-compose ([#1758](https://github.com/zylon-ai/private-gpt/issues/1758)) ([774e256](https://github.com/zylon-ai/private-gpt/commit/774e2560520dc31146561d09a2eb464c68593871))
93
+ * **ingest:** update script label ([#1770](https://github.com/zylon-ai/private-gpt/issues/1770)) ([7d2de5c](https://github.com/zylon-ai/private-gpt/commit/7d2de5c96fd42e339b26269b3155791311ef1d08))
94
+ * **settings:** set default tokenizer to avoid running make setup fail ([#1709](https://github.com/zylon-ai/private-gpt/issues/1709)) ([d17c34e](https://github.com/zylon-ai/private-gpt/commit/d17c34e81a84518086b93605b15032e2482377f7))
95
+
96
+ ## [0.4.0](https://github.com/imartinez/privateGPT/compare/v0.3.0...v0.4.0) (2024-03-06)
97
+
98
+
99
+ ### Features
100
+
101
+ * Upgrade to LlamaIndex to 0.10 ([#1663](https://github.com/imartinez/privateGPT/issues/1663)) ([45f0571](https://github.com/imartinez/privateGPT/commit/45f05711eb71ffccdedb26f37e680ced55795d44))
102
+ * **Vector:** support pgvector ([#1624](https://github.com/imartinez/privateGPT/issues/1624)) ([cd40e39](https://github.com/imartinez/privateGPT/commit/cd40e3982b780b548b9eea6438c759f1c22743a8))
103
+
104
+ ## [0.3.0](https://github.com/imartinez/privateGPT/compare/v0.2.0...v0.3.0) (2024-02-16)
105
+
106
+
107
+ ### Features
108
+
109
+ * add mistral + chatml prompts ([#1426](https://github.com/imartinez/privateGPT/issues/1426)) ([e326126](https://github.com/imartinez/privateGPT/commit/e326126d0d4cd7e46a79f080c442c86f6dd4d24b))
110
+ * Add stream information to generate SDKs ([#1569](https://github.com/imartinez/privateGPT/issues/1569)) ([24fae66](https://github.com/imartinez/privateGPT/commit/24fae660e6913aac6b52745fb2c2fe128ba2eb79))
111
+ * **API:** Ingest plain text ([#1417](https://github.com/imartinez/privateGPT/issues/1417)) ([6eeb95e](https://github.com/imartinez/privateGPT/commit/6eeb95ec7f17a618aaa47f5034ee5bccae02b667))
112
+ * **bulk-ingest:** Add --ignored Flag to Exclude Specific Files and Directories During Ingestion ([#1432](https://github.com/imartinez/privateGPT/issues/1432)) ([b178b51](https://github.com/imartinez/privateGPT/commit/b178b514519550e355baf0f4f3f6beb73dca7df2))
113
+ * **llm:** Add openailike llm mode ([#1447](https://github.com/imartinez/privateGPT/issues/1447)) ([2d27a9f](https://github.com/imartinez/privateGPT/commit/2d27a9f956d672cb1fe715cf0acdd35c37f378a5)), closes [#1424](https://github.com/imartinez/privateGPT/issues/1424)
114
+ * **llm:** Add support for Ollama LLM ([#1526](https://github.com/imartinez/privateGPT/issues/1526)) ([6bbec79](https://github.com/imartinez/privateGPT/commit/6bbec79583b7f28d9bea4b39c099ebef149db843))
115
+ * **settings:** Configurable context_window and tokenizer ([#1437](https://github.com/imartinez/privateGPT/issues/1437)) ([4780540](https://github.com/imartinez/privateGPT/commit/47805408703c23f0fd5cab52338142c1886b450b))
116
+ * **settings:** Update default model to TheBloke/Mistral-7B-Instruct-v0.2-GGUF ([#1415](https://github.com/imartinez/privateGPT/issues/1415)) ([8ec7cf4](https://github.com/imartinez/privateGPT/commit/8ec7cf49f40701a4f2156c48eb2fad9fe6220629))
117
+ * **ui:** make chat area stretch to fill the screen ([#1397](https://github.com/imartinez/privateGPT/issues/1397)) ([c71ae7c](https://github.com/imartinez/privateGPT/commit/c71ae7cee92463bbc5ea9c434eab9f99166e1363))
118
+ * **UI:** Select file to Query or Delete + Delete ALL ([#1612](https://github.com/imartinez/privateGPT/issues/1612)) ([aa13afd](https://github.com/imartinez/privateGPT/commit/aa13afde07122f2ddda3942f630e5cadc7e4e1ee))
119
+
120
+
121
+ ### Bug Fixes
122
+
123
+ * Adding an LLM param to fix broken generator from llamacpp ([#1519](https://github.com/imartinez/privateGPT/issues/1519)) ([869233f](https://github.com/imartinez/privateGPT/commit/869233f0e4f03dc23e5fae43cf7cb55350afdee9))
124
+ * **deploy:** fix local and external dockerfiles ([fde2b94](https://github.com/imartinez/privateGPT/commit/fde2b942bc03688701ed563be6d7d597c75e4e4e))
125
+ * **docker:** docker broken copy ([#1419](https://github.com/imartinez/privateGPT/issues/1419)) ([059f358](https://github.com/imartinez/privateGPT/commit/059f35840adbc3fb93d847d6decf6da32d08670c))
126
+ * **docs:** Update quickstart doc and set version in pyproject.toml to 0.2.0 ([0a89d76](https://github.com/imartinez/privateGPT/commit/0a89d76cc5ed4371ffe8068858f23dfbb5e8cc37))
127
+ * minor bug in chat stream output - python error being serialized ([#1449](https://github.com/imartinez/privateGPT/issues/1449)) ([6191bcd](https://github.com/imartinez/privateGPT/commit/6191bcdbd6e92b6f4d5995967dc196c9348c5954))
128
+ * **settings:** correct yaml multiline string ([#1403](https://github.com/imartinez/privateGPT/issues/1403)) ([2564f8d](https://github.com/imartinez/privateGPT/commit/2564f8d2bb8c4332a6a0ab6d722a2ac15006b85f))
129
+ * **tests:** load the test settings only when running tests ([d3acd85](https://github.com/imartinez/privateGPT/commit/d3acd85fe34030f8cfd7daf50b30c534087bdf2b))
130
+ * **UI:** Updated ui.py. Frees up the CPU to not be bottlenecked. ([24fb80c](https://github.com/imartinez/privateGPT/commit/24fb80ca38f21910fe4fd81505d14960e9ed4faa))
131
+
132
+ ## [0.2.0](https://github.com/imartinez/privateGPT/compare/v0.1.0...v0.2.0) (2023-12-10)
133
+
134
+
135
+ ### Features
136
+
137
+ * **llm:** drop default_system_prompt ([#1385](https://github.com/imartinez/privateGPT/issues/1385)) ([a3ed14c](https://github.com/imartinez/privateGPT/commit/a3ed14c58f77351dbd5f8f2d7868d1642a44f017))
138
+ * **ui:** Allows User to Set System Prompt via "Additional Options" in Chat Interface ([#1353](https://github.com/imartinez/privateGPT/issues/1353)) ([145f3ec](https://github.com/imartinez/privateGPT/commit/145f3ec9f41c4def5abf4065a06fb0786e2d992a))
139
+
140
+ ## [0.1.0](https://github.com/imartinez/privateGPT/compare/v0.0.2...v0.1.0) (2023-11-30)
141
+
142
+
143
+ ### Features
144
+
145
+ * Disable Gradio Analytics ([#1165](https://github.com/imartinez/privateGPT/issues/1165)) ([6583dc8](https://github.com/imartinez/privateGPT/commit/6583dc84c082773443fc3973b1cdf8095fa3fec3))
146
+ * Drop loguru and use builtin `logging` ([#1133](https://github.com/imartinez/privateGPT/issues/1133)) ([64c5ae2](https://github.com/imartinez/privateGPT/commit/64c5ae214a9520151c9c2d52ece535867d799367))
147
+ * enable resume download for hf_hub_download ([#1249](https://github.com/imartinez/privateGPT/issues/1249)) ([4197ada](https://github.com/imartinez/privateGPT/commit/4197ada6267c822f32c1d7ba2be6e7ce145a3404))
148
+ * move torch and transformers to local group ([#1172](https://github.com/imartinez/privateGPT/issues/1172)) ([0d677e1](https://github.com/imartinez/privateGPT/commit/0d677e10b970aec222ec04837d0f08f1631b6d4a))
149
+ * Qdrant support ([#1228](https://github.com/imartinez/privateGPT/issues/1228)) ([03d1ae6](https://github.com/imartinez/privateGPT/commit/03d1ae6d70dffdd2411f0d4e92f65080fff5a6e2))
150
+
151
+
152
+ ### Bug Fixes
153
+
154
+ * Docker and sagemaker setup ([#1118](https://github.com/imartinez/privateGPT/issues/1118)) ([895588b](https://github.com/imartinez/privateGPT/commit/895588b82a06c2bc71a9e22fb840c7f6442a3b5b))
155
+ * fix pytorch version to avoid wheel bug ([#1123](https://github.com/imartinez/privateGPT/issues/1123)) ([24cfddd](https://github.com/imartinez/privateGPT/commit/24cfddd60f74aadd2dade4c63f6012a2489938a1))
156
+ * Remove global state ([#1216](https://github.com/imartinez/privateGPT/issues/1216)) ([022bd71](https://github.com/imartinez/privateGPT/commit/022bd718e3dfc197027b1e24fb97e5525b186db4))
157
+ * sagemaker config and chat methods ([#1142](https://github.com/imartinez/privateGPT/issues/1142)) ([a517a58](https://github.com/imartinez/privateGPT/commit/a517a588c4927aa5c5c2a93e4f82a58f0599d251))
158
+ * typo in README.md ([#1091](https://github.com/imartinez/privateGPT/issues/1091)) ([ba23443](https://github.com/imartinez/privateGPT/commit/ba23443a70d323cd4f9a242b33fd9dce1bacd2db))
159
+ * Windows 11 failing to auto-delete tmp file ([#1260](https://github.com/imartinez/privateGPT/issues/1260)) ([0d52002](https://github.com/imartinez/privateGPT/commit/0d520026a3d5b08a9b8487be992d3095b21e710c))
160
+ * Windows permission error on ingest service tmp files ([#1280](https://github.com/imartinez/privateGPT/issues/1280)) ([f1cbff0](https://github.com/imartinez/privateGPT/commit/f1cbff0fb7059432d9e71473cbdd039032dab60d))
161
+
162
+ ## [0.0.2](https://github.com/imartinez/privateGPT/compare/v0.0.1...v0.0.2) (2023-10-20)
163
+
164
+
165
+ ### Bug Fixes
166
+
167
+ * chromadb max batch size ([#1087](https://github.com/imartinez/privateGPT/issues/1087)) ([f5a9bf4](https://github.com/imartinez/privateGPT/commit/f5a9bf4e374b2d4c76438cf8a97cccf222ec8e6f))
168
+
169
+ ## 0.0.1 (2023-10-20)
170
+
171
+ ### Miscellaneous Chores
172
+
173
+ * Initial version ([490d93f](https://github.com/imartinez/privateGPT/commit/490d93fdc1977443c92f6c42e57a1c585aa59430))
CITATION.cff ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This CITATION.cff file was generated with cffinit.
2
+ # Visit https://bit.ly/cffinit to generate yours today!
3
+
4
+ cff-version: 1.2.0
5
+ title: PrivateGPT
6
+ message: >-
7
+ If you use this software, please cite it using the
8
+ metadata from this file.
9
+ type: software
10
+ authors:
11
+ - name: Zylon by PrivateGPT
12
+ address: [email protected]
13
+ website: 'https://www.zylon.ai/'
14
+ repository-code: 'https://github.com/zylon-ai/private-gpt'
15
+ license: Apache-2.0
16
+ date-released: '2023-05-02'
Dockerfile.llamacpp-cpu ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### IMPORTANT, THIS IMAGE CAN ONLY BE RUN IN LINUX DOCKER
2
+ ### You will run into a segfault in mac
3
+ FROM python:3.11.6-slim-bookworm as base
4
+
5
+ # Install poetry
6
+ RUN pip install pipx
7
+ RUN python3 -m pipx ensurepath
8
+ RUN pipx install poetry==1.8.3
9
+ ENV PATH="/root/.local/bin:$PATH"
10
+ ENV PATH=".venv/bin/:$PATH"
11
+
12
+ # Dependencies to build llama-cpp
13
+ RUN apt update && apt install -y \
14
+ libopenblas-dev\
15
+ ninja-build\
16
+ build-essential\
17
+ pkg-config\
18
+ wget
19
+
20
+ # https://python-poetry.org/docs/configuration/#virtualenvsin-project
21
+ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
22
+
23
+ FROM base as dependencies
24
+ WORKDIR /home/worker/app
25
+ COPY pyproject.toml poetry.lock ./
26
+
27
+ ARG POETRY_EXTRAS="ui embeddings-huggingface llms-llama-cpp vector-stores-qdrant"
28
+ RUN poetry install --no-root --extras "${POETRY_EXTRAS}"
29
+
30
+ FROM base as app
31
+
32
+ ENV PYTHONUNBUFFERED=1
33
+ ENV PORT=8080
34
+ ENV APP_ENV=prod
35
+ ENV PYTHONPATH="$PYTHONPATH:/home/worker/app/private_gpt/"
36
+ EXPOSE 8080
37
+
38
+ # Prepare a non-root user
39
+ # More info about how to configure UIDs and GIDs in Docker:
40
+ # https://github.com/systemd/systemd/blob/main/docs/UIDS-GIDS.md
41
+
42
+ # Define the User ID (UID) for the non-root user
43
+ # UID 100 is chosen to avoid conflicts with existing system users
44
+ ARG UID=100
45
+
46
+ # Define the Group ID (GID) for the non-root user
47
+ # GID 65534 is often used for the 'nogroup' or 'nobody' group
48
+ ARG GID=65534
49
+
50
+ RUN adduser --system --gid ${GID} --uid ${UID} --home /home/worker worker
51
+ WORKDIR /home/worker/app
52
+
53
+ RUN chown worker /home/worker/app
54
+ RUN mkdir local_data && chown worker local_data
55
+ RUN mkdir models && chown worker models
56
+ COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
57
+ COPY --chown=worker private_gpt/ private_gpt
58
+ COPY --chown=worker *.yaml ./
59
+ COPY --chown=worker scripts/ scripts
60
+
61
+ USER worker
62
+ ENTRYPOINT python -m private_gpt
Dockerfile.ollama ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ FROM python:3.11.6-slim-bookworm as base
4
+
5
+ # Install poetry
6
+ RUN pip install pipx
7
+ RUN python3 -m pipx ensurepath
8
+ RUN pipx install poetry==1.8.3
9
+ ENV PATH="/root/.local/bin:$PATH"
10
+ ENV PATH=".venv/bin/:$PATH"
11
+
12
+ # https://python-poetry.org/docs/configuration/#virtualenvsin-project
13
+ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
14
+
15
+ FROM base as dependencies
16
+ WORKDIR /home/worker/app
17
+ COPY pyproject.toml poetry.lock ./
18
+
19
+ ARG POETRY_EXTRAS="ui vector-stores-qdrant llms-ollama embeddings-ollama"
20
+ RUN poetry install --no-root --extras "${POETRY_EXTRAS}"
21
+
22
+ FROM base as app
23
+ ENV PYTHONUNBUFFERED=1
24
+ ENV PORT=8080
25
+ ENV APP_ENV=prod
26
+ ENV PYTHONPATH="$PYTHONPATH:/home/worker/app/private_gpt/"
27
+ EXPOSE 8080
28
+
29
+ # Prepare a non-root user
30
+ # More info about how to configure UIDs and GIDs in Docker:
31
+ # https://github.com/systemd/systemd/blob/main/docs/UIDS-GIDS.md
32
+
33
+ # Define the User ID (UID) for the non-root user
34
+ # UID 100 is chosen to avoid conflicts with existing system users
35
+ ARG UID=100
36
+
37
+ # Define the Group ID (GID) for the non-root user
38
+ # GID 65534 is often used for the 'nogroup' or 'nobody' group
39
+ ARG GID=65534
40
+
41
+ RUN adduser --system --gid ${GID} --uid ${UID} --home /home/worker worker
42
+ WORKDIR /home/worker/app
43
+
44
+ RUN chown worker /home/worker/app
45
+ RUN mkdir local_data && chown worker local_data
46
+ RUN mkdir models && chown worker models
47
+ COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
48
+ COPY --chown=worker private_gpt/ private_gpt
49
+ COPY --chown=worker *.yaml .
50
+ COPY --chown=worker scripts/ scripts
51
+
52
+ USER worker
53
+ ENTRYPOINT python -m private_gpt
Dockerfile.openai ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ FROM python:3.11.6-slim-bookworm as base
4
+
5
+ # Install poetry
6
+ RUN pip install pipx
7
+ RUN python3 -m pipx ensurepath
8
+ RUN pipx install poetry==1.8.3
9
+ ENV PATH="/root/.local/bin:$PATH"
10
+ ENV PATH=".venv/bin/:$PATH"
11
+
12
+ # https://python-poetry.org/docs/configuration/#virtualenvsin-project
13
+ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
14
+
15
+ FROM base as dependencies
16
+ WORKDIR /home/worker/app
17
+ COPY pyproject.toml poetry.lock ./
18
+
19
+ ARG POETRY_EXTRAS="ui llms-openai embeddings-huggingface vector-stores-qdrant"
20
+ RUN poetry install --no-root --extras "${POETRY_EXTRAS}"
21
+
22
+ FROM base as app
23
+ ENV PYTHONUNBUFFERED=1
24
+ ENV PORT=8080
25
+ ENV APP_ENV=prod
26
+ ENV PYTHONPATH="$PYTHONPATH:/home/worker/app/private_gpt/"
27
+ EXPOSE 8080
28
+
29
+ # Prepare a non-root user
30
+ # More info about how to configure UIDs and GIDs in Docker:
31
+ # https://github.com/systemd/systemd/blob/main/docs/UIDS-GIDS.md
32
+
33
+ # Define the User ID (UID) for the non-root user
34
+ # UID 100 is chosen to avoid conflicts with existing system users
35
+ ARG UID=100
36
+
37
+ # Define the Group ID (GID) for the non-root user
38
+ # GID 65534 is often used for the 'nogroup' or 'nobody' group
39
+ ARG GID=65534
40
+
41
+ RUN adduser --system --gid ${GID} --uid ${UID} --home /home/worker worker
42
+ WORKDIR /home/worker/app
43
+
44
+ RUN chown worker /home/worker/app
45
+ RUN mkdir local_data && chown worker local_data
46
+ RUN mkdir models && chown worker models
47
+ COPY --chown=worker --from=dependencies /home/worker/app/.venv/ .venv
48
+ COPY --chown=worker private_gpt/ private_gpt
49
+ COPY --chown=worker *.yaml .
50
+ COPY --chown=worker scripts/ scripts
51
+
52
+ USER worker
53
+ ENTRYPOINT python -m private_gpt
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
Makefile ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Any args passed to the make script, use with $(call args, default_value)
2
+ args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
3
+
4
+ ########################################################################################################################
5
+ # Quality checks
6
+ ########################################################################################################################
7
+
8
+ test:
9
+ PYTHONPATH=. poetry run pytest tests
10
+
11
+ test-coverage:
12
+ PYTHONPATH=. poetry run pytest tests --cov private_gpt --cov-report term --cov-report=html --cov-report xml --junit-xml=tests-results.xml
13
+
14
+ black:
15
+ poetry run black . --check
16
+
17
+ ruff:
18
+ poetry run ruff check private_gpt tests
19
+
20
+ format:
21
+ poetry run black .
22
+ poetry run ruff check private_gpt tests --fix
23
+
24
+ mypy:
25
+ poetry run mypy private_gpt
26
+
27
+ check:
28
+ make format
29
+ make mypy
30
+
31
+ ########################################################################################################################
32
+ # Run
33
+ ########################################################################################################################
34
+
35
+ run:
36
+ poetry run python -m private_gpt
37
+
38
+ dev-windows:
39
+ (set PGPT_PROFILES=local & poetry run python -m uvicorn private_gpt.main:app --reload --port 8001)
40
+
41
+ dev:
42
+ PYTHONUNBUFFERED=1 PGPT_PROFILES=local poetry run python -m uvicorn private_gpt.main:app --reload --port 8001
43
+
44
+ ########################################################################################################################
45
+ # Misc
46
+ ########################################################################################################################
47
+
48
+ api-docs:
49
+ PGPT_PROFILES=mock poetry run python scripts/extract_openapi.py private_gpt.main:app --out fern/openapi/openapi.json
50
+
51
+ ingest:
52
+ @poetry run python scripts/ingest_folder.py $(call args)
53
+
54
+ stats:
55
+ poetry run python scripts/utils.py stats
56
+
57
+ wipe:
58
+ poetry run python scripts/utils.py wipe
59
+
60
+ setup:
61
+ poetry run python scripts/setup
62
+
63
+ list:
64
+ @echo "Available commands:"
65
+ @echo " test : Run tests using pytest"
66
+ @echo " test-coverage : Run tests with coverage report"
67
+ @echo " black : Check code format with black"
68
+ @echo " ruff : Check code with ruff"
69
+ @echo " format : Format code with black and ruff"
70
+ @echo " mypy : Run mypy for type checking"
71
+ @echo " check : Run format and mypy commands"
72
+ @echo " run : Run the application"
73
+ @echo " dev-windows : Run the application in development mode on Windows"
74
+ @echo " dev : Run the application in development mode"
75
+ @echo " api-docs : Generate API documentation"
76
+ @echo " ingest : Ingest data using specified script"
77
+ @echo " wipe : Wipe data using specified script"
78
+ @echo " setup : Setup the application"
README-hydro.md ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HidrogenGPT 📑
2
+
3
+ ![Gradio UI](/fern/docs/assets/ui-hidrogenGPT.jpg?raw=true)
4
+
5
+
6
+ HidrogenGPT based on PrivateGPT, a production-ready AI project that allows you to ask questions about your documents using the power
7
+ of Large Language Models (LLMs), even in scenarios without an Internet connection. 100% private, no data leaves your
8
+ execution environment at any point.
9
+
10
+ >[!TIP]
11
+ > If you are looking for an **enterprise-ready, fully private AI workspace**
12
+ > check out [Zylon's website](https://zylon.ai) or [request a demo](https://cal.com/zylon/demo?source=pgpt-readme).
13
+ > Crafted by the team behind PrivateGPT, Zylon is a best-in-class AI collaborative
14
+ > workspace that can be easily deployed on-premise (data center, bare metal...) or in your private cloud (AWS, GCP, Azure...).
15
+
16
+ The project provides an API offering all the primitives required to build private, context-aware AI applications.
17
+ It follows and extends the [OpenAI API standard](https://openai.com/blog/openai-api),
18
+ and supports both normal and streaming responses.
19
+
20
+ The API is divided into two logical blocks:
21
+
22
+ **High-level API**, which abstracts all the complexity of a RAG (Retrieval Augmented Generation)
23
+ pipeline implementation:
24
+ - Ingestion of documents: internally managing document parsing,
25
+ splitting, metadata extraction, embedding generation and storage.
26
+ - Chat & Completions using context from ingested documents:
27
+ abstracting the retrieval of context, the prompt engineering and the response generation.
28
+
29
+ **Low-level API**, which allows advanced users to implement their own complex pipelines:
30
+ - Embeddings generation: based on a piece of text.
31
+ - Contextual chunks retrieval: given a query, returns the most relevant chunks of text from the ingested documents.
32
+
33
+ In addition to this, a working [Gradio UI](https://www.gradio.app/)
34
+ client is provided to test the API, together with a set of useful tools such as bulk model
35
+ download script, ingestion script, documents folder watch, etc.
36
+
37
+ ## 🎞️ Overview
38
+ >[!WARNING]
39
+ > This README is not updated as frequently as the [documentation](https://docs.privategpt.dev/).
40
+ > Please check it out for the latest updates!
41
+
42
+ ### Motivation behind PrivateGPT
43
+ Generative AI is a game changer for our society, but adoption in companies of all sizes and data-sensitive
44
+ domains like healthcare or legal is limited by a clear concern: **privacy**.
45
+ Not being able to ensure that your data is fully under your control when using third-party AI tools
46
+ is a risk those industries cannot take.
47
+
48
+ ### Primordial version
49
+ The first version of PrivateGPT was launched in May 2023 as a novel approach to address the privacy
50
+ concerns by using LLMs in a complete offline way.
51
+
52
+ That version, which rapidly became a go-to project for privacy-sensitive setups and served as the seed
53
+ for thousands of local-focused generative AI projects, was the foundation of what PrivateGPT is becoming nowadays;
54
+ thus a simpler and more educational implementation to understand the basic concepts required
55
+ to build a fully local -and therefore, private- chatGPT-like tool.
56
+
57
+ If you want to keep experimenting with it, we have saved it in the
58
+ [primordial branch](https://github.com/zylon-ai/private-gpt/tree/primordial) of the project.
59
+
60
+ > It is strongly recommended to do a clean clone and install of this new version of
61
+ PrivateGPT if you come from the previous, primordial version.
62
+
63
+ ### Present and Future of PrivateGPT
64
+ PrivateGPT is now evolving towards becoming a gateway to generative AI models and primitives, including
65
+ completions, document ingestion, RAG pipelines and other low-level building blocks.
66
+ We want to make it easier for any developer to build AI applications and experiences, as well as provide
67
+ a suitable extensive architecture for the community to keep contributing.
68
+
69
+ Stay tuned to our [releases](https://github.com/zylon-ai/private-gpt/releases) to check out all the new features and changes included.
70
+
71
+ ## 📄 Documentation
72
+ Full documentation on installation, dependencies, configuration, running the server, deployment options,
73
+ ingesting local documents, API details and UI features can be found here: https://docs.privategpt.dev/
74
+
75
+ ## 🧩 Architecture
76
+ Conceptually, PrivateGPT is an API that wraps a RAG pipeline and exposes its
77
+ primitives.
78
+ * The API is built using [FastAPI](https://fastapi.tiangolo.com/) and follows
79
+ [OpenAI's API scheme](https://platform.openai.com/docs/api-reference).
80
+ * The RAG pipeline is based on [LlamaIndex](https://www.llamaindex.ai/).
81
+
82
+ The design of PrivateGPT allows to easily extend and adapt both the API and the
83
+ RAG implementation. Some key architectural decisions are:
84
+ * Dependency Injection, decoupling the different components and layers.
85
+ * Usage of LlamaIndex abstractions such as `LLM`, `BaseEmbedding` or `VectorStore`,
86
+ making it immediate to change the actual implementations of those abstractions.
87
+ * Simplicity, adding as few layers and new abstractions as possible.
88
+ * Ready to use, providing a full implementation of the API and RAG
89
+ pipeline.
90
+
91
+ Main building blocks:
92
+ * APIs are defined in `private_gpt:server:<api>`. Each package contains an
93
+ `<api>_router.py` (FastAPI layer) and an `<api>_service.py` (the
94
+ service implementation). Each *Service* uses LlamaIndex base abstractions instead
95
+ of specific implementations,
96
+ decoupling the actual implementation from its usage.
97
+ * Components are placed in
98
+ `private_gpt:components:<component>`. Each *Component* is in charge of providing
99
+ actual implementations to the base abstractions used in the Services - for example
100
+ `LLMComponent` is in charge of providing an actual implementation of an `LLM`
101
+ (for example `LlamaCPP` or `OpenAI`).
102
+
103
+ ## 💡 Contributing
104
+ Contributions are welcomed! To ensure code quality we have enabled several format and
105
+ typing checks, just run `make check` before committing to make sure your code is ok.
106
+ Remember to test your code! You'll find a tests folder with helpers, and you can run
107
+ tests using `make test` command.
108
+
109
+ Don't know what to contribute? Here is the public
110
+ [Project Board](https://github.com/users/imartinez/projects/3) with several ideas.
111
+
112
+ Head over to Discord
113
+ #contributors channel and ask for write permissions on that GitHub project.
114
+
115
+ ## 💬 Community
116
+ Join the conversation around PrivateGPT on our:
117
+ - [Twitter (aka X)](https://twitter.com/PrivateGPT_AI)
118
+ - [Discord](https://discord.gg/bK6mRVpErU)
119
+
120
+ ## 📖 Citation
121
+ If you use PrivateGPT in a paper, check out the [Citation file](CITATION.cff) for the correct citation.
122
+ You can also use the "Cite this repository" button in this repo to get the citation in different formats.
123
+
124
+ Here are a couple of examples:
125
+
126
+ #### BibTeX
127
+ ```bibtex
128
+ @software{Zylon_PrivateGPT_2023,
129
+ author = {Zylon by PrivateGPT},
130
+ license = {Apache-2.0},
131
+ month = may,
132
+ title = {{PrivateGPT}},
133
+ url = {https://github.com/zylon-ai/private-gpt},
134
+ year = {2023}
135
+ }
136
+ ```
137
+
138
+ #### APA
139
+ ```
140
+ Zylon by PrivateGPT (2023). PrivateGPT [Computer software]. https://github.com/zylon-ai/private-gpt
141
+ ```
142
+
143
+ ## 🤗 Partners & Supporters
144
+ PrivateGPT is actively supported by the teams behind:
145
+ * [Qdrant](https://qdrant.tech/), providing the default vector database
146
+ * [Fern](https://buildwithfern.com/), providing Documentation and SDKs
147
+ * [LlamaIndex](https://www.llamaindex.ai/), providing the base RAG framework and abstractions
148
+
149
+ This project has been strongly influenced and supported by other amazing projects like
150
+ [LangChain](https://github.com/hwchase17/langchain),
151
+ [GPT4All](https://github.com/nomic-ai/gpt4all),
152
+ [LlamaCpp](https://github.com/ggerganov/llama.cpp),
153
+ [Chroma](https://www.trychroma.com/)
154
+ and [SentenceTransformers](https://www.sbert.net/).
docker-compose.yaml ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+
3
+ #-----------------------------------
4
+ #---- Private-GPT services ---------
5
+ #-----------------------------------
6
+
7
+ # Private-GPT service for the Ollama CPU and GPU modes
8
+ # This service builds from an external Dockerfile and runs the Ollama mode.
9
+ private-gpt-ollama:
10
+ image: ${PGPT_IMAGE:-zylonai/private-gpt}:${PGPT_TAG:-0.6.2}-ollama # x-release-please-version
11
+ build:
12
+ context: .
13
+ dockerfile: Dockerfile.ollama
14
+ volumes:
15
+ - ./local_data/:/home/worker/app/local_data
16
+ ports:
17
+ - "8001:8001"
18
+ environment:
19
+ PORT: 8001
20
+ PGPT_PROFILES: docker
21
+ PGPT_MODE: ollama
22
+ PGPT_EMBED_MODE: ollama
23
+ PGPT_OLLAMA_API_BASE: http://ollama:11434
24
+ HF_TOKEN: ${HF_TOKEN:-}
25
+ profiles:
26
+ - ""
27
+ - ollama-cpu
28
+ - ollama-cuda
29
+ - ollama-api
30
+
31
+ # Private-GPT service for the local mode
32
+ # This service builds from a local Dockerfile and runs the application in local mode.
33
+ private-gpt-llamacpp-cpu:
34
+ image: ${PGPT_IMAGE:-zylonai/private-gpt}:${PGPT_TAG:-0.6.2}-llamacpp-cpu # x-release-please-version
35
+ build:
36
+ context: .
37
+ dockerfile: Dockerfile.llamacpp-cpu
38
+ volumes:
39
+ - ./local_data/:/home/worker/app/local_data
40
+ - ./models/:/home/worker/app/models
41
+ entrypoint: sh -c ".venv/bin/python scripts/setup && .venv/bin/python -m private_gpt"
42
+ ports:
43
+ - "8001:8001"
44
+ environment:
45
+ PORT: 8001
46
+ PGPT_PROFILES: local
47
+ HF_TOKEN: ${HF_TOKEN}
48
+ profiles:
49
+ - llamacpp-cpu
50
+
51
+ #-----------------------------------
52
+ #---- Ollama services --------------
53
+ #-----------------------------------
54
+
55
+ # Traefik reverse proxy for the Ollama service
56
+ # This will route requests to the Ollama service based on the profile.
57
+ ollama:
58
+ image: traefik:v2.10
59
+ ports:
60
+ - "8081:8080"
61
+ command:
62
+ - "--providers.file.filename=/etc/router.yml"
63
+ - "--log.level=ERROR"
64
+ - "--api.insecure=true"
65
+ - "--providers.docker=true"
66
+ - "--providers.docker.exposedbydefault=false"
67
+ - "--entrypoints.web.address=:11434"
68
+ volumes:
69
+ - /var/run/docker.sock:/var/run/docker.sock:ro
70
+ - ./.docker/router.yml:/etc/router.yml:ro
71
+ extra_hosts:
72
+ - "host.docker.internal:host-gateway"
73
+ profiles:
74
+ - ""
75
+ - ollama-cpu
76
+ - ollama-cuda
77
+ - ollama-api
78
+
79
+ # Ollama service for the CPU mode
80
+ ollama-cpu:
81
+ image: ollama/ollama:latest
82
+ volumes:
83
+ - ./models:/root/.ollama
84
+ profiles:
85
+ - ""
86
+ - ollama-cpu
87
+
88
+ # Ollama service for the CUDA mode
89
+ ollama-cuda:
90
+ image: ollama/ollama:latest
91
+ volumes:
92
+ - ./models:/root/.ollama
93
+ deploy:
94
+ resources:
95
+ reservations:
96
+ devices:
97
+ - driver: nvidia
98
+ count: 1
99
+ capabilities: [gpu]
100
+ profiles:
101
+ - ollama-cuda
102
+
103
+ openai:
104
+ image: 3x3cut0r/privategpt:latest
105
+ build:
106
+ context: .
107
+ dockerfile: Dockerfile.openai
108
+ container_name: privategpt
109
+ ports:
110
+ - 8080:8080/tcp
111
+ environment:
112
+ OPENAI_API_KEY: ${OPENAI_API_KEY}
113
+ OPENAI_API_BASE: https://api.openai.com/v1
114
+ OPENAI_MODEL: gpt-4o-mini
115
+ OPENAI_TEMPERATURE: 0.5
116
+
poetry.lock ADDED
The diff for this file is too large to render. See raw diff
 
pyproject.toml ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.poetry]
2
+ name = "private-gpt"
3
+ version = "0.6.2"
4
+ description = "Private GPT"
5
+ authors = ["Zylon <[email protected]>"]
6
+
7
+ [tool.poetry.dependencies]
8
+ python = ">=3.11,<3.12"
9
+ # PrivateGPT
10
+ fastapi = { extras = ["all"], version = "^0.111.0" }
11
+ python-multipart = "^0.0.9"
12
+ injector = "^0.21.0"
13
+ pyyaml = "^6.0.1"
14
+ watchdog = "^4.0.1"
15
+ transformers = "^4.42.3"
16
+ docx2txt = "^0.8"
17
+ cryptography = "^3.1"
18
+ # LlamaIndex core libs
19
+ llama-index-core = "^0.10.52"
20
+ llama-index-readers-file = "^0.1.27"
21
+ # Optional LlamaIndex integration libs
22
+ llama-index-llms-llama-cpp = {version = "^0.1.4", optional = true}
23
+ llama-index-llms-openai = {version = "^0.1.25", optional = true}
24
+ llama-index-llms-openai-like = {version ="^0.1.3", optional = true}
25
+ llama-index-llms-ollama = {version ="^0.2.2", optional = true}
26
+ llama-index-llms-azure-openai = {version ="^0.1.8", optional = true}
27
+ llama-index-llms-gemini = {version ="^0.1.11", optional = true}
28
+ llama-index-embeddings-ollama = {version ="^0.1.2", optional = true}
29
+ llama-index-embeddings-huggingface = {version ="^0.2.2", optional = true}
30
+ llama-index-embeddings-openai = {version ="^0.1.10", optional = true}
31
+ llama-index-embeddings-azure-openai = {version ="^0.1.10", optional = true}
32
+ llama-index-embeddings-gemini = {version ="^0.1.8", optional = true}
33
+ llama-index-vector-stores-qdrant = {version ="^0.2.10", optional = true}
34
+ llama-index-vector-stores-milvus = {version ="^0.1.20", optional = true}
35
+ llama-index-vector-stores-chroma = {version ="^0.1.10", optional = true}
36
+ llama-index-vector-stores-postgres = {version ="^0.1.11", optional = true}
37
+ llama-index-vector-stores-clickhouse = {version ="^0.1.3", optional = true}
38
+ llama-index-storage-docstore-postgres = {version ="^0.1.3", optional = true}
39
+ llama-index-storage-index-store-postgres = {version ="^0.1.4", optional = true}
40
+ # Postgres
41
+ psycopg2-binary = {version ="^2.9.9", optional = true}
42
+ asyncpg = {version="^0.29.0", optional = true}
43
+
44
+ # ClickHouse
45
+ clickhouse-connect = {version = "^0.7.15", optional = true}
46
+
47
+ # Optional Sagemaker dependency
48
+ boto3 = {version ="^1.34.139", optional = true}
49
+
50
+ # Optional Qdrant client
51
+ qdrant-client = {version ="^1.9.0", optional = true}
52
+
53
+ # Optional Reranker dependencies
54
+ torch = {version ="^2.3.1", optional = true}
55
+ sentence-transformers = {version ="^3.0.1", optional = true}
56
+
57
+ # Optional UI
58
+ gradio = {version ="^4.37.2", optional = true}
59
+ ffmpy = "0.4.0"
60
+
61
+ # Optional Google Gemini dependency
62
+ google-generativeai = {version ="^0.5.4", optional = true}
63
+
64
+ # Optional Ollama client
65
+ ollama = {version ="^0.3.0", optional = true}
66
+
67
+ # Optional HF Transformers
68
+ einops = {version = "^0.8.0", optional = true}
69
+ retry-async = "^0.1.4"
70
+
71
+ [tool.poetry.extras]
72
+ ui = ["gradio", "ffmpy"]
73
+ llms-llama-cpp = ["llama-index-llms-llama-cpp"]
74
+ llms-openai = ["llama-index-llms-openai"]
75
+ llms-openai-like = ["llama-index-llms-openai-like"]
76
+ llms-ollama = ["llama-index-llms-ollama", "ollama"]
77
+ llms-sagemaker = ["boto3"]
78
+ llms-azopenai = ["llama-index-llms-azure-openai"]
79
+ llms-gemini = ["llama-index-llms-gemini", "google-generativeai"]
80
+ embeddings-ollama = ["llama-index-embeddings-ollama", "ollama"]
81
+ embeddings-huggingface = ["llama-index-embeddings-huggingface", "einops"]
82
+ embeddings-openai = ["llama-index-embeddings-openai"]
83
+ embeddings-sagemaker = ["boto3"]
84
+ embeddings-azopenai = ["llama-index-embeddings-azure-openai"]
85
+ embeddings-gemini = ["llama-index-embeddings-gemini"]
86
+ vector-stores-qdrant = ["llama-index-vector-stores-qdrant"]
87
+ vector-stores-clickhouse = ["llama-index-vector-stores-clickhouse", "clickhouse_connect"]
88
+ vector-stores-chroma = ["llama-index-vector-stores-chroma"]
89
+ vector-stores-postgres = ["llama-index-vector-stores-postgres"]
90
+ vector-stores-milvus = ["llama-index-vector-stores-milvus"]
91
+ storage-nodestore-postgres = ["llama-index-storage-docstore-postgres","llama-index-storage-index-store-postgres","psycopg2-binary","asyncpg"]
92
+ rerank-sentence-transformers = ["torch", "sentence-transformers"]
93
+
94
+ [tool.poetry.group.dev.dependencies]
95
+ black = "^22"
96
+ mypy = "^1.2"
97
+ pre-commit = "^2"
98
+ pytest = "^7"
99
+ pytest-cov = "^3"
100
+ ruff = "^0"
101
+ pytest-asyncio = "^0.21.1"
102
+ types-pyyaml = "^6.0.12.12"
103
+
104
+ [build-system]
105
+ requires = ["poetry-core>=1.0.0"]
106
+ build-backend = "poetry.core.masonry.api"
107
+
108
+ # Packages configs
109
+
110
+ ## coverage
111
+
112
+ [tool.coverage.run]
113
+ branch = true
114
+
115
+ [tool.coverage.report]
116
+ skip_empty = true
117
+ precision = 2
118
+
119
+ ## black
120
+
121
+ [tool.black]
122
+ target-version = ['py311']
123
+
124
+ ## ruff
125
+ # Recommended ruff config for now, to be updated as we go along.
126
+ [tool.ruff]
127
+ target-version = 'py311'
128
+
129
+ # See all rules at https://beta.ruff.rs/docs/rules/
130
+ lint.select = [
131
+ "E", # pycodestyle
132
+ "W", # pycodestyle
133
+ "F", # Pyflakes
134
+ "B", # flake8-bugbear
135
+ "C4", # flake8-comprehensions
136
+ "D", # pydocstyle
137
+ "I", # isort
138
+ "SIM", # flake8-simplify
139
+ "TCH", # flake8-type-checking
140
+ "TID", # flake8-tidy-imports
141
+ "Q", # flake8-quotes
142
+ "UP", # pyupgrade
143
+ "PT", # flake8-pytest-style
144
+ "RUF", # Ruff-specific rules
145
+ ]
146
+
147
+ lint.ignore = [
148
+ "E501", # "Line too long"
149
+ # -> line length already regulated by black
150
+ "PT011", # "pytest.raises() should specify expected exception"
151
+ # -> would imply to update tests every time you update exception message
152
+ "SIM102", # "Use a single `if` statement instead of nested `if` statements"
153
+ # -> too restrictive,
154
+ "D100",
155
+ "D101",
156
+ "D102",
157
+ "D103",
158
+ "D104",
159
+ "D105",
160
+ "D106",
161
+ "D107"
162
+ # -> "Missing docstring in public function too restrictive"
163
+ ]
164
+
165
+ [tool.ruff.lint.pydocstyle]
166
+ # Automatically disable rules that are incompatible with Google docstring convention
167
+ convention = "google"
168
+
169
+ [tool.ruff.lint.pycodestyle]
170
+ max-doc-length = 88
171
+
172
+ [tool.ruff.lint.flake8-tidy-imports]
173
+ ban-relative-imports = "all"
174
+
175
+ [tool.ruff.lint.flake8-type-checking]
176
+ strict = true
177
+ runtime-evaluated-base-classes = ["pydantic.BaseModel"]
178
+ # Pydantic needs to be able to evaluate types at runtime
179
+ # see https://pypi.org/project/flake8-type-checking/ for flake8-type-checking documentation
180
+ # see https://beta.ruff.rs/docs/settings/#flake8-type-checking-runtime-evaluated-base-classes for ruff documentation
181
+
182
+ [tool.ruff.lint.per-file-ignores]
183
+ # Allow missing docstrings for tests
184
+ "tests/**/*.py" = ["D1"]
185
+
186
+ ## mypy
187
+
188
+ [tool.mypy]
189
+ python_version = "3.11"
190
+ strict = true
191
+ check_untyped_defs = false
192
+ explicit_package_bases = true
193
+ warn_unused_ignores = false
194
+ exclude = ["tests"]
195
+
196
+ [tool.mypy-llama-index]
197
+ ignore_missing_imports = true
198
+
199
+ [tool.pytest.ini_options]
200
+ asyncio_mode = "auto"
201
+ testpaths = ["tests"]
202
+ addopts = [
203
+ "--import-mode=importlib",
204
+ ]
settings-azopenai.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server:
2
+ env_name: ${APP_ENV:azopenai}
3
+
4
+ llm:
5
+ mode: azopenai
6
+
7
+ embedding:
8
+ mode: azopenai
9
+
10
+ azopenai:
11
+ api_key: ${AZ_OPENAI_API_KEY:}
12
+ azure_endpoint: ${AZ_OPENAI_ENDPOINT:}
13
+ embedding_deployment_name: ${AZ_OPENAI_EMBEDDING_DEPLOYMENT_NAME:}
14
+ llm_deployment_name: ${AZ_OPENAI_LLM_DEPLOYMENT_NAME:}
15
+ api_version: "2023-05-15"
16
+ embedding_model: text-embedding-ada-002
17
+ llm_model: gpt-35-turbo
settings-docker.yaml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server:
2
+ env_name: ${APP_ENV:prod}
3
+ port: ${PORT:8080}
4
+
5
+ llm:
6
+ mode: ${PGPT_MODE:mock}
7
+
8
+ embedding:
9
+ mode: ${PGPT_EMBED_MODE:mock}
10
+
11
+ llamacpp:
12
+ llm_hf_repo_id: ${PGPT_HF_REPO_ID:lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF}
13
+ llm_hf_model_file: ${PGPT_HF_MODEL_FILE:Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf}
14
+
15
+ huggingface:
16
+ embedding_hf_model_name: ${PGPT_EMBEDDING_HF_MODEL_NAME:nomic-ai/nomic-embed-text-v1.5}
17
+
18
+ sagemaker:
19
+ llm_endpoint_name: ${PGPT_SAGEMAKER_LLM_ENDPOINT_NAME:}
20
+ embedding_endpoint_name: ${PGPT_SAGEMAKER_EMBEDDING_ENDPOINT_NAME:}
21
+
22
+ ollama:
23
+ llm_model: ${PGPT_OLLAMA_LLM_MODEL:llama3.1}
24
+ embedding_model: ${PGPT_OLLAMA_EMBEDDING_MODEL:nomic-embed-text}
25
+ api_base: ${PGPT_OLLAMA_API_BASE:http://ollama:11434}
26
+ embedding_api_base: ${PGPT_OLLAMA_EMBEDDING_API_BASE:http://ollama:11434}
27
+ tfs_z: ${PGPT_OLLAMA_TFS_Z:1.0}
28
+ top_k: ${PGPT_OLLAMA_TOP_K:40}
29
+ top_p: ${PGPT_OLLAMA_TOP_P:0.9}
30
+ repeat_last_n: ${PGPT_OLLAMA_REPEAT_LAST_N:64}
31
+ repeat_penalty: ${PGPT_OLLAMA_REPEAT_PENALTY:1.2}
32
+ request_timeout: ${PGPT_OLLAMA_REQUEST_TIMEOUT:600.0}
33
+ autopull_models: ${PGPT_OLLAMA_AUTOPULL_MODELS:true}
34
+
35
+ ui:
36
+ enabled: true
37
+ path: /
settings-ollama.yaml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server:
2
+ env_name: ${APP_ENV:ollama}
3
+
4
+ llm:
5
+ mode: ollama
6
+ max_new_tokens: 512
7
+ context_window: 3900
8
+ temperature: 0.1 #The temperature of the model. Increasing the temperature will make the model answer more creatively. A value of 0.1 would be more factual. (Default: 0.1)
9
+
10
+ embedding:
11
+ mode: ollama
12
+
13
+ ollama:
14
+ llm_model: llama3.1
15
+ embedding_model: nomic-embed-text
16
+ api_base: http://localhost:11434
17
+ embedding_api_base: http://localhost:11434 # change if your embedding model runs on another ollama
18
+ keep_alive: 5m
19
+ tfs_z: 1.0 # Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting.
20
+ top_k: 40 # Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40)
21
+ top_p: 0.9 # Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. (Default: 0.9)
22
+ repeat_last_n: 64 # Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx)
23
+ repeat_penalty: 1.2 # Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1)
24
+ request_timeout: 12000.0 # Time elapsed until ollama times out the request. Default is 120s. Format is float.
25
+
26
+ vectorstore:
27
+ database: qdrant
28
+
29
+ qdrant:
30
+ path: local_data/private_gpt/qdrant
settings-openai.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server:
2
+ env_name: ${APP_ENV:openai}
3
+
4
+ llm:
5
+ mode: openai
6
+
7
+ embedding:
8
+ mode: huggingface
9
+
10
+ openai:
11
+ api_base: https://api.openai.com/v1
12
+ api_key: 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
13
+ model: gpt-4o-mini
14
+ temperature: 0.5
settings.yaml ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # The default configuration file.
2
+ # More information about configuration can be found in the documentation: https://docs.privategpt.dev/
3
+ # Syntax in `private_pgt/settings/settings.py`
4
+ server:
5
+ env_name: ${APP_ENV:prod}
6
+ port: ${PORT:8001}
7
+ cors:
8
+ enabled: true
9
+ allow_origins: ["*"]
10
+ allow_methods: ["*"]
11
+ allow_headers: ["*"]
12
+ auth:
13
+ enabled: false
14
+ # python -c 'import base64; print("Basic " + base64.b64encode("secret:key".encode()).decode())'
15
+ # 'secret' is the username and 'key' is the password for basic auth by default
16
+ # If the auth is enabled, this value must be set in the "Authorization" header of the request.
17
+ secret: "Basic c2VjcmV0OmtleQ=="
18
+
19
+ data:
20
+ local_ingestion:
21
+ enabled: ${LOCAL_INGESTION_ENABLED:false}
22
+ allow_ingest_from: ["*"]
23
+ local_data_folder: local_data/private_gpt
24
+
25
+ ui:
26
+ enabled: true
27
+ path: /
28
+ default_chat_system_prompt: >
29
+ You are a helpful, respectful and honest assistant.
30
+ Always answer as helpfully as possible and follow ALL given instructions.
31
+ Do not speculate or make up information.
32
+ Do not reference any given instructions or context.
33
+ default_query_system_prompt: >
34
+ You can only answer questions strictly based on the information contained within the provided documents.
35
+ Do not include any external knowledge or assumptions.
36
+ If the relevant answer is not found in the documents, respond with: 'The answer is not found in the provided context.'
37
+ Please ensure that all responses are concise and grounded solely in the provided material.
38
+
39
+ default_summarization_system_prompt: >
40
+ Provide a comprehensive summary of the provided context information.
41
+ The summary should cover all the key points and main ideas presented in
42
+ the original text, while also condensing the information into a concise
43
+ and easy-to-understand format. Please ensure that the summary includes
44
+ relevant details and examples that support the main ideas, while avoiding
45
+ any unnecessary information or repetition.
46
+ delete_file_button_enabled: true
47
+ delete_all_files_button_enabled: true
48
+ #You can only answer questions about the provided documents.
49
+ #If you know the answer but it is not based in the provided context, don't provide
50
+ #the answer, just state the answer is not in the context provided.
51
+
52
+ llm:
53
+ mode: llamacpp
54
+ prompt_style: "llama3"
55
+ # Should be matching the selected model
56
+ max_new_tokens: 512
57
+ context_window: 3900
58
+ # Select your tokenizer. Llama-index tokenizer is the default.
59
+ # tokenizer: meta-llama/Meta-Llama-3.1-8B-Instruct
60
+ temperature: 0.1 # The temperature of the model. Increasing the temperature will make the model answer more creatively. A value of 0.1 would be more factual. (Default: 0.1)
61
+
62
+ rag:
63
+ similarity_top_k: 2
64
+ #This value controls how many "top" documents the RAG returns to use in the context.
65
+ #similarity_value: 0.45
66
+ #This value is disabled by default. If you enable this settings, the RAG will only use articles that meet a certain percentage score.
67
+ rerank:
68
+ enabled: false
69
+ model: cross-encoder/ms-marco-MiniLM-L-2-v2
70
+ top_n: 1
71
+
72
+ summarize:
73
+ use_async: true
74
+
75
+ clickhouse:
76
+ host: localhost
77
+ port: 8443
78
+ username: admin
79
+ password: clickhouse
80
+ database: embeddings
81
+
82
+ llamacpp:
83
+ llm_hf_repo_id: lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF
84
+ llm_hf_model_file: Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
85
+ tfs_z: 1.0 # Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting
86
+ top_k: 40 # Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40)
87
+ top_p: 1.0 # Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. (Default: 0.9)
88
+ repeat_penalty: 1.1 # Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1)
89
+
90
+ embedding:
91
+ # Should be matching the value above in most cases
92
+ mode: huggingface
93
+ ingest_mode: simple
94
+ embed_dim: 768 # 768 is for nomic-ai/nomic-embed-text-v1.5
95
+
96
+ huggingface:
97
+ embedding_hf_model_name: nomic-ai/nomic-embed-text-v1.5 #intfloat/multilingual-e5-large
98
+ access_token: ${HF_TOKEN:}
99
+ # Warning: Enabling this option will allow the model to download and execute code from the internet.
100
+ # Nomic AI requires this option to be enabled to use the model, be aware if you are using a different model.
101
+ trust_remote_code: true
102
+
103
+ vectorstore:
104
+ database: qdrant
105
+
106
+ nodestore:
107
+ database: simple
108
+
109
+ milvus:
110
+ uri: local_data/private_gpt/milvus/milvus_local.db
111
+ collection_name: milvus_db
112
+ overwrite: false
113
+
114
+ qdrant:
115
+ path: local_data/private_gpt/qdrant
116
+
117
+ postgres:
118
+ host: localhost
119
+ port: 5432
120
+ database: postgres
121
+ user: postgres
122
+ password: postgres
123
+ schema_name: private_gpt
124
+
125
+ sagemaker:
126
+ llm_endpoint_name: huggingface-pytorch-tgi-inference-2023-09-25-19-53-32-140
127
+ embedding_endpoint_name: huggingface-pytorch-inference-2023-11-03-07-41-36-479
128
+
129
+ openai:
130
+ api_key: ${OPENAI_API_KEY:}
131
+ model: gpt-4o-mini
132
+ embedding_api_key: ${OPENAI_API_KEY:}
133
+ temperature: 0.5
134
+
135
+ ollama:
136
+ llm_model: llama3.1
137
+ embedding_model: nomic-embed-text
138
+ api_base: http://localhost:11434
139
+ embedding_api_base: http://localhost:11434 # change if your embedding model runs on another ollama
140
+ keep_alive: 5m
141
+ request_timeout: 300.0
142
+ autopull_models: true
143
+
144
+ azopenai:
145
+ api_key: ${AZ_OPENAI_API_KEY:}
146
+ azure_endpoint: ${AZ_OPENAI_ENDPOINT:}
147
+ embedding_deployment_name: ${AZ_OPENAI_EMBEDDING_DEPLOYMENT_NAME:}
148
+ llm_deployment_name: ${AZ_OPENAI_LLM_DEPLOYMENT_NAME:}
149
+ api_version: "2023-05-15"
150
+ embedding_model: text-embedding-ada-002
151
+ llm_model: gpt-35-turbo
152
+
153
+ gemini:
154
+ api_key: ${GOOGLE_API_KEY:}
155
+ model: models/gemini-pro
156
+ embedding_model: models/embedding-001
version.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 0.6.2