RAGASragas 0.4.3 · Python 3.10+
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
28 small wins to finish your pathNext lesson →

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

Example
from importlib.metadata import version

print(version("ragas"))
print(version("google-genai"))

RAGAS also sends anonymous usage data. Set RAGAS_DO_NOT_TRACK=true in your environment to turn it off.

The keys the evaluation app asks for · from the Complete AI Security Course In 8 Hours · 162:55 to 165:46

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.

VariableNeeded?What uses itGet it
GROQ_API_KEYYesThe app's answers, and the judgeconsole.groq.com/keys
GOOGLE_API_KEYYesGemini embeddings for the app's search and for two metricsaistudio.google.com/apikey
JUDGE_GROQOptionalA second Groq key only for the judge; without it the judge uses GROQ_API_KEYconsole.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.

bash
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.

ExampleAPI key
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")
  • The first line is Groq's reply, so GROQ_API_KEY works 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_KEY works.

pip vs uv vs Colab

pipuvColab
Installs intoThe active Python environmentThe project's own environmentThe notebook's runtime
Keys set withexport or $env:export or $env:Secrets and userdata.get
Best forA quick startA project you keepNothing installed on your machine
Watch out. Groq's free tier limits tokens per minute and per day, and RAGAS makes many judge calls. If a run stops with a 429 error, you hit the minute limit; Rate limits and cooldowns shows the fix the video uses.
Try it yourself
  • Run the version check and confirm RAGAS is 0.4.3.
  • Install langchain-community 0.4 in a throwaway environment, run import ragas, and read the error the pin prevents.
  • Change the Groq prompt to Reply with the single word: judge and run the key check again.

Little by little, you're building something great.