Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace 付き combo alias はその namespace prefix に selector を再利
| `modelMaxInputTokens?` | `Record<string, number>` |カタログの自動圧縮ヒントに使用されるモデルごとの正の最大入力制限。 |
| `defaultMaxOutputTokens?` | `number` |クライアントが `max_output_tokens` を省略した場合の、プロバイダー全体の `openai-chat` フォールバック。 |
| `modelMaxOutputTokens?` | `Record<string, number>` |モデルごとの `openai-chat` フォールバック バジェットがプラスになります。正確な/パターン一致はプロバイダーのデフォルトを上回ります。 |
| `modelCosts?` | `Record<string, Cost4>` | モデルごとの表示価格(100万トークンあたりの米ドル)。正確なモデル ID をキーにし、値は `input`, `output`, `cacheRead`, `cacheWrite` の 4 フィールドです(例: `{ "deepseek-v4-flash": { "input": 0.14, "output": 0.28, "cacheRead": 0.0028, "cacheWrite": 0 } }`)。組み込みカタログにないカスタム・内部プロバイダーの ID も有効です。ユーザー設定の価格は Logs の `~$` 見積もりで組み込みカタログより優先されます(フォールバック順: ユーザー設定 → jawcode カタログ → expected-price オーバーレイ → モデル別ベンダー価格)。全ゼロのエントリは次のソースにフォールバックします。表示専用の見積もりであり、請求には影響しません。 |
| `headers?` | `Record<string, string>` |追加の上流ヘッダー。認証、Cookie、API キー ヘッダー、埋め込まれた改行、および無効な名前は拒否されます。 |
| `openRouterRouting?` | `OpenRouterProviderRouting` |デフォルトの OpenRouter `order`、`only`、および `allowFallbacks` 設定。 `openai-chat` を持つ正規 OpenRouter に対してのみ有効です。 |
| `modelOpenRouterRouting?` | `Record<string, OpenRouterProviderRouting>` |プロバイダー全体の OpenRouter 設定を置き換える正確なモデル ID のオーバーライド。 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ target도 selector로 재사용할 수 없습니다. raw account id와 email은
| `modelMaxInputTokens?` | `Record<string, number>` | 카탈로그 자동 압축 힌트에 쓰는 양수 모델별 최대 입력 한도입니다. |
| `defaultMaxOutputTokens?` | `number` | 클라이언트가 `max_output_tokens`를 생략했을 때 쓰는 공급자 전반의 `openai-chat` 폴백입니다. |
| `modelMaxOutputTokens?` | `Record<string, number>` | 양수 모델별 `openai-chat` 폴백 예산입니다. 정확한 일치와 패턴 일치가 공급자 기본값보다 우선합니다. |
| `modelCosts?` | `Record<string, Cost4>` | 모델별 표시 가격(100만 토큰당 USD). 정확한 모델 ID를 키로 사용하며 값은 `input`, `output`, `cacheRead`, `cacheWrite` 네 필드입니다(예: `{ "deepseek-v4-flash": { "input": 0.14, "output": 0.28, "cacheRead": 0.0028, "cacheWrite": 0 } }`). 내장 카탈로그에 없는 커스텀·내부 공급자 ID도 유효합니다. 사용자 구성 가격은 Logs `~$` 추정에서 내장 카탈로그보다 우선합니다(폴백 순서: 사용자 설정 → jawcode 카탈로그 → expected-price 오버레이 → 모델별 벤더 가격). 전부 0인 항목은 다음 소스로 폴백합니다. 표시 전용 추정이며 청구에는 영향을 주지 않습니다. |
| `headers?` | `Record<string, string>` | 추가 상위 헤더입니다. Authorization, cookies, API-key 헤더, 내장 개행, 잘못된 이름은 허용하지 않습니다. |
| `openRouterRouting?` | `OpenRouterProviderRouting` | 기본 OpenRouter `order`, `only`, `allowFallbacks` 선호도입니다. 정식 OpenRouter와 `openai-chat`에서만 유효합니다. |
| `modelOpenRouterRouting?` | `Record<string, OpenRouterProviderRouting>` | 공급자 전반의 OpenRouter 선호도를 덮어쓰는 정확한 모델 id별 재정의입니다. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ differing backup and rewrites known legacy namespaced selected ids to bare ids.
| `modelMaxInputTokens?` | `Record<string, number>` | Positive per-model max input limits used for catalog auto-compaction hints. |
| `defaultMaxOutputTokens?` | `number` | Provider-wide `openai-chat` fallback when the client omits `max_output_tokens`. |
| `modelMaxOutputTokens?` | `Record<string, number>` | Positive per-model `openai-chat` fallback budgets; exact/pattern matches beat the provider default. |
| `modelCosts?` | `Record<string, Cost4>` | Per-model display prices (USD per 1M tokens), keyed by exact model id, e.g. `{ "deepseek-v4-flash": { "input": 0.14, "output": 0.28, "cacheRead": 0.0028, "cacheWrite": 0 } }`. Any model id is a valid key — custom or internal provider ids work even when they are absent from the built-in catalogs. User-configured prices win over the built-in catalogs in the Logs `~$` estimate; the fallback order is user `modelCosts` → jawcode catalog → expected-price overlay → model-level vendor fallback, and an all-zero entry falls through to the next source in that sequence. Display-time estimation only, never billing. |
| `headers?` | `Record<string, string>` | Extra upstream headers. Authorization, cookies, API-key headers, embedded newlines, and invalid names are rejected. |
| `openRouterRouting?` | `OpenRouterProviderRouting` | Default OpenRouter `order`, `only`, and `allowFallbacks` preferences; valid only for canonical OpenRouter with `openai-chat`. |
| `modelOpenRouterRouting?` | `Record<string, OpenRouterProviderRouting>` | Exact model-id overrides that replace the provider-wide OpenRouter preference. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ cross-route credential fallback не существует. Строки API GPT-
| `modelMaxInputTokens?` | `Record<string, number>` | Положительные лимиты max input по моделям, используемые для подсказок auto-compaction в каталоге. |
| `defaultMaxOutputTokens?` | `number` | Provider-wide fallback для `openai-chat`, когда клиент не передал `max_output_tokens`. |
| `modelMaxOutputTokens?` | `Record<string, number>` | Положительные fallback-budget'ы `openai-chat` по моделям; exact/pattern-match имеет приоритет над provider-default. |
| `modelCosts?` | `Record<string, Cost4>` | Отображаемые цены по моделям (USD за 1M токенов), ключ — точный id модели, значение — четыре поля: `input`, `output`, `cacheRead`, `cacheWrite` (пример: `{ "deepseek-v4-flash": { "input": 0.14, "output": 0.28, "cacheRead": 0.0028, "cacheWrite": 0 } }`). Любой id допустим — кастомные/внутренние провайдеры работают даже без строки во встроенных каталогах. Пользовательские цены имеют приоритет над встроенными каталогами в оценке `~$` в Logs (порядок: пользователь → каталог jawcode → expected-price overlay → вендорская цена модели); полностью нулевая запись переходит к следующему источнику. Только оценка для отображения, не биллинг. |
| `headers?` | `Record<string, string>` | Дополнительные upstream-header'ы. Заголовки авторизации, cookie, API-key-header'ы, встроенные переводы строк и невалидные имена отклоняются. |
| `openRouterRouting?` | `OpenRouterProviderRouting` | Предпочтения по умолчанию для OpenRouter (`order`, `only`, `allowFallbacks`); валидно только для канонического OpenRouter с `openai-chat`. |
| `modelOpenRouterRouting?` | `Record<string, OpenRouterProviderRouting>` | Exact override по model id, которые полностью заменяют provider-wide preference для OpenRouter. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pool account id(不能是内部 `__main__`),或用 `"@main"` 表示 Codex
| `modelMaxInputTokens?` | `Record<string, number>` | 正数型、按模型设置的最大输入限制,用于目录自动压缩提示。 |
| `defaultMaxOutputTokens?` | `number` | 当客户端省略 `max_output_tokens` 时,`openai-chat` 的提供者级回退值。 |
| `modelMaxOutputTokens?` | `Record<string, number>` | 正数型、按模型设置的 `openai-chat` 回退预算;精确/模式匹配优先于提供者默认值。 |
| `modelCosts?` | `Record<string, Cost4>` | 按模型设置的显示价格(每 100 万 token 的美元数),以精确模型 ID 为键,值为四个字段:`input`、`output`、`cacheRead`、`cacheWrite`(示例:`{ "deepseek-v4-flash": { "input": 0.14, "output": 0.28, "cacheRead": 0.0028, "cacheWrite": 0 } }`)。任何模型 ID 都是有效键——即使内置于内置目录中不存在,自定义/内部提供者的 ID 同样有效。用户配置的价格在 Logs 的 `~$` 估算中优先于内置目录(回退顺序:用户配置 → jawcode 目录 → expected-price 覆盖 → 模型级厂商价格);全零条目会回退到该顺序中的下一个来源。仅用于显示的估算,绝不涉及计费。 |
| `headers?` | `Record<string, string>` | 额外的上游请求头。会拒绝 Authorization、cookie、API key 头、嵌入换行符以及无效名称。 |
| `openRouterRouting?` | `OpenRouterProviderRouting` | 默认的 OpenRouter `order`、`only` 和 `allowFallbacks` 偏好;仅对使用 `openai-chat` 的规范 OpenRouter 有效。 |
| `modelOpenRouterRouting?` | `Record<string, OpenRouterProviderRouting>` | 精确模型 id 级别的覆盖项,会替换提供者级 OpenRouter 偏好。 |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions gui/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ export const de: Record<TKey, string> = {
"logs.detail.copied": "Kopiert",
"logs.detail.source.jawcode": "jawcode-Katalog",
"logs.detail.source.expected": "Expected-Preis-Overlay",
"logs.detail.source.user": "Anbieter-konfiguriertes Preis-Overlay",
"logs.detail.verification.verified": "Verifiziert",
"logs.detail.verification.derived": "Vom Basismodell abgeleitet",
"logs.detail.attempt.target": "Anbieter / Modell",
Expand All @@ -573,6 +574,7 @@ export const de: Record<TKey, string> = {
"logs.detail.estimate.usage_estimated": "Die Anbieternutzung ist geschätzt.",
"logs.detail.estimate.cache_detail_missing": "Cache-Details fehlen; Eingabe ist als Obergrenze geschätzt.",
"logs.detail.estimate.expected_price_overlay": "Ein verifizierter Expected-Listenpreis wurde verwendet.",
"logs.detail.estimate.provider_cost_overlay": "Ein vom Anbieter konfiguriertes Preis-Overlay wurde verwendet.",
"logs.col.error": "Fehler",
"logs.col.upstreamReason": "Upstream-Grund",
"logs.col.duration": "Dauer",
Expand Down
2 changes: 2 additions & 0 deletions gui/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ export const en = {
"logs.detail.copied": "Copied",
"logs.detail.source.jawcode": "jawcode catalog",
"logs.detail.source.expected": "Expected price overlay",
"logs.detail.source.user": "Provider-configured price overlay",
"logs.detail.verification.verified": "Verified",
"logs.detail.verification.derived": "Derived from base model",
"logs.detail.attempt.target": "Provider / model",
Expand All @@ -600,6 +601,7 @@ export const en = {
"logs.detail.estimate.usage_estimated": "Provider usage is estimated.",
"logs.detail.estimate.cache_detail_missing": "Cache details were unavailable; input is an upper-bound estimate.",
"logs.detail.estimate.expected_price_overlay": "A verified expected list price was used.",
"logs.detail.estimate.provider_cost_overlay": "A provider-configured price overlay was used.",
"logs.col.error": "Error",
"logs.col.upstreamReason": "Upstream reason",
"logs.col.duration": "Duration",
Expand Down
2 changes: 2 additions & 0 deletions gui/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ export const ja: Record<TKey, string> = {
"logs.detail.copied": "コピーしました",
"logs.detail.source.jawcode": "jawcode カタログ",
"logs.detail.source.expected": "予想価格オーバーレイ",
"logs.detail.source.user": "プロバイダー設定の価格オーバーレイ",
"logs.detail.verification.verified": "検証済み",
"logs.detail.verification.derived": "ベースモデルから派生",
"logs.detail.attempt.target": "プロバイダー / モデル",
Expand All @@ -558,6 +559,7 @@ export const ja: Record<TKey, string> = {
"logs.detail.estimate.usage_estimated": "プロバイダーの使用量は推定です。",
"logs.detail.estimate.cache_detail_missing": "キャッシュの詳細が利用できませんでした; 入力は上限の推定です。",
"logs.detail.estimate.expected_price_overlay": "検証済みの予想定価が使用されました。",
"logs.detail.estimate.provider_cost_overlay": "プロバイダー設定の価格オーバーレイが使用されました。",
"logs.col.error": "エラー",
"logs.col.upstreamReason": "上流の理由",
"logs.col.duration": "所要時間",
Expand Down
2 changes: 2 additions & 0 deletions gui/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ export const ko: Record<TKey, string> = {
"logs.detail.copied": "복사됨",
"logs.detail.source.jawcode": "jawcode 카탈로그",
"logs.detail.source.expected": "expected 가격 오버레이",
"logs.detail.source.user": "공급자 구성 가격 오버레이",
"logs.detail.verification.verified": "검증됨",
"logs.detail.verification.derived": "기반 모델 유도",
"logs.detail.attempt.target": "프로바이더 / 모델",
Expand All @@ -592,6 +593,7 @@ export const ko: Record<TKey, string> = {
"logs.detail.estimate.usage_estimated": "프로바이더 usage가 추정치입니다.",
"logs.detail.estimate.cache_detail_missing": "캐시 상세가 없어 입력 전액을 상한으로 추정했습니다.",
"logs.detail.estimate.expected_price_overlay": "검증된 expected 정가를 사용했습니다.",
"logs.detail.estimate.provider_cost_overlay": "공급자 구성 가격 오버레이를 사용했습니다.",
"logs.col.error": "오류",
"logs.col.upstreamReason": "업스트림 원인",
"logs.col.duration": "소요 시간",
Expand Down
2 changes: 2 additions & 0 deletions gui/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ export const ru: Record<TKey, string> = {
"logs.detail.copied": "Скопировано",
"logs.detail.source.jawcode": "каталог jawcode",
"logs.detail.source.expected": "Оверлей ожидаемых цен",
"logs.detail.source.user": "Ценовой оверлей провайдера",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"logs.detail.verification.verified": "Подтверждено",
"logs.detail.verification.derived": "Выведено из базовой модели",
"logs.detail.attempt.target": "Провайдер / модель",
Expand All @@ -590,6 +591,7 @@ export const ru: Record<TKey, string> = {
"logs.detail.estimate.usage_estimated": "Данные об использовании от провайдера — оценочные.",
"logs.detail.estimate.cache_detail_missing": "Детализация кэша недоступна; входные токены оценены по верхней границе.",
"logs.detail.estimate.expected_price_overlay": "Использована подтверждённая ожидаемая цена из прайс-листа.",
"logs.detail.estimate.provider_cost_overlay": "Использован ценовой оверлей провайдера.",
"logs.col.error": "Ошибка",
"logs.col.upstreamReason": "Причина от провайдера",
"logs.col.duration": "Длительность",
Expand Down
2 changes: 2 additions & 0 deletions gui/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ export const zh: Record<TKey, string> = {
"logs.detail.copied": "已复制",
"logs.detail.source.jawcode": "jawcode 目录",
"logs.detail.source.expected": "Expected 价格覆盖",
"logs.detail.source.user": "提供商自定义价格覆盖",
"logs.detail.verification.verified": "已验证",
"logs.detail.verification.derived": "由基础模型推导",
"logs.detail.attempt.target": "提供方 / 模型",
Expand All @@ -585,6 +586,7 @@ export const zh: Record<TKey, string> = {
"logs.detail.estimate.usage_estimated": "提供方 usage 为估算值。",
"logs.detail.estimate.cache_detail_missing": "缺少缓存明细;输入费用按上限估算。",
"logs.detail.estimate.expected_price_overlay": "使用了已验证的 Expected 标价。",
"logs.detail.estimate.provider_cost_overlay": "使用了提供商自定义的价格覆盖。",
"logs.col.error": "错误",
"logs.col.upstreamReason": "上游原因",
"logs.col.duration": "耗时",
Expand Down
11 changes: 9 additions & 2 deletions gui/src/pages/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ type MetricUnavailableReason =
| "price_unmatched" | "invalid_cache_breakdown"
| "invalid_usage" | "combo_attempt_unavailable";

type CostEstimateReason = "usage_estimated" | "cache_detail_missing" | "expected_price_overlay";
type CostEstimateReason =
| "usage_estimated"
| "cache_detail_missing"
| "expected_price_overlay"
| "provider_cost_overlay";
Comment thread
coderabbitai[bot] marked this conversation as resolved.

type TokPerSecondResult =
| { kind: "value"; value: number; estimated: boolean }
Expand All @@ -52,7 +56,7 @@ interface MatchedPriceInfo {
provider: string;
modelId: string;
jawcodeProvider?: string;
source: "jawcode" | "expected";
source: "jawcode" | "expected" | "user";
sourceRef?: string;
verifiedAt?: string;
status: "verified" | "verified-derived";
Expand Down Expand Up @@ -290,6 +294,7 @@ const ESTIMATE_REASON_KEYS = {
usage_estimated: "logs.detail.estimate.usage_estimated",
cache_detail_missing: "logs.detail.estimate.cache_detail_missing",
expected_price_overlay: "logs.detail.estimate.expected_price_overlay",
provider_cost_overlay: "logs.detail.estimate.provider_cost_overlay",
Comment thread
harryzhou2000 marked this conversation as resolved.
} as const satisfies Record<CostEstimateReason, string>;

/**
Expand All @@ -306,10 +311,12 @@ const RECOVERY_KIND_KEYS = {
"image-413": "logs.detail.attempt.recovery.image413",
} as const satisfies Record<AttemptRecoveryKind, string>;

/** Map a metric-unavailable reason to its i18n key. */
function metricReasonKey(reason: MetricUnavailableReason) {
return METRIC_REASON_KEYS[reason];
}

/** Map a cost-estimate reason to its i18n key. */
function estimateReasonKey(reason: CostEstimateReason) {
return ESTIMATE_REASON_KEYS[reason];
}
Expand Down
Loading
Loading