1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
43 small wins to finish your pathNext lesson →
Installation and setup
One pip install brings the framework, its core types and the runtime under its agents. Provider packages come later, when a hosted model replaces the one you write.
langchain 1.4.2
The langchain package brings langchain-core, which holds the message types and the base classes every model builds on, and langgraph, which runs the agent loop.
pip install "langchain==1.4.2"Check which version Python finds:
from importlib.metadata import version
print(version("langchain"))
print(version("langchain-core"))Lessons 26 and 29 install what they need when they need it: a text splitter, numpy and MCP support.
Keys, for when you want a hosted modelOptional
Every lesson runs on a stand-in model you write in lesson 3. To use a hosted model instead, install its provider package and set its key as an environment variable. Lesson 33 makes the switch with init_chat_model.
| 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" |
pip install "langchain-groq==1.1.3"export GROQ_API_KEY=gsk_...Try it yourself
- Run
pip show langchainand findlanggraphin itsRequiresline.
Little by little, you're building something great.