Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lspahija/knowledge-base
https://github.com/lspahija/knowledge-base
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lspahija/knowledge-base
- Owner: lspahija
- Created: 2023-04-08T11:30:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-02T19:17:19.000Z (about 1 year ago)
- Last Synced: 2024-11-01T12:09:07.790Z (about 2 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Knowledge Base
### Index
A queryable in-memory index is created over the files in the `data` directory upon startup.
New documents can be added to the index during runtime by sending a POST to the `/document` endpoint.
The default index used is the in-memory `GPTSimpleVectorIndex`. The vector db Pinecone is also supported.
To use Pinecone, set the `INDEX_TYPE` env var to `pinecone` and populate the `PINECONE_API_KEY` env var.### LLM
The default LLM used is `flan-t5-large`, an Apache-2.0-licensed LLM that is downloaded once upon startup and then runs
locally.To instead use `gpt-3.5-turbo`, set the `LLM_MODEL_NAME` env var to `gpt-3.5-turbo`.
If `gpt-3.5-turbo` is used, the `OPENAI_API_KEY` env var must also be set.### Run
Install dependencies with `pip install -r requirements.txt`Run with `python -m uvicorn app:app --reload`
### Sample Requests
`main.http` contains sample HTTP requests for the REST API.