Skip to main content

AutoGen on a VDS: Microsoft's Multi-Agent Framework

AI Agents on VPS · 19.04.2026 · 4 min read
Illustration for “AutoGen on a VDS: Microsoft's Multi-Agent Framework”

What Is AutoGen?

AutoGen is a framework from Microsoft Research for building multi-agent systems. Agents can talk to each other, write and execute code, and call external tools. This is especially powerful for coding and data analysis tasks.

Installation

pip install pyautogen

Two Agents: Coder and Critic

import autogen

config = {
    "config_list": [{
        "model": "llama3.2",
        "base_url": "http://localhost:11434/v1",
        "api_key": "ollama"
    }]
}

# The coder agent writes code
coder = autogen.AssistantAgent(
    name="Coder",
    system_message="You are an experienced Python developer. Write clean code.",
    llm_config=config
)

# The user agent runs and checks it
user = autogen.UserProxyAgent(
    name="User",
    human_input_mode="NEVER",
    code_execution_config={"work_dir": "/tmp/autogen"},
    max_consecutive_auto_reply=10
)

# Start the dialogue
user.initiate_chat(
    coder,
    message="Write a Python script for monitoring RAM and CPU usage"
)

GroupChat — Multiple Agents

groupchat = autogen.GroupChat(
    agents=[coder, user, reviewer],
    messages=[],
    max_round=10
)
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=config)
user.initiate_chat(manager, message="Create a REST API for task management")
Code execution: AutoGen can run generated code automatically. Run it in an isolated Docker container or with restricted permissions.

When to Choose AutoGen?

  • Coding and debugging tasks
  • Automated data analysis
  • Systems that need dialogue between agents
  • Complex multi-step tasks involving code

Common Errors During Installation and Launch

Most problems with AutoGen are not caused by the agent code itself, but by the environment: conflicting packages, an unreachable Ollama instance, or wrong paths for code execution.

ModuleNotFoundError: No module named 'autogen'

The AutoGen ecosystem split in 2024: part of the developers continued the project under the same name, while another part continued it as a fork under a separate name on PyPI. Both packages use the same namespace, import autogen, so if both end up installed in the same environment, the second one silently overwrites the files of the first, and old code stops finding the classes it expects. The fix is to keep only one of the packages in the project and pin its version in requirements.txt.

TimeoutError When Reaching the Local Model

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded

This error means AutoGen cannot reach Ollama at the address set in base_url. Check that the service is running (systemctl status ollama), that the model referenced in config_list is actually pulled (ollama list), and that port 11434 is not taken by another process.

AutoGen, CrewAI, and LangChain: Choosing a Framework

Criterion AutoGen CrewAI LangChain
Agent communication model Free-form dialogue, GroupChat Fixed roles and task handoff Explicit chains and call graphs
Code execution Built in, via UserProxyAgent Through separate tools Through tools and an executor agent
Learning curve Medium, requires understanding agent roles Low, declarative crew description Higher, many abstractions
Best suited for Code generation and debugging Step-by-step business processes Custom pipelines and RAG

If the task is not a multi-agent dialogue but a specific pipeline with clear steps, it is usually simpler to start with LangChain or CrewAI, and save AutoGen for cases where agents genuinely need to write and run code while talking to each other.

When AutoGen Is Not a Good Fit

  • You need a predictable, deterministic pipeline without an arbitrary number of dialogue rounds — GroupChat can drift into extra iterations.
  • Production code cannot run generated code without manual review — UserProxyAgent executes code automatically by default.
  • The team is not ready to maintain execution isolation (Docker or a separate low-privilege user).
  • The task can be solved with a single model call without dialogue between roles — in that case a direct request to Ollama is simpler and cheaper in resources.

How to Verify Everything Works

python3 -c "import autogen; print(autogen.__version__)"
ollama list
systemctl status ollama --no-pager

The first command confirms the package is installed and visible to the interpreter. The second shows which models are actually pulled — the name in the agent config must match one of the listed lines. The third checks that the Ollama service is active and accepting connections. If the dialogue between agents hangs without a response, the cause is almost always one of these three things.

It is also worth accounting for server resource load: each GroupChat round is a separate model call, and with more participants, response time grows linearly with the number of rounds rather than staying constant. On a VDS with a limited number of CPU cores, it makes sense to set a reasonable max_round in advance and watch the queue of requests to Ollama, otherwise an agent dialogue can take minutes instead of seconds.

Was this article helpful?
← Back to Knowledge Base Ask Support