Open curriculum · verified editionContribute on GitHub
Setup2 min352 words

Environment Setup

Copy the template and fill in only the keys you will use in each module:

SourceImprove this page

1. Python and Dependencies#

Requires Python ≥ 3.12 and uv.

cd llm-engineering-program
uv sync            # crea .venv e instala todas las dependencias
source .venv/bin/activate

Alternative without uv:

python3 -m venv .venv && source .venv/bin/activate
pip install -e .

2. API Keys#

Copy the template and fill in only the keys you will use in each module:

cp setup/.env.example .env
Variable Where to get it Used from
OPENAI_API_KEY platform.openai.com Module 1
ANTHROPIC_API_KEY console.anthropic.com Module 1
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION AWS Console (IAM) Module 1 (Bedrock)
COHERE_API_KEY dashboard.cohere.com Module 3 (rerank)
LANGSMITH_API_KEY smith.langchain.com Modules 4–6

The labs load .env with python-dotenv. Never upload .env to the repo (it is already in .gitignore).

3. Estimated API Costs#

Cost depends on the current catalog and pricing. The August 2026 examples use gpt-5.6-luna and claude-haiku-4-5 for volume, reserving higher tiers for justified comparisons. Check the official price before each run and set a budget; modules 3–5 also include offline workflows or local models with Ollama.

4. Optional Local Services#

  • Ollama (brew install ollama) — local models for deployment labs and for working without API costs.
  • Docker Desktop — required in module 5 (containers) and for local Qdrant/pgvector in module 3.
  • Node ≥ 20 — only for the Next.js frontend in module 3.

5. Verification#

python setup/check_env.py

Check the Python version, installed dependencies, and which API keys are configured.

6. Instructor Compatibility#

The main environment sets the current OpenAI SDK 3.x. Instructor 1.15.4, the version current as of 21-08-2026, declares openai<3 and rich<15; installing it in the same environment would make the lock unresolvable. The structured outputs lab uses the native API by default and keeps the comparison with Instructor in an isolated process:

uv run --no-project \
  --with-requirements setup/requirements-instructor.txt \
  python modulo-02-prompt-engineering/labs/05_structured_outputs_instructor.py \
  --backend instructor

This does not change the model (OPENAI_MODEL=gpt-5.6-luna); it only isolates incompatible SDK versions. The requirements file makes the decision reproducible.

RAGAS 0.4.3 pulls the same dependency. Additionally, langchain-community<0.4 is pinned: RAGAS still imports chat_models.vertexai, a module removed in the 0.4.x branch. Its live mode runs in an isolated manner with lexical retrieval to avoid mixing a second embedding stack:

uv run --no-project \
  --with-requirements setup/requirements-ragas.txt \
  python modulo-03-rag/labs/06_evaluacion_ragas.py \
  --ragas --lexical --limit 5

The --offline mode of the lab belongs to the main environment and does not require RAGAS or API keys.

Reviewed August 23, 2026

This content comes from the public curriculum and retains its editorial history.

Created and reviewed by

Found something outdated or improvable?

setup/README.md

Propose an improvement