Key Moments

Full Course: AI Coding Workflows From Cloud to Local

DeepLearning.AIDeepLearning.AI
Education5 min read79 min video
Nov 19, 2026|2,531 views|39|4
Save to Pod
TL;DR

AI coding workflows are moving beyond cloud-based agents to hybrid and local setups, offering more control over models, costs, and privacy, but requiring significant hardware for local execution.

Key Insights

1

By splitting tasks among sub-agents, developers can assign faster, less expensive models to secondary tasks while keeping a more powerful model for the primary role.

2

Running AI models locally can keep code and prompts private, which is a requirement for some organizations.

3

Using smaller, cheaper models for execution requires careful prompt engineering and specification to avoid costly errors and inefficiencies, as seen with DeepSeek Flash and Gemma 4.

4

Open Code, when paired with Open Router, provides a single API connection to a catalog of models, allowing developers to choose specific models like DeepSeek-V4-Pro for their needs.

5

Local AI development is becoming more accessible with tools like LM Studio, enabling the use of powerful models like Qwen 3.5 (27B parameters) on consumer hardware with 32GB of RAM.

Shifting control from monolithic cloud agents to customizable AI coding setups

The landscape of AI-powered coding is evolving from proprietary, all-in-one solutions like Claude Code to more open and controllable workflows. This shift allows developers to regain agency over critical aspects of their AI coding environment: the agent used, the models powering it, and crucially, where those models are run. This granular control directly impacts effectiveness, cost, code privacy, and tool behavior. The course outlines a progressive journey, starting with cloud-based workflows and gradually introducing more sophisticated configurations, including hybrid and fully local setups. By dissecting these architectures, developers can make informed trade-offs based on their specific project priorities, whether it's cost savings, enhanced privacy, or faster execution.

Building the 'Agent Clinic' application as a consistent benchmark

To effectively compare different AI coding workflows, the course utilizes a single, consistent application: 'Agent Clinic.' This application serves as a benchmark, allowing developers to see how each AI coding setup handles the same task and what advantages or compromises are made. The 'Agent Clinic' application is a simple web app where AI agents can complain about humans. It features a homepage and a complaints page, where users can view existing complaints and add new ones via a form. This consistent project ensures that the focus remains on the AI coding workflow itself, rather than variations in application complexity. The course guides users through setting up this project and gradually rebuilding it with different AI coding configurations.

Leveraging sub-agents to optimize model usage and cost

A key strategy for enhancing AI coding workflows is the strategic deployment of sub-agents. Instead of relying on a single, large model to handle all aspects of a task, work can be divided among specialized sub-agents. This approach allows developers to assign less expensive and faster models to perform specific, smaller tasks, while reserving more powerful, capable models for critical or complex operations. This not only optimizes resource allocation but also significantly impacts cost-efficiency. For instance, a primary agent might use a sophisticated model for planning and oversight, while sub-agents handle detailed coding or data retrieval with simpler, cheaper models. This granular control over model assignment is crucial for managing budgets and maximizing performance.

Exploring hybrid and local execution for enhanced privacy and control

The course progressively guides users towards more localized AI execution, starting with hybrid setups and culminating in fully local configurations. Hybrid approaches might involve a primary model running in the cloud while smaller sub-agents execute locally. Fully local setups aim to run all models directly on the developer's own hardware. This shift is driven by the desire for greater control over code and data privacy, as local execution keeps sensitive information within the user's environment. However, running models locally demands significant hardware resources, often requiring powerful GPUs and substantial RAM, a trade-off that must be carefully considered against the benefits of privacy and potential cost savings.

Choosing the right agent, provider, and model for the task

As developers move away from monolithic cloud agents, they gain the ability to select their programming agent (e.g., Claude Code, Open Code), their inference provider (e.g., Anthropic, Open Router, local servers via LM Studio), and the specific models they utilize. Tools like Open Router simplify connecting to a catalog of models through a single API key, abstracting away the complexities of managing multiple providers. This flexibility allows for tailoring the AI stack to specific needs, such as using a powerful model like DeepSeek-V4-Pro for complex planning and a cheaper, faster model like DeepSeek Flash for execution tasks, or even running a local model like Gemma 4 for sensitive operations.

The critical role of prompt engineering and specifications for smaller models

When working with smaller, less capable models, particularly in local setups, the quality of the prompt and the specificity of the project's requirements become paramount. Smaller models have limitations in context window size and reasoning capabilities, making them prone to errors or inefficiencies if not guided meticulously. The course emphasizes creating well-defined specifications, breaking down tasks into smaller, manageable steps, and crafting precise instructions for both the main agent and sub-agents. This detailed guidance, often embedded in agent definitions or detailed prompts, ensures that smaller models can perform their designated tasks effectively without succumbing to 'context degradation' or generating suboptimal code, thereby maximizing their cost and performance benefits.

Transitioning to local execution with LM Studio and custom agents

The course introduces local AI development by using LM Studio, a user-friendly tool for downloading, managing, and serving AI models locally. Developers learn to select models suitable for their hardware, such as Gemma 4 (12B parameters) or Qwen 3.5 (27B parameters), and configure them to run as local inference servers. Open Code is then configured to connect to these local models, enabling hybrid workflows where a cloud-based agent might interact with a locally running sub-agent. This step-by-step process demystifies local AI deployment, showing how to integrate personal hardware into the AI coding pipeline and manage the trade-offs between local resource constraints and model performance.

Full local execution: running both orchestrator and executor models on your machine

The final frontier explored is running both the main orchestrator ('big brain') and the executor ('small brain') models locally. This requires more powerful hardware, ideally with 32GB of RAM or more, to accommodate larger models like Qwen 3.5 (27B parameters) for the orchestrator. The process involves configuring Open Code to utilize these local models, often involving detailed prompt engineering and agent definitions to ensure effective collaboration between the locally running orchestrator and executor. This fully local setup offers the ultimate control over privacy and costs, though it presents the most significant hardware demands and potential for performance bottlenecks, requiring careful optimization of task delegation and model selection.

AI Coding Workflow Best Practices

Practical takeaways from this episode

Do This

Choose the right model for the task to optimize cost and performance.
Consider running models locally for enhanced privacy and control.
Structure your workflow by defining specific agents and their instructions.
Divide complex tasks into smaller, manageable units for sub-agents.
Use smaller, cheaper models for execution tasks guided by larger models for planning and review.
Clearly define specifications and roadmaps for agent actions.
Leverage tools like Open Code and Open Router for greater flexibility in model selection and deployment.
Utilize local models for privacy and potentially lower costs, but be mindful of hardware requirements.
Iterate and refine workflows by analyzing metrics like context usage, tool calls, and execution time.
Human oversight and testing remain crucial, especially with smaller or local models.

Avoid This

Don't use a large, sophisticated model for simple, routine tasks.
Don't assume a default cloud-based workflow is always the most efficient or private.
Don't let the AI tool dictate your workflow; shape the AI to support your process.
Don't neglect the importance of context management, as it can degrade performance.
Don't rely solely on automated testing; human review is essential.
Don't be afraid to experiment with different agents, models, and providers to find the best fit.
Don't underestimate the need for powerful hardware if running large models locally.
Avoid overly complex or vague prompts when working with smaller models.

AI Workflow Comparison Metrics (Agent Clinic App)

Data extracted from this episode

MetricClaude Code (Baseline)Claude Code + Sub-AgentsClaude Code + Sub-Agents (Haiku)Open Code + DeepSeek ProOpen Code + Sub-AgentsOpen Code + Custom Implementer (Flash)Local Gemma 4 (Sub-Agent) + Local Qwen 3.5 (Main)Local Gemma 4 (Sub-Agent) + Cloud DeepSeek Flash (Main)
Total Turns1661963 (per stage)3 (per stage)3 (per stage)
Main Agent Context (tokens)192k192k192k474k90k178k158k178k
Sub-Agent Context (tokens)N/A257k257kN/A1.39M110k (avg)39k (avg)117k
Total Context (tokens)192k449k449k474k1.48M288k207k295k
Tool Calls2833332885%N/AN/A57
Execution Time (Approx.)N/AN/AN/AN/AN/AN/A8m 52sN/A
Cost (Approx.)$0.02$0.03$0.03$0.02$0.08$0.02$0.02$0.05

Common Questions

The main goal is to empower developers to take control of their AI coding assistant's setup, moving beyond default tools to flexible, cost-effective, and privacy-conscious workflows, including running models locally.

Topics

Mentioned in this video

More from DeepLearningAI

View all 106 summaries

Ask anything from this episode.

Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.

Get Started Free