Fini Python ? Agents prêts pour la prod avec Mastra et Vercel AI SDK
Guide Mastra + Vercel AI SDK pour des agents TypeScript en production. Mastra, AI SDK. Voir OpenClaw + Ollama, iOS sans Mac, mémoire LLM, Hermes + Ollama.
Divulgation : location Mac optionnelle via VpsGona.
Pourquoi TypeScript
Studio sur localhost:4111. ToolLoopAgent : 20 étapes par défaut—fixez stepCountIs(N).
Python vs TS
| Axe | Python | TypeScript |
|---|---|---|
| Axe | Python | TypeScript |
| Runtime | venv | Node 20+ |
| Types | Pydantic | Zod partagé |
| UI | SSE custom | AI SDK stream |
| Cible | ML | Produits web |
Architecture
npm create mastra@latest ; ToolLoopAgent + createAgentUIStreamResponse.
Mastra (8 étapes)
- Node 20+
npm create mastra@latest- Assistant
src/mastra/.envnpm run dev- Outils Zod
- Déploiement
AI SDK (6 étapes)
- Next.js 15
npm install ai @ai-sdk/openai zod- Agent
- Route API
useChat- Prod : limites
Choix
Nouveau produit → Mastra. Feature SaaS → AI SDK.
Dépannage
Boucle infinie
Réduire stepCountIs.
Studio KO
Port 4111, Node 20+.
FAQ
Do I need Python for Mastra or Vercel AI SDK?
No for the app layer—both run on Node.js 20+. Python may remain for offline ML only.
What Node version is required?
Mastra targets Node 20+. Match dev and CI.
What is the default ToolLoopAgent step limit?
Up to 20 steps unless you set stopWhen: stepCountIs(N).
Where does Mastra Studio run?
Typically http://localhost:4111 after npm run dev.
Can I use local Ollama?
Yes via OpenAI-compatible endpoints; see our OpenClaw + Ollama and Hermes guides for local stacks.