100% Free! Claude Code Runs Local Models, No API Required! Use Super AI Agent Without VPN | Ollama | CC Switch | Lingdu Says
Summary
Highlights
The video introduces a new fascinating trend in the AI community: running Claude Code locally using personal AI models like Qwen, DeepSeek, or Gemma. This setup allows users to control Claude Code's powerful AI Agent directly from their desktop, eliminating the need for official APIs or internet connection. Claude Code, as an AI agent, can read projects, modify code, execute commands, fix bugs, and even build websites. This entire process can now be done offline and locally, thanks to the open-source project CC Switch.
Many people misunderstand Claude Code as a simple AI chatbot. However, its true strength lies in its capability as a robust AI Agent that can control your computer projects. It boasts an extended context window, enabling it to process entire projects, analyze codebases, and understand dependencies. For instance, with a command like 'add a login system to this website,' Claude Code can automatically read project code, modify files, install dependencies, and run commands to implement the feature. It functions as an AI, IDE, terminal, and file system combined.
The video guides viewers through the local deployment process. First, ensure Git is installed. Then, download and install the Claude Code desktop application, CC Switch, and Ollama. Claude Code acts as the AI Agent, Ollama manages local AI models, and CC Switch handles model impersonation and forwarding. The core principle is deceiving Claude Code into thinking it's calling its own API, while CC Switch redirects the requests to local AI models like Qwen or DeepSeek.
The tutorial begins with downloading and installing the official Claude Code desktop client, available for Windows (32-bit/x64 and ARM) and macOS. After installation, the user is advised not to open it immediately. Next, the CC Switch open-source project is downloaded and installed. This project is crucial for bridging Claude Code to local models. The installation for CC Switch involves a simple wizard.
The third step involves downloading and installing the Ollama client, which is recommended for its user-friendliness in deploying local AI models. After installing Ollama, users can pull models using the command line. The video demonstrates downloading the Gemma 4 26B model (17GB) and Qwen 3.5 9B model (6.6GB), emphasizing choosing models based on GPU memory. It also highlights the distinction between text-only and multimodal models.
The video then explains how to connect these local models to the Claude Code desktop version. In the CC Switch client, a new provider is added, labeled 'Ollama' and 'Qwen 3.5'. The API key can be arbitrary. The critical part is setting the request address to Ollama's local invocation address (127.0.0.1:11434/v1) and selecting 'OPENAI compatible mode' for API format. The desired local model (e.g., Qwen 3.5 9B or Gemma 4) is then specified for the SONNET and HAIKU models fields.
After configuring CC Switch, local routing must be enabled in CC Switch's settings. Crucially, the 'Claude routing forward' option needs to be activated. The video also covers enabling virtualization features in Windows (Windows Hypervisor Platform, Windows Subsystem for Linux, and Virtual Machine Platform) and restarting the computer. Upon restart, ensure CC Switch and Ollama are running. Then, open Claude Code, access the 'Help' menu, and enable 'Developer Mode'.
In Claude Code's developer mode, configure the third-party settings. Enter the gateway address provided by CC Switch and the arbitrary API key set earlier. Enable 'engine login mode' and export the configuration as a Windows Registry file. Edit this file to inject a command that forces Claude Code to display the three model options in CC Switch for easy switching. After importing the registry file and restarting Claude Code, select the local gateway. The video demonstrates Claude Code responding to a self-introduction, acknowledging it's running in an 'Anthropic environment,' successfully deceiving it into using the local Ollama model.
The video showcases Claude Code using the local model to generate a cyberpunk personal website homepage with dynamic backgrounds, frosted glass effects, typewriter animations, and particle effects. It also initiates the creation of a 3D parkour game. The creator notes that different local models yield varying results; the Gemma 4 model produces a functional game, while the Qwen model (being smaller) has issues. Users can switch local models in CC Switch by updating the model name in the Ollama configuration. The video concludes by emphasizing that all resources and download links are available below the video and on the presenter's blog.