diff --git a/README.md b/README.md index d618b1f..3c66eac 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a starter kit to deploy a modularizable RAG locally or on the cloud (or ## Features -- A configurable RAG setup based around Langchain +- A configurable RAG setup based around Langchain ([Check out the configuration cookbook here](https://redesigned-umbrella-evz5np5.pages.github.io/cookbook/)) - `RAG` and `RagConfig` python classes to help you set things up - A REST API based on FastAPI to provide easy access to the RAG as a web backend - A demo Streamlit to serve as a basic working frontend (not production grade) @@ -39,7 +39,7 @@ Start the frontend demo python -m streamlit run frontend/app.py ``` -You should than be able to login and chat to the bot: +You should then be able to login and chat to the bot: ![](docs/login_and_chat.gif) @@ -54,7 +54,7 @@ The RAG now has access to thn information from your loaded documents: ## Documentation -To deep dive into under the hood, take a look at the documentation +To learn how to configure the RAG, take a look at the documentation [On github pages](https://redesigned-umbrella-evz5np5.pages.github.io/) diff --git a/docs/cookbook.md b/docs/cookbook.md index 0bacfc8..ba61dac 100644 --- a/docs/cookbook.md +++ b/docs/cookbook.md @@ -1 +1,6 @@ -Here you will find a repository of configurations that proved to work. +Here you will find a repository of configurations that have proved to work. + +- [LLM Configuration samples](recipe_llms_configs.md) +- [Embedding model Configuration samples](recipe_embedding_models_configs.md) +- [Vector Store Configuration samples](recipe_vector_stores_configs.md) +- [Database Configuration samples](recipe_databases_configs.md) \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 4c47855..3ba45e2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ This is a starter kit to deploy a modularizable RAG locally or on the cloud (or ## Features -- A configurable RAG setup based around Langchain +- A configurable RAG setup based around Langchain ([Check out the configuration cookbook here](cookbook)) - `RAG` and `RagConfig` python classes to help you set things up - A REST API based on FastAPI to provide easy access to the RAG as a web backend - A demo Streamlit to serve as a basic working frontend (not production grade) @@ -39,7 +39,7 @@ Start the frontend demo python -m streamlit run frontend/app.py ``` -You should than be able to login and chat to the bot: +You should then be able to login and chat to the bot: ![](login_and_chat.gif) diff --git a/docs/recipe_databases_configs.md b/docs/recipe_databases_configs.md index 59ee660..4d3df4b 100644 --- a/docs/recipe_databases_configs.md +++ b/docs/recipe_databases_configs.md @@ -14,6 +14,7 @@ As the database URL contains a username and password, we don't want to have it d Instead, we have: ```yaml +# backend/config.yaml DatabaseConfig: &DatabaseConfig database_url: {{ DATABASE_URL }} ``` diff --git a/docs/recipe_embedding_models_configs.md b/docs/recipe_embedding_models_configs.md index 034a7df..915f769 100644 --- a/docs/recipe_embedding_models_configs.md +++ b/docs/recipe_embedding_models_configs.md @@ -1,6 +1,23 @@ +## Locally hosted embedding model from Hugging Face + +This will download the selected model from the HF hub and make embeddings on the machine the backend is running on. +```shell +pip install sentence_transformers +``` + +```yaml +# backend/config.yaml +EmbeddingModelConfig: &EmbeddingModelConfig + source: HuggingFaceEmbeddings + source_config: + model_name : 'BAAI/bge-base-en-v1.5' +``` + + ## Artefact Azure-hosted embedding model ```yaml +# backend/config.yaml EmbeddingModelConfig: &EmbeddingModelConfig source: OpenAIEmbeddings source_config: @@ -10,3 +27,20 @@ EmbeddingModelConfig: &EmbeddingModelConfig deployment: embeddings chunk_size: 500 ``` + +## AWS Bedrock + +!!! info "You will first need to login to AWS" + + ```shell + pip install boto3 + ``` + [Follow this guide to authenticate your machine](https://docs.aws.amazon.com/cli/latest/userguide/cli-authentication-user.html) + +```yaml +# backend/config.yaml +EmbeddingModelConfig: &EmbeddingModelConfig + source: BedrockEmbeddings + source_config: + model_id: 'amazon.titan-embed-text-v1' +``` \ No newline at end of file diff --git a/docs/recipe_llms_configs.md b/docs/recipe_llms_configs.md index b52e079..2d0a744 100644 --- a/docs/recipe_llms_configs.md +++ b/docs/recipe_llms_configs.md @@ -1,6 +1,7 @@ ## Artefact Azure-hosted GPT4-turbo ```yaml +# backend/config.yaml LLMConfig: &LLMConfig source: AzureChatOpenAI source_config: @@ -24,6 +25,7 @@ LLMConfig: &LLMConfig ``` ```yaml +# backend/config.yaml LLMConfig: &LLMConfig source: ChatOllama source_config: @@ -42,10 +44,10 @@ LLMConfig: &LLMConfig ``` !!! info "" - - [Activate the Vertex APIs in your project](https://console.cloud.google.com/vertex-ai) + Activate the Vertex APIs in your project ```yaml +# backend/config.yaml LLMConfig: &LLMConfig source: ChatVertexAI source_config: diff --git a/docs/recipe_vector_stores_configs.md b/docs/recipe_vector_stores_configs.md index bb79a31..efb0d17 100644 --- a/docs/recipe_vector_stores_configs.md +++ b/docs/recipe_vector_stores_configs.md @@ -9,6 +9,7 @@ pip install psycopg2-binary pgvector ``` ```yaml +# backend/config.yaml VectorStoreConfig: &VectorStoreConfig source: PGVector source_config: @@ -32,6 +33,7 @@ VectorStoreConfig: &VectorStoreConfig ## Local Chroma ```yaml +# backend/config.yaml VectorStoreConfig: &VectorStoreConfig source: Chroma source_config: