You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: rewrite LLM config section to use provider-based setup
Replace the legacy manual `llm.*` configuration with the modern provider
system across all README localizations (en, zh-CN, ja-JP, ko-KR, ru-RU).
The new structure introduces interactive setup for humans and CLI-based
`ocr config set` commands for CI/CD, covering both built-in and custom
providers.
OCR은 통합 **Provider** 시스템으로 LLM 설정을 관리합니다. 다양한 주요 provider가 내장되어 있으며, 프라이빗 배포 또는 기타 호환 엔드포인트에 연결하기 위한 커스텀 provider 추가도 지원합니다. 설정은 `~/.opencodereview/config.json`에 저장됩니다.
166
+
165
167
**Option A: 대화형 설정 (권장)**
166
168
167
169
```bash
@@ -171,26 +173,47 @@ ocr config model # 활성 provider의 model 선택
171
173
172
174

173
175
174
-
**Option B: 수동 설정**
176
+
대화형 UI가 provider 선택, API key 입력, model 설정을 안내하며, 완료 후 자동으로 연결 테스트를 수행합니다.
177
+
178
+
`ocr llm providers`를 실행하면 모든 built-in provider를 확인할 수 있습니다. Built-in provider에는 API URL과 프로토콜이 사전 설정되어 있어 API key만 제공하면 바로 사용할 수 있습니다. 해당 환경 변수(예: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`)가 이미 설정되어 있으면 API key가 자동으로 읽힙니다.
179
+
180
+
**커스텀 provider**도 대화형 UI에서 추가할 수 있습니다 — provider 이름, API URL, 프로토콜 타입(`anthropic` 또는 `openai`), API key를 입력합니다.
181
+
182
+
**Option B: CLI 설정 (CI/CD 등 비대화형 환경용)**
183
+
184
+
`ocr config set` 명령으로 provider 설정을 직접 작성합니다. 스크립트 및 자동화에 적합합니다.
185
+
186
+
Built-in provider 사용:
175
187
176
188
```bash
177
-
ocr config set llm.url https://api.anthropic.com/v1/messages
178
-
ocr config set llm.auth_token your-api-key-here
179
-
ocr config set llm.model claude-opus-4-6
180
-
ocr config set llm.use_anthropic true
189
+
ocr config set provider anthropic
190
+
ocr config set providers.anthropic.api_key your-api-key-here
191
+
ocr config set providers.anthropic.model claude-sonnet-4-6
181
192
```
182
193
183
-
config는 `~/.opencodereview/config.json`에 저장됩니다.
184
-
185
-
**`auth_header` (선택사항):** Anthropic 사용 시 API key를 전송할 HTTP header를 제어합니다. 생략하면 기본값은 `authorization` (Bearer token)입니다. 표준 `sk-ant-*` API key를 사용하는 경우 `x-api-key`로 설정해야 합니다:
194
+
커스텀 provider 사용 (프라이빗 게이트웨이 또는 기타 호환 엔드포인트):
186
195
187
196
```bash
188
-
ocr config set llm.auth_header x-api-key
197
+
ocr config set provider my-gateway
198
+
ocr config set custom_providers.my-gateway.url https://my-llm-gateway.internal/v1
199
+
ocr config set custom_providers.my-gateway.protocol openai
200
+
ocr config set custom_providers.my-gateway.api_key your-api-key-here
201
+
ocr config set custom_providers.my-gateway.model gpt-4o
189
202
```
190
203
191
-
지원되는 값: `x-api-key`, `authorization` (별칭: `bearer`). 그 외 값은 오류로 처리됩니다.
204
+
> 커스텀 provider에서는 `url`과 `protocol`이 필수입니다. 지원 프로토콜: `anthropic`, `openai`.
205
+
206
+
선택 설정:
207
+
208
+
| 키 | 설명 |
209
+
|----|------|
210
+
|`providers.<name>.auth_header`| 인증 header: `x-api-key` 또는 `authorization` (기본값: `authorization`) |
Claude Code 환경 변수(`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`)와도 호환되며, `~/.zshrc` / `~/.bashrc`의 export도 파싱합니다.
203
226
204
-
> **CC-Switch 사용자 참고**: [CC-Switch](https://github.com/farion1231/cc-switch)를 [routing service](https://www.ccswitch.io/en/docs?section=proxy&item=service)와 함께 사용한다면, 추가 설정 없이 `llm.url`을 CC-Switch proxy 주소로 지정할 수 있습니다.
205
-
> -**Claude** provider: `llm.url`을 `http://127.0.0.1:15721`로 설정
206
-
> -**Codex** provider: `llm.url`을 `http://127.0.0.1:15721/v1`로 설정
207
-
> - provider 설정에 맞게 `llm.model` 설정
208
-
> -`llm.auth_token`은 아무 값이나 사용할 수 있음
209
-
> -`extra_body` 설정은 그대로 적용됨
227
+
> **CC-Switch 사용자 참고**: [CC-Switch](https://github.com/farion1231/cc-switch)를 [routing service](https://www.ccswitch.io/en/docs?section=proxy&item=service)와 함께 사용한다면, provider의 `url`을 CC-Switch proxy 주소로 지정하여 추가 설정 없이 사용할 수 있습니다:
228
+
> -**Claude** provider: `providers.anthropic.url`을 `http://127.0.0.1:15721`로 설정
229
+
> -**Codex** provider: 해당 provider의 `url`을 `http://127.0.0.1:15721/v1`로 설정
230
+
> -`api_key`는 아무 값이나 사용 가능, `extra_body` 설정은 그대로 적용됨
**You must configure an LLM before reviewing code.**
164
164
165
+
OCR manages LLM configuration through a unified **Provider** system. It ships with many popular built-in providers and also supports adding custom providers to connect to private deployments or other compatible endpoints. Config is stored in `~/.opencodereview/config.json`.
166
+
165
167
**Option A: Interactive setup (Recommended)**
166
168
167
169
```bash
@@ -171,26 +173,47 @@ ocr config model # Pick a model for the active provider
171
173
172
174

173
175
174
-
**Option B: Manual config**
176
+
The interactive UI guides you through provider selection, API key entry, and model configuration, then automatically tests connectivity.
177
+
178
+
Run `ocr llm providers` to see all built-in providers. Built-in providers come with preset API URLs and protocols — just supply an API key to get started. If the corresponding environment variable is already set (e.g. `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`), the API key is picked up automatically.
179
+
180
+
**Custom providers** can also be added through the interactive UI — you'll need to provide a name, API URL, protocol type (`anthropic` or `openai`), and API key.
181
+
182
+
**Option B: CLI setup (for CI/CD and non-interactive environments)**
183
+
184
+
Use `ocr config set` to write provider configuration directly, suitable for scripts and automation.
185
+
186
+
Using a built-in provider:
175
187
176
188
```bash
177
-
ocr config set llm.url https://api.anthropic.com/v1/messages
178
-
ocr config set llm.auth_token your-api-key-here
179
-
ocr config set llm.model claude-opus-4-6
180
-
ocr config set llm.use_anthropic true
189
+
ocr config set provider anthropic
190
+
ocr config set providers.anthropic.api_key your-api-key-here
191
+
ocr config set providers.anthropic.model claude-sonnet-4-6
181
192
```
182
193
183
-
Config is stored in `~/.opencodereview/config.json`.
184
-
185
-
**`auth_header` (optional):** Controls which HTTP header carries the API key when using Anthropic. Defaults to `authorization` (Bearer token) if omitted. If you use a standard `sk-ant-*` API key, you must set it to `x-api-key`:
194
+
Using a custom provider (private gateway or other compatible endpoint):
186
195
187
196
```bash
188
-
ocr config set llm.auth_header x-api-key
197
+
ocr config set provider my-gateway
198
+
ocr config set custom_providers.my-gateway.url https://my-llm-gateway.internal/v1
199
+
ocr config set custom_providers.my-gateway.protocol openai
200
+
ocr config set custom_providers.my-gateway.api_key your-api-key-here
201
+
ocr config set custom_providers.my-gateway.model gpt-4o
189
202
```
190
203
191
-
Supported values: `x-api-key`, `authorization` (alias: `bearer`). Other values are rejected with an error.
204
+
> `url` and `protocol` are required for custom providers. Supported protocols: `anthropic`, `openai`.
205
+
206
+
Optional settings:
207
+
208
+
| Key | Description |
209
+
|-----|-------------|
210
+
|`providers.<name>.auth_header`| Auth header: `x-api-key` or `authorization` (default: `authorization`) |
211
+
|`providers.<name>.extra_body`| Custom JSON fields merged into the request body |
212
+
|`providers.<name>.models`| Model list for interactive selection |
It is also compatible with Claude Code environment variables (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`) and parses `~/.zshrc` / `~/.bashrc` for those exports.
225
+
Also compatible with Claude Code environment variables (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`) and parses `~/.zshrc` / `~/.bashrc` for those exports.
203
226
204
-
> **Note for CC-Switch Users**: If you are using [CC-Switch](https://github.com/farion1231/cc-switch) with [routing service](https://www.ccswitch.io/en/docs?section=proxy&item=service) enabled, you can point `llm.url` to the CC-Switch proxy address without additional configuration:
205
-
> - For **Claude** provider: set `llm.url` to `http://127.0.0.1:15721`
206
-
> - For **Codex** provider: set `llm.url` to `http://127.0.0.1:15721/v1`
207
-
> - Set `llm.model` according to your provider settings
208
-
> -`llm.auth_token` can be any value
209
-
> -`extra_body` settings still apply
227
+
> **Note for CC-Switch Users**: If you are using [CC-Switch](https://github.com/farion1231/cc-switch) with [routing service](https://www.ccswitch.io/en/docs?section=proxy&item=service) enabled, you can point the provider's `url` to the CC-Switch proxy address without additional configuration:
228
+
> - For **Claude** provider: set `providers.anthropic.url` to `http://127.0.0.1:15721`
229
+
> - For **Codex** provider: set the corresponding provider's `url` to `http://127.0.0.1:15721/v1`
230
+
> -`api_key` can be any value; `extra_body` settings still apply
0 commit comments