Custom Models
You can incorporate any 3rd party OpenAI compatible LLM into RAG Chat. We will use Together AI in this tutorial. Check out Together AI API for more information about their models and pricing.
Install RAG Chat SDK
Initialize the project and install the required packages:
Setup Upstash Redis
Create a Redis database using Upstash Console or Upstash CLI and copy the UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
into your .env
file.
Setup Upstash Vector
Create a Vector index using Upstash Console or Upstash CLI and copy the UPSTASH_VECTOR_REST_URL
and UPSTASH_VECTOR_REST_TOKEN
into your .env
file.
Setup Together AI
Create a Together AI account and get an API key from Together AI API -> Settings -> API KEYS. Set your Together AI API key as an environment variable:
Setup the Project
Initialize RAGChat with custom model:
Add context to the RAG Chat:
Chat with the RAG Chat:
Run
Run the project: