Skip to content
Journai
Go back

My dev toolbox: cloud and local stack

Learning AI engineering and improving my skills while being efficient requires a smart toolset that combines cloud LLM services and local models to deal with performance, resource constraints, and offline usability for code assistance.

This led me to design a hybrid local/cloud LLM architecture for coding assistance, focusing on balancing:

I chose a layered architecture where my primary IDE, Zed Editor, connects both to cloud-based Claude Code and a chain of local LLMs managed through OpenCode and LM Studio, with Qwen 2.5 as the primary local model.

Local LLM and Claude Code hybrid architecture for coding assistance

Prioritizing local compute constraints and model selection

My MacBook Pro’s M4 chip delivers 24GB unified RAM is good, but still limited for running very large LLMs locally.

I decided to use a carefully sized model: Qwen 2.5 with 14 billion parameters. This model fits into memory without resorting to disk swap, providing reasonable latency and response times for typical coding completions.

Trying to push for larger models locally causes unacceptable latency and memory pressure whereas very small models fall short of code comprehension and generation quality.

Balancing model size and hardware capacity:

This ensures my local stack can operate smoothly with my available hardware.

Delegating complexity: Claude Code for heavy-duty tasks

While the local stack handles simpler edits and incremental code generation, cloud-based Claude Code provides high-end reasoning, architecture design assistance, and large-scale context windows.

This separation leverages Claudes’s power when connected, without burdening my local resources.

OpenCode and LM Studio as local orchestration platforms

OpenCode manages the LLM invocation cycle locally by handling prompt construction, token management, and caching. LM Studio loads the model and exposes an OpenAI compatible server.

Their modular architecture allows swapping Qwen with other local models or cloud-based ones for offloading complex LLM calls.

Responsibilities include:

Embedding LLMs and agents into Zed

Zed is my central code editor, chosen for its extensibility and performance.

I configured it using only native Agent Client Protocol (ACP) that connect Zed to both the local LLM stack (OpenCode/LM Studio/Qwen) and the cloud Claude Code API.

This lets me:

Planning for future extensibility

The stack is designed as a living architecture:

This approach maintains momentum while supporting experimentation.

Reflecting on hybrid local/cloud LLM design

Building this stack taught me many things about AI and LLM architectures:

While this is a pure developer experience enhancement, I see a wider and actual long-term approach to gaining “local AI” skills: sovereignty.

In a world where data sovereignty comes more and more into play, being able to implement local AI is a critical step to help mission-critical applications (government, banking, healthcare, …) secure their data and operations. I will cover this topic in more detail in the future.


Share this post:

Previous Post
An AI chatbot in Shopify Admin
Next Post
The first ping