@cartanova/qgrid-ai-sdk 2.10.1 → 2.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +29 -11
- package/README.md +29 -11
- package/dist/index.d.ts +9 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -12,8 +12,8 @@ AI SDK v6 custom `LanguageModelV3` provider for [qgrid](https://github.com/carta
|
|
|
12
12
|
+import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
13
13
|
|
|
14
14
|
const { text } = await generateText({
|
|
15
|
-
- model: openai("gpt-
|
|
16
|
-
+ model: qgrid("openai/gpt-
|
|
15
|
+
- model: openai("gpt-6-luna"),
|
|
16
|
+
+ model: qgrid("openai/gpt-6-luna"),
|
|
17
17
|
prompt: "서울 날씨 알려줘",
|
|
18
18
|
});
|
|
19
19
|
```
|
|
@@ -43,7 +43,7 @@ import { generateText } from "ai";
|
|
|
43
43
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
44
44
|
|
|
45
45
|
const { text } = await generateText({
|
|
46
|
-
model: qgrid("openai/gpt-
|
|
46
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
47
47
|
prompt: "서울 날씨 알려줘",
|
|
48
48
|
});
|
|
49
49
|
```
|
|
@@ -62,7 +62,7 @@ import { generateText } from "ai";
|
|
|
62
62
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
63
63
|
|
|
64
64
|
const { text } = await generateText({
|
|
65
|
-
model: qgrid("openai/gpt-
|
|
65
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
66
66
|
system: "당신은 학술 논문 요약가입니다.",
|
|
67
67
|
prompt: paperText,
|
|
68
68
|
});
|
|
@@ -104,7 +104,7 @@ import { streamText } from "ai";
|
|
|
104
104
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
105
105
|
|
|
106
106
|
const { textStream } = streamText({
|
|
107
|
-
model: qgrid("openai/gpt-
|
|
107
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
108
108
|
prompt: "TypeScript의 장점을 설명해줘",
|
|
109
109
|
});
|
|
110
110
|
|
|
@@ -121,7 +121,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
|
121
121
|
import { z } from "zod";
|
|
122
122
|
|
|
123
123
|
const { text } = await generateText({
|
|
124
|
-
model: qgrid("openai/gpt-
|
|
124
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
125
125
|
prompt: "서울 날씨 알려줘",
|
|
126
126
|
tools: {
|
|
127
127
|
getWeather: tool({
|
|
@@ -204,7 +204,8 @@ const { text } = await generateText({
|
|
|
204
204
|
| `tokenName` | provider prefix를 포함한 토큰 이름 | 공통 | `anthropic/yds`처럼 활성 토큰 하나를 엄격히 지정. prefix는 model provider와 같아야 하며 빈 값·누락·inactive·quota 초과 시 다른 토큰으로 fallback하지 않음 |
|
|
205
205
|
| `logger` | `boolean` | 공통 | qgrid request log 저장 여부. 기본값은 `true`. `false`로 설정해도 client tool 실행과 multi-step 연결은 계속 동작 |
|
|
206
206
|
| `sessionKey` | `string` | OpenAI 전용 | 전체 history 재전송 시 불투명 prompt-cache affinity를 파생하는 멀티턴 대화 식별자 ([아래](#멀티턴-prompt-cache-sessionkey) 참조) |
|
|
207
|
-
| `
|
|
207
|
+
| `thinking` | `boolean` | 공통 | 생략하면 기존 모델별 동작 유지. `true`는 effort로 깊이를 조절하고, `false`는 요청 effort와 config `defaultEffort`를 무시. 모델·실행 경로 미지원 시 오류 |
|
|
208
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI 전용 (`QgridOpenAIProviderOptions`) | ChatGPT 구독 Codex 경로의 reasoning 깊이. GPT-6 Astra/Sol과 GPT-5.6 Sol/Terra는 `"ultra"`까지, GPT-6 Luna와 GPT-5.6 Luna는 `"max"`까지 지원하며, 모델이 지원하지 않는 값은 서버가 조용히 무시하고 백엔드 기본값을 적용. `"none"`/`"minimal"`은 공개 effort 값이 아니며 thinking 비활성화에는 `thinking: false`를 사용 |
|
|
208
209
|
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic 전용 (`QgridAnthropicProviderOptions`) | Claude Code `--effort` 허용값. 집합 밖의 값은 서버가 조용히 무시하고 qgrid 기본(`"low"`)을 적용. 모델별 상한(예: Sonnet 4.6은 `"xhigh"` 없음)은 Claude Code가 처리 |
|
|
209
210
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI 전용 | 응답 텍스트의 상세도 |
|
|
210
211
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI 전용 | 추론 요약 출력 방식 |
|
|
@@ -226,6 +227,23 @@ await generateText({
|
|
|
226
227
|
|
|
227
228
|
`tokenName`은 `streamText`에서도 같은 방식으로 동작합니다.
|
|
228
229
|
|
|
230
|
+
```typescript
|
|
231
|
+
providerOptions: {
|
|
232
|
+
qgrid: { thinking: false, effort: "high" } satisfies QgridProviderOptions,
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`thinking: false`는 위의 `high`를 무시하며 generate·stream 및 도구 후속 요청에 적용됩니다. `true`도 쉬운 질문에서 thinking 토큰 발생을 보장하지는 않습니다. **서버와 SDK를 함께 업데이트하세요.** 구버전 서버는 새 필드를 무시할 수 있습니다. 비활성화 지원은 실제 모델과 Claude Code 실행 경로에 따라 다릅니다. Sonnet 5.5의 `between_tools` 모드는 답변 전 thinking만 끄며 도구 호출 사이 thinking 블록은 남을 수 있습니다. Haiku 5.5와 Sonnet 5.5의 off 요청은 Claude Code 2.1.295 이상이 필요합니다.
|
|
237
|
+
|
|
238
|
+
Thinking 비활성화 정책 스냅샷(2026-10-10, Claude Code 조사 기준 2.1.295):
|
|
239
|
+
|
|
240
|
+
| Provider | 현재 정책에서 off를 허용하는 모델 ID |
|
|
241
|
+
|---|---|
|
|
242
|
+
| OpenAI | `gpt-6-sol`, `gpt-6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5` |
|
|
243
|
+
| Anthropic | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-haiku-4-5`, `claude-sonnet-4-5`, `claude-sonnet-4-6`, `claude-sonnet-5`, `claude-opus-4-5`, `claude-opus-4-6`, `claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5` |
|
|
244
|
+
|
|
245
|
+
위 ID에 평소처럼 `openai/` 또는 `anthropic/` prefix를 붙입니다. 백엔드가 명시적으로 거부한 모델은 `gpt-6-astra`, `gpt-6.1-sol`, `claude-fable-5`, `claude-fable-5-1`, `claude-opus-5-5`입니다. Haiku 5.5와 Sonnet 5.5의 네이티브 전달은 Claude Code 2.1.295에서 검증했습니다. off 요청에서 서버는 CLI 버전을 확인하며 2.1.295 미만이거나 확인할 수 없으면 입력 오류를 반환합니다. 나머지 모델도 off 미확인으로 구분하며 모델 접근 실패를 thinking 강제의 근거로 보지 않습니다. 이 제한은 명시적 false에만 적용됩니다.
|
|
246
|
+
|
|
229
247
|
AI SDK 최상위 `timeout`은 전체 클라이언트 제한시간이며 custom provider 실행 전에
|
|
230
248
|
`AbortSignal`로 변환됩니다. 따라서 그 숫자 자체는 qgrid에 전달되지 않습니다. qgrid 서버의
|
|
231
249
|
Claude Code 프로세스 제한시간을 바꾸려면 `providerOptions.qgrid.timeoutMs`를 사용하세요.
|
|
@@ -241,7 +259,7 @@ Anthropic `generateText` 요청에는 전역 설정을 바꾸지 않는 요청
|
|
|
241
259
|
|
|
242
260
|
```typescript
|
|
243
261
|
const { text } = await generateText({
|
|
244
|
-
model: qgrid("openai/gpt-
|
|
262
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
245
263
|
prompt: nextTurnPrompt,
|
|
246
264
|
providerOptions: { qgrid: { sessionKey: "game-session-123" } },
|
|
247
265
|
});
|
|
@@ -432,13 +450,13 @@ Qgrid 비용 추정에는 [표준 API 단가](https://developers.openai.com/api/
|
|
|
432
450
|
|
|
433
451
|
`anthropic/claude-fable-5-1`(2026-09-01 출시)은 Fable 5와 같은 1M context, 128K 최대 출력, 항상 켜진 adaptive thinking, input $10 / output $50 단가를 공유합니다. cache read만 Fable 5의 $1 대신 1M tokens당 $0.25(input의 0.025x)로 과금되며, cache write는 $12.50(5분)/$20(1시간)으로 같습니다. Fable 5.1의 API 수준 파괴적 변경(forced `tool_choice` 거부, 모델에 귀속된 thinking 블록)은 qgrid에 영향을 주지 않습니다. qgrid는 도구를 끈 Claude Code를 fresh 프로세스로 실행하고 히스토리를 텍스트로 평탄화해 전달하기 때문입니다.
|
|
434
452
|
|
|
435
|
-
`anthropic/claude-opus-5`는 기본 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 단가는 input $5, cache read $0.50, 5분 cache write $6.25, 1시간 cache write $10, output $25입니다. qgrid는 Opus 5의 기본 adaptive thinking
|
|
453
|
+
`anthropic/claude-opus-5`는 기본 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 단가는 input $5, cache read $0.50, 5분 cache write $6.25, 1시간 cache write $10, output $25입니다. thinking 옵션을 생략하면 qgrid는 Opus 5의 기본 adaptive thinking을 유지합니다. `thinking: false`는 effort를 무시하고 내부적으로 low와 disabled를 사용합니다.
|
|
436
454
|
|
|
437
455
|
`anthropic/claude-opus-5-5`(2026-09-22 출시)는 1M context와 128K 최대 출력을 지원합니다. 1M tokens당 단가는 input $4, cache read $0.20(input의 0.05x), 5분 cache write $5, 1시간 cache write $8, output $20입니다. adaptive thinking이 항상 켜져 있고 끌 수 없으므로 qgrid는 Fable과 같이 이를 보존하고 `effort`로 추론 깊이를 조절합니다. Opus 5.5의 API 수준 파괴적 변경(forced `tool_choice` 거부, 모델에 귀속된 thinking 블록)은 Fable 5.1과 같은 이유로 qgrid에 영향을 주지 않습니다. Opus 5 단가는 변동이 없습니다.
|
|
438
456
|
|
|
439
|
-
`anthropic/claude-sonnet-5-5`(2026-09-28 출시)는 1M context와 128K 최대 출력을 지원하며 Sonnet 5와 같은 기본 단가입니다. 1M tokens당 input $2, 5분 cache write $2.50, 1시간 cache write $4, output $10이고, cache read는 2026-10-07에 $0.20에서 절반으로 인하되어 Opus 5.5와 같은 0.05x인 $0.10입니다. qgrid는 요청 시점 단가로 비용을 기록하므로 그 이전 로그는 $0.20 추정치를 유지합니다. thinking
|
|
457
|
+
`anthropic/claude-sonnet-5-5`(2026-09-28 출시)는 1M context와 128K 최대 출력을 지원하며 Sonnet 5와 같은 기본 단가입니다. 1M tokens당 input $2, 5분 cache write $2.50, 1시간 cache write $4, output $10이고, cache read는 2026-10-07에 $0.20에서 절반으로 인하되어 Opus 5.5와 같은 0.05x인 $0.10입니다. qgrid는 요청 시점 단가로 비용을 기록하므로 그 이전 로그는 $0.20 추정치를 유지합니다. thinking 생략 시 기본 adaptive 동작을 유지합니다. `thinking: false`는 Claude Code 2.1.295 이상에서 `between_tools`를 전달해 답변 전 thinking을 끄며, 도구 호출 사이 thinking 블록은 남을 수 있습니다.
|
|
440
458
|
|
|
441
|
-
`anthropic/claude-haiku-5-5`(2026-10-07 출시)는 1M context와 128K 최대 출력을 지원하며, 현행 Claude 모델 중 유일하게 프롬프트 길이별 단가를 씁니다. 100K 토큰 이하 프롬프트는 1M tokens당 input $0.10, cache read $0.01, 5분 cache write $0.125, 1시간 cache write $0.20, output $0.50이고, 프롬프트가 100K 토큰을 넘으면 모든 단가가 5배($0.50 / $0.05 / $0.625 / $1 / $2.50)로 요청 전체에 적용됩니다. qgrid는 GPT-6에 쓰는 요청 전체 long-context 규칙으로 이를 계산합니다. adaptive thinking이 기본으로 켜져 있고 API 기본 effort는 `medium
|
|
459
|
+
`anthropic/claude-haiku-5-5`(2026-10-07 출시)는 1M context와 128K 최대 출력을 지원하며, 현행 Claude 모델 중 유일하게 프롬프트 길이별 단가를 씁니다. 100K 토큰 이하 프롬프트는 1M tokens당 input $0.10, cache read $0.01, 5분 cache write $0.125, 1시간 cache write $0.20, output $0.50이고, 프롬프트가 100K 토큰을 넘으면 모든 단가가 5배($0.50 / $0.05 / $0.625 / $1 / $2.50)로 요청 전체에 적용됩니다. qgrid는 GPT-6에 쓰는 요청 전체 long-context 규칙으로 이를 계산합니다. adaptive thinking이 기본으로 켜져 있고 API 기본 effort는 `medium`입니다. thinking 생략 시 기본 adaptive 동작과 effort(SDK 기본 `low`)를 유지합니다. `thinking: false`는 Claude Code 2.1.295 이상에서 네이티브 요청 설정을 통해 disabled와 low를 전달합니다. Haiku 5.5는 Claude 4.7+ 토크나이저를 쓰므로 같은 텍스트가 Haiku 4.5보다 약 30% 더 많은 토큰으로 계산됩니다.
|
|
442
460
|
|
|
443
461
|
Claude Code는 Fable의 safety refusal을 다른 Opus 모델로 자동 재시도할 수 있습니다. 현재 CLI는 refusal 카테고리에 따라 Opus 5 또는 Opus 4.8을 고릅니다. 이 경우 AI SDK 응답의 `response.modelId`와 `providerMetadata.qgrid.model`은 실제 serving 모델인 Opus를 가리킵니다. `providerMetadata.qgrid.requestedModel`은 Fable로 유지되고, `providerMetadata.qgrid.modelFallbacks`에 refusal fallback 이력이 담깁니다. 같은 metadata에서 `costSource`와 5분/1시간 cache-write 토큰 분해도 확인할 수 있습니다.
|
|
444
462
|
|
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ AI SDK v6 custom `LanguageModelV3` provider for [qgrid](https://github.com/carta
|
|
|
12
12
|
+import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
13
13
|
|
|
14
14
|
const { text } = await generateText({
|
|
15
|
-
- model: openai("gpt-
|
|
16
|
-
+ model: qgrid("openai/gpt-
|
|
15
|
+
- model: openai("gpt-6-luna"),
|
|
16
|
+
+ model: qgrid("openai/gpt-6-luna"),
|
|
17
17
|
prompt: "What's the weather in Seoul?",
|
|
18
18
|
});
|
|
19
19
|
```
|
|
@@ -43,7 +43,7 @@ import { generateText } from "ai";
|
|
|
43
43
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
44
44
|
|
|
45
45
|
const { text } = await generateText({
|
|
46
|
-
model: qgrid("openai/gpt-
|
|
46
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
47
47
|
prompt: "What's the weather in Seoul?",
|
|
48
48
|
});
|
|
49
49
|
```
|
|
@@ -62,7 +62,7 @@ import { generateText } from "ai";
|
|
|
62
62
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
63
63
|
|
|
64
64
|
const { text } = await generateText({
|
|
65
|
-
model: qgrid("openai/gpt-
|
|
65
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
66
66
|
system: "You are an academic paper summarizer.",
|
|
67
67
|
prompt: paperText,
|
|
68
68
|
});
|
|
@@ -112,7 +112,7 @@ import { streamText } from "ai";
|
|
|
112
112
|
import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
113
113
|
|
|
114
114
|
const { textStream } = streamText({
|
|
115
|
-
model: qgrid("openai/gpt-
|
|
115
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
116
116
|
prompt: "Explain the benefits of TypeScript",
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -129,7 +129,7 @@ import { qgrid } from "@cartanova/qgrid-ai-sdk";
|
|
|
129
129
|
import { z } from "zod";
|
|
130
130
|
|
|
131
131
|
const { text } = await generateText({
|
|
132
|
-
model: qgrid("openai/gpt-
|
|
132
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
133
133
|
prompt: "What's the weather in Seoul?",
|
|
134
134
|
tools: {
|
|
135
135
|
getWeather: tool({
|
|
@@ -213,7 +213,8 @@ const { text } = await generateText({
|
|
|
213
213
|
| `tokenName` | provider-prefixed token name | both providers | Strictly targets one active token, such as `anthropic/yds`. The prefix must match the model provider; empty, missing, inactive, or over-threshold targets fail without fallback |
|
|
214
214
|
| `logger` | `boolean` | both providers | qgrid request logging. Defaults to `true`; `false` disables request-log persistence for this generation without disabling client tools or multi-step continuation |
|
|
215
215
|
| `sessionKey` | `string` | OpenAI only | Multi-turn conversation identifier used to derive opaque prompt-cache affinity while replaying full history (see [below](#multi-turn-prompt-cache-sessionkey)) |
|
|
216
|
-
| `
|
|
216
|
+
| `thinking` | `boolean` | Both providers | Omit to preserve existing model behavior. `true` enables thinking with effort; `false` ignores request effort and config `defaultEffort`. Unsupported models or runtimes return an error |
|
|
217
|
+
| `effort` | OpenAI: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` \| `"ultra"` | OpenAI only (`QgridOpenAIProviderOptions`) | Reasoning depth on the ChatGPT-subscription Codex route. GPT-6 Astra, GPT-6 Sol, and GPT-5.6 Sol/Terra support effort through `"ultra"`; GPT-6 Luna and GPT-5.6 Luna support it through `"max"`; a value the model does not support is silently ignored by the server and the backend default applies. `"none"`/`"minimal"` are not public effort values; use `thinking: false` to disable thinking |
|
|
217
218
|
| `effort` | Anthropic: `"low"` \| `"medium"` \| `"high"` \| `"xhigh"` \| `"max"` | Anthropic only (`QgridAnthropicProviderOptions`) | Claude Code `--effort` levels. Values outside this set are silently ignored and qgrid's default (`"low"`) applies; per-model limits (for example no `"xhigh"` on Sonnet 4.6) are handled by Claude Code |
|
|
218
219
|
| `verbosity` | `"low"` \| `"medium"` \| `"high"` | OpenAI only | Response text verbosity |
|
|
219
220
|
| `reasoningSummary` | `"auto"` \| `"concise"` \| `"detailed"` \| `"none"` | OpenAI only | Reasoning summary output mode |
|
|
@@ -235,6 +236,23 @@ await generateText({
|
|
|
235
236
|
|
|
236
237
|
`tokenName` works the same way with `streamText`.
|
|
237
238
|
|
|
239
|
+
```typescript
|
|
240
|
+
providerOptions: {
|
|
241
|
+
qgrid: { thinking: false, effort: "high" } satisfies QgridProviderOptions,
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
`thinking: false` ignores `high` in this example and applies to generate, stream, and tool follow-up requests. `true` does not guarantee thinking tokens on every response. **Update the server and SDK together:** older servers may ignore the new field. Disabling support depends on the model and Claude Code runtime. Sonnet 5.5's `between_tools` mode disables pre-answer thinking but can retain thinking blocks between tools; off requests for Haiku 5.5 and Sonnet 5.5 require Claude Code 2.1.295 or newer.
|
|
246
|
+
|
|
247
|
+
Thinking-off policy snapshot (2026-10-10; Claude Code investigation baseline 2.1.295):
|
|
248
|
+
|
|
249
|
+
| Provider | Off-capable model IDs in the current policy |
|
|
250
|
+
|---|---|
|
|
251
|
+
| OpenAI | `gpt-6-sol`, `gpt-6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5` |
|
|
252
|
+
| Anthropic | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-haiku-4-5`, `claude-sonnet-4-5`, `claude-sonnet-4-6`, `claude-sonnet-5`, `claude-opus-4-5`, `claude-opus-4-6`, `claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5` |
|
|
253
|
+
|
|
254
|
+
Use the usual `openai/` or `anthropic/` prefix with these IDs. Explicitly rejected by the backend: `gpt-6-astra`, `gpt-6.1-sol`, `claude-fable-5`, `claude-fable-5-1`, and `claude-opus-5-5`. Native delivery for Haiku 5.5 and Sonnet 5.5 was verified with Claude Code 2.1.295. For their off requests, the server checks the CLI version and returns an input error if it is older than 2.1.295 or cannot be determined. Other model IDs are unverified for off; model-access failures do not prove mandatory thinking. These restrictions apply only to explicit false.
|
|
255
|
+
|
|
238
256
|
AI SDK's top-level `timeout` remains the overall client-side budget and is converted to an
|
|
239
257
|
`AbortSignal` before the custom provider runs. It does not expose the numeric timeout to qgrid.
|
|
240
258
|
Use `providerOptions.qgrid.timeoutMs` when the qgrid server's Claude Code process needs a different
|
|
@@ -250,7 +268,7 @@ For multi-turn conversations, pass a caller-side domain ID (game session ID, cha
|
|
|
250
268
|
|
|
251
269
|
```typescript
|
|
252
270
|
const { text } = await generateText({
|
|
253
|
-
model: qgrid("openai/gpt-
|
|
271
|
+
model: qgrid("openai/gpt-6-luna"),
|
|
254
272
|
prompt: nextTurnPrompt,
|
|
255
273
|
providerOptions: { qgrid: { sessionKey: "game-session-123" } },
|
|
256
274
|
});
|
|
@@ -468,13 +486,13 @@ Qgrid uses [Standard API pricing](https://developers.openai.com/api/docs/pricing
|
|
|
468
486
|
|
|
469
487
|
`anthropic/claude-fable-5-1` (released 2026-09-01) shares Fable 5's 1M context window, 128K max output, always-on adaptive thinking, and $10 input / $50 output pricing. Its cache reads cost $0.25 per 1M tokens (0.025x the input price) instead of Fable 5's $1; cache writes stay at $12.50 (5m) and $20 (1h). Fable 5.1's API-level breaking changes (forced `tool_choice` rejection, model-bound thinking blocks) do not affect qgrid, which runs Claude Code with tools disabled and replays history as flattened text in a fresh process.
|
|
470
488
|
|
|
471
|
-
`anthropic/claude-opus-5` has a default 1M context window and 128K max output. Its prices per 1M tokens are $5 input, $0.50 cache read, $6.25 five-minute cache write, $10 one-hour cache write, and $25 output.
|
|
489
|
+
`anthropic/claude-opus-5` has a default 1M context window and 128K max output. Its prices per 1M tokens are $5 input, $0.50 cache read, $6.25 five-minute cache write, $10 one-hour cache write, and $25 output. Omitting thinking preserves Opus 5's default adaptive behavior. `thinking: false` ignores effort and internally uses low with disabled thinking.
|
|
472
490
|
|
|
473
491
|
`anthropic/claude-opus-5-5` (released 2026-09-22) has a 1M context window and 128K max output. Its prices per 1M tokens are $4 input, $0.20 cache read (0.05x the input price), $5 five-minute cache write, $8 one-hour cache write, and $20 output. Adaptive thinking is always on and cannot be disabled, so qgrid preserves it and uses `effort` to control depth, as it does for Fable. Opus 5.5's API-level breaking changes (forced `tool_choice` rejection, model-bound thinking blocks) do not affect qgrid for the same reason as Fable 5.1. Opus 5 pricing did not change.
|
|
474
492
|
|
|
475
|
-
`anthropic/claude-sonnet-5-5` (released 2026-09-28) has a 1M context window and 128K max output at Sonnet 5's base prices: $2 input, $2.50 five-minute cache write, $4 one-hour cache write, and $10 output per 1M tokens. Its cache reads cost $0.10 (0.05x the input price, the same multiplier as Opus 5.5) since Anthropic halved them from $0.20 on 2026-10-07; qgrid prices each request at the rate current when it runs, so logs from before that date keep the $0.20 estimate.
|
|
493
|
+
`anthropic/claude-sonnet-5-5` (released 2026-09-28) has a 1M context window and 128K max output at Sonnet 5's base prices: $2 input, $2.50 five-minute cache write, $4 one-hour cache write, and $10 output per 1M tokens. Its cache reads cost $0.10 (0.05x the input price, the same multiplier as Opus 5.5) since Anthropic halved them from $0.20 on 2026-10-07; qgrid prices each request at the rate current when it runs, so logs from before that date keep the $0.20 estimate. Omission preserves adaptive defaults. With Claude Code 2.1.295 or newer, `thinking: false` delivers `between_tools`, disabling pre-answer thinking while allowing thinking blocks between tools.
|
|
476
494
|
|
|
477
|
-
`anthropic/claude-haiku-5-5` (released 2026-10-07) has a 1M context window and 128K max output, and is the only current Claude model priced by prompt length. For prompts up to 100K tokens it costs $0.10 input, $0.01 cache read, $0.125 five-minute cache write, $0.20 one-hour cache write, and $0.50 output per 1M tokens; once the prompt exceeds 100K tokens, every rate is 5x ($0.50 / $0.05 / $0.625 / $1 / $2.50) and applies to the whole request, which qgrid models with the same whole-request long-context rule it uses for GPT-6. Adaptive thinking is on by default with a `medium` API default effort
|
|
495
|
+
`anthropic/claude-haiku-5-5` (released 2026-10-07) has a 1M context window and 128K max output, and is the only current Claude model priced by prompt length. For prompts up to 100K tokens it costs $0.10 input, $0.01 cache read, $0.125 five-minute cache write, $0.20 one-hour cache write, and $0.50 output per 1M tokens; once the prompt exceeds 100K tokens, every rate is 5x ($0.50 / $0.05 / $0.625 / $1 / $2.50) and applies to the whole request, which qgrid models with the same whole-request long-context rule it uses for GPT-6. Adaptive thinking is on by default with a `medium` API default effort. Omission preserves adaptive defaults with effort (SDK default `low`). With Claude Code 2.1.295 or newer, `thinking: false` uses native request settings to deliver disabled thinking and low effort. Haiku 5.5 uses the Claude 4.7+ tokenizer, so the same text counts roughly 30% more tokens than on Haiku 4.5.
|
|
478
496
|
|
|
479
497
|
Claude Code may automatically retry a Fable safety refusal on another Opus model; the current CLI picks Opus 5 or Opus 4.8 by refusal category. In that case, the AI SDK response's `response.modelId` and `providerMetadata.qgrid.model` identify Opus as the actual serving model. `providerMetadata.qgrid.requestedModel` remains Fable, and `providerMetadata.qgrid.modelFallbacks` contains the refusal fallback history. The metadata also exposes `costSource` and the 5m/1h cache-write token split.
|
|
480
498
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { TelemetrySettings } from "ai";
|
|
|
3
3
|
//#region src/index.types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* OpenAI 경로(ChatGPT 구독 Codex 백엔드)의 reasoning effort. 백엔드 모델 카탈로그의
|
|
6
|
-
* supported_reasoning_levels
|
|
6
|
+
* supported_reasoning_levels 합집합이다. `none`/`minimal`은 공개 effort 값이 아니며,
|
|
7
|
+
* 지원 모델의 thinking 비활성화에는 `thinking: false`를 사용한다.
|
|
7
8
|
* GPT-6 Astra와 GPT-5.6 Sol/Terra는 `ultra`, Luna는 `max`까지 지원한다.
|
|
8
9
|
* 모델이 지원하지 않는 값은 서버가 조용히 무시한다.
|
|
9
10
|
*/
|
|
@@ -29,6 +30,13 @@ type QgridAnthropicProviderConfig = QgridCommonProviderConfig & {
|
|
|
29
30
|
/** `qgrid()` 는 모델 ID prefix 로 오버로드되므로 보통 provider 별 타입이 추론된다. */
|
|
30
31
|
type QgridProviderConfig = QgridOpenAIProviderConfig | QgridAnthropicProviderConfig;
|
|
31
32
|
type QgridCommonProviderOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* 답변 전 thinking 활성화 여부. 생략하면 기존 모델별 동작을 유지한다.
|
|
35
|
+
* false는 effort/defaultEffort를 무시하며, 모델·실행 경로가 지원하지 않으면 서버가 거부한다.
|
|
36
|
+
* true는 effort로 깊이를 조절하지만 매 응답의 thinking 토큰을 보장하지 않는다.
|
|
37
|
+
* 서버와 SDK를 함께 업데이트해야 한다. 구버전 서버는 이 옵션을 무시할 수 있다.
|
|
38
|
+
*/
|
|
39
|
+
thinking?: boolean;
|
|
32
40
|
/**
|
|
33
41
|
* 이 요청을 처리할 활성 qgrid 토큰 이름. provider prefix를 포함해야 하며 다른 토큰으로 fallback하지 않는다.
|
|
34
42
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1192,7 +1192,7 @@ function qgrid(modelId, config) {
|
|
|
1192
1192
|
const imageGeneration = qgridOptions.imageGeneration;
|
|
1193
1193
|
const { prompt, system, history, input, imageUrls, droppedImageCount } = extractPromptAndHistory(options.prompt, { includeImages: imageGeneration === true });
|
|
1194
1194
|
if (!imageGeneration) warnDroppedImages(droppedImageCount);
|
|
1195
|
-
const effectiveEffort = qgridOptions.effort ?? effort;
|
|
1195
|
+
const effectiveEffort = qgridOptions.thinking === false ? void 0 : qgridOptions.effort ?? effort;
|
|
1196
1196
|
const verbosity = qgridOptions.verbosity;
|
|
1197
1197
|
const reasoningSummary = qgridOptions.reasoningSummary;
|
|
1198
1198
|
const serviceTier = qgridOptions.serviceTier;
|
|
@@ -1223,6 +1223,7 @@ function qgrid(modelId, config) {
|
|
|
1223
1223
|
model: modelId,
|
|
1224
1224
|
system,
|
|
1225
1225
|
effort: effectiveEffort,
|
|
1226
|
+
thinking: qgridOptions.thinking,
|
|
1226
1227
|
...verbosity ? { verbosity } : {},
|
|
1227
1228
|
...reasoningSummary ? { reasoningSummary } : {},
|
|
1228
1229
|
...serviceTier ? { serviceTier } : {},
|
|
@@ -1299,7 +1300,7 @@ function qgrid(modelId, config) {
|
|
|
1299
1300
|
const tools = options.tools?.filter((t) => t.type === "function");
|
|
1300
1301
|
const hasTools = tools && tools.length > 0;
|
|
1301
1302
|
const qgridOptions = getQgridProviderOptions(options);
|
|
1302
|
-
const effectiveEffort = qgridOptions.effort ?? effort;
|
|
1303
|
+
const effectiveEffort = qgridOptions.thinking === false ? void 0 : qgridOptions.effort ?? effort;
|
|
1303
1304
|
const verbosity = qgridOptions.verbosity;
|
|
1304
1305
|
const reasoningSummary = qgridOptions.reasoningSummary;
|
|
1305
1306
|
const serviceTier = qgridOptions.serviceTier;
|
|
@@ -1331,6 +1332,7 @@ function qgrid(modelId, config) {
|
|
|
1331
1332
|
model: modelId,
|
|
1332
1333
|
system,
|
|
1333
1334
|
effort: effectiveEffort,
|
|
1335
|
+
thinking: qgridOptions.thinking,
|
|
1334
1336
|
...verbosity ? { verbosity } : {},
|
|
1335
1337
|
...reasoningSummary ? { reasoningSummary } : {},
|
|
1336
1338
|
...serviceTier ? { serviceTier } : {},
|