From 42d70cbdd9de1655cb8aa0fb94b1dc05ec807159 Mon Sep 17 00:00:00 2001 From: fylorn <249551762+fylorn@users.noreply.github.com> Date: Sat, 10 Oct 2026 19:09:36 +0800 Subject: [PATCH 1/3] Docs for Lite 2026.10.13 and core 0.69.0 - Features (en, zh-CN): the new upstream dialog's Service step; every amber warning can be ignored and Show again brings them back; each turn's context window and its estimated breakdown in the conversation view; a model's reasoning kept across API formats, tool calls written into answer text, compressed request bodies and upstream answers, and keep-alive pings while a request waits for a slot; the Time condition of routing rules; one colour per request on the routing map; the menu bar item no longer coloured by a quota. - Claude Code, Codex and failover guides, CC Switch comparison (en, zh-CN): the Service step of the new upstream dialog. - Lite page: the menu bar tile no longer describes the quota colours. Co-Authored-By: Claude Fable 5.1 --- src/content/docs-lite/en/claude-code-other-models.md | 2 +- src/content/docs-lite/en/codex-other-models.md | 2 +- src/content/docs-lite/en/compare-cc-switch.md | 2 +- .../docs-lite/en/failover-and-load-balancing.md | 2 +- src/content/docs-lite/en/features.md | 12 ++++++------ .../docs-lite/zh-CN/claude-code-other-models.md | 2 +- src/content/docs-lite/zh-CN/codex-other-models.md | 2 +- src/content/docs-lite/zh-CN/compare-cc-switch.md | 2 +- .../docs-lite/zh-CN/failover-and-load-balancing.md | 2 +- src/content/docs-lite/zh-CN/features.md | 12 ++++++------ src/i18n/pages/lite.ts | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/content/docs-lite/en/claude-code-other-models.md b/src/content/docs-lite/en/claude-code-other-models.md index 26f29db..d1bdd86 100644 --- a/src/content/docs-lite/en/claude-code-other-models.md +++ b/src/content/docs-lite/en/claude-code-other-models.md @@ -10,7 +10,7 @@ ThinkWatch Lite connects Claude Code to a gateway on the same computer, which fo ## Steps -1. On the Upstreams page, choose **New upstream** and pick a **Service**: +1. On the Upstreams page, choose **New upstream**. The first step, **Service**, lists the services that can be connected, account sign-ins first and API access after them, with a search box; picking one goes straight to **Connection**: - **DeepSeek** fills in `https://api.deepseek.com/anthropic` and the protocol. Enter the **API key**. - GLM with a key: **Custom**, with `https://open.bigmodel.cn/api/anthropic` or `https://api.z.ai/api/anthropic` as the **Base URL**, **Protocol** set to **Anthropic Messages**, and the **API key**. GLM's OpenAI-compatible address also works from ThinkWatch Lite 2026.10.5, with **Protocol** set to **OpenAI Chat Completions**: `https://api.z.ai/api/paas/v4` or `https://open.bigmodel.cn/api/paas/v4`, and `…/api/coding/paas/v4` on a GLM Coding Plan. Claude Code's requests are then converted, so the Anthropic address is the more direct choice. - GLM with an account: **Z.ai / BigModel account**. Select the **Account service**, tick **Acknowledge the notes above and continue signing in**, choose **Sign in** and authorize in the browser. The app creates an API key named `thinkwatch` on the account and saves the upstream. diff --git a/src/content/docs-lite/en/codex-other-models.md b/src/content/docs-lite/en/codex-other-models.md index 01f31a7..1cd6d92 100644 --- a/src/content/docs-lite/en/codex-other-models.md +++ b/src/content/docs-lite/en/codex-other-models.md @@ -10,7 +10,7 @@ ThinkWatch Lite connects Codex to a gateway on the same computer that accepts th ## Steps -1. On the Upstreams page, choose **New upstream** and pick a **Service**: **Anthropic** for Claude, or **Google Gemini**; each fills in the address and protocol. For a relay, choose **Custom**, enter its **Base URL** without an endpoint path such as `/chat/completions`, and set **Protocol** to **OpenAI Chat Completions**; for GLM, for example, `https://api.z.ai/api/paas/v4`, or `…/api/coding/paas/v4` on a GLM Coding Plan. A base URL that ends with its own version, such as `/v4` or Volcengine Ark's `/api/v3`, is used as written from ThinkWatch Lite 2026.10.5. Enter the **API key**, choose **Check connection**, then **Next**. If the relay lists no models, or leaves some out, type each missing model ID in the box at the end of **Models** and press Enter. Choose **Next**, then **Create**. +1. On the Upstreams page, choose **New upstream** and pick the service on the first step, **Service**, which goes straight to **Connection**: **Anthropic** for Claude, or **Google Gemini**; each fills in the address and protocol. For a relay, choose **Custom**, enter its **Base URL** without an endpoint path such as `/chat/completions`, and set **Protocol** to **OpenAI Chat Completions**; for GLM, for example, `https://api.z.ai/api/paas/v4`, or `…/api/coding/paas/v4` on a GLM Coding Plan. A base URL that ends with its own version, such as `/v4` or Volcengine Ark's `/api/v3`, is used as written from ThinkWatch Lite 2026.10.5. Enter the **API key**, choose **Check connection**, then **Next**. If the relay lists no models, or leaves some out, type each missing model ID in the box at the end of **Models** and press Enter. Choose **Next**, then **Create**. 2. On the Clients page, choose **Connect…** on the Codex row. The dialog shows the change to `~/.codex/config.toml`: | Field | Value | diff --git a/src/content/docs-lite/en/compare-cc-switch.md b/src/content/docs-lite/en/compare-cc-switch.md index 77281c1..4bd4903 100644 --- a/src/content/docs-lite/en/compare-cc-switch.md +++ b/src/content/docs-lite/en/compare-cc-switch.md @@ -17,7 +17,7 @@ A dash means the feature is not described in that product's documentation. | | CC Switch | ThinkWatch Lite | |---|---|---| | Clients | Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes Agent, Pi, MiniMax Code | In one step: Claude Code, Claude Desktop, Codex (also in the ChatGPT desktop app), opencode, Pi, oh-my-pi, Grok Build, Qwen Code, Hermes Agent, Zed, Aider, DeepSeek Harness. With instructions: Cursor, Continue, Antigravity CLI | -| Adding providers | More than 50 presets; `ccswitch://` links import providers, MCP servers, prompts and skills | Anthropic, OpenAI, Google Gemini, Amazon Bedrock, DeepSeek and Ollama in the service list, or any compatible endpoint; `thinkwatch://import` links from a relay or vendor pre-fill one upstream | +| Adding providers | More than 50 presets; `ccswitch://` links import providers, MCP servers, prompts and skills | A new upstream starts from the service: a ChatGPT or Z.ai / BigModel account sign-in, API access to Anthropic, OpenAI, Google Gemini, Amazon Bedrock, DeepSeek or Ollama, or any compatible endpoint; `thinkwatch://import` links from a relay or vendor pre-fill one upstream | | Routing | In proxy mode, each client's requests go to its current provider; models can be mapped per provider | Ordered rules per key by model, API format, input tokens, tools, images, extended thinking and more; rules can rewrite the model | | Failover | Queue in priority order with a circuit breaker (proxy mode) | Next upstream in the group when an attempt fails before the answer begins; a session stays on one upstream | | Load balancing | — | Group strategies: in order, manual, round robin, lowest latency, lowest cost | diff --git a/src/content/docs-lite/en/failover-and-load-balancing.md b/src/content/docs-lite/en/failover-and-load-balancing.md index 095719f..3d00cfe 100644 --- a/src/content/docs-lite/en/failover-and-load-balancing.md +++ b/src/content/docs-lite/en/failover-and-load-balancing.md @@ -9,7 +9,7 @@ ThinkWatch Lite turns each relay key into an upstream and puts several upstreams ## Steps -1. On the Upstreams page, choose **New upstream**. Under **Connection**, enter a **Name**, the **Base URL** and one **API key**, choose **Check connection**, then **Next** until **Create**. Repeat for each key: an upstream holds one key, and failover and pauses work per upstream. +1. On the Upstreams page, choose **New upstream** and pick the service under **Service** (**Custom** for a relay). Under **Connection**, enter a **Name**, the **Base URL** and one **API key**, choose **Check connection**, then **Next** until **Create**. Repeat for each key: an upstream holds one key, and failover and pauses work per upstream. 2. On the Routing page, choose **New group** under **Groups**. Enter a **Name**, choose a **Strategy**, tick the upstreams under **Members**, drag them into order and choose **Create**. For **Round robin**, also enter each member's **Weight** and choose **Distribute by**. 3. Under **Routes**, open the route, choose **Edit…** on the rule that should use the group (usually **All requests (catch-all)**), select the group in **Forward to** and choose **Save** in both dialogs. 4. **Dry run** checks the result without sending anything. On the Traffic page, a request's **Routing** tab lists the upstreams it tried under **Attempts**. diff --git a/src/content/docs-lite/en/features.md b/src/content/docs-lite/en/features.md index c56759a..042aec5 100644 --- a/src/content/docs-lite/en/features.md +++ b/src/content/docs-lite/en/features.md @@ -8,7 +8,7 @@ The main window has ten pages: Overview, Traffic, Clients, Keys, Upstreams, Rout The Overview page covers the last 24 hours, 7 days, 30 days or a custom range on one screen of six cards: **Tokens**, **Cost**, **Cache hits**, **Requests**, **First token** and **Traffic**. Each card gives its figure and the change against the previous period of the same length. All but Cache hits carry a small chart of the period; hovering any chart shows the same point in time on every chart, and the value appears on the card under the pointer. **Cache hits** shows the hit rate, the net savings the cache brought, and how input was split between cache reads, uncached input and cache writes. **First token** charts the median and the 95th percentile of the time to first token, and stretches without requests are bridged with a faint dashed line. **Traffic** is what requests sent to their upstreams and received from them (see [Traffic and sessions](#traffic-and-sessions)), with upload and download charted separately. -A strip above the cards lists what needs attention: failed requests, tool calls that were cut off, upstreams that cannot be used (circuit open, credentials rejected or sign-in required), and unpriced requests, each with a link to the page that deals with it. It is hidden when there is nothing to list. The table below the cards lists the requests, tokens, cost, cache hits, first token and generation speed by model, upstream or key (generation speed by model and by upstream only), and a row opens the matching requests in Traffic. In **Live**, the Tokens, Cost and Requests cards follow the last ten minutes, while the other cards, the strip and the table cover the last 24 hours. +A strip above the cards lists what needs attention: failed requests, tool calls that were cut off, upstreams that cannot be used (circuit open, credentials rejected or sign-in required), and unpriced requests, each with a link to the page that deals with it. It is hidden when there is nothing to list. Each line can be ignored and returns when that matter has news; the notice that request recording could not start and the banners for a lost connection or rejected configuration can be ignored as well, and **Show again** in Settings › General brings every ignored warning back. The table below the cards lists the requests, tokens, cost, cache hits, first token and generation speed by model, upstream or key (generation speed by model and by upstream only), and a row opens the matching requests in Traffic. In **Live**, the Tokens, Cost and Requests cards follow the last ten minutes, while the other cards, the strip and the table cover the last 24 hours. The cost figure states how much of it is estimated, for instance for a response that was cut off before it finished. Requests whose model has no price, and requests whose upstream reported no usage, are counted separately and never added in as zero. Prices come from price sheets: the default one follows LiteLLM's public prices and is refreshed once a day, and a custom one applies a multiplier and its own prices for particular models, as needed for a relay whose prices differ from the official ones. A subscription account such as a ChatGPT sign-in is priced from the price sheet like any other upstream, and an upstream such as a local model can be set to free. Each request's cost is fixed when the request finishes, and the request records the price sheet and the date of the prices it was costed with. @@ -16,7 +16,7 @@ Until the first request has gone to an upstream, the Overview page shows a get-s ## Traffic and sessions -The Traffic page lists requests as they arrive: status, key, model, upstream, time to first token and total time (with the generation speed on hover), tokens (with the upload and download on hover) and cost, with marks for a converted API format, redacted keys, text deleted by the content filter and a blocked or suspicious tool call. Long upstream, model and key names are cut short, and hovering shows them in full. The list can be searched (path, key, upstream, model and error message), filtered by key, upstream and model, or narrowed to failed or unpriced requests. It holds the latest 2,000 requests, and a search or filter also runs over the stored history, further back on request. With content search on, it also covers what each request newly sent (the last user turn, tool results included) and its answer (tool calls included), for as long as payloads are kept; a match shows its excerpt under the request. The Sessions view groups the requests of one conversation into turns, with the input tokens and the cost of each turn. A session's Conversation tab replays it turn by turn: the messages each turn added and its answer, with text, folded thinking, tool calls beside their results, and images by type and size. Changes to the system prompt and restarts after compaction are marked, and a turn whose bodies are past retention, were too large to keep whole or cannot be read says so. Each turn opens its request. +The Traffic page lists requests as they arrive: status, key, model, upstream, time to first token and total time (with the generation speed on hover), tokens (with the upload and download on hover) and cost, with marks for a converted API format, redacted keys, text deleted by the content filter and a blocked or suspicious tool call. Long upstream, model and key names are cut short, and hovering shows them in full. The list can be searched (path, key, upstream, model and error message), filtered by key, upstream and model, or narrowed to failed or unpriced requests. It holds the latest 2,000 requests, and a search or filter also runs over the stored history, further back on request. With content search on, it also covers what each request newly sent (the last user turn, tool results included) and its answer (tool calls included), for as long as payloads are kept; a match shows its excerpt under the request. The Sessions view groups the requests of one conversation into turns, with the input tokens and the cost of each turn. Each turn also shows how full the model's context window was: the tokens sent to the model over the window, with cache reads as their own segment. Opening a turn shows an estimate of how much the system prompt, the tool definitions, the earlier conversation and the last user message took. A session's Conversation tab replays it turn by turn: the messages each turn added and its answer, with text, folded thinking, tool calls beside their results, and images by type and size. Changes to the system prompt and restarts after compaction are marked, and a turn whose bodies are past retention, were too large to keep whole or cannot be read says so. Each turn opens its request. A request opens into its timeline, its routing (the rule it matched, the group it went through and each attempt with its status and duration), its content, and its usage and cost. The timeline gives the proxy the request went out through (**Egress**, or **Direct**) and how much it sent to its upstreams and received from them (**Upload** and **Download**), measured as it crossed the network: after the gateway's own compression, before decoding, and summed over failover attempts. A request from DeepSeek Harness also shows the size of the session log it carried, the whole conversation the client attaches to every request; the gateway removes it before a request goes to an upstream other than DeepSeek. A finished request can be sent again, unchanged, to another upstream after an estimate of its cost, and the two responses are shown side by side. @@ -45,7 +45,7 @@ Usage limits keep one client from using up a budget: each caps the key at a numb ## Upstreams -Upstreams are the services requests are forwarded to: API keys for Anthropic, OpenAI, Google Gemini, DeepSeek or any compatible endpoint, Amazon Bedrock (with an API key, access keys or an AWS profile), a ChatGPT account or a Z.ai / BigModel account signed in from the app, relays such as OpenRouter, and local models such as Ollama. A ChatGPT account shows its usage limits and reset times. So does an upstream on a GLM Coding Plan, that is, one whose address is on `api.z.ai` or `open.bigmodel.cn`, whether it was signed in from the app or added with a key: its 5-hour and weekly limits and, on a plan billed in credits, the credits left (“1,976 / 2,000 credits left”). When a client and an upstream use different API formats, requests are converted between Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Gemini, and the fields that cannot be carried over are listed on the request. Clients such as Codex mark no prompt-cache breakpoints; when their requests are converted for an upstream in Anthropic Messages format, or for a Claude model on Bedrock that AWS lists for prompt caching (Claude 3.5 Sonnet v2, Claude 3.7 Sonnet, and Claude 4.5 and later), the gateway marks them, so each turn reads what the previous one cached. An upstream that refuses the marks receives the request again without them. Upstreams can be reached through an outbound proxy and priced with a price sheet of their own; aliases, proxies and price sheets have tabs on the same page. The **Traffic · 24 h** column of the **Proxies** tab gives the upload and download through each proxy over the last 24 hours, with 7 and 30 days on hover. An optional **Concurrency limit** suits relays and accounts that allow only so many requests at once: when the upstream is full, a conversation that stays on it waits for a free slot, other requests go to the next upstream, and when every upstream is full a request waits and then receives a busy error. **Specs…** in an upstream's model list sets by hand a model's context window, maximum output, and whether it reasons and takes images, for a model the price table lacks or gets wrong; the values set there are used in place of the price table's. A connection test times the DNS lookup and the TCP, TLS and proxy handshakes without incurring any cost; an inference test measures the time to first token and estimates its cost before it runs. +Upstreams are the services requests are forwarded to: API keys for Anthropic, OpenAI, Google Gemini, DeepSeek or any compatible endpoint, Amazon Bedrock (with an API key, access keys or an AWS profile), a ChatGPT account or a Z.ai / BigModel account signed in from the app, relays such as OpenRouter, and local models such as Ollama. **New upstream** starts with the service: account sign-ins (ChatGPT, Z.ai / BigModel) first, then API access (Anthropic, OpenAI, Google Gemini, Amazon Bedrock, DeepSeek, Ollama and Custom), with a search box; picking one goes straight to **Connection**. A ChatGPT account shows its usage limits and reset times. So does an upstream on a GLM Coding Plan, that is, one whose address is on `api.z.ai` or `open.bigmodel.cn`, whether it was signed in from the app or added with a key: its 5-hour and weekly limits and, on a plan billed in credits, the credits left (“1,976 / 2,000 credits left”). When a client and an upstream use different API formats, requests are converted between Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Gemini, and the fields that cannot be carried over are listed on the request. A model's reasoning survives the conversion: the reasoning a Chat Completions upstream such as DeepSeek, Kimi or GLM returns reaches the client as it is and goes back to that upstream on the next turn, so a conversation with tool calls can continue, and the thought signatures on a Gemini model's tool calls are kept as well. When a Chat Completions model writes a tool call into its answer text, the gateway recognises it as an ordinary tool call, provided the request defined that tool, and it goes through tool-call inspection like any other. A request body a client sends compressed with gzip, deflate or zstd is read as usual, and an answer an upstream sends compressed reaches the client decoded. Clients such as Codex mark no prompt-cache breakpoints; when their requests are converted for an upstream in Anthropic Messages format, or for a Claude model on Bedrock that AWS lists for prompt caching (Claude 3.5 Sonnet v2, Claude 3.7 Sonnet, and Claude 4.5 and later), the gateway marks them, so each turn reads what the previous one cached. An upstream that refuses the marks receives the request again without them. Upstreams can be reached through an outbound proxy and priced with a price sheet of their own; aliases, proxies and price sheets have tabs on the same page. The **Traffic · 24 h** column of the **Proxies** tab gives the upload and download through each proxy over the last 24 hours, with 7 and 30 days on hover. An optional **Concurrency limit** suits relays and accounts that allow only so many requests at once: when the upstream is full, a conversation that stays on it waits for a free slot, other requests go to the next upstream, and when every upstream is full a request waits and then receives a busy error. A streamed request waiting for a slot or for its key's usage window receives keep-alive pings while it waits. **Specs…** in an upstream's model list sets by hand a model's context window, maximum output, and whether it reasons and takes images, for a model the price table lacks or gets wrong; the values set there are used in place of the price table's. A connection test times the DNS lookup and the TCP, TLS and proxy handshakes without incurring any cost; an inference test measures the time to first token and estimates its cost before it runs. An upstream's models are the ones it lists plus any added by hand. Upstreams often leave out models they serve: an account backend hides newer models, a relay lists only some. **Add models…** in an upstream's model list adds such models by their exact IDs, several at a time. An ID cannot contain `*` or `?` or have spaces around it, is at most 256 characters, and is added once; the dialog points out an ID that breaks these rules, or one the upstream already lists, before saving. A model added by hand is marked **Manual**, and routing and failover, aliases, routing rules that name a model, a key's allowed models, the model list clients see, the dry run and the speed test all treat it like a listed model. The summary at the top of the list counts the models the upstream lists apart from those added by hand. Hovering over a manual model shows **Remove**, which takes effect at once, with **Undo** in the message that follows. The **Models** section of the **New upstream** and **Edit upstream** dialogs ends with the same input, for an upstream with or without a list, so models can also be added while it is created or edited. They are saved with the rest of the upstream, and with **Selected models** a model added there is enabled at once. For an upstream that lists no models, the models added by hand are its whole list. @@ -59,7 +59,7 @@ A relay or vendor can hand out an import link, `thinkwatch://import?…` or its ## Routing and failover -Each key follows a route, and keys without one follow the default route. A route is a list of rules evaluated in order. A rule matches on the model, the key, the client's API format, input tokens, `max_tokens`, the number of tools, images, extended thinking, streaming, prompt caching or the kind of auxiliary request; it then forwards the request to an upstream, a group or specified models, or refuses it, and can rewrite the model, `max_tokens` or extended thinking. Specified models name an upstream and one of its models, with backups tried in order, and send the model as written; to have one client use one model under another model's name, a rule on that client's key does it without changing what the name means for other clients. A model condition written for an upstream model also matches the aliases that list it. Setting `max_tokens` caps the length of answers: the upstream stops at that point by itself, without an error. A group puts several upstreams behind one name and decides the order in which they are tried: as listed, manually selected, in turn, lowest latency first or lowest cost first. In a round-robin group each member has a weight from 1 to 100, its long-run share of requests, and **Distribute by** can multiply the weights by each upstream's speed (time to first token), its reliability (recent success rate) or both; conversations in progress stay on their upstream. When an attempt fails, the request moves on to the next upstream, and by default a session stays on one upstream so that its prompt cache keeps hitting. An upstream that sends no content for the **No-response timeout** in Settings › Failover, 300 seconds by default, is given up on; keep-alive pings do not count as content. Before anything has reached the client, the request moves to the next upstream, and when none is left the client receives a timeout error; once the answer has started, it ends with an error. A map at the top of the page traces every key through its route and groups to the upstreams, and requests in flight move along their path from the key to the upstream. +Each key follows a route, and keys without one follow the default route. A route is a list of rules evaluated in order. A rule matches on the model, the key, the client's API format, input tokens, `max_tokens`, the number of tools, images, extended thinking, streaming, prompt caching, the kind of auxiliary request or the time of day; it then forwards the request to an upstream, a group or specified models, or refuses it, and can rewrite the model, `max_tokens` or extended thinking. Specified models name an upstream and one of its models, with backups tried in order, and send the model as written; to have one client use one model under another model's name, a rule on that client's key does it without changing what the name means for other clients. A model condition written for an upstream model also matches the aliases that list it. The time of day is judged by the local clock of the machine the gateway runs on: pick the weekdays and a start and end time, several windows per rule if needed, and an end earlier than the start is an overnight window. Setting `max_tokens` caps the length of answers: the upstream stops at that point by itself, without an error. A group puts several upstreams behind one name and decides the order in which they are tried: as listed, manually selected, in turn, lowest latency first or lowest cost first. In a round-robin group each member has a weight from 1 to 100, its long-run share of requests, and **Distribute by** can multiply the weights by each upstream's speed (time to first token), its reliability (recent success rate) or both; conversations in progress stay on their upstream. When an attempt fails, the request moves on to the next upstream, and by default a session stays on one upstream so that its prompt cache keeps hitting. An upstream that sends no content for the **No-response timeout** in Settings › Failover, 300 seconds by default, is given up on; keep-alive pings do not count as content. Before anything has reached the client, the request moves to the next upstream, and when none is left the client receives a timeout error; once the answer has started, it ends with an error. A map at the top of the page traces every key through its route and groups to the upstreams, and requests in flight move along their path from the key to the upstream, each in its own colour. Auxiliary requests that clients send on their own (health checks, warm-ups, titles, topic detection and input suggestions) can be answered locally at no cost, or forwarded. Forwarded ones go through the routing rules like any other request, and a rule can send a given kind to a lower-cost upstream. @@ -95,11 +95,11 @@ Plugins are short JavaScript files that change requests before they go to an ups ## Settings -Settings has seven sections. Connection lists the local core and the saved remote cores, described in [Connecting to a remote core](/docs/lite/remote-core). General sets the language, the appearance, what the menu bar item shows on macOS (or that it is hidden), launch at login, whether notices arrive as system notifications, in the app only or not at all, and shows hidden guidance hints again. Listening sets who can reach the gateway (this machine only, the local network of a chosen interface, or every interface), its port and the allowed address ranges. Failover sets how long a failing upstream is paused before requests go to the next one: after how many consecutive failures, for how long, and separate pauses for an insufficient balance, a used-up quota and rate limits. It also sets the no-response timeout, after which an upstream that has sent no content is given up on (300 seconds by default, from 30 to 3,600), and how long in total a request may wait for a free slot on a full upstream or for a key's per-minute or per-hour limit, 30 seconds by default. Log retention sets how long request payloads and request records are kept, and a size cap for payloads; the security log expires with the request records. About shows the version, checks for updates and produces a diagnostics bundle with keys and addresses masked. Uninstall restores every connected client and removes the autostart entry, and is meant to be run before the app is deleted. +Settings has seven sections. Connection lists the local core and the saved remote cores, described in [Connecting to a remote core](/docs/lite/remote-core). General sets the language, the appearance, what the menu bar item shows on macOS (or that it is hidden), launch at login, whether notices arrive as system notifications, in the app only or not at all, and shows hidden guidance hints and ignored warnings again. Listening sets who can reach the gateway (this machine only, the local network of a chosen interface, or every interface), its port and the allowed address ranges. Failover sets how long a failing upstream is paused before requests go to the next one: after how many consecutive failures, for how long, and separate pauses for an insufficient balance, a used-up quota and rate limits. It also sets the no-response timeout, after which an upstream that has sent no content is given up on (300 seconds by default, from 30 to 3,600), and how long in total a request may wait for a free slot on a full upstream or for a key's per-minute or per-hour limit, 30 seconds by default. Log retention sets how long request payloads and request records are kept, and a size cap for payloads; the security log expires with the request records. About shows the version, checks for updates and produces a diagnostics bundle with keys and addresses masked. Uninstall restores every connected client and removes the autostart entry, and is meant to be run before the app is deleted. ## Menu bar, system tray and notifications -On macOS the menu bar shows today's tokens above today's cost, written as a plain number without the ≥ and ~ marks, as short as the token count ($41.20); the opened menu marks a cost that includes estimates or is only a lower bound. The numbers turn orange when a subscription quota is nearly used up and red when it is. **Menu bar** in Settings › General can reduce the item to the icon or to the numbers, or set it to **Hidden**, which takes it off the menu bar: the gateway keeps running in the background, after a launch at login as well, and opening ThinkWatch Lite again from Finder or Spotlight shows the main window. +On macOS the menu bar shows today's tokens above today's cost, written as a plain number without the ≥ and ~ marks, as short as the token count ($41.20); the opened menu marks a cost that includes estimates or is only a lower bound. A subscription quota that is nearly used up or spent does not colour the item; only its row in the opened menu turns orange or red, and the mark carries a red badge when the gateway is not running. **Menu bar** in Settings › General can reduce the item to the icon or to the numbers, or set it to **Hidden**, which takes it off the menu bar: the gateway keeps running in the background, after a launch at login as well, and opening ThinkWatch Lite again from Finder or Spotlight shows the main window. Clicking it opens a native menu. **Open ThinkWatch Lite** always comes first, followed by unread notices and a **Today** block: today's tokens in large type, with requests, failures and cost on the line below and a small chart of tokens per hour beside them. The block's top line gives the gateway's state, the server's name when connected to a remote core, and the generation speed over the last minute. Below it, each quota window an upstream reports has a row with how much is used and when it resets (subscription accounts and GLM Coding Plan upstreams; a plan billed in credits shows the credits left under the bar), followed by the requests in progress. The actions come last: choosing the upstream of a manually selected group, copying the gateway address, which is shown beside the item, or the default key, installing a new version when one is available, settings, switching connections and checking for updates, all without opening the main window. diff --git a/src/content/docs-lite/zh-CN/claude-code-other-models.md b/src/content/docs-lite/zh-CN/claude-code-other-models.md index b099db4..43d4df6 100644 --- a/src/content/docs-lite/zh-CN/claude-code-other-models.md +++ b/src/content/docs-lite/zh-CN/claude-code-other-models.md @@ -10,7 +10,7 @@ ThinkWatch Lite 把 Claude Code 接到本机的网关上,网关再把每个请 ## 步骤 -1. 在「上游」页点击「新建上游」,选择「服务类型」: +1. 在「上游」页点击「新建上游」。第一步「服务类型」列出可接入的服务,账号登录在前、API 接入在后,可以搜索;选定后直接进入「连接」: - 「DeepSeek」:自动填入 `https://api.deepseek.com/anthropic` 和接口协议,再填写「API 密钥」。 - GLM(API 密钥):选「自定义」,「接口地址」填 `https://open.bigmodel.cn/api/anthropic` 或 `https://api.z.ai/api/anthropic`,「接口协议」选「Anthropic Messages」,再填写「API 密钥」。自 ThinkWatch Lite 2026.10.5 起,也可以使用 GLM 的 OpenAI 兼容地址,「接口协议」选「OpenAI Chat Completions」:`https://api.z.ai/api/paas/v4` 或 `https://open.bigmodel.cn/api/paas/v4`,GLM Coding Plan 使用 `…/api/coding/paas/v4`。这时 Claude Code 的请求需要转换格式,因此 Anthropic 地址更直接。 - GLM(账号登录):选「Z.ai / BigModel 账号」,在「账号归属」中选择站点,勾选「已阅读上述说明,继续登录」,点击「登录」并在浏览器中完成授权。应用在该账号中创建一把名为 `thinkwatch` 的 API 密钥,并写入上游。 diff --git a/src/content/docs-lite/zh-CN/codex-other-models.md b/src/content/docs-lite/zh-CN/codex-other-models.md index 909f1d4..7aed046 100644 --- a/src/content/docs-lite/zh-CN/codex-other-models.md +++ b/src/content/docs-lite/zh-CN/codex-other-models.md @@ -10,7 +10,7 @@ ThinkWatch Lite 把 Codex 接到本机的网关上,网关接收 OpenAI Respons ## 步骤 -1. 在「上游」页点击「新建上游」,选择「服务类型」:Claude 选「Anthropic」,Gemini 选「Google Gemini」,接口地址和接口协议会自动填入。中转站选「自定义」,「接口地址」填它的 Base URL(不含 `/chat/completions` 等接口路径),「接口协议」选「OpenAI Chat Completions」;例如 GLM 填 `https://api.z.ai/api/paas/v4`,GLM Coding Plan 填 `…/api/coding/paas/v4`。以自带版本号结尾的地址(如 `/v4`、火山方舟的 `/api/v3`),自 ThinkWatch Lite 2026.10.5 起按原样使用。填写「API 密钥」,点击「检测连接」,再点击「下一步」。中转站不提供模型列表或没有列全时,在「模型」一节末尾的输入框中逐个填写缺少的模型 ID 并回车。再点击「下一步」,然后点击「创建」。 +1. 在「上游」页点击「新建上游」,在第一步「服务类型」中选择服务,选定后直接进入「连接」:Claude 选「Anthropic」,Gemini 选「Google Gemini」,接口地址和接口协议会自动填入。中转站选「自定义」,「接口地址」填它的 Base URL(不含 `/chat/completions` 等接口路径),「接口协议」选「OpenAI Chat Completions」;例如 GLM 填 `https://api.z.ai/api/paas/v4`,GLM Coding Plan 填 `…/api/coding/paas/v4`。以自带版本号结尾的地址(如 `/v4`、火山方舟的 `/api/v3`),自 ThinkWatch Lite 2026.10.5 起按原样使用。填写「API 密钥」,点击「检测连接」,再点击「下一步」。中转站不提供模型列表或没有列全时,在「模型」一节末尾的输入框中逐个填写缺少的模型 ID 并回车。再点击「下一步」,然后点击「创建」。 2. 在「客户端」页 Codex 一行点击「接管…」。对话框列出对 `~/.codex/config.toml` 的修改: | 字段 | 写入 | diff --git a/src/content/docs-lite/zh-CN/compare-cc-switch.md b/src/content/docs-lite/zh-CN/compare-cc-switch.md index 45a0557..e212ac9 100644 --- a/src/content/docs-lite/zh-CN/compare-cc-switch.md +++ b/src/content/docs-lite/zh-CN/compare-cc-switch.md @@ -17,7 +17,7 @@ ThinkWatch Lite 在本机运行网关 ThinkWatch Core。在客户端页把每个 | | CC Switch | ThinkWatch Lite | |---|---|---| | 客户端 | Claude Code、Claude Desktop、Codex、Gemini CLI、Grok Build、OpenCode、OpenClaw、Hermes Agent、Pi、MiniMax Code | 一键接管:Claude Code、Claude Desktop、Codex(含 ChatGPT 桌面版中的 Codex)、opencode、Pi、oh-my-pi、Grok Build、Qwen Code、Hermes Agent、Zed、Aider、DeepSeek Harness;提供配置方法:Cursor、Continue、Antigravity CLI | -| 添加供应商 | 50 余个供应商预设;`ccswitch://` 链接可导入供应商、MCP 服务器、提示词与技能 | 服务类型中列有 Anthropic、OpenAI、Google Gemini、Amazon Bedrock、DeepSeek 与 Ollama,也可填写任何兼容接口;中转站或服务商可通过 `thinkwatch://import` 链接预填一个上游 | +| 添加供应商 | 50 余个供应商预设;`ccswitch://` 链接可导入供应商、MCP 服务器、提示词与技能 | 新建上游先选择服务:ChatGPT 与 Z.ai / BigModel 账号登录,或 Anthropic、OpenAI、Google Gemini、Amazon Bedrock、DeepSeek、Ollama 的 API 接入,也可填写任何兼容接口;中转站或服务商可通过 `thinkwatch://import` 链接预填一个上游 | | 路由 | 代理模式下,每个客户端的请求发往它当前的供应商;可按供应商映射模型 | 每把密钥的规则按顺序匹配模型、API 格式、输入 token、工具、图片、扩展思考等条件;规则可以改写模型 | | 故障转移 | 按优先级排列的故障转移队列,带熔断(代理模式) | 回答开始之前尝试失败时,转到策略组中的下一个上游;同一会话默认保持在同一个上游 | | 负载均衡 | — | 策略组:按顺序、手动选择、轮询、延迟最低、费用最低 | diff --git a/src/content/docs-lite/zh-CN/failover-and-load-balancing.md b/src/content/docs-lite/zh-CN/failover-and-load-balancing.md index a6801c2..70843eb 100644 --- a/src/content/docs-lite/zh-CN/failover-and-load-balancing.md +++ b/src/content/docs-lite/zh-CN/failover-and-load-balancing.md @@ -9,7 +9,7 @@ ThinkWatch Lite 把每个中转站的每把密钥建成一个上游,再把多 ## 步骤 -1. 在上游页选择「新建上游」。在「连接」中填写「名称」「接口地址」和一把「API 密钥」,选择「检测连接」,再依次选择「下一步」直到「创建」。每把密钥重复一次:一个上游只有一把密钥,故障转移和暂停都以上游为单位。 +1. 在上游页选择「新建上游」,在「服务类型」中选择服务(中转站选「自定义」)。在「连接」中填写「名称」「接口地址」和一把「API 密钥」,选择「检测连接」,再依次选择「下一步」直到「创建」。每把密钥重复一次:一个上游只有一把密钥,故障转移和暂停都以上游为单位。 2. 在路由页的「策略组」标签中选择「新建策略组」。填写「名称」,选择「策略」,在「成员」中勾选上游并拖动排序,然后选择「创建」。策略为「轮询」时,还要填写每个成员的「权重」并选择「分配依据」。 3. 在「路由」标签中打开路由,对要使用该策略组的规则选择「编辑…」(通常是「全部请求(兜底)」那一条),在「转发至」中选择该策略组,并在两个对话框中各选择一次「保存」。 4. 「试算」可以检查结果,不会发出请求。在流量页打开请求,「路由」标签的「尝试链」列出尝试过的每个上游。 diff --git a/src/content/docs-lite/zh-CN/features.md b/src/content/docs-lite/zh-CN/features.md index f96a83d..5d6c44b 100644 --- a/src/content/docs-lite/zh-CN/features.md +++ b/src/content/docs-lite/zh-CN/features.md @@ -8,7 +8,7 @@ 概览页按最近 24 小时、7 天、30 天或自定义区间统计,在一屏之内分为六张卡片:「Token」「费用」「缓存命中」「请求」「首 token」与「流量」。每张卡片给出数值,以及与上一个同等长度的区间相比的变化。除「缓存命中」外,每张卡片都带有一张该区间的小图;指向任意一张小图时,所有小图都标出同一时刻,数值显示在指针所在的卡片上。「缓存命中」显示命中率、缓存带来的净节省,以及输入在缓存读取、新输入与缓存写入之间的构成。「首 token」按时间显示首 token 时间的中位数与 P95,没有请求的时段以淡色虚线连接。「流量」是请求发往上游与从上游收到的数据量(见[流量与会话](#流量与会话)),上传与下载各绘一条线。 -卡片上方的提示条逐项列出需要处理的事:失败的请求、被切断的工具调用、无法使用的上游(熔断中、凭据被拒或需要重新登录),以及无法计价的请求,每一项都附有前往处理的页面;没有需要处理的事时不显示。卡片下方的明细表按模型、上游或密钥列出请求、token、费用、缓存命中、首 token 与生成速度(生成速度只按模型和上游统计),点击一行即在流量页打开对应的请求。选择「实时」时,「Token」「费用」「请求」三张卡片显示最近十分钟,其余卡片、提示条与明细表按最近 24 小时统计。 +卡片上方的提示条逐项列出需要处理的事:失败的请求、被切断的工具调用、无法使用的上游(熔断中、凭据被拒或需要重新登录),以及无法计价的请求,每一项都附有前往处理的页面;没有需要处理的事时不显示。每一项都可以忽略,忽略后有新情况时再次出现;请求记录无法启动的提示,以及连接断开、配置未通过校验的横幅同样可以忽略,「设置 › 通用」可以让忽略过的提醒全部重新显示。卡片下方的明细表按模型、上游或密钥列出请求、token、费用、缓存命中、首 token 与生成速度(生成速度只按模型和上游统计),点击一行即在流量页打开对应的请求。选择「实时」时,「Token」「费用」「请求」三张卡片显示最近十分钟,其余卡片、提示条与明细表按最近 24 小时统计。 费用会注明其中估算的部分,例如响应结束前被中断的请求。模型未定价的请求和上游未报告用量的请求单独计数,从不按零计入。价格来自价目表:默认价目表采用 LiteLLM 的公开价格,每天更新一次;自定义价目表在其基础上设置倍率,并可单独为个别模型定价,适用于价格与官方不同的中转服务。ChatGPT 这类订阅账号同样按价目表计价,本地模型等上游可设为不计费。每个请求的费用在请求结束时确定,并注明计价所用的价目表及其数据日期。 @@ -16,7 +16,7 @@ ## 流量与会话 -流量页实时列出请求:状态、密钥、模型、上游、首 token 时间与总耗时(悬停时显示生成速度)、token(悬停时显示上传与下载)和费用,并标出格式转换、被脱敏的密钥、被内容过滤删除的文字,以及被拦截或可疑的工具调用。上游、模型和密钥的名称过长时截断显示,悬停可查看全名。列表可以搜索(路径、密钥、上游、模型与错误信息),可以按密钥、上游和模型筛选,或只看失败、无法计价的请求。列表装有最近 2,000 条请求,搜索与筛选同时在全部请求记录中进行,可以继续向更早的记录搜索。打开「搜索内容」后,还会搜索每个请求新发送的内容(最后一轮用户消息,含工具结果)及其回答(含工具调用),范围以报文仍保留的请求为限;命中的片段显示在对应请求的下方。「会话」视图把同一段对话的请求归为若干轮次,给出每一轮的输入 token 与费用。会话的「对话」页按轮还原整段对话:每一轮新加入的消息和回答,包括文字、折叠的思考、工具调用及其结果,图片只显示类型和大小。系统提示词的变化和压缩上下文之后的重新开始会标出;报文已过保留期、过大未能完整保存或无法读取的轮次会注明原因。每一轮都可以打开对应的请求。 +流量页实时列出请求:状态、密钥、模型、上游、首 token 时间与总耗时(悬停时显示生成速度)、token(悬停时显示上传与下载)和费用,并标出格式转换、被脱敏的密钥、被内容过滤删除的文字,以及被拦截或可疑的工具调用。上游、模型和密钥的名称过长时截断显示,悬停可查看全名。列表可以搜索(路径、密钥、上游、模型与错误信息),可以按密钥、上游和模型筛选,或只看失败、无法计价的请求。列表装有最近 2,000 条请求,搜索与筛选同时在全部请求记录中进行,可以继续向更早的记录搜索。打开「搜索内容」后,还会搜索每个请求新发送的内容(最后一轮用户消息,含工具结果)及其回答(含工具调用),范围以报文仍保留的请求为限;命中的片段显示在对应请求的下方。「会话」视图把同一段对话的请求归为若干轮次,给出每一轮的输入 token 与费用。每一轮还标出模型的上下文窗口用了多少:发给模型的 token 相对上下文窗口的比例,其中缓存读取单独成段;打开一轮,可以看到系统提示、工具定义、此前的对话与最后一条用户消息各占多少的估算。会话的「对话」页按轮还原整段对话:每一轮新加入的消息和回答,包括文字、折叠的思考、工具调用及其结果,图片只显示类型和大小。系统提示词的变化和压缩上下文之后的重新开始会标出;报文已过保留期、过大未能完整保存或无法读取的轮次会注明原因。每一轮都可以打开对应的请求。 打开一个请求可以查看时间线、路由(命中的规则、经过的策略组,以及每一次尝试的状态与耗时)、内容、用量与费用。时间线给出请求经由的代理(「出口」,未经代理时为「直连」),以及请求发往上游与从上游收到的数据量(「上传」与「下载」),按网络上实际传输的大小计算:在网关自身的压缩之后、解码之前,故障转移的各次尝试合计在内。DeepSeek Harness 发出的请求还会显示所带会话日志的大小:这是客户端随每个请求附带的整段对话记录,发往 DeepSeek 以外的上游之前由网关去除。已结束的请求可以在预估费用后原样发送到另一个上游,两次的响应并排对照。 @@ -45,7 +45,7 @@ WSL 2 默认使用 NAT 网络,此时 Windows 上的网关无法从 WSL 内访 ## 上游 -上游是网关转发请求的目标:Anthropic、OpenAI、Google Gemini、DeepSeek 或任何兼容接口的 API 密钥,Amazon Bedrock(API 密钥、访问密钥或 AWS 配置文件),在应用内登录的 ChatGPT 账号或 Z.ai / BigModel 账号,OpenRouter 等中转服务,以及 Ollama 等本机模型。ChatGPT 账号显示订阅额度与重置时间;GLM Coding Plan 的上游(地址在 `api.z.ai` 或 `open.bigmodel.cn` 上,在应用内登录或手动填写密钥均可)同样显示:5 小时与每周额度,积分制套餐另外显示剩余积分(「剩余 1,976 / 2,000 积分」)。客户端与上游的 API 格式不同时,请求在 Anthropic Messages、OpenAI Chat Completions、OpenAI Responses 与 Gemini 之间自动转换,无法转换的字段会在请求上逐一列出。Codex 等不标注提示缓存断点的客户端,请求转换后发往 Anthropic Messages 格式的上游,或 Bedrock 上 AWS 列为支持提示缓存的 Claude 模型(Claude 3.5 Sonnet v2、Claude 3.7 Sonnet 以及 Claude 4.5 起的模型)时,由网关标注断点,每一轮都能读取上一轮写入的缓存。上游拒绝这些标注时,网关去掉标注重新发送一次。上游可以经出站代理访问,也可以使用单独的价目表计价,别名、代理与价目表在同一页的标签中管理。「代理」标签页的「流量 · 24 小时」一列给出经过每个代理的上传与下载,悬停可查看 7 天与 30 天的数据。可选的「并发上限」适用于限制并发的中转站或账号:上游已满时,留在它上面的对话等待空位,其他请求交给下一个上游;所有上游都满时,请求先等待,仍无空位则返回繁忙错误。在上游的模型列表中选择「规格…」,可以手动设置模型的上下文窗口、输出上限,以及是否支持推理与图片输入,适用于价目表中没有或数值有误的模型,手动设置的值优先于价目表。链路测速测量 DNS 解析以及 TCP、TLS、代理握手的耗时,不产生费用;推理测速测量首个 token 的时间,运行前先给出费用预估。 +上游是网关转发请求的目标:Anthropic、OpenAI、Google Gemini、DeepSeek 或任何兼容接口的 API 密钥,Amazon Bedrock(API 密钥、访问密钥或 AWS 配置文件),在应用内登录的 ChatGPT 账号或 Z.ai / BigModel 账号,OpenRouter 等中转服务,以及 Ollama 等本机模型。「新建上游」先选择服务:账号登录(ChatGPT、Z.ai / BigModel)在前,API 接入(Anthropic、OpenAI、Google Gemini、Amazon Bedrock、DeepSeek、Ollama 与自定义)在后,可以搜索;选定后直接进入「连接」。ChatGPT 账号显示订阅额度与重置时间;GLM Coding Plan 的上游(地址在 `api.z.ai` 或 `open.bigmodel.cn` 上,在应用内登录或手动填写密钥均可)同样显示:5 小时与每周额度,积分制套餐另外显示剩余积分(「剩余 1,976 / 2,000 积分」)。客户端与上游的 API 格式不同时,请求在 Anthropic Messages、OpenAI Chat Completions、OpenAI Responses 与 Gemini 之间自动转换,无法转换的字段会在请求上逐一列出。模型的思考在转换中保留:DeepSeek、Kimi、GLM 等 Chat Completions 格式上游返回的思考内容原样交给客户端,下一轮送回同一上游,带工具调用的对话因此能继续;Gemini 模型工具调用上的思考签名同样保留。Chat Completions 格式的模型把工具调用写进回答正文时,只要请求定义了这个工具,网关就把它识别为普通的工具调用,并与其他工具调用一样经过工具调用审查。客户端以 gzip、deflate 或 zstd 压缩发送的请求正文照常读取,上游压缩返回的回答解码后交给客户端。Codex 等不标注提示缓存断点的客户端,请求转换后发往 Anthropic Messages 格式的上游,或 Bedrock 上 AWS 列为支持提示缓存的 Claude 模型(Claude 3.5 Sonnet v2、Claude 3.7 Sonnet 以及 Claude 4.5 起的模型)时,由网关标注断点,每一轮都能读取上一轮写入的缓存。上游拒绝这些标注时,网关去掉标注重新发送一次。上游可以经出站代理访问,也可以使用单独的价目表计价,别名、代理与价目表在同一页的标签中管理。「代理」标签页的「流量 · 24 小时」一列给出经过每个代理的上传与下载,悬停可查看 7 天与 30 天的数据。可选的「并发上限」适用于限制并发的中转站或账号:上游已满时,留在它上面的对话等待空位,其他请求交给下一个上游;所有上游都满时,请求先等待,仍无空位则返回繁忙错误。流式请求等待空位或密钥的用量窗口期间,客户端会收到保活心跳。在上游的模型列表中选择「规格…」,可以手动设置模型的上下文窗口、输出上限,以及是否支持推理与图片输入,适用于价目表中没有或数值有误的模型,手动设置的值优先于价目表。链路测速测量 DNS 解析以及 TCP、TLS、代理握手的耗时,不产生费用;推理测速测量首个 token 的时间,运行前先给出费用预估。 一家上游的模型,是它自己列出的模型加上手动添加的模型。上游常常没有列全它能服务的模型:账号类的后端会隐藏较新的模型,中转站只列出一部分。在上游的模型列表中选择「添加模型…」,可以按确切的模型 ID 添加这类模型,一次可以添加多个。模型 ID 不能含 `*` 或 `?`,前后不能有空格,最多 256 个字符,且不能重复;不符合要求的,以及上游已经列出的,对话框在保存之前当场指出。手动添加的模型标有「手动」,路由与故障转移、别名、指定模型的路由规则、密钥的可用模型、客户端看到的模型列表、试算与推理测速都把它当作列出的模型。列表顶部的摘要把上游列出的模型与手动添加的模型分开计数。悬停在手动添加的模型上会出现「移除」,立即生效,随后的提示中可以「撤销」。「新建上游」与「编辑上游」对话框的「模型」一节末尾有同样的输入框,无论上游是否提供模型列表,创建或编辑时都可以在这里添加模型,随上游的其他设置一起保存;启用范围为「指定模型」时,在这里添加的模型立即勾选启用。上游不提供模型列表时,手动添加的模型就是它的全部模型。 @@ -59,7 +59,7 @@ API 密钥和请求头的值可以写成 `${变量名}`,读取系统环境变 ## 路由与故障转移 -每把密钥使用一条路由,未指定的使用默认路由。路由由按顺序匹配的规则组成。规则的条件包括模型、密钥、客户端的 API 格式、输入 token 数、`max_tokens`、工具数量、图片、扩展思考、流式、提示缓存以及辅助请求的类型;命中后把请求交给某个上游、策略组或指定模型,或拒绝请求,也可以改写模型、`max_tokens` 或扩展思考。指定模型写明上游和它的某个模型,可按顺序列出备用,模型名原样发出;要让某个客户端把一个模型当另一个模型的名称使用,在这个客户端的密钥上写规则即可,不会改变这个名称对其他客户端的含义。条件写上游模型名时,也匹配列有它的别名。设置 `max_tokens` 可以限制回答的长度:上游到达上限时自行停止,不会报错。策略组把多个上游放在同一个名字下,并决定尝试的先后:按顺序、手动选择、轮询、延迟最低优先或费用最低优先。轮询策略组的每个成员有 1 到 100 的权重,即长期分到的请求比例;「分配依据」可以在权重之上再乘以各上游的速度(首 token 时间)、稳定性(最近的成功率)或两者,进行中的对话仍留在原上游。一次尝试失败时,请求转到下一个上游;同一会话默认保持在同一个上游上,以便提示缓存持续命中。上游连续「设置 › 故障转移」中的「无响应超时」(默认 300 秒)没有发出内容时,网关放弃这个上游,保活心跳不算内容:尚未向客户端发出内容时,请求转到下一个上游,没有可用的上游时客户端收到超时错误;回答已经开始时,以错误结束。页面顶部的路由图显示每把密钥经过的路由、策略组和上游,进行中的请求沿各自的路径从密钥移向上游。 +每把密钥使用一条路由,未指定的使用默认路由。路由由按顺序匹配的规则组成。规则的条件包括模型、密钥、客户端的 API 格式、输入 token 数、`max_tokens`、工具数量、图片、扩展思考、流式、提示缓存、辅助请求的类型以及时段;命中后把请求交给某个上游、策略组或指定模型,或拒绝请求,也可以改写模型、`max_tokens` 或扩展思考。指定模型写明上游和它的某个模型,可按顺序列出备用,模型名原样发出;要让某个客户端把一个模型当另一个模型的名称使用,在这个客户端的密钥上写规则即可,不会改变这个名称对其他客户端的含义。条件写上游模型名时,也匹配列有它的别名。时段按网关所在机器的本地时间判断:选择星期与起止时刻即可,一条规则可以写多个时段,结束早于开始的为跨夜时段。设置 `max_tokens` 可以限制回答的长度:上游到达上限时自行停止,不会报错。策略组把多个上游放在同一个名字下,并决定尝试的先后:按顺序、手动选择、轮询、延迟最低优先或费用最低优先。轮询策略组的每个成员有 1 到 100 的权重,即长期分到的请求比例;「分配依据」可以在权重之上再乘以各上游的速度(首 token 时间)、稳定性(最近的成功率)或两者,进行中的对话仍留在原上游。一次尝试失败时,请求转到下一个上游;同一会话默认保持在同一个上游上,以便提示缓存持续命中。上游连续「设置 › 故障转移」中的「无响应超时」(默认 300 秒)没有发出内容时,网关放弃这个上游,保活心跳不算内容:尚未向客户端发出内容时,请求转到下一个上游,没有可用的上游时客户端收到超时错误;回答已经开始时,以错误结束。页面顶部的路由图显示每把密钥经过的路由、策略组和上游,进行中的请求各有一种颜色,沿各自的路径从密钥移向上游。 客户端自行发出的辅助请求(连通性检查、预热、生成标题、话题识别、输入建议)可以由网关在本地应答而不产生费用,也可以转发。转发的辅助请求和普通请求一样经过路由规则,规则可以按辅助请求的类型把它们分流到费用更低的上游。 @@ -95,11 +95,11 @@ MCP 页管理客户端从自己的配置文件中加载的内容,这些内容 ## 设置 -设置页分为七节。「连接」列出本机 core 和已保存的远程 core,详见[连接远程 core](/zh-CN/docs/lite/remote-core)。「通用」设置语言、外观、菜单栏显示的内容(仅 macOS,也可设为不显示)、开机启动、提醒以系统通知发送、仅在应用内显示还是关闭,并可让设为不再显示的引导提示重新显示。「网关监听」设置网关的访问范围(仅本机、所选网卡所在的局域网或所有网卡)、端口和放行网段。「故障转移」设置上游失败后暂停多久、请求交给下一个上游:连续失败几次后暂停、暂停多长,以及余额不足、额度用完和限流时各自的暂停时长;还设置无响应超时,即上游多久没有发出内容即被放弃(默认 300 秒,可设 30 到 3,600 秒),以及上游并发已满或密钥的分钟、小时上限用满时请求合计最多等待的时长(默认 30 秒)。「日志保留」分别设置请求报文与请求记录的保留天数,以及报文的空间上限;安全日志随请求记录一同过期。「关于」显示版本、检查更新,并可生成诊断包,其中的密钥与地址均已脱敏。「卸载」还原所有已接管的客户端并取消开机启动,应在删除应用之前执行。 +设置页分为七节。「连接」列出本机 core 和已保存的远程 core,详见[连接远程 core](/zh-CN/docs/lite/remote-core)。「通用」设置语言、外观、菜单栏显示的内容(仅 macOS,也可设为不显示)、开机启动、提醒以系统通知发送、仅在应用内显示还是关闭,并可让设为不再显示的引导提示和忽略过的提醒重新显示。「网关监听」设置网关的访问范围(仅本机、所选网卡所在的局域网或所有网卡)、端口和放行网段。「故障转移」设置上游失败后暂停多久、请求交给下一个上游:连续失败几次后暂停、暂停多长,以及余额不足、额度用完和限流时各自的暂停时长;还设置无响应超时,即上游多久没有发出内容即被放弃(默认 300 秒,可设 30 到 3,600 秒),以及上游并发已满或密钥的分钟、小时上限用满时请求合计最多等待的时长(默认 30 秒)。「日志保留」分别设置请求报文与请求记录的保留天数,以及报文的空间上限;安全日志随请求记录一同过期。「关于」显示版本、检查更新,并可生成诊断包,其中的密钥与地址均已脱敏。「卸载」还原所有已接管的客户端并取消开机启动,应在删除应用之前执行。 ## 菜单栏、系统托盘与通知 -macOS 菜单栏显示今日 token 与今日费用,费用只写数值、不带「≥」「~」记号,与 token 数一样简短($41.20);点开的菜单中仍会标出含估算或只是下限的费用。订阅额度紧张时数字变橙、用完变红。「设置 › 通用」中的「菜单栏」可以改为仅标识或仅数值,也可以选「不显示」,菜单栏中不再出现该项:网关照常在后台运行,开机启动时也是如此;从访达或聚焦搜索再次打开 ThinkWatch Lite,即显示主窗口。 +macOS 菜单栏显示今日 token 与今日费用,费用只写数值、不带「≥」「~」记号,与 token 数一样简短($41.20);点开的菜单中仍会标出含估算或只是下限的费用。订阅额度紧张或用完时,菜单栏项不变色,只在点开的菜单中把对应的额度行标为橙色或红色;网关未运行时标识带有红色标记。「设置 › 通用」中的「菜单栏」可以改为仅标识或仅数值,也可以选「不显示」,菜单栏中不再出现该项:网关照常在后台运行,开机启动时也是如此;从访达或聚焦搜索再次打开 ThinkWatch Lite,即显示主窗口。 点开是原生菜单。第一项始终是「打开主界面」,其后是未读的提醒和「今日」一栏:今日 token 以大字显示,下方一行为请求数、失败数与费用,旁边是按小时统计 token 的小图。这一栏的顶行显示网关状态、连接远程 core 时的服务器名称,以及最近一分钟的生成速度。再往下,上游报告的每个额度窗口各占一行,显示已用比例与重置时间(订阅账号与 GLM Coding Plan 上游;积分制套餐在额度条下方显示剩余积分),然后是进行中的请求。最后是常用操作:切换手动选择策略组中的上游、复制网关地址(菜单项右侧显示该地址)和默认密钥、有新版本时安装新版本、设置、切换连接、检查更新,不必先打开主界面。 diff --git a/src/i18n/pages/lite.ts b/src/i18n/pages/lite.ts index 0710476..a4dc6c1 100644 --- a/src/i18n/pages/lite.ts +++ b/src/i18n/pages/lite.ts @@ -204,7 +204,7 @@ export const liteCopy = { menubar: { eyebrow: "Outside the main window", title: "Menu bar, tray and notifications", - body: "The macOS menu bar shows today's tokens and cost, in orange when a subscription quota is nearly used up and red once it has run out. Its menu gives the gateway's state, each quota with its reset time and the requests in progress, and copies the gateway address or default key without opening the window. Windows and Linux have the same menu in the tray.", + body: "The macOS menu bar shows today's tokens and cost. Its menu gives the gateway's state, each quota with its reset time and the requests in progress, and copies the gateway address or default key without opening the window. Windows and Linux have the same menu in the tray.", notices: "A system notification reports a gateway that stopped forwarding, a lost remote connection, a quota that ran out, a credential that stopped working, an unreachable proxy, configuration that did not take effect, a dangerous tool call that was cut off, and suspicious content in client configuration.", chipAlt: "The menu bar item: the ThinkWatch mark with today's 13.3M tokens above today's cost, $9.34", @@ -446,7 +446,7 @@ export const liteCopy = { menubar: { eyebrow: "主窗口之外", title: "菜单栏、托盘与系统通知", - body: "macOS 菜单栏显示今日 token 与费用,订阅额度将尽时变为橙色,用完后变为红色。点开的菜单给出网关状态、各项额度及重置时间与进行中的请求,不打开主窗口即可复制网关地址或默认密钥。Windows 与 Linux 的托盘提供相同的菜单。", + body: "macOS 菜单栏显示今日 token 与费用。点开的菜单给出网关状态、各项额度及重置时间与进行中的请求,不打开主窗口即可复制网关地址或默认密钥。Windows 与 Linux 的托盘提供相同的菜单。", notices: "网关停止转发、远程连接断开、额度用完、凭据失效、代理无法连接、配置未能生效、危险工具调用被切断,以及客户端配置中出现可疑内容时,应用发送系统通知。", chipAlt: "菜单栏:ThinkWatch 标识,右侧上行为今日 token 13.3M,下行为今日费用 $9.34", From f223dfabf1183955f9c413f6c1418c70610c9eff Mon Sep 17 00:00:00 2001 From: fylorn <249551762+fylorn@users.noreply.github.com> Date: Sat, 10 Oct 2026 19:09:36 +0800 Subject: [PATCH 2/3] Core docs from v0.69.0 The configuration reference gains the time condition of routing rules; the server guide is unchanged since v0.67.1. Co-Authored-By: Claude Fable 5.1 --- src/data/core-docs/config.md | 12 ++++++++++++ src/data/core-docs/config.zh-CN.md | 3 +++ src/data/core-docs/manifest.json | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/data/core-docs/config.md b/src/data/core-docs/config.md index 5775a5a..fac9474 100644 --- a/src/data/core-docs/config.md +++ b/src/data/core-docs/config.md @@ -1319,6 +1319,7 @@ routes: | `thinking` | bool | — | Whether extended thinking is on. | | `stream` | bool | — | Whether the response is streamed. | | `intent` | string or list of strings | — | A client helper request: `assistant_internal` for any of them, or one class (`titling`). Classes set to `intercept` in `client_probes` are answered locally and never reach routing. | +| `time` | string or list of strings | — | Local time of the machine core runs on, as a window `[days ]HH:MM-HH:MM`: `mon-fri 09:00-18:00`, `sat,sun 00:00-24:00`, `22:00-06:00`. Several windows: any of them. See below. | | `provider_would_be` | string or list of strings | — | The upstream routing chose. Such a rule is evaluated after routing, may only `set` or `deny`, and cannot have `to`. | @@ -1326,6 +1327,17 @@ A comparison starts with `>`, `>=`, `<`, `<=` or `==`, and the number may end in `k` or `m`: `">200k"`, `"<=4k"`. Without an operator it is an error, not an equality: `"200k"` alone is refused. +A time window is `[ ]-`, evaluated against the local +wall-clock time of the machine core runs on, at the moment the request is +routed. `` is a comma-separated list of `mon`, `tue`, `wed`, `thu`, +`fri`, `sat`, `sun` and ranges such as `mon-fri` or `fri-mon` (which wraps +past Sunday); leave it out for every day. Case does not matter. The hours are +24-hour: the start is included, the end is not, and the end may be `24:00`. +An end earlier than the start is an overnight window, and its days are the +days it starts on: `fri 22:00-06:00` runs from Friday 22:00 to Saturday 05:59. +A value that does not fit this shape is refused when the configuration is +read, naming the rule and the value. + #### `routes[].rules[].set` `set.model` may name an alias; each upstream then receives its own name for diff --git a/src/data/core-docs/config.zh-CN.md b/src/data/core-docs/config.zh-CN.md index bb98524..94b7cf7 100644 --- a/src/data/core-docs/config.zh-CN.md +++ b/src/data/core-docs/config.zh-CN.md @@ -987,11 +987,14 @@ routes: | `thinking` | 布尔 | — | 是否开启扩展思考。 | | `stream` | 布尔 | — | 是否流式返回。 | | `intent` | 字符串或字符串列表 | — | 客户端的辅助请求:`assistant_internal` 表示任意一类,也可以写具体的一类(`titling`)。在 `client_probes` 中设为 `intercept` 的类别由本地应答,不会进入路由。 | +| `time` | 字符串或字符串列表 | — | core 所在机器的本地时间落在窗口 `[days ]HH:MM-HH:MM` 里:`mon-fri 09:00-18:00`、`sat,sun 00:00-24:00`、`22:00-06:00`。写几个窗口满足其一即可。见下文。 | | `provider_would_be` | 字符串或字符串列表 | — | 路由选中的上游。这类规则在路由完成后求值,只能 `set` 或 `deny`,不能写 `to`。 | 比较式以 `>`、`>=`、`<`、`<=` 或 `==` 开头,数字可以带 `k` 或 `m` 后缀:`">200k"`、`"<=4k"`。不带运算符是错误,不当作相等:单写 `"200k"` 会被拒绝。 +时间窗口写成 `[ ]-`,按 core 所在机器在路由那一刻的本地时间求值。`` 是用逗号分隔的 `mon`、`tue`、`wed`、`thu`、`fri`、`sat`、`sun`,也可以写 `mon-fri`、`fri-mon`(跨过周日绕回去)这样的一段;不写就是每天。大小写不论。时刻是 24 小时制:起点含、终点不含,终点可以写 `24:00`。终点早于起点的是过夜的窗口,天指窗口开始的那一天:`fri 22:00-06:00` 从周五 22:00 到周六 05:59。不合这个写法的值在读配置时就被拒绝,并说明是哪条规则、哪个值。 + #### `routes[].rules[].set` `set.model` 可以写别名,每家上游收到各自对它的叫法。和别名一样,回答里的模型名写成客户端请求的名称。 diff --git a/src/data/core-docs/manifest.json b/src/data/core-docs/manifest.json index 27e29c7..16a5b42 100644 --- a/src/data/core-docs/manifest.json +++ b/src/data/core-docs/manifest.json @@ -1,9 +1,9 @@ { "repository": "ThinkWatchProject/ThinkWatch-Core", - "ref": "v0.68.0", + "ref": "v0.69.0", "files": { - "docs/config.md": "31d4ff32e28e94d2e53816147c51ef2818a9558265c147612ddfc39b0942beb8", - "docs/config.zh-CN.md": "d7ab9cde90fb6eb910b7b4261a8ccdc9bff1e70b97262860fecc1713dd285117", + "docs/config.md": "71c13485896f5c94579b72e906ea3d834c50305a584b11faf00d4af0e4ef59bb", + "docs/config.zh-CN.md": "f487fb3c15c2e8004078d33954198db5971afc967495f6712569b286a2b4f47f", "docs/server.md": "5e1e9b901bef2b46d417aea057a1db24c78457d3c1938b8540ecb4766515b68f", "docs/server.zh-CN.md": "1f508e7c39b8ded28653773ca4d8701e6bdc2247bcd359c3a8fd00fd1401a6ff" } From ffbfb3e0a7dc4a27d0662068da9288a56097ea8b Mon Sep 17 00:00:00 2001 From: fylorn <249551762+fylorn@users.noreply.github.com> Date: Sat, 10 Oct 2026 19:09:36 +0800 Subject: [PATCH 3/3] Deployment guide: version examples move to 3.4.0 Co-Authored-By: Claude Fable 5.1 --- src/content/docs/en/deployment-guide.md | 6 +++--- src/content/docs/zh-CN/deployment-guide.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/en/deployment-guide.md b/src/content/docs/en/deployment-guide.md index d02b649..d8084c8 100644 --- a/src/content/docs/en/deployment-guide.md +++ b/src/content/docs/en/deployment-guide.md @@ -231,7 +231,7 @@ docker compose -f deploy/docker-compose.yml --env-file .env.production up -d To pin a release instead of `latest`, set `IMAGE_TAG` to its version, or to the SHA of a commit on `main`: ```bash -IMAGE_TAG=3.3.1 docker compose -f deploy/docker-compose.yml --env-file .env.production up -d +IMAGE_TAG=3.4.0 docker compose -f deploy/docker-compose.yml --env-file .env.production up -d ``` This starts: @@ -744,8 +744,8 @@ The server is stateless, so rolling updates work out of the box: ```bash # Update the image tag helm upgrade think-watch deploy/helm/think-watch \ - --set image.server.tag=3.3.1 \ - --set image.web.tag=3.3.1 \ + --set image.server.tag=3.4.0 \ + --set image.web.tag=3.4.0 \ --reuse-values ``` diff --git a/src/content/docs/zh-CN/deployment-guide.md b/src/content/docs/zh-CN/deployment-guide.md index ee1991c..2a325c8 100644 --- a/src/content/docs/zh-CN/deployment-guide.md +++ b/src/content/docs/zh-CN/deployment-guide.md @@ -231,7 +231,7 @@ docker compose -f deploy/docker-compose.yml --env-file .env.production up -d 如需固定某个版本而非 `latest`,将 `IMAGE_TAG` 设为该版本号,或 `main` 分支上某次提交的 SHA: ```bash -IMAGE_TAG=3.3.1 docker compose -f deploy/docker-compose.yml --env-file .env.production up -d +IMAGE_TAG=3.4.0 docker compose -f deploy/docker-compose.yml --env-file .env.production up -d ``` 这将启动: @@ -744,8 +744,8 @@ ThinkWatch 在 Web 控制台中内置了**配置指南**页面,位于 `/gatewa ```bash # Update the image tag helm upgrade think-watch deploy/helm/think-watch \ - --set image.server.tag=3.3.1 \ - --set image.web.tag=3.3.1 \ + --set image.server.tag=3.4.0 \ + --set image.web.tag=3.4.0 \ --reuse-values ```