An example RAG application for the Shadow of Altars book written by the author, Vincas Mykolaitis-Putinas.
I had specific restriction for this project:
Firstly, after cloning the repository, copy the .env.tmpl file to .env and fill in the necessary environment variables.
Afterwards, run the following command to start the application:
sudo docker compose up
To improve the perfomance of RAG, there are a couple of parameters that can be tuned in settings.py:
Prompts:
SYSTEM_PROMPT: System prompt used for RAG, could be improved by experimenting with different prompts.CONTEXT_PROMPT: Context prompt used for RAG, could be improved by experimenting with different prompts.Generation settings:
GenerationSettings.temperature: Temperature parameter for RAG, controls how creative the model is.GenerationSettings.top_p: Controls how diverse models vocabulary is.GenerationSettings.similiarity_top_k: Controls how many nodes to retrieve for context.Processing settings:
ProcessingSettings.chunk_size: Controls how large the chunks can be for retrieval.ProcessingSettings.chunk_overlap: Controls how much overlap there is between chunks.Aside from tuning parameters, model performance can be improved by:
BaseChatModel from src/example_rag/chatbot/model.py.You can deploy containerized application to any cloud provider that supports Docker containers, for example AWS, Azure, GCP, DigitalOcean, etc. However, LLM and Embedding model serving should be refactored to be capable of asynchronous processing, and should be served as separate services, as they are computationally expensive.
7 commits
Python
83.0%
Jupyter Notebook
14.3%
Dockerfile
1.5%
Makefile
1.2%
An example RAG application for the Shadow of Altars book written by the author, Vincas Mykolaitis-Putinas.
I had specific restriction for this project:
Firstly, after cloning the repository, copy the .env.tmpl file to .env and fill in the necessary environment variables.
Afterwards, run the following command to start the application:
sudo docker compose up
To improve the perfomance of RAG, there are a couple of parameters that can be tuned in settings.py:
Prompts:
SYSTEM_PROMPT: System prompt used for RAG, could be improved by experimenting with different prompts.CONTEXT_PROMPT: Context prompt used for RAG, could be improved by experimenting with different prompts.Generation settings:
GenerationSettings.temperature: Temperature parameter for RAG, controls how creative the model is.GenerationSettings.top_p: Controls how diverse models vocabulary is.GenerationSettings.similiarity_top_k: Controls how many nodes to retrieve for context.Processing settings:
ProcessingSettings.chunk_size: Controls how large the chunks can be for retrieval.ProcessingSettings.chunk_overlap: Controls how much overlap there is between chunks.Aside from tuning parameters, model performance can be improved by:
BaseChatModel from src/example_rag/chatbot/model.py.You can deploy containerized application to any cloud provider that supports Docker containers, for example AWS, Azure, GCP, DigitalOcean, etc. However, LLM and Embedding model serving should be refactored to be capable of asynchronous processing, and should be served as separate services, as they are computationally expensive.
7 commits
Python
83.0%
Jupyter Notebook
14.3%
Dockerfile
1.5%
Makefile
1.2%