(Video explanation in Persian/Farsi - English tutorial coming soon)
Persian Language Tutorial - Click the thumbnail above to watch a detailed implementation walkthrough in Persian.
- Ensure
ninja
tool is on your PATH
Ubuntu example:sudo apt install ninja-build
- Run the installation script:
./install-models.sh
Important Notes:
- Modify
install-models.sh
to specify which models to install - For models with HuggingFace restrictions:
- Environment variable method:
HUGGINGFACE_TOKEN=hf_tokenblahblahblah ./install-models.sh
- CLI argument method (overrides environment variable):
./install-models.sh --hf-token hf_tokenblahblahblah
- Environment variable method:
docker compose up --build -d --wait rag
Follow the vectorstore population guide to load online article content.
python3 -m venv ./examples/populate-vectorstore/.venv
source ./examples/populate-vectorstore/.venv/bin/activate
pip install --requirement=./examples/populate-vectorstore/requirements.txt
Artificial Intelligence:
python3 ./examples/populate-vectorstore/populate-vectorstore.py \
--max-chunk-bytes 2000 \
https://en.wikipedia.org/wiki/Artificial_intelligence
Cyrus the Great:
python3 ./examples/populate-vectorstore/populate-vectorstore.py \
--max-chunk-bytes 2000 \
https://en.wikipedia.org/wiki/Cyrus_the_Great
Follow the chat client guide to deploy a test client.
-
Generate JS client stubs:
docker run --network=host --rm -v ${PWD}/examples/rag-chat/:/local \ openapitools/openapi-generator-cli generate \ -i http://localhost:8000/v1/rag.swagger.json \ -g javascript \ -o /local/js-client \ --additional-properties=usePromises=true,useES6=true
-
Verify directory structure:
./examples/rag-chat/ ├── index.html └── js-client ├── ... └── ...
-
Install serve tool:
npm install -g serve
-
Start web server:
serve -l 3000 ./examples/rag-chat/
-
Access chat client:
http://localhost:3000