Model-agnostic CLI agent that turns any LLM into an autonomous coding assistant.
Hugging Face: https://huggingface.co/opensynapselabs
GitHub: https://github.com/OpenSynapseLabs
Arche Code is a terminal-native AI agent for code generation, editing, refactoring, debugging, and testing. It is built around a pluggable model provider system — swap the backend without changing your workflow.
Supported providers:
- Arche — fine-tuned local models via HuggingFace transformers
- OpenAI — GPT models via API
- Local — GGUF via llama.cpp, Ollama endpoints, or any local checkpoint
- Stub — zero-dependency fallback for testing and CI
git clone https://github.com/OpenSynapseLabs/arche-code.git
cd arche-code
pip install -e .This creates an editable installation. Changes to the source code are reflected immediately without re-installing.
git clone https://github.com/OpenSynapseLabs/arche-code.git
cd arche-code
pip install -r requirements.txtThen run via module:
python -m arche_code# Write code from a description
arche write "a FastAPI endpoint that validates JWT tokens"
# Edit a file in-place (with confirmation)
arche edit app.py "add rate limiting middleware"
# Refactor for performance
arche refactor app.py --goal "reduce database round trips"
# Analyze quality
arche analyze app.py
# Generate tests
arche test app.py
# Debug from an error traceback
arche debug app.py "AttributeError: 'NoneType' object has no attribute 'split'"
# Interactive chat mode
arche chat
# Interactive REPL shell
arche shell
# Re-run model setup anytime
arche setupfrom arche_code import ModelConfig, ArcheAgent
# Arche model
config = ModelConfig(provider="arche")
agent = ArcheAgent(config)
# OpenAI
config = ModelConfig(provider="openai", api_key="sk-...", model_name="gpt-4")
agent = ArcheAgent(config)
# Local GGUF
config = ModelConfig(provider="local", local_path="./models/model.gguf")
agent = ArcheAgent(config)Providers are auto-registered via ModelRegistry.
Adding a new backend means subclassing ModelProvider and implementing four methods:
load()generate()is_ready()get_info()
The ArcheAgent class exposes six task types:
| Method | Task | Output |
|---|---|---|
write() |
Generate from description | Code block |
edit() |
Apply instruction to existing code | Patched code |
refactor() |
Restructure against a goal | Refactored code |
analyze() |
Static quality review | Markdown report |
generate_test() |
Unit tests from source | Test file |
debug() |
Fix from error message | Corrected code |
Each call returns a TaskResult with:
- success flag
- output text
- error string
- iteration count
- metadata dict
Task history is queryable via:
agent.get_history()The FileAccessManager enforces opt-in consent before reading any path:
- Per-file prompts on first access
- Optional global consent flag
/read <path>and/ls <path>commands inside chat mode
| Module | Function |
|---|---|
editor.py |
AST-aware function/class replacement with undo stack |
parser.py |
Regex + AST extraction of functions, classes, imports |
validators.py |
Syntax check, naming conventions, line length, docstring coverage |
tester.py |
Execution via sys.executable, pytest runner, coverage, import validation |
project.py |
Scaffold new projects with src/, tests/, docs/ layout |
from arche_code import Plugin, HookType
class MyPlugin(Plugin):
def get_hooks(self):
return [
(HookType.PRE_WRITE, self.lint_before_write),
(HookType.POST_EDIT, self.format_after_edit),
]Hooks execute in priority order.
The bundled PreCommitHook validates syntax before any write or edit operation.
$ arche chat
💬 Chat Mode
Type 'exit' or 'quit' to leave, 'clear' to clear history
You: how do I memoize a recursive Fibonacci in Python?
Arche: [generated explanation + code block]
You: /read ./src/utils.py
[file content rendered with syntax highlighting]Features:
- Rolling conversation history
- File read commands
- Directory listing commands
$ arche shell
╔════════════════════════════════════════════════════════════╗
║ Arche Code Shell ║
║ Type 'help' for commands ║
╚════════════════════════════════════════════════════════════╝
arche> write "async context manager for SQLite"
arche> parse app.py
arche> validate app.py
arche> status
arche> exitFeatures:
- Tab completion
- Persistent history
- Interactive command execution
On first launch, arche shell automatically starts the setup wizard if no model is detected.
$ arche shell
No model downloaded yet. Let's get you set up.
Run interactive model setup now? [Y/n]: yarche setuparche --provider arche write "hello world in Rust"If the selected model is missing, Arche Code prompts to download it automatically.
~/.arche/models/<model_name>
Configuration file:
~/.arche_code/config.json
Example:
{
"model": {
"provider": "arche",
"model_name": "default",
"device": "auto",
"quantization": "bf16",
"max_tokens": 2048,
"temperature": 0.2
},
"editor": {
"auto_format": true,
"line_length": 100
}
}Override via CLI flags:
arche --provider openai --model gpt-4 --temperature 0.1 write "..."When quantization is set to q8, Arche Code automatically enables 8-bit loading via bitsandbytes.
config = ModelConfig(
provider="arche",
quantization="q8",
)If bitsandbytes is unavailable, the loader falls back automatically.
Arche Code includes built-in memory hygiene for extended sessions:
- Step history cap
- Task history trimming
- Periodic compaction
- Manual compaction via
/compact - Provider reload support
Programmatic compaction:
agent.compact_memory()- First-run onboarding
arche setupcommand- Interactive model picker
- Expanded model catalog
- 8-bit quantization support
- Agent step history cap
- Memory trim optimization
We build specialized coding models and tools for software engineers.
Our models are open and available on Hugging Face for local use without API keys or rate limits.
We actively develop Arche Code — new features and providers are added regularly.
- Hugging Face: https://huggingface.co/opensynapselabs
- GitHub: https://github.com/OpenSynapseLabs
Apache License 2.0 — see LICENSE for details.