From 73f71c2438782595c4677ca4a2cac1caebc1b70a Mon Sep 17 00:00:00 2001 From: Laure-di Date: Tue, 24 Sep 2024 16:10:24 +0200 Subject: [PATCH] configure dev env part --- tutorials/how-to-implement-rag/index.mdx | 45 +++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tutorials/how-to-implement-rag/index.mdx b/tutorials/how-to-implement-rag/index.mdx index a5c48231e2..7413da1470 100644 --- a/tutorials/how-to-implement-rag/index.mdx +++ b/tutorials/how-to-implement-rag/index.mdx @@ -2,6 +2,11 @@ meta: title: How to implement RAG with managed inference description: +content: + h1: How to implement RAG with managed inference +tags: inference managed postgresql pgvector object storage +categories: + - inference --- RAG (Retrieval-Augmented Generation) is a powerful approach for enhancing a model's knowledge by leveraging your own dataset. @@ -14,4 +19,42 @@ By utilizing our managed inference services, managed databases, and object stora - [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/): Set up an inference deployment using [sentence-transformers/sentence-t5-xxl](/ai-data/managed-inference/reference-content/sentence-t5-xxl/) on an L4 instance to efficiently process embeddings. - [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/) with the model of your choice. - [Object Storage Bucket](/storage/object/how-to/create-a-bucket/) to store all the data you want to inject into your LLM model. -- [Managed Database](/managed-databases/postgresql-and-mysql/how-to/create-a-database/) to securely store all your embeddings. \ No newline at end of file +- [Managed Database](/managed-databases/postgresql-and-mysql/how-to/create-a-database/) to securely store all your embeddings. + +## Configure your developement environnement +1. Install necessary packages: run the following command to install the required packages: + ```sh + pip install langchain psycopg2 python-dotenv scaleway + ``` +2. Configure your environnement variables: create a .env file and add the following variables. These will store your API keys, database connection details, and other configuration values. + ```sh + # .env file + + # Scaleway API credentials + SCW_ACCESS_KEY=your_scaleway_access_key + SCW_SECRET_KEY=your_scaleway_secret_key + SCW_API_KEY=your_scaleway_api_key + + # Scaleway project and region + SCW_DEFAULT_PROJECT_ID=your_scaleway_project_id + SCW_DEFAULT_REGION=your_scaleway_region + + # Scaleway managed database (PostgreSQL) credentials + SCW_DB_NAME=your_scaleway_managed_db_name + SCW_DB_USER=your_scaleway_managed_db_username + SCW_DB_PASSWORD=your_scaleway_managed_db_password + SCW_DB_HOST=your_scaleway_managed_db_host # The IP address of your database instance + SCW_DB_PORT=your_scaleway_managed_db_port # The port number for your database instance + + # Scaleway S3 bucket configuration + SCW_BUCKET_NAME=your_scaleway_bucket_name + SCW_BUCKET_ENDPOINT=your_scaleway_bucket_endpoint # S3 endpoint, e.g., https://s3.fr-par.scw.cloud + + # Scaleway Inference API configuration (Embeddings) + SCW_INFERENCE_EMBEDDINGS_ENDPOINT=your_scaleway_inference_embeddings_endpoint # Endpoint for sentence-transformers/sentence-t5-xxl deployment + SCW_INFERENCE_API_KEY_EMBEDDINGS=your_scaleway_api_key_for_embeddings + + # Scaleway Inference API configuration (LLM deployment) + SCW_INFERENCE_DEPLOYMENT_ENDPOINT=your_scaleway_inference_endpoint # Endpoint for your LLM deployment + SCW_INFERENCE_API_KEY=your_scaleway_api_key_for_inference_deployment + ``` \ No newline at end of file