← Back to Blogs

Using CrewAI with Local Models to Automate Task Workflows

2025-08-052 min readGenAI
Using CrewAI with Local Models to Automate Task Workflows

Large Language Models (LLMs) have opened the door to powerful task automation, but not everyone wants to rely on cloud-based services. That’s where CrewAI shines — allowing you to build multi-agent workflows while connecting to local models for improved privacy, lower latency, and cost savings.

Using CrewAI with locally hosted LLMs such as Ollama or LM Studio gives you full control over your AI workflows. You can design agents that specialize in different roles and chain them together to execute complex processes from start to finish — all on your own machine.

Why use CrewAI with Local Models?

Example: Multi-Agent Workflow

Here’s a simple example of using CrewAI with a local model for task automation:

Setting It Up

Step 1: Install Ollama (or another local LLM runtime):

brew install ollama

Step 2: Then pull the model you want to use:

ollama pull mistral

Step 3: Install CrewAI

pip install crewai

Step 4: Connect CrewAI to your local machine

from langchain_community.llms import Ollama
from crewai import Agent, Task, Crew, Process
 
llm = Ollama(model="mistral")
 
research_agent = Agent(
    role="Research Analyst",
    goal="Research topics and provide summaries",
    backstory="An AI that gathers and organizes knowledge.",
    llm=llm
)
 
task = Task(
    description="Research CrewAI's features and summarize them in bullet points.",
    expected_output="A concise bullet point list.",
    agent=research_agent
)
 
crew = Crew(
    agents=[research_agent],
    tasks=[task],
    process=Process.sequential
)
 
print(crew.kickoff())

Happy Coding 💻

Building a Local Knowledge...Understanding Software Design Patterns...