Self-hosted AI agents

Run n8n or Dify if you want a platform with a visual builder; reach for LangGraph, CrewAI, or smolagents if you want a framework in code. Pair either with a model that documents tool-use support, then test it against your tools and failure cases. The rest of this page is the part the tutorials skip: what fails, what gets broken into, and when the honest answer is a cron job.

Updated July 11, 2026

Flat illustration of a llama puppeteer holding a marionette control bar with strings leading to three small llamas performing tasks below

The platforms

n8n logo

A workflow automation platform with agent nodes and visual graphs. A practical choice when agents need to touch systems such as mail, calendars, and databases.

Dify logo

A full LLM application platform: visual workflows, RAG pipelines, model routing, and an API layer, deployed with one Docker Compose file. Where teams build agent-backed apps rather than personal automations.

The frameworks

These frameworks are code-first building blocks rather than hosted platforms. Model-provider support and deployment requirements vary, so check each framework's integration documentation before choosing a local or hosted backend.

LangGraph logo

A code-first framework for durable, stateful agent workflows with explicit graphs, checkpoints, and human-in-the-loop gates.

CrewAI logo

Role-based multi-agent orchestration, with agents given goals and tools that collaborate like a small team. A concise starting point for a multi-agent prototype.

AutoGen (AG2) logo

A conversation-driven multi-agent framework for workflows where agents coordinate through messages and tools.

smolagents logo

A lightweight, code-first agent framework that can execute Python-based tools. A good fit for experiments and simple automations.

Tool calling is the gate

Tool calling depends on a model emitting a valid call and on the workflow handling failures safely. Test for malformed arguments, requests that are described instead of invoked, unexpected tool responses, and retries that repeat a failing call. These checks are more useful than assuming a model will behave consistently across tools or prompts.

There is no universal parameter-count, quantization, or hardware threshold for dependable tool use. Evaluate candidate models with representative tools, inputs, and recovery paths on the hardware you plan to run. The 8 GB VRAM guide covers local model-running considerations for a constrained GPU.

Your agent hub is a credential vault

A self-hosted automation platform holds working credentials for everything it automates, which makes it the most valuable box on your network to compromise. Keep the hub off the public internet or behind strong authentication, restrict access to stored credentials, and treat updates as security patches rather than feature releases.

The second exposure is prompt injection, and agents make it kinetic: an agent that reads untrusted content can be steered by it, and an agent with tools can act on the steering. Give agents the narrowest tools that do the job, isolate sensitive actions, and assume anything they read may be adversarial.

When a cron job wins

A practical rule: use a cron job or script when the inputs and steps are fixed. For work such as backups, certificate renewal, health checks, and log rotation, deterministic automation is usually easier to test and debug than a model-driven workflow. Agents are more worth considering when inputs are ambiguous, span messy sources, or require judgment that fixed rules cannot express. Deciding which kind of problem you have is most of the architecture.

Questions people actually ask

What hardware does an agent stack need?

Plan separately for orchestration, storage, tools, and the model. The model usually drives hardware needs. A hybrid setup can keep orchestration self-hosted while using a hosted model API; assess the resulting data flow and access controls for your use case.

Which local models actually handle tool calling?

Choose a model with documented tool-use support and test it with the tools and failure cases in your workflow. Validate tool-call formatting and failure handling before production use.

What is MCP and should I care?

Treat every tool server as a service with access controls. Authenticate it, restrict its permissions, and review the tools it exposes before connecting an agent.

Do I even need an agent for my use case?

If the inputs are structured and the steps are known, no; a script does it deterministically, cheaper, and debuggably. The experienced-operator rule of thumb is that agents earn their overhead on ambiguous inputs, multiple data sources, or genuine judgment. Backups, log rotation, and health checks are cron jobs wearing an expensive costume when an agent does them.

Sources

Every project above is one row in the Awesome Open Source AI registry, which resyncs twice a day from the curated GitHub list. The Agentic AI category holds the longer tail, and for agents that write code specifically, see the self-hosted coding assistant guide.

by Alvin