gabrielchasukjin/cloi
A local-first coding agent for the terminal, powered by Ollama. Reads, searches, edits and runs code on your machine — no API key, no data leaving the host.
What it solves
Cloi is a local-first coding agent for the terminal that allows users to interact with their codebase via a natural language interface. It eliminates the need for external API keys and prevents data from leaving the host machine by running entirely locally using Ollama.
How it works
Cloi integrates with Ollama to execute a tool-use loop where the agent can read, search, and edit files and run shell commands. It employs several reliability mechanisms to ensure accuracy:
- Hardware-Aware Model Selection: It measures VRAM, RAM, and core count to suggest a primary model for every step and a larger fallback model for complex tasks.
- Escalation Logic: If the agent gets stuck (e.g., repeated identical calls or consecutive tool failures), it automatically hands the conversation to the larger fallback model.
- Verification: Claims about file contents are verified against the actual workspace state to prevent hallucinations.
- Result Caching: Substantial results are stored and can be recalled later, reducing redundant tool calls.
- Python Interpreter: A session-long interpreter allows the agent to perform complex logic, arithmetic, or file operations in a single cell rather than multiple tool calls.
- Context Management: Instead of letting Ollama silently drop tokens, Cloi summarizes older parts of the conversation to maintain context.
Who it’s for
Developers who want an AI coding assistant that is completely private, runs locally on their own hardware, and operates directly within the terminal.
Highlights
- Local-first: Powered by Ollama, requiring no API keys or data transmission.
- Dynamic Model Routing: Switches to a larger model based on observed failure rather than pre-guessing task type.
- Built-in Verification: Automatically checks quotes and line citations against actual files.
- Integrated Python Interpreter: Allows for efficient data processing and looping within the agent's workflow.
- Workspace Guardrails: Restricts paths to the workspace and requires user permission for writes and shell commands.
Related
- Project
- Project
- Project
- Project
- Dispatch