Last updated October 23, 2026. We installed all 11 frameworks that day, ran the same agent job in each with internet access blocked, measured memory and disk use, and checked licenses, releases, and advisories.
The best open source AI agent frameworks you can self host in 2026 are Pydantic AI, LangGraph, and Microsoft Agent Framework, because all three run on your own servers with no vendor service in the loop and sent no data out in our test. Google ADK, Agno, and Haystack come next if you want a ready made API server for your agents.
Self hosting means more than a permissive license. You need a framework that works with a model you host, keeps state in a database you run, and does not phone home from inside your network. This guide sits in our agent frameworks hub, and our guide to the 12 best AI agent frameworks covers the wider field, including managed options.
On October 23, 2026 we installed 11 open source frameworks into clean environments, scanned every dependency, and ran one identical job five times in each against a local model server with all internet traffic refused and logged. No vendor paid for placement or reviewed this page, per our editorial standards and disclosure policy.
TL;DR
- All 11 frameworks completed the job offline in 5 of 5 runs, each with exactly 2 calls to the local model and 1 tool call, so every one of them can run without a cloud model.
- Four sent data out by default. CrewAI tried 8 telemetry connections per run, OpenAI Agents SDK tried 3 trace uploads, a Haystack Pipeline sent 3 analytics events, and Agno sent 1 call. Each stopped with one documented setting.
- Memory ranged from 59 MB to 190 MB for the same job. Microsoft Agent Framework was the leanest, and CrewAI and LlamaIndex used about three times as much.
- CrewAI is the heaviest install at 775 MB and 137 packages, with 6 known advisories in pinned dependencies. Pydantic AI, LangGraph, Microsoft Agent Framework, Agno, Haystack, LlamaIndex, and smolagents had none.
- Read the serving terms, not just the license. LangGraph’s library is MIT, but LangChain’s self hosted Agent Server needs a LangSmith license, while Agno’s AgentOS and Haystack’s Hayhooks are free to run yourself.
Self Hostable Open Source AI Agent Frameworks at a Glance
Every framework here is free to use, so the real differences are how you serve it, where state lives, and what it sends home. The table uses each project’s documentation and our own test on October 23, 2026, with memory measured as the median peak for the whole Python process.
| Framework | License | Serve it yourself with | State you run | Default outbound traffic | Peak memory |
|---|---|---|---|---|---|
| Pydantic AI | MIT | Your own app or worker | Temporal, DBOS, or Prefect | None | 75 MB |
| LangGraph | MIT | Your own app; Agent Server needs a license | SQLite or Postgres checkpointer | None | 90 MB |
| Microsoft Agent Framework | MIT | Your own app | Workflow checkpoints | None | 59 MB |
| Google ADK | Apache 2.0 | adk api_server, containers | Database session service | None | 96 MB |
| Agno | Apache 2.0 | AgentOS on FastAPI | Databases you configure | 1 telemetry call | 73 MB |
| Haystack | Apache 2.0 | Hayhooks | Redis checkpoints via Hayhooks | 3 events from a Pipeline | 92 MB |
| Strands Agents | Apache 2.0 | Docker, Kubernetes, EC2 | Session persistence | None | 102 MB |
| LlamaIndex | MIT | llamactl serve | Serialized workflow context | None | 179 MB |
| smolagents | Apache 2.0 | Your own app plus a sandbox | None built in | None | 72 MB |
| CrewAI | MIT | Your own app | Flow state persistence | 8 telemetry attempts | 190 MB |
Verdict: Choose Pydantic AI for typed Python services, LangGraph for complex stateful graphs, and Microsoft Agent Framework for the smallest footprint or .NET support. Pick Agno, Google ADK, or Haystack if you want a ready made agent API server, and leave CrewAI for teams that accept its weight in exchange for its crew model.
How We Chose and Tested These Frameworks
We started from code first open source AI agent frameworks with an OSI approved license, a release in the last six months, and support for any OpenAI compatible endpoint, which is how most teams reach vLLM, Ollama, or a gateway. That ruled out no code builders, hosted only platforms, and SDKs locked to one model vendor.
- Same job everywhere: a shop assistant calls one price lookup tool, then writes a one line summary. A local server played the model’s part with fixed replies, so every run was free, repeatable, and fully offline.
- Network check: DNS lookups were blocked and all traffic went through a logging proxy that refused every outside connection, so anything a framework tried to send showed up in the log.
- Resource check: peak resident memory of the whole process across five runs, median cold import time, and wall time from process start to exit.
- Install and dependency scan: package count and disk size after a clean
uv pip installinto Python 3.12, then a pip-audit scan of each environment. - Project health: GitHub stars, license, releases in the last 12 months, and last month’s PyPI downloads, all collected the same day.
We tested 11 frameworks and list 10. OpenAI Agents SDK passed the job but tried to upload 3 traces per run to api.openai.com by default, which its tracing docs describe, so it suits OpenAI users better than air gapped teams. TypeScript frameworks such as Mastra are out of scope for this Python test.
What Our October 23 Hands-On Test Found
Every framework finished the job offline, so a self hosted model works with all of them; the gaps were memory, install weight, and silent outbound traffic. Those three numbers decide how many agents fit on one node, how big your container images get, and whether your security team signs off.

- Leanest: Microsoft Agent Framework peaked at 59 MB with a 0.06 second import, then smolagents at 72 MB, Agno at 73 MB, and Pydantic AI at 75 MB.
- Heaviest: CrewAI at 190 MB and LlamaIndex at 179 MB, roughly three times the leanest options, which adds up when you run one agent process per tenant.
- Fastest full runs: Microsoft Agent Framework at 0.61 seconds, smolagents at 0.76, Haystack at 0.89, and Agno and Pydantic AI at about 0.9, against 1.13 seconds for LangGraph.
- Slowest: CrewAI took 12.83 seconds by default because it kept retrying blocked telemetry uploads, and 2.84 seconds once telemetry was off.

Blocked telemetry still costs time: behind a strict firewall, CrewAI spent about 10 extra seconds per run waiting on uploads that could never succeed. Haystack was a split case, since a standalone Agent sent nothing, but wrapping the same agent in a Pipeline sent 3 analytics events to PostHog.

Disk size matters for container builds, cold starts, and the number of packages your team must patch. CrewAI pulled in 137 packages, including a vector database and a machine learning runtime, while Microsoft Agent Framework needed 21 and Pydantic AI 26.
1. Pydantic AI: Best Overall for Self Hosted Python Agents

Pydantic AI is the best default for self hosting because it is light, sent nothing out, and hands long running state to engines you already operate. It peaked at 75 MB, installed 26 packages in 47 MB, and the scan found no advisories. The repository has 20,814 stars, and pydantic-ai-slim had 23.9 million downloads last month.
For agents that must survive restarts, the durable execution docs cover Temporal, DBOS, and Prefect, all of which you can run on your own servers. Agents are plain Python objects, so you serve them from FastAPI or a worker you already have, and send traces to any OpenTelemetry backend.
- Best for: Python teams that want typed agents inside services they already run.
- Self hosting (October 2026): no server component to license. You host the app, the model, and the durable engine.
- Watch out for: about 200 releases in 12 months, so pin versions, and a startup banner suggesting the paid Logfire service.
2. LangGraph: Best for Complex Stateful Graphs

LangGraph is the most downloaded framework here, at 44.8 million PyPI downloads last month, and the library itself runs anywhere with no account. It peaked at 90 MB, installed 46 packages in 77 MB with the SQLite checkpointer, and made no outside connections. Its persistence layer saves a checkpoint at every step, so you can resume, inspect, and replay runs from your own database.
The catch is the server. LangChain’s deployment docs say a standalone Agent Server runs on Docker or Kubernetes with your own PostgreSQL and Redis, but needs a LangSmith license, and the self hosted control plane requires the Enterprise plan. Many teams skip both and wrap the graph in their own FastAPI service.
- Best for: teams that need explicit graphs, checkpoints, and human approval steps.
- Self hosting (October 2026): the MIT library is free to embed. The packaged Agent Server and control plane are licensed through LangSmith.
- Watch out for: the gap between the free library and the paid server, and LangSmith tracing if you turn it on.
3. Microsoft Agent Framework: Best Lightweight Option and .NET Support

Microsoft Agent Framework had the smallest footprint in our test: 21 packages, 37 MB on disk, 59 MB peak memory, and a 0.61 second run. The repository describes graph based workflows with checkpointing, streaming, human in the loop, and time travel, in Python and .NET. It has 14,286 stars and shipped version 1.23.0 on October 22, 2026.
The overview docs list Ollama alongside cloud providers, so a local model works without extra adapters. Foundry Hosted Agents is an optional managed home on Azure, but nothing in the core package needs it, and our run sent no traffic out.
- Best for: .NET shops, teams leaving AutoGen, and anyone packing many agents onto one node.
- Self hosting (October 2026): no server to license. Bring your own host, model, and checkpoint storage.
- Watch out for: an Azure first set of samples, and a split between the core package and many optional connector packages.
4. Google ADK: Best Built In API Server

Google ADK ships a ready made REST server, so one command turns an agent folder into an API you can put behind your own gateway. The API server docs show adk api_server running locally on port 8000, and the sessions docs offer a database session service for state you host yourself.
ADK peaked at 96 MB, installed 48 packages in 71 MB, and sent nothing out. pip-audit flagged one advisory in the pinned opentelemetry-api 1.42.1. The deployment guide favors Cloud Run, GKE, and Google’s Agent Platform, but containers run anywhere, and ADK requires Python 3.11 or later.
- Best for: teams that want an agent API and dev UI without writing the service layer.
- Self hosting (October 2026): free under Apache 2.0, with a built in server and database backed sessions.
- Watch out for: Google Cloud defaults in the deploy docs and the OpenTelemetry advisory until the pin moves.
5. Agno: Best Full Agent Runtime You Own

Agno pairs a Python SDK with AgentOS, a FastAPI runtime that serves agents as an API in your own infrastructure. The AgentOS docs say it runs in your infrastructure and writes state to databases you configure, while the optional control plane connects from your browser straight to your endpoint. The repository has 42,873 stars.
Agno was light at 73 MB peak and 0.9 seconds per run, but it sent one call to os-api.agno.com per run. Its telemetry docs confirm telemetry is on by default and that AGNO_TELEMETRY=false turns it off, which dropped peak memory to 68 MB in our test.
- Best for: teams that want sessions, approvals, and an agent API without building them.
- Self hosting (October 2026): free under Apache 2.0. AgentOS runs on your servers, and the hosted control plane is optional.
- Watch out for: telemetry on by default and about 142 releases in 12 months.
6. Haystack: Best for Retrieval Heavy Agents Served Over HTTP

Haystack is the oldest project here, started in 2019, and its Hayhooks server turns pipelines and agents into REST, OpenAI compatible, and MCP endpoints you run yourself. The Hayhooks README also lists checkpoints in Redis, human approval, and recovery after restarts. The Haystack repository has 26,816 stars and shipped 3.4.1 on October 21, 2026.
A standalone Haystack Agent sent nothing in our test, but the same agent inside a Pipeline sent 3 events to eu.i.posthog.com. The telemetry docs explain that an event fires each time a component is initialized, and HAYSTACK_TELEMETRY_ENABLED=False brought the count to zero.

- Best for: teams whose agents search and reason over documents and need an HTTP front end.
- Self hosting (October 2026): free under Apache 2.0, including Hayhooks. deepset’s enterprise platform is optional.
- Watch out for: Pipeline telemetry on by default, Python 3.11 or later, and 566,000 downloads last month, far fewer than the leaders.
7. Strands Agents: Best for Container and Kubernetes Deployments

Strands Agents has the most complete production guide of the group, with deployment pages for Docker, Kubernetes, EC2, Fargate, and Lambda. The Operating Agents in Production page covers tool management, security, execution limits, and observability, and strands-agents had 37.1 million downloads last month, second only to LangGraph.
It peaked at 102 MB, installed 54 packages in 88 MB, and sent nothing out. pip-audit flagged MCP 2.1.1 for a session cleanup advisory in stateful HTTP servers, so check that pin if you expose MCP servers. The repository has 8,933 stars.
- Best for: platform teams that ship agents as containers on Kubernetes or AWS.
- Self hosting (October 2026): free under Apache 2.0. Bedrock AgentCore is an optional managed runtime.
- Watch out for: AWS flavored defaults and the MCP advisory.
8. LlamaIndex: Best for Agents Over Your Own Data

LlamaIndex gives you the widest set of data connectors and a CLI that serves workflows as an API on your own machine. The llamactl docs say llamactl serve installs dependencies, reads the configured workflows, and serves them as an API, while cloud deployments are optional and marked beta.
It was one of the heavier options at 179 MB peak, 194 MB on disk, and 2.33 seconds per run, with no outbound traffic and no advisories. The core repository has 52,636 stars but now calls itself a document processing platform, and llama-index-core shipped only 19 releases in 12 months, with workflows moving to the llama-agents repository.
- Best for: teams building retrieval heavy agents over internal documents.
- Self hosting (October 2026): free under MIT.
llamactl serveruns locally, and LlamaCloud is optional. - Watch out for: high memory use, a split between core and workflow packages, and a company focus shifting to document processing.
9. smolagents: Best Minimal Framework for Code Agents

smolagents keeps the whole agent loop in about 1,000 lines of code, and its agents write their actions as Python rather than JSON tool calls. It was light at 72 MB peak and 0.76 seconds per run, with 35 packages, no outbound traffic, and no advisories. The repository has 30,009 stars.
Code agents need a sandbox. The secure execution docs warn that no local Python sandbox is fully secure and point to Docker, E2B, Modal, and Blaxel, so self hosters should plan on Docker. The last release, 1.26.0, shipped on May 29, 2026, one of only 4 releases in 12 months.
- Best for: researchers and small teams who want readable code agents and full control.
- Self hosting (October 2026): free under Apache 2.0, with Docker as the self hosted sandbox option.
- Watch out for: a slow release pace, no built in state store, and sandboxing work you must own.
10. CrewAI: Best for Role Based Crews If You Accept the Weight

CrewAI is the most starred framework here, at 60,026 stars, but it was also the heaviest to self host in every measure we took. It installed 137 packages in 775 MB, peaked at 190 MB, and its pinned ChromaDB, MCP, and uv versions carried 6 known advisories in our scan.
By default it tried 8 connections to telemetry.crewai.com per run. The telemetry docs describe the opt out, and setting CREWAI_DISABLE_TELEMETRY=true with OTEL_SDK_DISABLED=true cut traffic to zero and run time from 12.83 to 2.84 seconds. The repository shipped more than 300 releases in 12 months.
- Best for: teams that want role based crews and Flows and can absorb a large image.
- Self hosting (October 2026): free under MIT. The CrewAI platform is a separate managed product.
- Watch out for: telemetry on by default, the install size, and the pinned dependency advisories.
Maintenance and Security Compared
LangGraph, Strands, and Pydantic AI lead on downloads, and only three frameworks shipped pinned dependencies with known advisories. The table uses GitHub, PyPI, and pypistats data plus our pip-audit scans, all collected on October 23, 2026. Stars show interest, but downloads and release pace say more about real production use.
| Framework | GitHub stars | Releases, last 12 months | Downloads, last month | Known advisories |
|---|---|---|---|---|
| Pydantic AI | 20,814 | 200 | 23.9 million (slim) | 0 |
| LangGraph | 43,776 | 47 | 44.8 million | 0 |
| Microsoft Agent Framework | 14,286 | 61 | 1.0 million (core) | 0 |
| Google ADK | 21,978 | 63 | 10.1 million | 1, in opentelemetry-api |
| Agno | 42,873 | 142 | 1.8 million | 0 |
| Haystack | 26,816 | 85 | 566,000 | 0 |
| Strands Agents | 8,933 | 56 | 37.1 million | 1, in MCP |
| LlamaIndex (core) | 52,636 | 19 | 6.6 million | 0 |
| smolagents | 30,009 | 4 | 426,000 | 0 |
| CrewAI | 60,026 | 305 | 2.4 million | 6, in ChromaDB, MCP, and uv |
Release pace cuts both ways. Very fast projects such as CrewAI and Pydantic AI fix bugs quickly but need pinned versions and a test run before each upgrade, while smolagents and LlamaIndex core change slowly, which is stable but can leave fixes waiting.
Service layers need the same scrutiny as the framework core. AgentScope, which this guide does not rank, received three CVEs on November 5, 2026, and its 2.0.11 agent service still trusts a caller-supplied user header and spawns any stdio MCP command it is sent. Our AgentScope 2.0.11 vulnerability test covers what to block before you expose any self-hosted agent API.
Settings for Running Fully Offline
These are the settings that brought our proxy log to zero connections without changing the output or the two model calls. Each comes from the vendor’s own documentation. Put them in your base image so every container starts quiet, then confirm with a logging proxy after each upgrade.
# CrewAI 1.15.28
export CREWAI_DISABLE_TELEMETRY=true
export OTEL_SDK_DISABLED=true
# Agno 3.1.9 (AgentOS also takes telemetry=False)
export AGNO_TELEMETRY=false
# Haystack 3.4.1 Pipelines
export HAYSTACK_TELEMETRY_ENABLED=False
# OpenAI Agents SDK 0.24.0, if you use it with a local model
export OPENAI_AGENTS_DISABLE_TRACING=1
# Point every framework at your own model server
export OPENAI_BASE_URL=http://models.internal:8000/v1
If you still want traces, send OpenTelemetry spans to a backend you host, using our open source LLM observability guide or the Arize Phoenix vs Langfuse vs Helicone comparison. Putting one of the LLM gateways we compared in front of your model servers also gives you one place for keys, limits, and cost tracking.
Which Self Hosted Framework Should You Choose?
Match your team to a profile below, then repeat our test with your own job, your own model, and a logging proxy before you commit. Each profile names a first choice, a fallback, and the next check to run, so you can shortlist two frameworks in an afternoon.
Python product teams shipping agent features
- Start with Pydantic AI, and add Temporal or DBOS when runs must survive restarts.
- Use LangGraph instead when your flows need explicit branches, loops, and replayable checkpoints.
- Score answers before launch with our AI agent evaluation tools guide.
Platform teams running many agents per node
- Choose Microsoft Agent Framework or Agno for the lowest memory per process.
- Use Strands Agents if your deployment target is Kubernetes or AWS containers.
- Track the whole fleet from our agent observability hub.
Teams that want an agent API without building one
- Pick Google ADK for a built in REST server, or Agno for AgentOS with sessions and approvals.
- Pick Haystack with Hayhooks if your agents are mostly retrieval over documents.
- Expose tools over the Model Context Protocol and review our MCP security tools guide.
Regulated or air gapped environments
- Favor frameworks with no default outbound traffic and no advisories, such as Pydantic AI, LangGraph, and Microsoft Agent Framework.
- Mirror packages internally and scan them, as the LiteLLM incident showed.
- Read the LiteLLM supply chain compromise write up and test tool misuse with our AI agent testing tools guide.
Frequently Asked Questions
What is the best open source AI agent framework to self host?
Pydantic AI is the best overall pick for self hosted Python agents because it is light, sent no data out in our test, and works with durable engines you can run yourself. LangGraph is better for complex stateful graphs, and Microsoft Agent Framework had the smallest memory and disk footprint of the 11 we tested.
Can these agent frameworks run with a local or self hosted model?
Yes. All 11 frameworks we tested completed the same tool calling job against a local OpenAI compatible server with internet access blocked, each making exactly two model calls. That means you can pair any of them with vLLM, Ollama, or another model server inside your own network.
Which open source agent frameworks send telemetry by default?
In our October 2026 test, CrewAI tried eight telemetry connections per run, OpenAI Agents SDK tried three trace uploads, a Haystack Pipeline sent three analytics events, and Agno sent one call. Pydantic AI, LangGraph, Microsoft Agent Framework, Google ADK, Strands Agents, LlamaIndex, and smolagents sent nothing with default settings.
Is LangGraph free to self host?
The LangGraph library is MIT licensed and free to run inside your own application with a SQLite or Postgres checkpointer. LangChain’s packaged Agent Server is different: its standalone mode needs a LangSmith license, and the self hosted control plane requires the Enterprise plan, so many teams wrap graphs in their own FastAPI service.
How much memory does an AI agent framework need?
For a simple one tool agent, peak memory in our test ranged from 59 MB for Microsoft Agent Framework to 190 MB for CrewAI. Most frameworks sat between 72 MB and 102 MB. Real agents with larger prompts, retrieval, and more tools will use more, so measure your own workload before you size servers.
Related Guides
Self-hosting a crew-style setup without CrewAI? Our CrewAI alternatives ranking compares open source options such as LangGraph, Pydantic AI, Agno and AG2 on dependencies and what leaves the process by default.
Self-hosting open source frameworks is one path; picking among TypeScript options is another. Our Mastra vs Vercel AI SDK vs LangGraph.js comparison covers which of the three fits lean web agents versus durable graphs.
Self-hosting open source is one path; staying inside Microsoft’s family is another. Our Microsoft Agent Framework vs Semantic Kernel vs AutoGen comparison covers support status and the AutoGen migration path.
Self-hosting open source is one path; staying in TypeScript is another. Our 10 best TypeScript AI agent frameworks test ranks Node.js frameworks by setup, streaming and tool calling.
Self-hosting is one filter; multi-agent orchestration is another. Our 10 best multi-agent frameworks test ranks frameworks by call count, prompt traffic and default context sharing.
For related coverage, see our LangGraph alternatives guide, LangChain vs LangGraph vs Deep Agents comparison, LangGraph vs CrewAI vs AutoGen comparison and OpenAI Agents SDK vs Claude Agent SDK vs Google ADK comparison.
Read the agent frameworks hub, 12 best AI agent frameworks, AgentOps hub, agent observability coverage, AI agent observability tools, open source LLM observability, LangSmith alternatives, AI agent evaluation tools, AI agent testing tools, LLM gateways, prompt management tools, MCP hosting platforms, and Cloudflare vs Vercel vs AgentCore. Notes on how we work sit on editorial standards, disclosure, and contact.
The Bottom Line
For most teams, Pydantic AI, LangGraph, and Microsoft Agent Framework are the safest open source AI agent frameworks to self host, with no default outbound traffic and no known advisories. Add Agno, Google ADK, or Haystack when you want a ready made server, and set the telemetry switches before anything reaches production.
These projects release often, so rerun a logged test after each upgrade and check this page for updates. Send corrections or your own results through our contact page.

