Installation and setup
LangGraph installs with pip. The course runs on a stand-in chat model, and a free Groq or Gemini key is enough when you move to a hosted one.
langgraph 1.2.11 and langchain 1.4.0
Two packages are needed: langgraph runs your graphs, and langchain provides the chat models, message types and tools used from lesson 13 onwards. LangGraph pulls in part of LangChain by itself, but not the part lesson 30 needs. The versions are pinned so your output matches the lessons.
pip install "langgraph==1.2.11" "langchain==1.4.0"Check that Python finds the installed version:
from importlib.metadata import version
print(version("langgraph"))A hosted chat model for lesson 31Optional
Lessons 2 to 14 are plain Python and LangGraph, and from lesson 15 the course uses a stand-in chat model you write yourself. Lesson 31 loads a hosted model with init_chat_model. Each provider needs its LangChain package and a key.
| Provider | Key | Variable | Package and model string |
|---|---|---|---|
| Groq | Free, console.groq.com/keys | GROQ_API_KEY | langchain-groq, "groq:openai/gpt-oss-120b" |
| Gemini | Free, aistudio.google.com/apikey | GOOGLE_API_KEY | langchain-google-genai, "google_genai:gemini-2.5-flash" |
| OpenRouter | Free models end in :free, openrouter.ai/keys | OPENROUTER_API_KEY | langchain-openrouter, "openrouter:google/gemma-4-31b-it:free" |
| OpenAI | Paid, platform.openai.com/api-keys | OPENAI_API_KEY | langchain-openai, "openai:gpt-4o-mini" |
pip install langchain-groqexport GROQ_API_KEY=gsk_...from langchain.chat_models import init_chat_model
model = init_chat_model("groq:openai/gpt-oss-120b")langgraph dev, in lesson 36, reads keys from a .env file in the project folder. List .env in .gitignore so a key never reaches a repository.
# .env
GROQ_API_KEY=gsk_...
LANGSMITH_API_KEY=your-key-here
LANGSMITH_TRACING=trueLangSmith tracingOptional
LangSmith, LangChain's hosted tracing service, is optional. Lesson 37 turns it on with two variables, LANGSMITH_TRACING=true and LANGSMITH_API_KEY, using a key from your LangSmith account settings.
- Run
pip show langgraphand compare the version with the one printed above.
Little by little, you're building something great.