Chuyển đến nội dung chính
oh-my-pi (lệnh omp, còn được gọi là pi-mono — cùng một dự án) là một agent lập trình terminal tối giản, mở rộng được.
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

bun install -g @oh-my-pi/pi-coding-agent
Yêu cầu bun >= 1.3.14. Lệnh được cài là omp.

Cấu hình

Trước tiên export khóa API của bạn dưới dạng biến môi trường:
export ORCA_KEY="sk-orca-..."
Tệp cấu hình: ~/.omp/agent/models.yml.
providers:
  orcarouter:
    baseUrl: https://api.orcarouter.ai/v1
    api: openai-completions
    apiKey: ORCA_KEY
    authHeader: true
    models:
      - id: orcarouter/auto
        name: OrcaRouter Auto
        reasoning: false
        input: [text]
        contextWindow: 200000
        maxTokens: 8192
        compat:
          supportsDeveloperRole: false
          maxTokensField: max_tokens
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

omp -p --model "orcarouter/orcarouter/auto" "Reply with exactly: OK"
Kết quả mong đợi: OK.

Ghi chú

  • Yêu cầu bun >= 1.3.14.
  • base_url phải chứa /v1.
  • Trường apiKey nhận tên của một biến môi trường, không phải bản thân khóa; với authHeader: true nó được gửi dưới dạng Authorization: Bearer <value>.
  • Tham chiếu model dùng định dạng provider/model — ở đây là orcarouter/orcarouter/auto (provider orcarouter + ID model orcarouter/auto).
  • Dùng -p cho các lần chạy không tương tác.
  • oh-my-pi và pi-mono là cùng một dự án; lệnh là omp ở cả hai.

Bật suy luận / thinking

Mục model mặc định ở trên có reasoning: false. Để bật suy luận và cho phép chọn mức effort, hãy khai báo một khối thinking cùng với một compat.reasoningEffortMap trên model:
models:
  - id: anthropic/claude-sonnet-4.6
    name: Claude Sonnet 4.6
    reasoning: true
    thinking:
      minLevel: low
      maxLevel: xhigh
      mode: effort
    input: [text]
    contextWindow: 200000
    maxTokens: 8192
    compat:
      supportsDeveloperRole: false
      supportsReasoningEffort: true
      maxTokensField: max_tokens
      thinkingFormat: openai
      reasoningEffortMap: { low: low, medium: medium, high: high, xhigh: high }
Sau đó chọn một mức effort lúc chạy bằng hậu tố model:level (trong khoảng minLevel..maxLevel):
omp -p --model "orcarouter/anthropic/claude-sonnet-4.6:high" "What is 17*23?"
Đã kiểm chứng: hậu tố :high chọn mức effort và hoạt động với OrcaRouter.