Skip to main content
Prerequisite: Please install python (version 3.10 or higher) before proceeding.

Step 1. Install chatformers

Step 2. Get API Keys first. Lets assume you are using model from GRQO (https://console.groq.com/docs/openai):

Step 2. Imports

You can use other openai compaitable llm also if required.
python
python
from groq import Groq client = Groq( api_key=os.environ.get(“GROQ_API_KEY”), )

Step 3. Setup Variables

python

Step 4. Setup LLM Client

python

Step 5. Set Config

Check documentation for other supported vectorstore, embedding model and LLM model
This is the example of chromadb as vector store, ollama as embedding model and groq as LLM. You can use other supported vectorstore, embedding model and LLM model-
python

Step 6. Initilize Chatbot-

python

Step 7. Add Memories-

Here’s how to solve some common problems when working with the CLI.
python

Step 8. Add Buffer window / Sliding Chat Memory-

python

Step 9. Chat-

python

Step 10. Optional-

python

Complete Code-

python
Output Looks like-