Installation and setup
RAGAS installs from PyPI with pip, and its judged metrics need an API key for a hosted model: this course uses free keys from Groq and Google Gemini.
Last updated: 29 Sep, 2026 · RAGAS 0.4.3
You need Python 3.10 or later. Check yours with python --version. Then install three packages: RAGAS itself, a version of LangChain Community that RAGAS 0.4.3 can import, and Google's google-genai for Gemini embeddings.
Installing RAGAS with pip, uv or Colab
pip install "ragas==0.4.3" "langchain-community<0.4" "google-genai==2.25.0"The langchain-community pin matters. RAGAS 0.4.3 imports a Vertex AI class that langchain-community removed in its 0.4 release, so with the newest version import ragas stops with ModuleNotFoundError: No module named 'langchain_community.chat_models.vertexai'. The openai package, which the judge and the app use to talk to Groq, comes with RAGAS.
Checking the installed versions
from importlib.metadata import version
print(version("ragas"))
print(version("google-genai"))0.4.3 2.25.0
RAGAS also sends anonymous usage data. Set RAGAS_DO_NOT_TRACK=true in your environment to turn it off.
Getting a Groq key and a Gemini key
The video's app asks for a Groq key, an optional second Groq key for the judge, and a Gemini key. The judge makes many calls, so a separate judge key keeps those calls from using up the key the app answers with. The video also gives one piece of advice: judge with a different model, ideally from a different provider, than the one that wrote the answers, because a model tends to favour text like its own. The video says the app answers with Gemini; the app's code in the repository answers with Groq and uses Gemini for embeddings, and that is the split this course follows.
Then it creates both keys. For Gemini, open Google AI Studio, choose Get API key, create a key and copy it. For Groq, open the Groq console, go to API Keys, create a key with a name and an expiry, and copy it.
| Variable | Needed? | What uses it | Get it |
|---|---|---|---|
GROQ_API_KEY | Yes | The app's answers, and the judge | console.groq.com/keys |
GOOGLE_API_KEY | Yes | Gemini embeddings for the app's search and for two metrics | aistudio.google.com/apikey |
JUDGE_GROQ | Optional | A second Groq key only for the judge; without it the judge uses GROQ_API_KEY | console.groq.com/keys |
The video's app names the Gemini key GEMINI_API_KEY. The google-genai client reads either name; this course uses GOOGLE_API_KEY.
Setting the keysRequired
export GROQ_API_KEY=gsk_...
export GOOGLE_API_KEY=AIza...A second key for the judgeOptional
If you have a second Groq account, set its key as JUDGE_GROQ, the name the video's app uses. The judge file in LLM as a judge reads it first and falls back to GROQ_API_KEY.
export JUDGE_GROQ=gsk_...Checking both keys with a real call
One call to Groq and one to Gemini. If either key is missing or wrong, this is where you find out.
import os
from google import genai
from openai import OpenAI
groq = OpenAI(api_key=os.environ["GROQ_API_KEY"], base_url="https://api.groq.com/openai/v1")
reply = groq.chat.completions.create(
model="openai/gpt-oss-20b",
messages=[{"role": "user", "content": "Reply with the single word: ready"}],
)
print(reply.choices[0].message.content)
gemini = genai.Client()
result = gemini.models.embed_content(model="gemini-embedding-2", contents=["TechNest return policy"])
print(len(result.embeddings[0].values), "numbers in one Gemini embedding")ready 3072 numbers in one Gemini embedding
- The first line is Groq's reply, so
GROQ_API_KEYworks and the model the judge uses answers. - The second line is the length of one Gemini embedding: the list of numbers the app's search compares. It proves
GOOGLE_API_KEYworks.
pip vs uv vs Colab
| pip | uv | Colab | |
|---|---|---|---|
| Installs into | The active Python environment | The project's own environment | The notebook's runtime |
| Keys set with | export or $env: | export or $env: | Secrets and userdata.get |
| Best for | A quick start | A project you keep | Nothing installed on your machine |
429 error, you hit the minute limit; Rate limits and cooldowns shows the fix the video uses.Related
- Previous: RAGAS overview
- Next: LLM evaluation
- Reference: Installation
- Run the version check and confirm RAGAS is 0.4.3.
- Install
langchain-community0.4 in a throwaway environment, runimport ragas, and read the error the pin prevents. - Change the Groq prompt to
Reply with the single word: judgeand run the key check again.
Little by little, you're building something great.