Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EmanuelCampos/monorepo-llama-index
Packages to use llama indexes on a react app with flask
https://github.com/EmanuelCampos/monorepo-llama-index
Last synced: about 2 months ago
JSON representation
Packages to use llama indexes on a react app with flask
- Host: GitHub
- URL: https://github.com/EmanuelCampos/monorepo-llama-index
- Owner: EmanuelCampos
- Created: 2023-05-30T13:46:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-13T00:22:47.000Z (over 1 year ago)
- Last Synced: 2024-06-12T11:28:25.077Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 3.43 MB
- Stars: 27
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Monorepo llama Index
![A screenshot of website package](./assets/flow.png)A fullstack application containing a crawler, API and web page to augment LLMs based on essays an articles.
> ⚠️ Every time that you need to index new web pages, even using `text-ada-002` embedding from OpenAI, essays and articles can be bigger and consume a lot of tokens, be sure to limitate your quota usage on OpenAI to unforeseen events.
> ⚠️ The project is expensive because the texts/websites aren't being pre-processed yet, it's one of the biggest priorities
> ⚠️ For each question/prompt you will be charged from OpenAI too
## Requirements:
- A Computer
- Python 3.9.12
- Node v16.14.2## Crawler
Download all essays from a web page based on a config file and store to be used by llama-index.### How to run
Provide the websites on `config.json` file and after run `yarn crawler` all the anchors links there will be crawled and store on a examples folder.1. `yarn install`
2. Add the personal site/blog on `config.json` files. (prefer the page that only list essays/articles)
3. run `yarn crawler`## LLAMA
Index the essays and interact with the LLM through a Flask API### How to run
> ⚠️ can be expensive depending of the quantity of files
To index all the files and generate a storage of the indexes on disk run
```bash
python ./packages/llama/index.py
```After this a storage folder will be generated and you will be able to use a Flask API to interact with the LLM using the indexes.
run locally after `pip install`:
```bash
flask --app ./src/api run --host=0.0.0.0 -p 3000
```## Web
![A screenshot of website package](./assets/readme-img.png)
Interact with the LLM through your OpenAI api keyrun locally after `yarn install`
```
yarn web:dev
```## Next steps
- [ ] Pre-process texts
- [ ] Improve crawler to not get shit stuff
- [ ] Make web application more generic
- [ ] Support other types of index