Introduction
In this tutorial, we'll explore how to set up and use OpenWorker, a local-first desktop AI coworker developed by Andrew Ng. Unlike traditional chat-based AI assistants, OpenWorker focuses on delivering finished deliverables rather than conversational responses. This approach makes it ideal for productivity tasks where you need tangible outputs like code, documents, or data analysis. We'll walk through installing OpenWorker, configuring its local Python agent server, and demonstrating its capabilities with practical examples.
Prerequisites
To follow along with this tutorial, you'll need:
- A computer running Windows, macOS, or Linux
- Python 3.8 or higher installed on your system
- Basic understanding of command-line interfaces
- Access to a terminal or command prompt
- Optional: Ollama installed for local LLM support
Step-by-Step Instructions
1. Install OpenWorker
First, we'll download and install OpenWorker from its GitHub repository. This desktop application runs a local Python agent server within a Tauri shell, enabling secure, local execution of AI tasks.
git clone https://github.com/andrewyng/openworker.git
cd openworker
npm install
Why this step? Cloning the repository gives us access to the complete source code. Installing dependencies ensures all required libraries are available for the application to run properly.
2. Configure the Local Python Agent Server
OpenWorker uses a Python agent server to execute tasks. We need to set up this server to work with your local environment.
python -m venv agent_env
source agent_env/bin/activate # On Windows: agent_env\Scripts\activate
pip install -r requirements.txt
Why this step? Creating a virtual environment isolates the Python dependencies required by OpenWorker from your system's Python installation. This prevents conflicts with other projects and ensures consistent behavior.
3. Set Up Ollama (Optional but Recommended)
For fully local LLM support, we'll install Ollama, which allows OpenWorker to run large language models without internet access.
# On macOS/Linux
curl -fsSL https://ollama.com/install.sh | sh
# On Windows
winget install Ollama
Why this step? Ollama provides a local interface to run large language models, ensuring privacy and performance. It's crucial for the local-first approach that OpenWorker promotes.
4. Initialize OpenWorker with Your Models
OpenWorker supports 30 curated tool-calling models. We'll configure it to use a few of these models for different tasks.
# Start the Ollama server
ollama serve &
# Pull a model for testing
ollama pull llama3
ollama pull phi3
Why this step? Initializing the models ensures they're available for OpenWorker to use when executing tasks. The local nature of these models means no internet connection is required for execution.
5. Configure OpenWorker's Risk Engine
OpenWorker's security model gates every write, shell command, and off-machine action through a typed risk engine. We'll configure this for safe execution.
# Create a configuration file
mkdir -p ~/.openworker
vim ~/.openworker/config.json
Insert the following configuration:
{
"risk_engine": {
"enabled": true,
"allowed_commands": ["ls", "pwd", "echo"],
"allowed_writes": ["/tmp"],
"timeout_seconds": 30
}
}
Why this step? The risk engine is a critical security feature that prevents OpenWorker from executing potentially harmful actions. By configuring it, we ensure that only pre-approved operations can be performed, maintaining system integrity.
6. Test OpenWorker with a Simple Task
Now we'll test OpenWorker's ability to create deliverables. We'll ask it to generate a Python script that calculates Fibonacci numbers.
# Run OpenWorker in development mode
npm run dev
Once the interface loads, you can input a task like:
Create a Python script that generates the first 10 Fibonacci numbers and saves them to a text file named fibonacci.txt.
Why this step? This demonstrates OpenWorker's core functionality - transforming natural language instructions into executable deliverables. The tool-calling capabilities allow it to interact with your local system to create files and execute code.
7. Review the Generated Deliverable
After executing the task, OpenWorker will create a Python script and a text file. We'll review the generated code to understand how it worked.
# Check the generated Python script
ls -la
Open the generated script and examine its structure:
import os
def fibonacci(n):
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
if __name__ == "__main__":
fib_sequence = list(fibonacci(10))
with open('fibonacci.txt', 'w') as f:
f.write('\n'.join(map(str, fib_sequence)))
print("Fibonacci sequence saved to fibonacci.txt")
Why this step? Reviewing the generated code shows how OpenWorker translates your request into functional, executable code. This is the key difference from chat-based assistants - it produces working deliverables rather than just responses.
Summary
In this tutorial, we've set up OpenWorker, configured its local Python agent server, and demonstrated its ability to create tangible deliverables. We've explored how it uses Ollama for local LLM support and implemented its risk engine for secure execution. OpenWorker represents a significant shift from chat-based AI assistants toward productivity-focused tools that generate working code and files. This approach is particularly valuable for developers, researchers, and professionals who need to quickly prototype solutions or automate routine tasks.
The key advantages of OpenWorker include:
- Local-first execution for privacy and performance
- Deliverable-focused outputs instead of chat responses
- Secure risk engine preventing harmful system actions
- Support for 30 curated tool-calling models
This setup provides a foundation for integrating OpenWorker into your workflow, enabling you to leverage AI for productivity while maintaining control over your local environment.



