| Crates.io | chace |
| lib.rs | chace |
| version | 0.2.0 |
| created_at | 2025-12-14 18:57:29.332741+00 |
| updated_at | 2025-12-26 08:35:42.654595+00 |
| description | CHamal's AutoComplete Engine - An LLM based code completion engine |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1984931 |
| size | 1,236,062 |
Pronounced: /tʃeɪs/ (chase)
CHamal's AutoComplete Engine
[!WARNING] CHACE is still at early development so bugs and breaking changes should be expected.
CHACE is a Rust-based engine designed for controlled AI-assisted code completion. Traditional code completion tools like GitHub copilot or agents like cursor can hallucinate easily on large codebases when the context is misleading or too much. To mitigate that, CHACE:
This approach keeps the AI focused on the specific task, reduces token usage, maintains precision and efficiency and produces more predictable results.
The idea is heavily inspired by ThePrimeagen's new approach to AI-assisted coding. While his implementation is built with Lua and requires Opencode to work (not yet open-sourced), I took a different architectural approach: built as a standalone Rust binary that operates independently and can be integrated into any editor through plugins. This design ensures the core application to be editor-agnostic, lightweight, and easy to extend to other development environments.
CHACE runs as a Unix socket server (/tmp/chace.sock) that accepts JSON requests containing source code and cursor position. The engine:
Currently supports:
cargo install chace
Set the required environment variables:
export GEMINI_API_KEY="your-gemini-api-key"
export GROQ_API_KEY="your-groq-api-key"
chace
The server listens on /tmp/chace.sock and handles concurrent connections.
Send JSON-encoded requests via the Unix socket:
{
"source_code": "fn add(a: i32, b: i32) -> i32 {\n\n}",
"cursor_byte": 35,
"backend": "Gemini",
"context_snippets": ["struct User {\n id: u32,\n name: String\n}"]
}
Optional Fields:
context_snippets (array of strings): Additional code snippets to provide context for better code generation{
"start_byte": 35,
"end_byte": 36,
"body": " a + b",
"usage": {
"prompt_tokens": 300,
"completion_tokens": 1200,
"total_tokens": 1500
}
"error": null
}
Optional Fields:
error (string or null): Error message if the request failed, null on successCHACE is designed to be integrated with IDEs via plugins. See chace.nvim for reference.
CHACE uses a line-delimited JSON protocol via a Unix socket:
git clone https://github.com/chamal1120/chace.git
cd chace
cargo build --release
To add support for a new language:
Cargo.tomlsrc/languages/LanguageStandard trait with the following methods:FunctionInfo objects containing:main.rsTo add a new LLM provider:
src/ai/LLMBackend traitmain.rsrefer tests.
MIT License - see LICENSE for details.