Ollama Cloud vs. Local Architecture
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The ollacc project provides a specialized architecture for integrating Claude Code with Ollama. While standard Ollama deployments typically rely on a local server (localhost:11434) to proxy requests to the cloud or run models locally, ollacc implements a "Direct-to-Cloud" path. This architecture eliminates the local Ollama overhead by pointing the Anthropic SDK directly at the Ollama Cloud API.
Sources: README.md:5-15, README.md:20-25
Architectural Comparison
The primary distinction between standard Ollama usage and the ollacc approach lies in the network path and resource utilization of the local machine.
Standard Local-Routed Architecture
In a standard setup, requests from Claude Code are sent to a local Ollama server. Even when using cloud models via ollama pull <cloud-model>, the local server acts as a proxy. Every request and response consumes local CPU and RAM as it funnels through the local daemon.
This diagram illustrates the proxying behavior where the local server remains in the critical path.
Sources: README.md:12-19
Ollacc Direct-to-Cloud Architecture
The ollacc architecture removes the intermediate local server. By configuring specific environment variables, the Anthropic SDK communicates directly with https://ollama.com. This is particularly beneficial for "swarming" scenarios where multiple parallel sessions would otherwise be bottlenecked by a single local process.
The diagram shows how ollacc acts as a configuration wrapper that enables a direct connection between the client and the cloud API.
Sources: README.md:20-27, lib/auth.sh:51-55
Key Components and Logic
Configuration and Environment Management
ollacc manages the state necessary to bypass the local server through a configuration file and specific environment variables required by the Anthropic SDK.
| Variable | Source/Value | Purpose |
|---|---|---|
ANTHROPIC_BASE_URL | https://ollama.com | Redirects SDK from Anthropic servers to Ollama Cloud. |
ANTHROPIC_AUTH_TOKEN | ~/.ollacc/config | Bearer token for authenticating with Ollama Cloud. |
ANTHROPIC_API_KEY | "" (Empty) | Must be empty to force the SDK to use the Auth Token. |
Sources: lib/auth.sh:10-13, lib/auth.sh:51-55, README.md:104-115
Dynamic Model Discovery
Instead of relying on locally pulled manifests, ollacc dynamically discovers available cloud models by intersecting popular models with the user's authorized catalog.
- Catalog Fetch: Retrieves the authorized tags from
https://ollama.com/api/tags. - Popular Scrape: Scrapes
https://ollama.com/search?c=cloudfor current trending models. - Intersection: Filters the popular list to only include models present in the user's authorized catalog.
Sources: lib/catalog.sh:22-60
This sequence shows the process of populating the model selection menu without querying a local database.
Sources: lib/catalog.sh:22-55
Execution Flow
The ollacc system follows a specific startup sequence to ensure the environment is prepared before handing over control to the Claude Code process.
The flow ensures that by the time claude is executed, the local environment is indistinguishable from one pointing to a native Anthropic endpoint, despite routing to Ollama Cloud.
Sources: install.sh:65-71, lib/auth.sh:18-49, lib/menu.sh:7-35, README.md:30-36
Persistence and Security
The architecture relies on a local hidden directory ~/.ollacc/ for state persistence.
- Config File:
~/.ollacc/configstores the API token and default model. It is created withchmod 600to restrict access to the current user. - Permissions: The directory itself is
chmod 700. - Idempotency: The installer ensures that the
ollaccalias is added to shell profiles (.zshrc,.bashrc, etc.) only once.
Sources: install.sh:41-43, install.sh:65-71, lib/config.sh:44-46
Conclusion
The ollacc architecture serves as a performance-oriented alternative to the standard Ollama local-proxy model. By leveraging the Anthropic SDK's environment-based configuration, it enables direct communication with Ollama Cloud, reducing local resource consumption and improving scalability for parallel AI agent tasks.