← Back to hub
Models — Claude, OpenAI, Groq, Ollama
In one line
One helper loads any model brain. Swap one string to change providers.
Key idea
init_chat_model gives a unified interface. Same agent code, different model.
In 1.0 every model returns the same shape via response.content_blocks.
| Provider | Good for | Install | name |
|---|---|---|---|
| Anthropic (Claude) | Strong reasoning, agents | langchain-anthropic | anthropic |
| OpenAI | General use | langchain-openai | openai |
| Groq | Very fast, cheap | langchain-groq | groq |
| Ollama | Local, private, offline | langchain-ollama | ollama |
from langchain.chat_models import init_chat_model
model = init_chat_model("claude-sonnet-4-6", model_provider="anthropic")
Tip. Build with cheap Groq, run private data on Ollama, switch to Claude for hard tasks. Same code.
Links
My notes
Add your own findings here as you learn.