Chuyển đến nội dung chính
Crush là agent lập trình AI terminal mã nguồn mở của Charm.
Giao thức: tương thích OpenAI
  • Base URL: https://api.orcarouter.ai/v1 (có chứa hậu tố /v1)

Cài đặt

npm install -g @charmland/crush
Gói npm là một trình khởi chạy; lần chạy đầu tiên sẽ tự tải về binary cho nền tảng (yêu cầu có truy cập mạng).

Cấu hình

Tệp cấu hình: ~/.config/crush/crush.json (Windows: %USERPROFILE%\.config\crush\crush.json).
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "orcarouter": {
      "type": "openai",
      "base_url": "https://api.orcarouter.ai/v1",
      "api_key": "sk-orca-...",
      "models": [
        { "id": "orcarouter/auto", "name": "OrcaRouter Auto", "context_window": 200000, "default_max_tokens": 4096 }
      ]
    }
  }
}
Thay orcarouter/auto bằng một model cụ thể nếu bạn thích, ví dụ anthropic/claude-opus-4.8 hoặc google/gemini-2.5-flash. ID model luôn dùng định dạng vendor/model.

Chạy

crush run "Reply with exactly: OK"
Kết quả mong đợi: OK.

Ghi chú

  • base_url phải chứa /v1.
  • Lần chạy đầu tiên tải về binary, nên khởi động ban đầu cần truy cập mạng.
  • models[].id dùng định dạng vendor/model (ví dụ orcarouter/auto, anthropic/claude-opus-4.8).

Bật suy luận / thinking

Đặt theo từng model trong crush.json:
  • Model kiểu OpenAI"reasoning_effort": "high" (giá trị low / medium / high), và đánh dấu model "can_reason": true.
  • Model Anthropic"think": true (công tắc boolean cho extended thinking).
"models": [
  { "id": "anthropic/claude-sonnet-4.6", "name": "Sonnet 4.6", "context_window": 200000, "default_max_tokens": 4096, "can_reason": true, "reasoning_effort": "high" }
]
Đã kiểm chứng: reasoning_effort: "high" hoạt động với OrcaRouter.