Compare commits

..
15 Commits
Author SHA1 Message Date
KimiSwitch Dev 2f75929fda ci: release 重跑时覆盖同名资产(overwrite: true)
Release / Version consistency (push) Canceled after 0s
Release / Build (macos-latest) (push) Canceled after 0s
Release / Build (ubuntu-latest) (push) Canceled after 0s
Release / Build (windows-latest) (push) Canceled after 0s
2026-08-02 00:38:51 +08:00
KimiSwitch Dev a1c3f06bdf feat(settings): 关于页新增官方网站链接(billowliu2.github.io/KimiSwitch) 2026-08-02 00:37:28 +08:00
KimiSwitch Dev acde6d97c2 merge: Dev_20260801 → main(v0.6.9:仪表盘缓存命中列 + 人民币计价 + 性能优化)
Release / Version consistency (push) Canceled after 0s
Release / Build (macos-latest) (push) Canceled after 0s
Release / Build (ubuntu-latest) (push) Canceled after 0s
Release / Build (windows-latest) (push) Canceled after 0s
2026-08-02 00:18:49 +08:00
KimiSwitch Dev 6cbaea7159 chore: bump v0.6.9 + 官网版本文案/更新日志同步 2026-08-02 00:18:23 +08:00
KimiSwitch Dev f0d5e27bb4 chore: models.dev 价格快照同步 2026-08-02 00:18:22 +08:00
KimiSwitch Dev 38a11666ac feat(dashboard): 最近请求缓存命中列 + 中文模式人民币计价 + 价格解析记忆化
- 最近请求表新增缓存命中率列(缓存读取/总输入)
- useCurrency:中文界面费用按最新 USD→CNY 汇率显示 ¥,英文保持 $(open.er-api.com,缓存 12h,失败兜底 7.2)
- match_price 记忆化缓存:O(记录数×5910) → O(模型种类×5910),扫描从秒级降到百毫秒级
- 仪表盘右上角显示加载耗时/数据量(get_summary 往返埋点);Rust 侧分段计时
2026-08-02 00:18:19 +08:00
KimiSwitch Dev de132ffb3a feat(website): GLM 推广图标换为智谱官方 Z 字标;SEO 关键词补充 Kimi Switch / KimiCode Switch 2026-08-01 20:38:53 +08:00
KimiSwitch Dev a285d192eb feat(website): 首页 Hero 徽标显示 v0.6.8 + 更新日志缓存按版本失效 2026-08-01 20:35:32 +08:00
KimiSwitch Dev 127818a7c3 merge: Dev_20260801 → main(官网 v0.6.8 文案) 2026-08-01 20:32:43 +08:00
KimiSwitch Dev 6bc9e4644e feat(website): 版本号更新到 v0.6.8 + 更新日志内置 v0.6.8 条目
- Nav 下载按钮 / 下载页副标题 / 三平台已发布文案
- 内置更新日志补 v0.6.8(GitHub API 不可达时兜底也能看到最新版本说明)
2026-08-01 20:32:27 +08:00
KimiSwitch Dev dfd41d12c0 merge: Dev_20260801 → main(release.yml 自动发布) 2026-08-01 20:18:32 +08:00
KimiSwitch Dev 615dfb54e0 ci: 去掉 releaseDraft,tag 推送时自动发布 Release
之前 releaseDraft: true 导致每次发版后 release 停在草稿状态,下载直链 404,需手动 PATCH 发布
2026-08-01 20:18:05 +08:00
KimiSwitch Dev 8914b40bec merge: main → Dev_20260801(SEO 升级) 2026-08-01 19:58:47 +08:00
KimiSwitch Dev 4071930aff chore: Cargo.lock 同步 v0.6.8 2026-08-01 19:57:40 +08:00
KimiSwitch Dev 1b5cd0f416 feat(website): SEO 升级 — BrowserRouter + 每页独立 meta
- HashRouter → BrowserRouter(basename /KimiSwitch),GitHub Pages 用 404.html SPA 回退,/features /download /changelog 变为可收录的独立 URL
- 每页独立 title / description / OG / canonical(RouteMeta 随语言切换)
- og:image 改为绝对地址;sitemap 更新为干净路径
2026-08-01 19:56:54 +08:00
29 changed files with 1261 additions and 191 deletions

No files matched your search

+1 -1
View File
@@ -86,6 +86,6 @@ jobs:
- **Linux**: `.deb` / `.AppImage` / `.rpm` - **Linux**: `.deb` / `.AppImage` / `.rpm`
Full changelog: see commit history. Full changelog: see commit history.
releaseDraft: true
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
overwrite: true
args: ${{ matrix.args }} args: ${{ matrix.args }}
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "kimiswitch", "name": "kimiswitch",
"private": true, "private": true,
"version": "0.6.8", "version": "0.6.9",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+1 -1
View File
@@ -1958,7 +1958,7 @@ dependencies = [
[[package]] [[package]]
name = "kimiswitch" name = "kimiswitch"
version = "0.6.7" version = "0.6.8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "kimiswitch" name = "kimiswitch"
version = "0.6.8" version = "0.6.9"
description = "Kimi Switch - model config manager" description = "Kimi Switch - model config manager"
authors = ["you"] authors = ["you"]
edition = "2021" edition = "2021"
+30
View File
@@ -610,7 +610,26 @@ fn strip_context_suffix(model_name: &str) -> Option<String> {
}) })
} }
/// Memoized price resolution. `match_price` is called once per usage record
/// during the scan, and the models.dev suffix scan is O(5910) per miss — with
/// thousands of records sharing a handful of model names, memoizing the result
/// turns the whole scan from O(records × 5910) into O(unique_models × 5910).
static MATCH_PRICE_MEMO: OnceLock<Mutex<HashMap<String, (String, f64, f64, f64, bool)>>> =
OnceLock::new();
/// Resolve a model's price, caching per-model results (hits and misses).
fn match_price(model_name: &str) -> (String, f64, f64, f64, bool) { fn match_price(model_name: &str) -> (String, f64, f64, f64, bool) {
let key = model_name.to_ascii_lowercase();
let memo = MATCH_PRICE_MEMO.get_or_init(|| Mutex::new(HashMap::new()));
if let Some(hit) = memo.lock().unwrap().get(&key) {
return hit.clone();
}
let result = match_price_inner(model_name);
memo.lock().unwrap().insert(key, result.clone());
result
}
fn match_price_inner(model_name: &str) -> (String, f64, f64, f64, bool) {
let bare = match model_name.rsplit_once('/') { let bare = match model_name.rsplit_once('/') {
Some((_, b)) => b, Some((_, b)) => b,
None => model_name, None => model_name,
@@ -1537,6 +1556,7 @@ pub fn get_prices() -> PricesResult {
#[tauri::command] #[tauri::command]
pub fn get_summary(home_override: Option<String>, range: Option<String>, refresh: Option<bool>) -> SummaryResult { pub fn get_summary(home_override: Option<String>, range: Option<String>, refresh: Option<bool>) -> SummaryResult {
let t0 = std::time::Instant::now();
let refresh = refresh.unwrap_or(false); let refresh = refresh.unwrap_or(false);
let home = resolve_kimi_home(home_override); let home = resolve_kimi_home(home_override);
let now_ms = std::time::SystemTime::now() let now_ms = std::time::SystemTime::now()
@@ -1544,6 +1564,7 @@ pub fn get_summary(home_override: Option<String>, range: Option<String>, refresh
let r = range.unwrap_or_else(|| "30d".into()); let r = range.unwrap_or_else(|| "30d".into());
let (records, meta) = scan_usage_cached(&home, refresh); let (records, meta) = scan_usage_cached(&home, refresh);
let t1 = std::time::Instant::now();
let stats = aggregate(&records, &r, now_ms); let stats = aggregate(&records, &r, now_ms);
let all_stats = aggregate(&records, "all", now_ms); let all_stats = aggregate(&records, "all", now_ms);
let heatmap = build_heatmap(&records, now_ms); let heatmap = build_heatmap(&records, now_ms);
@@ -1568,6 +1589,15 @@ pub fn get_summary(home_override: Option<String>, range: Option<String>, refresh
name, provider: std::env::var("KIMI_MODEL_PROVIDER").ok(), model: std::env::var("KIMI_MODEL_ID").ok(), name, provider: std::env::var("KIMI_MODEL_PROVIDER").ok(), model: std::env::var("KIMI_MODEL_ID").ok(),
}); });
let t2 = std::time::Instant::now();
let scan_ms = t1.duration_since(t0).as_secs_f64() * 1000.0;
let aggregate_ms = t2.duration_since(t1).as_secs_f64() * 1000.0;
let total_ms = t2.duration_since(t0).as_secs_f64() * 1000.0;
eprintln!(
"[dashboard] get_summary range={} records={} scan={:.0}ms aggregate={:.0}ms total={:.0}ms",
r, records.len(), scan_ms, aggregate_ms, total_ms
);
SummaryResult { SummaryResult {
home: home.to_string_lossy().to_string(), home: home.to_string_lossy().to_string(),
valid: is_kimi_home(&home), valid: is_kimi_home(&home),
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"productName": "Kimi Switch", "productName": "Kimi Switch",
"version": "0.6.8", "version": "0.6.9",
"identifier": "com.kimiswitch.app", "identifier": "com.kimiswitch.app",
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",
+12
View File
@@ -372,6 +372,18 @@ export function SettingsModal({
<div>{t("appDescription")}</div> <div>{t("appDescription")}</div>
<div className="text-xs text-content-muted">v{appVersion} · MIT License</div> <div className="text-xs text-content-muted">v{appVersion} · MIT License</div>
<div className="pt-2 space-y-1"> <div className="pt-2 space-y-1">
<div>
{t("settingsWebsite")}:{" "}
<button
type="button"
onClick={() =>
openExternal("https://billowliu2.github.io/KimiSwitch")
}
className="text-blue-500 hover:text-blue-400 underline bg-transparent p-0 border-0 cursor-pointer"
>
billowliu2.github.io/KimiSwitch
</button>
</div>
<div> <div>
{t("attributionPorted")}{" "} {t("attributionPorted")}{" "}
<button <button
+4 -2
View File
@@ -1,7 +1,8 @@
import { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { createPortal } from "react-dom"; import { createPortal } from "react-dom";
import { useTranslation } from "../../i18n"; import { useTranslation } from "../../i18n";
import { fmtPct, fmtTokens, fmtUsd } from "../../lib/dashboard-format"; import { useCurrency } from "../../hooks/useCurrency";
import { fmtPct, fmtTokens } from "../../lib/dashboard-format";
import type { DailyRow } from "../../types/dashboard"; import type { DailyRow } from "../../types/dashboard";
import { DailyDetailModal } from "./DailyDetailModal"; import { DailyDetailModal } from "./DailyDetailModal";
@@ -43,6 +44,7 @@ function shortModel(model: string): string {
export function DailyBars({ daily, dimension, names, unknownProviderLabel }: DailyBarsProps) { export function DailyBars({ daily, dimension, names, unknownProviderLabel }: DailyBarsProps) {
const { t } = useTranslation(); const { t } = useTranslation();
const { money } = useCurrency();
const [selected, setSelected] = useState<DailyRow | null>(null); const [selected, setSelected] = useState<DailyRow | null>(null);
const colorMap = useMemo(() => { const colorMap = useMemo(() => {
@@ -103,7 +105,7 @@ export function DailyBars({ daily, dimension, names, unknownProviderLabel }: Dai
const tooltipLines = [ const tooltipLines = [
d.date, d.date,
`${t("totalTokens")}: ${fmtTokens(d.totalTokens)} · ${fmtUsd(d.costUsd)} · ${t("colCacheHit")} ${fmtPct(d.cacheHitRate)}`, `${t("totalTokens")}: ${fmtTokens(d.totalTokens)} · ${money(d.costUsd)} · ${t("colCacheHit")} ${fmtPct(d.cacheHitRate)}`,
...segments.map((s) => `${displayName(s.key)}: ${fmtTokens(s.tokens)}`), ...segments.map((s) => `${displayName(s.key)}: ${fmtTokens(s.tokens)}`),
"", "",
t("doubleClickHint"), t("doubleClickHint"),
@@ -1,6 +1,7 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { useTranslation } from "../../i18n"; import { useTranslation } from "../../i18n";
import { fmtPct, fmtTokens, fmtUsd } from "../../lib/dashboard-format"; import { useCurrency } from "../../hooks/useCurrency";
import { fmtPct, fmtTokens } from "../../lib/dashboard-format";
import type { DailyRow } from "../../types/dashboard"; import type { DailyRow } from "../../types/dashboard";
import { modelColor } from "./DailyBars"; import { modelColor } from "./DailyBars";
@@ -22,6 +23,7 @@ function shortModel(model: string): string {
export function DailyDetailModal({ day, dimension, colorMap, unknownProviderLabel, onClose }: DailyDetailModalProps) { export function DailyDetailModal({ day, dimension, colorMap, unknownProviderLabel, onClose }: DailyDetailModalProps) {
const { t } = useTranslation(); const { t } = useTranslation();
const { money } = useCurrency();
useEffect(() => { useEffect(() => {
const onKey = (e: KeyboardEvent) => { const onKey = (e: KeyboardEvent) => {
@@ -106,7 +108,7 @@ export function DailyDetailModal({ day, dimension, colorMap, unknownProviderLabe
{/* Day summary chips */} {/* Day summary chips */}
<div className="grid grid-cols-2 gap-2 px-5 py-3 sm:grid-cols-4"> <div className="grid grid-cols-2 gap-2 px-5 py-3 sm:grid-cols-4">
<SummaryChip label={t("totalTokens")} value={fmtTokens(day.totalTokens)} tone="default" /> <SummaryChip label={t("totalTokens")} value={fmtTokens(day.totalTokens)} tone="default" />
<SummaryChip label={t("cost")} value={fmtUsd(day.costUsd)} tone="orange" /> <SummaryChip label={t("cost")} value={money(day.costUsd)} tone="orange" />
<SummaryChip label={t("requests")} value={Math.round(day.requests).toLocaleString()} tone="blue" /> <SummaryChip label={t("requests")} value={Math.round(day.requests).toLocaleString()} tone="blue" />
<SummaryChip label={t("cacheHitRate")} value={fmtPct(day.cacheHitRate)} tone="green" /> <SummaryChip label={t("cacheHitRate")} value={fmtPct(day.cacheHitRate)} tone="green" />
</div> </div>
+23 -6
View File
@@ -1,13 +1,20 @@
import { useState, type ReactNode } from "react"; import { useState, type ReactNode } from "react";
import { useDashboard, type DashboardRange } from "../../hooks/useDashboard"; import { useDashboard, type DashboardRange } from "../../hooks/useDashboard";
import { useCurrency } from "../../hooks/useCurrency";
import { useTranslation } from "../../i18n"; import { useTranslation } from "../../i18n";
import { fmtInt, fmtPct, fmtTime, fmtTokens, fmtUsd } from "../../lib/dashboard-format"; import { fmtInt, fmtPct, fmtTime, fmtTokens } from "../../lib/dashboard-format";
import { DailyBars } from "./DailyBars"; import { DailyBars } from "./DailyBars";
import { Heatmap } from "./Heatmap"; import { Heatmap } from "./Heatmap";
import { TrendLineChart } from "./TrendLineChart"; import { TrendLineChart } from "./TrendLineChart";
const RANGES: DashboardRange[] = ["today", "7d", "30d", "all"]; const RANGES: DashboardRange[] = ["today", "7d", "30d", "all"];
/** Per-request cache hit rate: cached tokens / total input tokens. */
function cacheHitOf(r: { inputOther: number; inputCacheRead: number }): number {
const denom = r.inputOther + r.inputCacheRead;
return denom > 0 ? r.inputCacheRead / denom : 0;
}
function Card({ function Card({
title, title,
subtitle, subtitle,
@@ -44,7 +51,8 @@ function KpiCard({ label, value, sub }: { label: string; value: string; sub?: st
export function DashboardPage() { export function DashboardPage() {
const { t } = useTranslation(); const { t } = useTranslation();
const { range, changeRange, data, loading, error, refresh } = useDashboard(); const { money } = useCurrency();
const { range, changeRange, data, loading, error, refresh, loadStats } = useDashboard();
const [showAllModels, setShowAllModels] = useState(false); const [showAllModels, setShowAllModels] = useState(false);
const [recentPage, setRecentPage] = useState(1); const [recentPage, setRecentPage] = useState(1);
const [trendTab, setTrendTab] = useState<"daily" | "model" | "provider">("daily"); const [trendTab, setTrendTab] = useState<"daily" | "model" | "provider">("daily");
@@ -120,13 +128,14 @@ export function DashboardPage() {
{ label: t("kpiCacheCreation"), value: fmtTokens(totals.inputCacheCreation), sub: fmtInt(totals.inputCacheCreation) }, { label: t("kpiCacheCreation"), value: fmtTokens(totals.inputCacheCreation), sub: fmtInt(totals.inputCacheCreation) },
{ label: t("kpiCacheHit"), value: fmtPct(totals.cacheHitRate) }, { label: t("kpiCacheHit"), value: fmtPct(totals.cacheHitRate) },
{ label: t("totalTokens"), value: fmtTokens(totals.totalTokens), sub: fmtInt(totals.totalTokens) }, { label: t("totalTokens"), value: fmtTokens(totals.totalTokens), sub: fmtInt(totals.totalTokens) },
{ label: t("kpiCost"), value: fmtUsd(totals.costUsd) }, { label: t("kpiCost"), value: money(totals.costUsd) },
]; ];
return ( return (
<div className="h-full overflow-auto p-4 space-y-4"> <div className="h-full overflow-auto p-4 space-y-4">
{/* Range tabs + refresh */} {/* Range tabs + refresh */}
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="flex items-center bg-input border border-border rounded p-0.5"> <div className="flex items-center bg-input border border-border rounded p-0.5">
{RANGES.map((r) => ( {RANGES.map((r) => (
<button <button
@@ -143,6 +152,12 @@ export function DashboardPage() {
</button> </button>
))} ))}
</div> </div>
{loadStats && !loading && (
<span className="hidden text-[10px] text-content-muted sm:inline">
{t("loadStats", { ms: loadStats.ms, kb: loadStats.kb })}
</span>
)}
</div>
<button <button
type="button" type="button"
onClick={() => refresh(true)} onClick={() => refresh(true)}
@@ -175,7 +190,7 @@ export function DashboardPage() {
{fmtTokens(tot.totalTokens)} {fmtTokens(tot.totalTokens)}
</div> </div>
<div className="mt-1 text-[11px] text-content-muted"> <div className="mt-1 text-[11px] text-content-muted">
{fmtInt(tot.requests)} {t("unitTimes")} · {fmtUsd(tot.costUsd)} · {fmtPct(tot.cacheHitRate)} {fmtInt(tot.requests)} {t("unitTimes")} · {money(tot.costUsd)} · {fmtPct(tot.cacheHitRate)}
</div> </div>
</button> </button>
); );
@@ -305,7 +320,7 @@ export function DashboardPage() {
<td className="py-2 pr-3 text-right text-content-muted">{fmtInt(m.requests)}</td> <td className="py-2 pr-3 text-right text-content-muted">{fmtInt(m.requests)}</td>
<td className="py-2 pr-3 text-right text-content-muted">{fmtTokens(m.totalTokens)}</td> <td className="py-2 pr-3 text-right text-content-muted">{fmtTokens(m.totalTokens)}</td>
<td className="py-2 pr-3 text-right text-content-muted">{fmtPct(m.cacheHitRate)}</td> <td className="py-2 pr-3 text-right text-content-muted">{fmtPct(m.cacheHitRate)}</td>
<td className="py-2 text-right text-orange-600 dark:text-orange-400">{fmtUsd(m.costUsd)}</td> <td className="py-2 text-right text-orange-600 dark:text-orange-400">{money(m.costUsd)}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
@@ -346,6 +361,7 @@ export function DashboardPage() {
<th className="pb-2 pr-4 font-normal text-right">{t("colInput")}</th> <th className="pb-2 pr-4 font-normal text-right">{t("colInput")}</th>
<th className="pb-2 pr-4 font-normal text-right">{t("colOutput")}</th> <th className="pb-2 pr-4 font-normal text-right">{t("colOutput")}</th>
<th className="pb-2 pr-4 font-normal text-right">{t("colCacheRead")}</th> <th className="pb-2 pr-4 font-normal text-right">{t("colCacheRead")}</th>
<th className="pb-2 pr-4 font-normal text-right">{t("colCacheHit")}</th>
<th className="pb-2 font-normal text-right">{t("cost")}</th> <th className="pb-2 font-normal text-right">{t("cost")}</th>
</tr> </tr>
</thead> </thead>
@@ -359,7 +375,8 @@ export function DashboardPage() {
<td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.inputOther)}</td> <td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.inputOther)}</td>
<td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.output)}</td> <td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.output)}</td>
<td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.inputCacheRead)}</td> <td className="py-1.5 pr-4 text-right text-content-muted">{fmtTokens(r.inputCacheRead)}</td>
<td className="py-1.5 text-right text-orange-600 dark:text-orange-400">{fmtUsd(r.costUsd)}</td> <td className="py-1.5 pr-4 text-right text-content-muted">{fmtPct(cacheHitOf(r))}</td>
<td className="py-1.5 text-right text-orange-600 dark:text-orange-400">{money(r.costUsd)}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
+4 -2
View File
@@ -1,7 +1,8 @@
import { useEffect, useMemo, useRef, useState, type MouseEvent } from "react"; import { useEffect, useMemo, useRef, useState, type MouseEvent } from "react";
import { createPortal } from "react-dom"; import { createPortal } from "react-dom";
import { useTranslation } from "../../i18n"; import { useTranslation } from "../../i18n";
import { fmtPct, fmtTokens, fmtUsd } from "../../lib/dashboard-format"; import { useCurrency } from "../../hooks/useCurrency";
import { fmtPct, fmtTokens } from "../../lib/dashboard-format";
import type { HeatmapCell, HeatmapData } from "../../types/dashboard"; import type { HeatmapCell, HeatmapData } from "../../types/dashboard";
interface HeatmapProps { interface HeatmapProps {
@@ -220,6 +221,7 @@ export function Heatmap({ heatmap }: HeatmapProps) {
function HeatmapTooltip({ state }: { state: HoverState }) { function HeatmapTooltip({ state }: { state: HoverState }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { money } = useCurrency();
const { cell, x, y } = state; const { cell, x, y } = state;
// Position above the cursor with a small offset; flip below if too close to top. // Position above the cursor with a small offset; flip below if too close to top.
const offset = 14; const offset = 14;
@@ -239,7 +241,7 @@ function HeatmapTooltip({ state }: { state: HoverState }) {
> >
<div className="font-medium text-content-primary">{cell.date}</div> <div className="font-medium text-content-primary">{cell.date}</div>
<div className="text-content-muted"> <div className="text-content-muted">
{fmtTokens(cell.totalTokens)} · {fmtUsd(cell.costUsd)} ·{" "} {fmtTokens(cell.totalTokens)} · {money(cell.costUsd)} ·{" "}
{fmtInt(cell.requests)} {t("requests")} {fmtInt(cell.requests)} {t("requests")}
</div> </div>
<div className="text-content-muted"> <div className="text-content-muted">
+83
View File
@@ -0,0 +1,83 @@
import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "../i18n";
import { fmtUsd } from "../lib/dashboard-format";
/**
* USD → CNY exchange rate for the dashboard.
* Chinese mode shows prices in CNY (latest available rate), English stays in
* USD. The rate is fetched once and cached in localStorage for 12h; any
* failure falls back to a conservative fixed rate so the UI never blocks.
*/
const FALLBACK_RATE = 7.2;
const CACHE_KEY = "kimi-switch-cny-rate";
const CACHE_TTL = 12 * 60 * 60 * 1000; // 12 hours
function readCachedRate(): number | null {
try {
const raw = localStorage.getItem(CACHE_KEY);
if (!raw) return null;
const { ts, rate } = JSON.parse(raw) as { ts: number; rate: number };
if (Date.now() - ts > CACHE_TTL || !(rate > 1)) return null;
return rate;
} catch {
return null;
}
}
function writeCachedRate(rate: number) {
try {
localStorage.setItem(CACHE_KEY, JSON.stringify({ ts: Date.now(), rate }));
} catch {
/* ignore */
}
}
export function useCurrency() {
const { lang } = useTranslation();
const [rate, setRate] = useState<number | null>(null);
useEffect(() => {
let cancelled = false;
(async () => {
const cached = readCachedRate();
if (cached) {
setRate(cached);
return;
}
try {
const res = await fetch("https://open.er-api.com/v6/latest/USD");
if (res.ok) {
const data = (await res.json()) as { rates?: { CNY?: number } };
const cny = Number(data.rates?.CNY);
if (cny > 1) {
if (!cancelled) setRate(cny);
writeCachedRate(cny);
return;
}
}
} catch {
/* network blocked → fallback */
}
if (!cancelled) setRate(FALLBACK_RATE);
})();
return () => {
cancelled = true;
};
}, []);
/** Format a USD cost for display: CNY in Chinese mode, USD otherwise. */
const money = useCallback(
(usd: number): string => {
if (lang !== "zh") return fmtUsd(usd);
const v = (Number(usd) || 0) * (rate ?? FALLBACK_RATE);
if (v === 0) return "¥0.00";
if (v < 0.1) return "¥" + v.toFixed(3);
if (v < 1) return "¥" + v.toFixed(2);
return "¥" + v.toFixed(2);
},
[lang, rate],
);
return { money, cnyRate: rate ?? FALLBACK_RATE };
}
+8 -1
View File
@@ -22,16 +22,23 @@ export function useDashboard() {
const [data, setData] = useState<SummaryResult | null>(null); const [data, setData] = useState<SummaryResult | null>(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
/** Round-trip timing for the last get_summary call (user-perceived lag). */
const [loadStats, setLoadStats] = useState<{ ms: number; kb: number } | null>(null);
const refresh = useCallback(async (force = false) => { const refresh = useCallback(async (force = false) => {
setLoading(true); setLoading(true);
setError(null); setError(null);
const start = performance.now();
try { try {
const result = await invoke<SummaryResult>("get_summary", { const result = await invoke<SummaryResult>("get_summary", {
range, range,
refresh: force, refresh: force,
}); });
setData(result); setData(result);
setLoadStats({
ms: Math.round(performance.now() - start),
kb: Math.round(JSON.stringify(result).length / 1024),
});
} catch (err) { } catch (err) {
const msg = err instanceof Error ? err.message : String(err); const msg = err instanceof Error ? err.message : String(err);
setError(msg); setError(msg);
@@ -53,5 +60,5 @@ export function useDashboard() {
} }
}, []); }, []);
return { range, changeRange, data, loading, error, refresh }; return { range, changeRange, data, loading, error, refresh, loadStats };
} }
+2
View File
@@ -197,6 +197,7 @@ export const enTranslations: Record<TranslationKey, string> = {
scanning: "Scanning…", scanning: "Scanning…",
refresh: "Refresh", refresh: "Refresh",
refreshing: "Refreshing…", refreshing: "Refreshing…",
loadStats: "Loaded in {ms} ms · {kb} KB payload",
refreshed: "Refreshed", refreshed: "Refreshed",
cancel: "Cancel", cancel: "Cancel",
confirmDeleteTitle: "Delete session forever?", confirmDeleteTitle: "Delete session forever?",
@@ -260,6 +261,7 @@ export const enTranslations: Record<TranslationKey, string> = {
updateCheckFailed: "Update check failed", updateCheckFailed: "Update check failed",
lastChecked: "Last checked", lastChecked: "Last checked",
appDescription: "Windows desktop LLM provider config manager", appDescription: "Windows desktop LLM provider config manager",
settingsWebsite: "Official website",
referenceProject: "Reference project", referenceProject: "Reference project",
// Validation errors // Validation errors
+2
View File
@@ -194,6 +194,7 @@ export const zhTranslations = {
scanning: "扫描中…", scanning: "扫描中…",
refresh: "刷新", refresh: "刷新",
refreshing: "刷新中…", refreshing: "刷新中…",
loadStats: "加载 {ms} ms · 数据 {kb} KB",
refreshed: "已刷新", refreshed: "已刷新",
cancel: "取消", cancel: "取消",
confirmDeleteTitle: "永久删除会话?", confirmDeleteTitle: "永久删除会话?",
@@ -255,6 +256,7 @@ export const zhTranslations = {
updateCheckFailed: "检查更新失败", updateCheckFailed: "检查更新失败",
lastChecked: "上次检查", lastChecked: "上次检查",
appDescription: "Windows 桌面端 LLM 供应商配置管理器", appDescription: "Windows 桌面端 LLM 供应商配置管理器",
settingsWebsite: "官方网站",
referenceProject: "引用项目", referenceProject: "引用项目",
// Validation errors // Validation errors
+478 -71
View File
@@ -17101,7 +17101,9 @@
"output_limit": 8192, "output_limit": 8192,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true "structured_output": true,
"image": true,
"video": true
}, },
{ {
"id": "qwen3.6-27b", "id": "qwen3.6-27b",
@@ -17175,7 +17177,8 @@
"name": "Abliterated Model Large", "name": "Abliterated Model Large",
"cost": { "cost": {
"input": 5, "input": 5,
"output": 5 "output": 5,
"cache_read": 0.5
}, },
"context": 1000000, "context": 1000000,
"input_limit": 1000000, "input_limit": 1000000,
@@ -17189,7 +17192,8 @@
"name": "Abliterated Model", "name": "Abliterated Model",
"cost": { "cost": {
"input": 3, "input": 3,
"output": 3 "output": 3,
"cache_read": 0.3
}, },
"context": 150000, "context": 150000,
"input_limit": 150000, "input_limit": 150000,
@@ -18190,7 +18194,9 @@
"output_limit": 65536, "output_limit": 65536,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true "structured_output": true,
"image": true,
"video": true
}, },
{ {
"id": "gpt-5.2-chat-latest", "id": "gpt-5.2-chat-latest",
@@ -19796,6 +19802,22 @@
"structured_output": true, "structured_output": true,
"image": true "image": true
}, },
{
"id": "kimi-k3-fast",
"name": "Kimi K3",
"cost": {
"input": 4.5,
"output": 22.5,
"cache_read": 0.45
},
"context": 1040384,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{ {
"id": "claude-opus-5", "id": "claude-opus-5",
"name": "Claude Opus 5", "name": "Claude Opus 5",
@@ -29065,7 +29087,9 @@
"output_limit": 32768, "output_limit": 32768,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true "structured_output": true,
"image": true,
"video": true
}, },
{ {
"id": "Qwen/Qwen3-8B", "id": "Qwen/Qwen3-8B",
@@ -29441,7 +29465,8 @@
"name": "zai-org/GLM-5", "name": "zai-org/GLM-5",
"cost": { "cost": {
"input": 0.95, "input": 0.95,
"output": 2.55 "output": 2.55,
"cache_read": 0.2
}, },
"context": 205000, "context": 205000,
"output_limit": 205000, "output_limit": 205000,
@@ -29467,6 +29492,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
}, },
"context": 1049000, "context": 1049000,
@@ -29481,6 +29507,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
}, },
"context": 205000, "context": 205000,
@@ -29495,6 +29522,7 @@
"cost": { "cost": {
"input": 1.2, "input": 1.2,
"output": 4, "output": 4,
"cache_read": 0.24,
"cache_write": 0 "cache_write": 0
}, },
"context": 200000, "context": 200000,
@@ -29824,7 +29852,8 @@
"name": "MiniMaxAI/MiniMax-M2.5", "name": "MiniMaxAI/MiniMax-M2.5",
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03
}, },
"context": 197000, "context": 197000,
"output_limit": 131000, "output_limit": 131000,
@@ -29992,7 +30021,8 @@
"name": "moonshotai/Kimi-K2.5", "name": "moonshotai/Kimi-K2.5",
"cost": { "cost": {
"input": 0.45, "input": 0.45,
"output": 2.25 "output": 2.25,
"cache_read": 0.07
}, },
"context": 262000, "context": 262000,
"output_limit": 262000, "output_limit": 262000,
@@ -36790,8 +36820,9 @@
"id": "zai-org-glm-4.7-flash", "id": "zai-org-glm-4.7-flash",
"name": "GLM 4.7 Flash", "name": "GLM 4.7 Flash",
"cost": { "cost": {
"input": 0.125, "input": 0.06,
"output": 0.5 "output": 0.4,
"cache_read": 0.01
}, },
"context": 128000, "context": 128000,
"output_limit": 16384, "output_limit": 16384,
@@ -36825,6 +36856,20 @@
"structured_output": true, "structured_output": true,
"image": true "image": true
}, },
{
"id": "deepseek-v4-flash-0731",
"name": "DeepSeek V4 Flash 0731",
"cost": {
"input": 0.175,
"output": 0.35,
"cache_read": 0.035
},
"context": 1000000,
"output_limit": 32768,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{ {
"id": "qwen3-235b-a22b-instruct-2507", "id": "qwen3-235b-a22b-instruct-2507",
"name": "Qwen 3 235B A22B Instruct 2507", "name": "Qwen 3 235B A22B Instruct 2507",
@@ -37751,7 +37796,8 @@
"name": "GLM-5.1", "name": "GLM-5.1",
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4 "output": 4.4,
"cache_read": 0.26
}, },
"context": 202752, "context": 202752,
"output_limit": 131072, "output_limit": 131072,
@@ -37822,7 +37868,8 @@
"name": "Qwen3.7 Max", "name": "Qwen3.7 Max",
"cost": { "cost": {
"input": 1.25, "input": 1.25,
"output": 3.75 "output": 3.75,
"cache_read": 0.125
}, },
"context": 1000000, "context": 1000000,
"output_limit": 500000, "output_limit": 500000,
@@ -37844,7 +37891,8 @@
"name": "Qwen3.5 397B A17B", "name": "Qwen3.5 397B A17B",
"cost": { "cost": {
"input": 0.6, "input": 0.6,
"output": 3.6 "output": 3.6,
"cache_read": 0.35
}, },
"context": 262144, "context": 262144,
"output_limit": 130000, "output_limit": 130000,
@@ -40988,6 +41036,21 @@
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"image": true "image": true
},
{
"id": "moonshotai/Kimi-K3",
"name": "Kimi K3",
"cost": {
"input": 3,
"output": 15,
"cache_read": 0.3
},
"context": 1048576,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true
} }
] ]
}, },
@@ -41448,7 +41511,9 @@
"name": "MiniMax-M2.1", "name": "MiniMax-M2.1",
"cost": { "cost": {
"input": 2.1, "input": 2.1,
"output": 8.4 "output": 8.4,
"cache_read": 2.1,
"cache_write": 8.4
}, },
"context": 204800, "context": 204800,
"output_limit": 131072, "output_limit": 131072,
@@ -45670,7 +45735,9 @@
"output_limit": 32000, "output_limit": 32000,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true "structured_output": true,
"image": true,
"video": true
}, },
{ {
"id": "nemotron-3-ultra", "id": "nemotron-3-ultra",
@@ -48709,7 +48776,9 @@
"name": "MiniMax-M2.1", "name": "MiniMax-M2.1",
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03,
"cache_write": 0.375
}, },
"context": 204800, "context": 204800,
"output_limit": 131072, "output_limit": 131072,
@@ -49621,6 +49690,355 @@
} }
] ]
}, },
"tensorx": {
"id": "tensorx",
"name": "TensorX",
"models": [
{
"id": "nvidia/nemotron-3-super-120b-a12b",
"name": "Nemotron 3 Super 120B A12B",
"cost": {
"input": 0.3,
"output": 0.9,
"cache_read": 0.075,
"cache_write": 0.375
},
"context": 262144,
"output_limit": 262144,
"reasoning": true,
"tool_call": true
},
{
"id": "qwen/qwen3-coder-30b-a3b-instruct",
"name": "Qwen3-Coder 30B-A3B Instruct",
"cost": {
"input": 0.06,
"output": 0.25,
"cache_read": 0.015,
"cache_write": 0.075
},
"context": 262000,
"output_limit": 65536,
"tool_call": true
},
{
"id": "qwen/qwen3.5-9b",
"name": "Qwen3.5 9B",
"cost": {
"input": 0.15,
"output": 0.2,
"cache_read": 0.0375,
"cache_write": 0.1875
},
"context": 262144,
"output_limit": 65536,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{
"id": "qwen/qwen3-vl-235b-a22b-instruct",
"name": "Qwen3 VL 235B-A22B Instruct",
"cost": {
"input": 0.21,
"output": 1.9,
"cache_read": 0.0525,
"cache_write": 0.2625
},
"context": 131000,
"output_limit": 131072,
"tool_call": true,
"image": true
},
{
"id": "qwen/qwen3-235b-a22b-2507",
"name": "Qwen3 235B-A22B-2507",
"cost": {
"input": 0.072,
"output": 0.464,
"cache_read": 0.018,
"cache_write": 0.09
},
"context": 131000,
"output_limit": 262144,
"tool_call": true
},
{
"id": "qwen/qwen3.5-122b-a10b",
"name": "Qwen3.5 122B-A10B",
"cost": {
"input": 0.5,
"output": 3.5,
"cache_read": 0.125,
"cache_write": 0.625
},
"context": 262144,
"output_limit": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{
"id": "minimax/minimax-m3",
"name": "MiniMax-M3",
"cost": {
"input": 0.4,
"output": 2,
"cache_read": 0.1
},
"context": 1048576,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"image": true,
"video": true
},
{
"id": "minimax/minimax-m2.5",
"name": "MiniMax-M2.5",
"cost": {
"input": 0.3,
"output": 1.2,
"cache_read": 0.075,
"cache_write": 0.375
},
"context": 196608,
"output_limit": 65536,
"reasoning": true,
"tool_call": true
},
{
"id": "deepseek/deepseek-v4-flash",
"name": "DeepSeek V4 Flash",
"cost": {
"input": 0.15,
"output": 0.3,
"cache_read": 0.0375,
"cache_write": 0.1875
},
"context": 1048576,
"output_limit": 384000,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{
"id": "deepseek/deepseek-v4-pro",
"name": "DeepSeek V4 Pro",
"cost": {
"input": 1.75,
"output": 3.5,
"cache_read": 0.4375,
"cache_write": 2.185
},
"context": 1048576,
"output_limit": 384000,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{
"id": "deepseek/deepseek-r1-0528",
"name": "DeepSeek R1-0528",
"cost": {
"input": 0.66,
"output": 2.6,
"cache_read": 0.165,
"cache_write": 0.825
},
"context": 164000,
"output_limit": 8192,
"reasoning": true,
"tool_call": true
},
{
"id": "deepseek/deepseek-v3.2",
"name": "DeepSeek V3.2",
"cost": {
"input": 0.3,
"output": 0.5,
"cache_read": 0.075,
"cache_write": 0.375
},
"context": 163840,
"output_limit": 163840,
"reasoning": true,
"tool_call": true
},
{
"id": "deepseek/deepseek-chat-v3.1",
"name": "DeepSeek Chat V3.1",
"cost": {
"input": 0.2,
"output": 0.8,
"cache_read": 0.05,
"cache_write": 0.25
},
"context": 164000,
"output_limit": 163840,
"reasoning": true,
"tool_call": true
},
{
"id": "z-ai/glm-5",
"name": "GLM-5",
"cost": {
"input": 1,
"output": 3.2,
"cache_read": 0.25,
"cache_write": 1.25
},
"context": 202752,
"output_limit": 202752,
"reasoning": true,
"tool_call": true
},
{
"id": "z-ai/glm-5.1",
"name": "GLM-5.1",
"cost": {
"input": 1.4,
"output": 4.4,
"cache_read": 0.35,
"cache_write": 1.75
},
"context": 202752,
"output_limit": 202752,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{
"id": "z-ai/glm-5.2",
"name": "GLM-5.2",
"cost": {
"input": 1.5,
"output": 4.5,
"cache_read": 0.375
},
"context": 1048576,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{
"id": "z-ai/glm-4.7",
"name": "GLM-4.7",
"cost": {
"input": 0.6,
"output": 2.2,
"cache_read": 0.15,
"cache_write": 0.75
},
"context": 200000,
"output_limit": 200000,
"reasoning": true,
"tool_call": true,
"image": true
},
{
"id": "z-ai/glm-5-turbo",
"name": "GLM-5-Turbo",
"cost": {
"input": 1.2,
"output": 4,
"cache_read": 0.3,
"cache_write": 1.5
},
"context": 202752,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{
"id": "z-ai/glm-5v-turbo",
"name": "GLM-5V-Turbo",
"cost": {
"input": 1.2,
"output": 4,
"cache_read": 0.3,
"cache_write": 1.5
},
"context": 202752,
"output_limit": 131072,
"reasoning": true,
"tool_call": true,
"image": true,
"video": true
},
{
"id": "moonshotai/kimi-k2.5",
"name": "Kimi K2.5",
"cost": {
"input": 0.5,
"output": 2.8,
"cache_read": 0.125,
"cache_write": 0.625
},
"context": 262144,
"output_limit": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{
"id": "moonshotai/kimi-k2.6",
"name": "Kimi K2.6",
"cost": {
"input": 1,
"output": 4,
"cache_read": 0.25,
"cache_write": 1.25
},
"context": 262144,
"output_limit": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{
"id": "moonshotai/kimi-k2.7-code",
"name": "Kimi K2.7 Code",
"cost": {
"input": 1.25,
"output": 4.5,
"cache_read": 0.3125
},
"context": 262144,
"output_limit": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{
"id": "openai/gpt-oss-120b",
"name": "GPT OSS 120B",
"cost": {
"input": 0.04,
"output": 0.2,
"cache_read": 0.01,
"cache_write": 0.05
},
"context": 131072,
"output_limit": 32768,
"reasoning": true,
"tool_call": true,
"structured_output": true
}
]
},
"llama": { "llama": {
"id": "llama", "id": "llama",
"name": "Llama", "name": "Llama",
@@ -58117,7 +58535,8 @@
"cache_read": 0.03 "cache_read": 0.03
}, },
"context": 32768, "context": 32768,
"output_limit": 65536 "output_limit": 65536,
"image": true
}, },
{ {
"id": "google/imagen-4.0-generate-001", "id": "google/imagen-4.0-generate-001",
@@ -58133,7 +58552,8 @@
"cache_read": 0.2 "cache_read": 0.2
}, },
"context": 65536, "context": 65536,
"output_limit": 32768 "output_limit": 32768,
"image": true
}, },
{ {
"id": "google/gemini-3.1-pro-preview", "id": "google/gemini-3.1-pro-preview",
@@ -58150,6 +58570,10 @@
"structured_output": true, "structured_output": true,
"image": true "image": true
}, },
{
"id": "google/veo-3.1-lite-generate-001",
"name": "Veo 3.1 Lite Generate"
},
{ {
"id": "google/gemini-2.5-flash-lite", "id": "google/gemini-2.5-flash-lite",
"name": "Gemini 2.5 Flash Lite", "name": "Gemini 2.5 Flash Lite",
@@ -58868,7 +59292,8 @@
}, },
"context": 128000, "context": 128000,
"output_limit": 128000, "output_limit": 128000,
"tool_call": true "tool_call": true,
"image": true
}, },
{ {
"id": "mistral/mistral-small", "id": "mistral/mistral-small",
@@ -59198,6 +59623,19 @@
"tool_call": true, "tool_call": true,
"structured_output": true "structured_output": true
}, },
{
"id": "deepseek/deepseek-v4-flash-0731",
"name": "DeepSeek V4 Flash 0731",
"cost": {
"input": 0.13,
"output": 0.26,
"cache_read": 0.028
},
"context": 1000000,
"output_limit": 384000,
"reasoning": true,
"tool_call": true
},
{ {
"id": "deepseek/deepseek-v3", "id": "deepseek/deepseek-v3",
"name": "DeepSeek V3 0324", "name": "DeepSeek V3 0324",
@@ -59714,7 +60152,8 @@
"context": 256000, "context": 256000,
"output_limit": 80000, "output_limit": 80000,
"reasoning": true, "reasoning": true,
"tool_call": true "tool_call": true,
"image": true
}, },
{ {
"id": "kwaipilot/kat-coder-air-v2.5", "id": "kwaipilot/kat-coder-air-v2.5",
@@ -59727,7 +60166,8 @@
"context": 256000, "context": 256000,
"output_limit": 80000, "output_limit": 80000,
"reasoning": true, "reasoning": true,
"tool_call": true "tool_call": true,
"image": true
}, },
{ {
"id": "xiaomi/mimo-v2.5", "id": "xiaomi/mimo-v2.5",
@@ -60018,7 +60458,8 @@
"name": "Sonar Reasoning Pro", "name": "Sonar Reasoning Pro",
"context": 127000, "context": 127000,
"output_limit": 8000, "output_limit": 8000,
"reasoning": true "reasoning": true,
"image": true
}, },
{ {
"id": "moonshotai/kimi-k2.5", "id": "moonshotai/kimi-k2.5",
@@ -61102,7 +61543,8 @@
"context": 262114, "context": 262114,
"output_limit": 262114, "output_limit": 262114,
"reasoning": true, "reasoning": true,
"tool_call": true "tool_call": true,
"image": true
}, },
{ {
"id": "stepfun/step-3.7-flash", "id": "stepfun/step-3.7-flash",
@@ -68833,7 +69275,9 @@
"name": "MiniMax-M2.1", "name": "MiniMax-M2.1",
"cost": { "cost": {
"input": 0, "input": 0,
"output": 0 "output": 0,
"cache_read": 0,
"cache_write": 0
}, },
"context": 204800, "context": 204800,
"output_limit": 131072, "output_limit": 131072,
@@ -68910,6 +69354,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
}, },
"context": 1049000, "context": 1049000,
@@ -68973,6 +69418,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
}, },
"context": 205000, "context": 205000,
@@ -69064,7 +69510,8 @@
"name": "Pro/moonshotai/Kimi-K2.5", "name": "Pro/moonshotai/Kimi-K2.5",
"cost": { "cost": {
"input": 0.45, "input": 0.45,
"output": 2.25 "output": 2.25,
"cache_read": 0.07
}, },
"context": 262000, "context": 262000,
"output_limit": 262000, "output_limit": 262000,
@@ -72114,20 +72561,6 @@
"structured_output": true, "structured_output": true,
"image": true "image": true
}, },
{
"id": "zai-org/GLM-5-TEE",
"name": "GLM 5 TEE",
"cost": {
"input": 0.95,
"output": 2.55,
"cache_read": 0.475
},
"context": 202752,
"output_limit": 65535,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{ {
"id": "zai-org/GLM-5.1-TEE", "id": "zai-org/GLM-5.1-TEE",
"name": "GLM 5.1 TEE", "name": "GLM 5.1 TEE",
@@ -72225,20 +72658,6 @@
"structured_output": true, "structured_output": true,
"image": true "image": true
}, },
{
"id": "MiniMaxAI/MiniMax-M2.5-TEE",
"name": "MiniMax M2.5 TEE",
"cost": {
"input": 0.15,
"output": 1.2,
"cache_read": 0.075
},
"context": 196608,
"output_limit": 65536,
"reasoning": true,
"tool_call": true,
"structured_output": true
},
{ {
"id": "deepseek-ai/DeepSeek-V3.2-TEE", "id": "deepseek-ai/DeepSeek-V3.2-TEE",
"name": "DeepSeek V3.2 TEE", "name": "DeepSeek V3.2 TEE",
@@ -72269,22 +72688,6 @@
"image": true, "image": true,
"video": true "video": true
}, },
{
"id": "moonshotai/Kimi-K2.5-TEE",
"name": "Kimi K2.5 TEE",
"cost": {
"input": 0.44,
"output": 2,
"cache_read": 0.22
},
"context": 262144,
"output_limit": 65535,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true
},
{ {
"id": "moonshotai/Kimi-K3-TEE", "id": "moonshotai/Kimi-K3-TEE",
"name": "Kimi K3 TEE", "name": "Kimi K3 TEE",
@@ -77090,7 +77493,9 @@
"name": "MiniMax-M2.1", "name": "MiniMax-M2.1",
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03,
"cache_write": 0.375
}, },
"context": 204800, "context": 204800,
"output_limit": 131072, "output_limit": 131072,
@@ -77719,7 +78124,9 @@
"name": "MiniMax-M2.1", "name": "MiniMax-M2.1",
"cost": { "cost": {
"input": 0, "input": 0,
"output": 0 "output": 0,
"cache_read": 0,
"cache_write": 0
}, },
"context": 204800, "context": 204800,
"output_limit": 131072, "output_limit": 131072,
+407 -55
View File
@@ -13610,6 +13610,8 @@
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true, "structured_output": true,
"image": true,
"video": true,
"cost": { "cost": {
"input": 0, "input": 0,
"output": 0 "output": 0
@@ -13674,7 +13676,8 @@
"structured_output": true, "structured_output": true,
"cost": { "cost": {
"input": 5, "input": 5,
"output": 5 "output": 5,
"cache_read": 0.5
} }
}, },
"abliteration-ai/abliterated-model": { "abliteration-ai/abliterated-model": {
@@ -13685,7 +13688,8 @@
"image": true, "image": true,
"cost": { "cost": {
"input": 3, "input": 3,
"output": 3 "output": 3,
"cache_read": 0.3
} }
}, },
"alibaba-coding-plan-cn/qwen3.7-plus": { "alibaba-coding-plan-cn/qwen3.7-plus": {
@@ -14520,6 +14524,8 @@
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true, "structured_output": true,
"image": true,
"video": true,
"cost": { "cost": {
"input": 0.1, "input": 0.1,
"output": 0.15 "output": 0.15
@@ -15883,6 +15889,20 @@
"cache_read": 0.2 "cache_read": 0.2
} }
}, },
"llmgateway/kimi-k3-fast": {
"name": "Kimi K3",
"context": 1040384,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 4.5,
"output": 22.5,
"cache_read": 0.45
}
},
"llmgateway/claude-opus-5": { "llmgateway/claude-opus-5": {
"name": "Claude Opus 5", "name": "Claude Opus 5",
"context": 1000000, "context": 1000000,
@@ -23525,6 +23545,8 @@
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true, "structured_output": true,
"image": true,
"video": true,
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 0.3, "output": 0.3,
@@ -23853,7 +23875,8 @@
"structured_output": true, "structured_output": true,
"cost": { "cost": {
"input": 0.95, "input": 0.95,
"output": 2.55 "output": 2.55,
"cache_read": 0.2
} }
}, },
"siliconflow/zai-org/GLM-4.5-Air": { "siliconflow/zai-org/GLM-4.5-Air": {
@@ -23875,6 +23898,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
} }
}, },
@@ -23887,6 +23911,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
} }
}, },
@@ -23899,6 +23924,7 @@
"cost": { "cost": {
"input": 1.2, "input": 1.2,
"output": 4, "output": 4,
"cache_read": 0.24,
"cache_write": 0 "cache_write": 0
} }
}, },
@@ -24174,7 +24200,8 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03
} }
}, },
"siliconflow/inclusionAI/Ling-flash-2.0": { "siliconflow/inclusionAI/Ling-flash-2.0": {
@@ -24319,7 +24346,8 @@
"image": true, "image": true,
"cost": { "cost": {
"input": 0.45, "input": 0.45,
"output": 2.25 "output": 2.25,
"cache_read": 0.07
} }
}, },
"siliconflow/openai/gpt-oss-20b": { "siliconflow/openai/gpt-oss-20b": {
@@ -29988,8 +30016,9 @@
"tool_call": true, "tool_call": true,
"structured_output": true, "structured_output": true,
"cost": { "cost": {
"input": 0.125, "input": 0.06,
"output": 0.5 "output": 0.4,
"cache_read": 0.01
} }
}, },
"venice/llama-3.2-3b": { "venice/llama-3.2-3b": {
@@ -30013,6 +30042,18 @@
"output": 225 "output": 225
} }
}, },
"venice/deepseek-v4-flash-0731": {
"name": "DeepSeek V4 Flash 0731",
"context": 1000000,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 0.175,
"output": 0.35,
"cache_read": 0.035
}
},
"venice/qwen3-235b-a22b-instruct-2507": { "venice/qwen3-235b-a22b-instruct-2507": {
"name": "Qwen 3 235B A22B Instruct 2507", "name": "Qwen 3 235B A22B Instruct 2507",
"context": 128000, "context": 128000,
@@ -30792,7 +30833,8 @@
"structured_output": true, "structured_output": true,
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4 "output": 4.4,
"cache_read": 0.26
} }
}, },
"togetherai/pearl-ai/gemma-4-31b-it": { "togetherai/pearl-ai/gemma-4-31b-it": {
@@ -30849,7 +30891,8 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 1.25, "input": 1.25,
"output": 3.75 "output": 3.75,
"cache_read": 0.125
} }
}, },
"togetherai/Qwen/Qwen3-235B-A22B-Instruct-2507-tput": { "togetherai/Qwen/Qwen3-235B-A22B-Instruct-2507-tput": {
@@ -30869,7 +30912,8 @@
"image": true, "image": true,
"cost": { "cost": {
"input": 0.6, "input": 0.6,
"output": 3.6 "output": 3.6,
"cache_read": 0.35
} }
}, },
"togetherai/Qwen/Qwen3.6-Plus": { "togetherai/Qwen/Qwen3.6-Plus": {
@@ -33439,6 +33483,19 @@
"cache_read": 0.27 "cache_read": 0.27
} }
}, },
"modal/moonshotai/Kimi-K3": {
"name": "Kimi K3",
"context": 1048576,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"cost": {
"input": 3,
"output": 15,
"cache_read": 0.3
}
},
"qihang-ai/gemini-2.5-flash": { "qihang-ai/gemini-2.5-flash": {
"name": "Gemini 2.5 Flash", "name": "Gemini 2.5 Flash",
"context": 1048576, "context": 1048576,
@@ -33814,7 +33871,9 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 2.1, "input": 2.1,
"output": 8.4 "output": 8.4,
"cache_read": 2.1,
"cache_write": 8.4
} }
}, },
"moark/GLM-4.7": { "moark/GLM-4.7": {
@@ -37298,6 +37357,8 @@
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"structured_output": true, "structured_output": true,
"image": true,
"video": true,
"cost": { "cost": {
"input": 0.16, "input": 0.16,
"output": 0.48 "output": 0.48
@@ -39859,7 +39920,9 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03,
"cache_write": 0.375
} }
}, },
"minimax/MiniMax-M2.5": { "minimax/MiniMax-M2.5": {
@@ -40611,6 +40674,303 @@
"cache_read": 0.11 "cache_read": 0.11
} }
}, },
"tensorx/nvidia/nemotron-3-super-120b-a12b": {
"name": "Nemotron 3 Super 120B A12B",
"context": 262144,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.3,
"output": 0.9,
"cache_read": 0.075,
"cache_write": 0.375
}
},
"tensorx/qwen/qwen3-coder-30b-a3b-instruct": {
"name": "Qwen3-Coder 30B-A3B Instruct",
"context": 262000,
"tool_call": true,
"cost": {
"input": 0.06,
"output": 0.25,
"cache_read": 0.015,
"cache_write": 0.075
}
},
"tensorx/qwen/qwen3.5-9b": {
"name": "Qwen3.5 9B",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 0.15,
"output": 0.2,
"cache_read": 0.0375,
"cache_write": 0.1875
}
},
"tensorx/qwen/qwen3-vl-235b-a22b-instruct": {
"name": "Qwen3 VL 235B-A22B Instruct",
"context": 131000,
"tool_call": true,
"image": true,
"cost": {
"input": 0.21,
"output": 1.9,
"cache_read": 0.0525,
"cache_write": 0.2625
}
},
"tensorx/qwen/qwen3-235b-a22b-2507": {
"name": "Qwen3 235B-A22B-2507",
"context": 131000,
"tool_call": true,
"cost": {
"input": 0.072,
"output": 0.464,
"cache_read": 0.018,
"cache_write": 0.09
}
},
"tensorx/qwen/qwen3.5-122b-a10b": {
"name": "Qwen3.5 122B-A10B",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 0.5,
"output": 3.5,
"cache_read": 0.125,
"cache_write": 0.625
}
},
"tensorx/minimax/minimax-m3": {
"name": "MiniMax-M3",
"context": 1048576,
"reasoning": true,
"tool_call": true,
"image": true,
"video": true,
"cost": {
"input": 0.4,
"output": 2,
"cache_read": 0.1
}
},
"tensorx/minimax/minimax-m2.5": {
"name": "MiniMax-M2.5",
"context": 196608,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.3,
"output": 1.2,
"cache_read": 0.075,
"cache_write": 0.375
}
},
"tensorx/deepseek/deepseek-v4-flash": {
"name": "DeepSeek V4 Flash",
"context": 1048576,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 0.15,
"output": 0.3,
"cache_read": 0.0375,
"cache_write": 0.1875
}
},
"tensorx/deepseek/deepseek-v4-pro": {
"name": "DeepSeek V4 Pro",
"context": 1048576,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 1.75,
"output": 3.5,
"cache_read": 0.4375,
"cache_write": 2.185
}
},
"tensorx/deepseek/deepseek-r1-0528": {
"name": "DeepSeek R1-0528",
"context": 164000,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.66,
"output": 2.6,
"cache_read": 0.165,
"cache_write": 0.825
}
},
"tensorx/deepseek/deepseek-v3.2": {
"name": "DeepSeek V3.2",
"context": 163840,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.3,
"output": 0.5,
"cache_read": 0.075,
"cache_write": 0.375
}
},
"tensorx/deepseek/deepseek-chat-v3.1": {
"name": "DeepSeek Chat V3.1",
"context": 164000,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.2,
"output": 0.8,
"cache_read": 0.05,
"cache_write": 0.25
}
},
"tensorx/z-ai/glm-5": {
"name": "GLM-5",
"context": 202752,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 1,
"output": 3.2,
"cache_read": 0.25,
"cache_write": 1.25
}
},
"tensorx/z-ai/glm-5.1": {
"name": "GLM-5.1",
"context": 202752,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 1.4,
"output": 4.4,
"cache_read": 0.35,
"cache_write": 1.75
}
},
"tensorx/z-ai/glm-5.2": {
"name": "GLM-5.2",
"context": 1048576,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 1.5,
"output": 4.5,
"cache_read": 0.375
}
},
"tensorx/z-ai/glm-4.7": {
"name": "GLM-4.7",
"context": 200000,
"reasoning": true,
"tool_call": true,
"image": true,
"cost": {
"input": 0.6,
"output": 2.2,
"cache_read": 0.15,
"cache_write": 0.75
}
},
"tensorx/z-ai/glm-5-turbo": {
"name": "GLM-5-Turbo",
"context": 202752,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 1.2,
"output": 4,
"cache_read": 0.3,
"cache_write": 1.5
}
},
"tensorx/z-ai/glm-5v-turbo": {
"name": "GLM-5V-Turbo",
"context": 202752,
"reasoning": true,
"tool_call": true,
"image": true,
"video": true,
"cost": {
"input": 1.2,
"output": 4,
"cache_read": 0.3,
"cache_write": 1.5
}
},
"tensorx/moonshotai/kimi-k2.5": {
"name": "Kimi K2.5",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 0.5,
"output": 2.8,
"cache_read": 0.125,
"cache_write": 0.625
}
},
"tensorx/moonshotai/kimi-k2.6": {
"name": "Kimi K2.6",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 1,
"output": 4,
"cache_read": 0.25,
"cache_write": 1.25
}
},
"tensorx/moonshotai/kimi-k2.7-code": {
"name": "Kimi K2.7 Code",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 1.25,
"output": 4.5,
"cache_read": 0.3125
}
},
"tensorx/openai/gpt-oss-120b": {
"name": "GPT OSS 120B",
"context": 131072,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 0.04,
"output": 0.2,
"cache_read": 0.01,
"cache_write": 0.05
}
},
"llama/cerebras-llama-4-maverick-17b-128e-instruct": { "llama/cerebras-llama-4-maverick-17b-128e-instruct": {
"name": "Cerebras-Llama-4-Maverick-17B-128E-Instruct", "name": "Cerebras-Llama-4-Maverick-17B-128E-Instruct",
"context": 128000, "context": 128000,
@@ -47689,6 +48049,7 @@
"vercel/google/gemini-2.5-flash-image": { "vercel/google/gemini-2.5-flash-image": {
"name": "Nano Banana (Gemini 2.5 Flash Image)", "name": "Nano Banana (Gemini 2.5 Flash Image)",
"context": 32768, "context": 32768,
"image": true,
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 2.5, "output": 2.5,
@@ -47702,6 +48063,7 @@
"vercel/google/gemini-3-pro-image": { "vercel/google/gemini-3-pro-image": {
"name": "Nano Banana Pro", "name": "Nano Banana Pro",
"context": 65536, "context": 65536,
"image": true,
"cost": { "cost": {
"input": 2, "input": 2,
"output": 12, "output": 12,
@@ -47721,6 +48083,9 @@
"cache_read": 0.2 "cache_read": 0.2
} }
}, },
"vercel/google/veo-3.1-lite-generate-001": {
"name": "Veo 3.1 Lite Generate"
},
"vercel/google/gemini-2.5-flash-lite": { "vercel/google/gemini-2.5-flash-lite": {
"name": "Gemini 2.5 Flash Lite", "name": "Gemini 2.5 Flash Lite",
"context": 1048576, "context": 1048576,
@@ -48298,6 +48663,7 @@
"name": "Mistral Nemo", "name": "Mistral Nemo",
"context": 128000, "context": 128000,
"tool_call": true, "tool_call": true,
"image": true,
"cost": { "cost": {
"input": 0.15, "input": 0.15,
"output": 0.15 "output": 0.15
@@ -48578,6 +48944,17 @@
"cache_read": 0.0036 "cache_read": 0.0036
} }
}, },
"vercel/deepseek/deepseek-v4-flash-0731": {
"name": "DeepSeek V4 Flash 0731",
"context": 1000000,
"reasoning": true,
"tool_call": true,
"cost": {
"input": 0.13,
"output": 0.26,
"cache_read": 0.028
}
},
"vercel/deepseek/deepseek-v3": { "vercel/deepseek/deepseek-v3": {
"name": "DeepSeek V3 0324", "name": "DeepSeek V3 0324",
"context": 163840, "context": 163840,
@@ -49002,6 +49379,7 @@
"context": 256000, "context": 256000,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"image": true,
"cost": { "cost": {
"input": 0.74, "input": 0.74,
"output": 2.96, "output": 2.96,
@@ -49013,6 +49391,7 @@
"context": 256000, "context": 256000,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"image": true,
"cost": { "cost": {
"input": 0.15, "input": 0.15,
"output": 0.6, "output": 0.6,
@@ -49266,7 +49645,8 @@
"vercel/perplexity/sonar-reasoning-pro": { "vercel/perplexity/sonar-reasoning-pro": {
"name": "Sonar Reasoning Pro", "name": "Sonar Reasoning Pro",
"context": 127000, "context": 127000,
"reasoning": true "reasoning": true,
"image": true
}, },
"vercel/moonshotai/kimi-k2.5": { "vercel/moonshotai/kimi-k2.5": {
"name": "Kimi K2.5", "name": "Kimi K2.5",
@@ -50157,6 +50537,7 @@
"context": 262114, "context": 262114,
"reasoning": true, "reasoning": true,
"tool_call": true, "tool_call": true,
"image": true,
"cost": { "cost": {
"input": 0.09, "input": 0.09,
"output": 0.3, "output": 0.3,
@@ -56667,7 +57048,9 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 0, "input": 0,
"output": 0 "output": 0,
"cache_read": 0,
"cache_write": 0
} }
}, },
"minimax-coding-plan/MiniMax-M2.5": { "minimax-coding-plan/MiniMax-M2.5": {
@@ -56729,6 +57112,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
} }
}, },
@@ -56782,6 +57166,7 @@
"cost": { "cost": {
"input": 1.4, "input": 1.4,
"output": 4.4, "output": 4.4,
"cache_read": 0.26,
"cache_write": 0 "cache_write": 0
} }
}, },
@@ -56860,7 +57245,8 @@
"image": true, "image": true,
"cost": { "cost": {
"input": 0.45, "input": 0.45,
"output": 2.25 "output": 2.25,
"cache_read": 0.07
} }
}, },
"siliconflow-cn/Qwen/Qwen3.5-27B": { "siliconflow-cn/Qwen/Qwen3.5-27B": {
@@ -59386,18 +59772,6 @@
"cache_read": 0.06 "cache_read": 0.06
} }
}, },
"chutes/zai-org/GLM-5-TEE": {
"name": "GLM 5 TEE",
"context": 202752,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 0.95,
"output": 2.55,
"cache_read": 0.475
}
},
"chutes/zai-org/GLM-5.1-TEE": { "chutes/zai-org/GLM-5.1-TEE": {
"name": "GLM 5.1 TEE", "name": "GLM 5.1 TEE",
"context": 202752, "context": 202752,
@@ -59481,18 +59855,6 @@
"cache_read": 0.225 "cache_read": 0.225
} }
}, },
"chutes/MiniMaxAI/MiniMax-M2.5-TEE": {
"name": "MiniMax M2.5 TEE",
"context": 196608,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"cost": {
"input": 0.15,
"output": 1.2,
"cache_read": 0.075
}
},
"chutes/deepseek-ai/DeepSeek-V3.2-TEE": { "chutes/deepseek-ai/DeepSeek-V3.2-TEE": {
"name": "DeepSeek V3.2 TEE", "name": "DeepSeek V3.2 TEE",
"context": 131072, "context": 131072,
@@ -59519,20 +59881,6 @@
"cache_read": 0.33 "cache_read": 0.33
} }
}, },
"chutes/moonshotai/Kimi-K2.5-TEE": {
"name": "Kimi K2.5 TEE",
"context": 262144,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"image": true,
"video": true,
"cost": {
"input": 0.44,
"output": 2,
"cache_read": 0.22
}
},
"chutes/moonshotai/Kimi-K3-TEE": { "chutes/moonshotai/Kimi-K3-TEE": {
"name": "Kimi K3 TEE", "name": "Kimi K3 TEE",
"context": 1048576, "context": 1048576,
@@ -63413,7 +63761,9 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 0.3, "input": 0.3,
"output": 1.2 "output": 1.2,
"cache_read": 0.03,
"cache_write": 0.375
} }
}, },
"minimax-cn/MiniMax-M2.5": { "minimax-cn/MiniMax-M2.5": {
@@ -63930,7 +64280,9 @@
"tool_call": true, "tool_call": true,
"cost": { "cost": {
"input": 0, "input": 0,
"output": 0 "output": 0,
"cache_read": 0,
"cache_write": 0
} }
}, },
"minimax-cn-coding-plan/MiniMax-M2.5": { "minimax-cn-coding-plan/MiniMax-M2.5": {
+4 -4
View File
@@ -13,7 +13,7 @@
/> />
<meta <meta
name="keywords" name="keywords"
content="KimiSwitch, KimiCodeSwitch, SwitchKimi, Kimi Code Switch, Kimi 切换, LLM 供应商管理, AI 供应商切换, 多 LLM 管理, Kimi 用量监控, 智谱 GLM, MiniMax, DeepSeek, OpenRouter, 基元律动, 用量查询, 账单监控, Token 套餐, Claude, GPT, Windows LLM 桌面工具" content="Kimi Switch, KimiSwitch, KimiCode Switch, KimiCodeSwitch, SwitchKimi, Kimi Code Switch, Kimi 切换, LLM 供应商管理, AI 供应商切换, 多 LLM 管理, Kimi 用量监控, 智谱 GLM, MiniMax, DeepSeek, OpenRouter, 基元律动, 用量查询, 账单监控, Token 套餐, Claude, GPT, Windows LLM 桌面工具"
/> />
<!-- Open Graph --> <!-- Open Graph -->
@@ -24,7 +24,7 @@
content="一键切换 Kimi / 智谱 GLM / MiniMax / DeepSeek 等供应商,用量与账单一目了然,开源 MIT。" content="一键切换 Kimi / 智谱 GLM / MiniMax / DeepSeek 等供应商,用量与账单一目了然,开源 MIT。"
/> />
<meta property="og:url" content="https://billowliu2.github.io/KimiSwitch/" /> <meta property="og:url" content="https://billowliu2.github.io/KimiSwitch/" />
<meta property="og:image" content="%BASE_URL%og.png" /> <meta property="og:image" content="https://billowliu2.github.io/KimiSwitch/og.png" />
<!-- Twitter --> <!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
@@ -33,7 +33,7 @@
name="twitter:description" name="twitter:description"
content="一键切换 Kimi / 智谱 GLM / MiniMax / DeepSeek 等供应商,用量与账单一目了然,开源 MIT。" content="一键切换 Kimi / 智谱 GLM / MiniMax / DeepSeek 等供应商,用量与账单一目了然,开源 MIT。"
/> />
<meta name="twitter:image" content="%BASE_URL%og.png" /> <meta name="twitter:image" content="https://billowliu2.github.io/KimiSwitch/og.png" />
<!-- Canonical --> <!-- Canonical -->
<link rel="canonical" href="https://billowliu2.github.io/KimiSwitch/" /> <link rel="canonical" href="https://billowliu2.github.io/KimiSwitch/" />
@@ -46,7 +46,7 @@
{ {
"@type": "SoftwareApplication", "@type": "SoftwareApplication",
"name": "Kimi Switch", "name": "Kimi Switch",
"alternateName": ["KimiSwitch", "KimiCodeSwitch"], "alternateName": ["KimiSwitch", "KimiCodeSwitch", "Kimi Switch", "KimiCode Switch"],
"url": "https://billowliu2.github.io/KimiSwitch/", "url": "https://billowliu2.github.io/KimiSwitch/",
"applicationCategory": "DeveloperApplication", "applicationCategory": "DeveloperApplication",
"operatingSystem": "Windows 10, Windows 11", "operatingSystem": "Windows 10, Windows 11",
+18
View File
@@ -16,6 +16,7 @@
"react-router-dom": "^7.18.2" "react-router-dom": "^7.18.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^26.1.2",
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
@@ -1299,6 +1300,16 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": {
"version": "26.1.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz",
"integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~8.3.0"
}
},
"node_modules/@types/prop-types": { "node_modules/@types/prop-types": {
"version": "15.7.15", "version": "15.7.15",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz",
@@ -2723,6 +2734,13 @@
"node": ">=14.17" "node": ">=14.17"
} }
}, },
"node_modules/undici-types": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
"dev": true,
"license": "MIT"
},
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
+1
View File
@@ -17,6 +17,7 @@
"react-router-dom": "^7.18.2" "react-router-dom": "^7.18.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^26.1.2",
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#0F62FE"><path d="M12 2L4 6v6c0 5 3.5 8.5 8 10 4.5-1.5 8-5 8-10V6l-8-4zm0 4l4 2v4c0 3-1.5 5-4 6-2.5-1-4-3-4-6V8l4-2z"/></svg>

Before

Width:  |  Height:  |  Size: 192 B

+3 -13
View File
@@ -6,27 +6,17 @@
<priority>1.0</priority> <priority>1.0</priority>
</url> </url>
<url> <url>
<loc>https://billowliu2.github.io/KimiSwitch/#/features</loc> <loc>https://billowliu2.github.io/KimiSwitch/features</loc>
<changefreq>monthly</changefreq> <changefreq>monthly</changefreq>
<priority>0.8</priority> <priority>0.8</priority>
</url> </url>
<url> <url>
<loc>https://billowliu2.github.io/KimiSwitch/#/showcase</loc> <loc>https://billowliu2.github.io/KimiSwitch/changelog</loc>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://billowliu2.github.io/KimiSwitch/#/performance</loc>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://billowliu2.github.io/KimiSwitch/#/changelog</loc>
<changefreq>weekly</changefreq> <changefreq>weekly</changefreq>
<priority>0.7</priority> <priority>0.7</priority>
</url> </url>
<url> <url>
<loc>https://billowliu2.github.io/KimiSwitch/#/download</loc> <loc>https://billowliu2.github.io/KimiSwitch/download</loc>
<changefreq>weekly</changefreq> <changefreq>weekly</changefreq>
<priority>0.9</priority> <priority>0.9</priority>
</url> </url>
+46
View File
@@ -8,6 +8,10 @@ import Download from "./sections/Download";
import Privacy from "./sections/Privacy"; import Privacy from "./sections/Privacy";
import CTA from "./sections/CTA"; import CTA from "./sections/CTA";
import Footer from "./components/Footer"; import Footer from "./components/Footer";
import { useLang, type Dict } from "./i18n";
const SITE_URL = "https://billowliu2.github.io/KimiSwitch";
type SeoKey = keyof Dict["seo"];
function ScrollToTop() { function ScrollToTop() {
const { pathname } = useLocation(); const { pathname } = useLocation();
@@ -17,6 +21,47 @@ function ScrollToTop() {
return null; return null;
} }
/** Update per-page title / description / OG / canonical for SEO. */
function RouteMeta() {
const { pathname } = useLocation();
const { t } = useLang();
useEffect(() => {
const page = pathname.replace(/\/+$/, "");
const seoKey: SeoKey =
page === "/features" || page === "/changelog" || page === "/download"
? (page.slice(1) as SeoKey)
: "home";
const m = t.seo[seoKey];
const url = `${SITE_URL}${page === "" ? "/" : page}`;
document.title = m.title;
setMeta("name", "description", m.description);
setMeta("property", "og:title", m.title);
setMeta("property", "og:description", m.description);
setMeta("property", "og:url", url);
setMeta("name", "twitter:title", m.title);
setMeta("name", "twitter:description", m.description);
const canon = document.querySelector('link[rel="canonical"]');
if (canon) canon.setAttribute("href", url);
}, [pathname, t]);
return null;
}
function setMeta(attr: "name" | "property", key: string, content: string) {
let el = document.head.querySelector<HTMLMetaElement>(
`meta[${attr}="${key}"]`,
);
if (!el) {
el = document.createElement("meta");
el.setAttribute(attr, key);
document.head.appendChild(el);
}
el.setAttribute("content", content);
}
const homePage = ( const homePage = (
<> <>
<Hero /> <Hero />
@@ -30,6 +75,7 @@ export default function App() {
<Nav /> <Nav />
<main className="flex-1"> <main className="flex-1">
<ScrollToTop /> <ScrollToTop />
<RouteMeta />
<Routes> <Routes>
<Route path="/" element={homePage} /> <Route path="/" element={homePage} />
<Route <Route
+1 -1
View File
@@ -5,7 +5,7 @@ import { asset } from "../lib/asset";
/** Map recommendLink.name → logo file in public/logos (only when we have one). */ /** Map recommendLink.name → logo file in public/logos (only when we have one). */
const logoFor: Record<string, string> = { const logoFor: Record<string, string> = {
"Kimi": "logos/kimi.svg", "Kimi": "logos/kimi.svg",
"智谱 GLM": "logos/glm.svg", "智谱 GLM": "logos/zhipu.svg",
"DeepSeek": "logos/deepseek.svg", "DeepSeek": "logos/deepseek.svg",
"OpenCodeGo": "logos/opencode.svg", "OpenCodeGo": "logos/opencode.svg",
"MiniMax": "logos/minimax.svg", "MiniMax": "logos/minimax.svg",
+83 -9
View File
@@ -16,10 +16,10 @@ const zh = {
performance: "性能", performance: "性能",
changelog: "更新日志", changelog: "更新日志",
download: "下载", download: "下载",
downloadBtn: "下载 v0.6.7", downloadBtn: "下载 v0.6.9",
}, },
hero: { hero: {
badge: "开源 MIT · Windows 10 / 11", badge: "v0.6.9 · 开源 MIT · Windows / macOS / Linux",
titleBefore: "统一管理你的", titleBefore: "统一管理你的",
titleAccent: "AI 供应商", titleAccent: "AI 供应商",
titleAfter: "", titleAfter: "",
@@ -141,11 +141,22 @@ const zh = {
fallbackNote: "内置版本记录", fallbackNote: "内置版本记录",
entries: [ entries: [
{ {
version: "v0.6.7", version: "v0.6.9",
date: "2026-08-01", date: "2026-08-01",
items: [ items: [
"应用内置 Kimi 设备授权登录(等同 kimi login),浏览器授权即用,过期自动续期", "最近请求新增缓存命中率列,每次请求命中一目了然",
"外链打开统一走 Rust 命令,修复部分链接无法跳转", "中文模式费用按最新汇率换算人民币(¥)显示,英文模式保持美元",
"仪表盘性能再优化:价格解析记忆化缓存,扫描从秒级降到百毫秒级;右上角新增加载耗时/数据量跟踪",
],
},
{
version: "v0.6.8",
date: "2026-08-01",
items: [
"仪表盘加载提速:models.dev 快照移出主 bundle,异步加载不阻塞首帧",
"Rust 价格索引启动时后台预热;get_summary 扫描结果 8 秒缓存",
"k3-256k 按 k3 牌价计费",
"官网更新:Kimi 风格重设计、中英文切换、更新日志同步 GitHub Releases、三平台下载",
], ],
}, },
{ {
@@ -234,7 +245,7 @@ const zh = {
}, },
download: { download: {
title: "下载 Kimi Switch", title: "下载 Kimi Switch",
subtitle: "当前版本 v0.6.7 · Windows 10 / 11 主推,macOS 与 Linux 路线图上。", subtitle: "当前版本 v0.6.9 · Windows / macOS / Linux 三平台已发布",
autoUpdate: "应用内置自动检测更新,新版本发布后在设置页一键升级。", autoUpdate: "应用内置自动检测更新,新版本发布后在设置页一键升级。",
ready: "已发布", ready: "已发布",
wip: "开发中", wip: "开发中",
@@ -252,6 +263,28 @@ const zh = {
download: "免费下载", download: "免费下载",
source: "GitHub 源码", source: "GitHub 源码",
}, },
seo: {
home: {
title: "Kimi Switch — 多 LLM 供应商统一管理 · 用量监控 · 账单一目了然",
description:
"Kimi Switch / KimiCodeSwitch — Windows 桌面端多 LLM 供应商统一管理器,一键切换 Kimi / 智谱 GLM / MiniMax / DeepSeek / OpenRouter / 基元律动,用量账单实时监控,开源 MIT。",
},
features: {
title: "核心功能 - Kimi Switch",
description:
"Kimi Switch 核心功能:多供应商管理、用量与账单监控、Kimi 一键授权登录、智能模型发现与自动更新,22 个预设开箱即用。",
},
changelog: {
title: "更新日志 - Kimi Switch",
description:
"Kimi Switch 更新日志:每个版本的重要变更记录,同步自 GitHub Releases。",
},
download: {
title: "下载 - Kimi Switch",
description:
"下载 Kimi Switch:Windows .msi、macOS .dmg、Linux .deb / .AppImage / .rpm,免费开源 MIT。",
},
},
footer: { footer: {
recommend: "推荐供应商", recommend: "推荐供应商",
mirror: "国内镜像", mirror: "国内镜像",
@@ -280,10 +313,10 @@ const en: Dict = {
performance: "Performance", performance: "Performance",
changelog: "Changelog", changelog: "Changelog",
download: "Download", download: "Download",
downloadBtn: "Download v0.6.7", downloadBtn: "Download v0.6.9",
}, },
hero: { hero: {
badge: "Open source MIT · Windows 10 / 11", badge: "v0.6.9 · Open source MIT · Windows / macOS / Linux",
titleBefore: "One app for all your ", titleBefore: "One app for all your ",
titleAccent: "AI providers", titleAccent: "AI providers",
titleAfter: "", titleAfter: "",
@@ -404,6 +437,25 @@ const en: Dict = {
syncedNote: "Synced from GitHub Releases", syncedNote: "Synced from GitHub Releases",
fallbackNote: "Built-in release notes", fallbackNote: "Built-in release notes",
entries: [ entries: [
{
version: "v0.6.9",
date: "2026-08-01",
items: [
"Recent requests gain a cache-hit-rate column, per request at a glance",
"Chinese UI now shows costs in CNY (latest exchange rate); English keeps USD",
"Dashboard speedup: memoized price resolution drops the scan from seconds to milliseconds; load time / payload tracking in the top-right corner",
],
},
{
version: "v0.6.8",
date: "2026-08-01",
items: [
"Dashboard speedup: models.dev snapshot moved out of the main bundle, async load without blocking first paint",
"Rust price index warmed in the background at startup; get_summary scan cached for 8s",
"k3-256k billed at the k3 list price",
"Website refresh: Kimi-style redesign, zh/en switch, changelog synced from GitHub Releases, downloads for all three platforms",
],
},
{ {
version: "v0.6.7", version: "v0.6.7",
date: "2026-08-01", date: "2026-08-01",
@@ -498,7 +550,7 @@ const en: Dict = {
}, },
download: { download: {
title: "Download Kimi Switch", title: "Download Kimi Switch",
subtitle: "Current version v0.6.7 · Windows 10 / 11 first, macOS and Linux on the roadmap.", subtitle: "Current version v0.6.9 · Windows, macOS and Linux now released",
autoUpdate: "Built-in update detection: upgrade in one click from Settings when a new version ships.", autoUpdate: "Built-in update detection: upgrade in one click from Settings when a new version ships.",
ready: "Available", ready: "Available",
wip: "In development", wip: "In development",
@@ -516,6 +568,28 @@ const en: Dict = {
download: "Free Download", download: "Free Download",
source: "GitHub Source", source: "GitHub Source",
}, },
seo: {
home: {
title: "Kimi Switch — Unified Management for AI Providers · Usage & Billing",
description:
"Kimi Switch / KimiCodeSwitch — a Windows desktop manager for multiple LLM providers. Switch between Kimi, Zhipu GLM, MiniMax, DeepSeek, OpenRouter and TokenRhythm in one click, with usage and billing at a glance. Open source MIT.",
},
features: {
title: "Core Features - Kimi Switch",
description:
"Kimi Switch core features: multi-provider management, usage & billing, one-click Kimi login, smart model discovery and auto updates. 22 presets out of the box.",
},
changelog: {
title: "Changelog - Kimi Switch",
description:
"Kimi Switch changelog: notable changes in every release, synced from GitHub Releases.",
},
download: {
title: "Download - Kimi Switch",
description:
"Download Kimi Switch: Windows .msi, macOS .dmg, Linux .deb / .AppImage / .rpm. Free and open source under MIT.",
},
},
footer: { footer: {
recommend: "Recommended Providers", recommend: "Recommended Providers",
mirror: "China mirror", mirror: "China mirror",
+3 -3
View File
@@ -1,16 +1,16 @@
import { StrictMode } from "react"; import { StrictMode } from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { HashRouter } from "react-router-dom"; import { BrowserRouter } from "react-router-dom";
import { LangProvider } from "./i18n"; import { LangProvider } from "./i18n";
import App from "./App"; import App from "./App";
import "./index.css"; import "./index.css";
createRoot(document.getElementById("root")!).render( createRoot(document.getElementById("root")!).render(
<StrictMode> <StrictMode>
<HashRouter> <BrowserRouter basename="/KimiSwitch">
<LangProvider> <LangProvider>
<App /> <App />
</LangProvider> </LangProvider>
</HashRouter> </BrowserRouter>
</StrictMode>, </StrictMode>,
); );
+12 -7
View File
@@ -10,9 +10,14 @@ interface ChangelogEntry {
const API_URL = const API_URL =
"https://api.github.com/repos/billowliu2/KimiSwitch/releases?per_page=20"; "https://api.github.com/repos/billowliu2/KimiSwitch/releases?per_page=20";
const CACHE_KEY = "kimi-switch-changelog";
const CACHE_TTL = 60 * 60 * 1000; // 1 hour const CACHE_TTL = 60 * 60 * 1000; // 1 hour
/** Cache key is versioned by the newest embedded release so redeploys
* invalidate stale caches in the browser immediately. */
function cacheKey(embedded: ChangelogEntry[]) {
return `kimi-switch-changelog-${embedded[0]?.version ?? "v1"}`;
}
/** Parse a GitHub release body into bullet items. */ /** Parse a GitHub release body into bullet items. */
function parseBody(body: string): string[] { function parseBody(body: string): string[] {
return body return body
@@ -36,9 +41,9 @@ async function fetchReleases(): Promise<ChangelogEntry[]> {
})); }));
} }
function readCache(): ChangelogEntry[] | null { function readCache(embedded: ChangelogEntry[]): ChangelogEntry[] | null {
try { try {
const raw = localStorage.getItem(CACHE_KEY); const raw = localStorage.getItem(cacheKey(embedded));
if (!raw) return null; if (!raw) return null;
const { ts, data } = JSON.parse(raw) as { ts: number; data: ChangelogEntry[] }; const { ts, data } = JSON.parse(raw) as { ts: number; data: ChangelogEntry[] };
if (Date.now() - ts > CACHE_TTL) return null; if (Date.now() - ts > CACHE_TTL) return null;
@@ -48,10 +53,10 @@ function readCache(): ChangelogEntry[] | null {
} }
} }
function writeCache(data: ChangelogEntry[]) { function writeCache(data: ChangelogEntry[], embedded: ChangelogEntry[]) {
try { try {
localStorage.setItem( localStorage.setItem(
CACHE_KEY, cacheKey(embedded),
JSON.stringify({ ts: Date.now(), data }), JSON.stringify({ ts: Date.now(), data }),
); );
} catch { } catch {
@@ -67,7 +72,7 @@ export default function Changelog() {
useEffect(() => { useEffect(() => {
let cancelled = false; let cancelled = false;
const cached = readCache(); const cached = readCache(embedded);
if (cached) { if (cached) {
setRemote(cached); setRemote(cached);
setSynced(true); setSynced(true);
@@ -78,7 +83,7 @@ export default function Changelog() {
if (cancelled) return; if (cancelled) return;
setRemote(data); setRemote(data);
setSynced(true); setSynced(true);
writeCache(data); writeCache(data, embedded);
}) })
.catch(() => { .catch(() => {
/* 网络不通时使用内置列表兜底 */ /* 网络不通时使用内置列表兜底 */
+7 -7
View File
@@ -8,25 +8,25 @@ const icons: Record<string, Icon> = {
linux: LinuxLogo, linux: LinuxLogo,
}; };
const VERSION = "0.6.8"; const VERSION = "0.6.9";
const GITHUB = "https://github.com/billowliu2/KimiSwitch"; const GITHUB = "https://github.com/billowliu2/KimiSwitch";
const MIRROR_RELEASES = "https://git.codingplan.site/admin/KimiCodeSwitch/releases"; const MIRROR_RELEASES = "https://git.codingplan.site/admin/KimiCodeSwitch/releases";
const dl = (file: string) => `${GITHUB}/releases/download/v${VERSION}/${file}`; const dl = (file: string) => `${GITHUB}/releases/download/v${VERSION}/${file}`;
/** Per-platform download assets for the current release (names match the CI /** Per-platform download assets for the current release (names match the CI
* release workflow, e.g. Kimi.Switch_0.6.8_x64_en-US.msi). */ * release workflow, e.g. Kimi.Switch_0.6.9_x64_en-US.msi). */
const assets: Record<string, { label: string; href: string }[]> = { const assets: Record<string, { label: string; href: string }[]> = {
windows: [ windows: [
{ label: "MSI", href: dl("Kimi.Switch_0.6.8_x64_en-US.msi") }, { label: "MSI", href: dl("Kimi.Switch_0.6.9_x64_en-US.msi") },
{ label: "镜像", href: MIRROR_RELEASES }, { label: "镜像", href: MIRROR_RELEASES },
], ],
macos: [ macos: [
{ label: "Apple Silicon (.dmg)", href: dl("Kimi.Switch_0.6.8_aarch64.dmg") }, { label: "Apple Silicon (.dmg)", href: dl("Kimi.Switch_0.6.9_aarch64.dmg") },
], ],
linux: [ linux: [
{ label: ".deb", href: dl("Kimi.Switch_0.6.8_amd64.deb") }, { label: ".deb", href: dl("Kimi.Switch_0.6.9_amd64.deb") },
{ label: ".AppImage", href: dl("Kimi.Switch_0.6.8_amd64.AppImage") }, { label: ".AppImage", href: dl("Kimi.Switch_0.6.9_amd64.AppImage") },
{ label: ".rpm", href: dl("Kimi.Switch-0.6.8-1.x86_64.rpm") }, { label: ".rpm", href: dl("Kimi.Switch-0.6.9-1.x86_64.rpm") },
], ],
}; };
+21 -2
View File
@@ -1,10 +1,29 @@
import { defineConfig } from "vite"; import { defineConfig, type Plugin } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { copyFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
/**
* GitHub Pages SPA fallback: any deep path (e.g. /KimiSwitch/features) is
* served by 404.html; duplicating the built index.html there lets the
* BrowserRouter boot and render the right route. This keeps every page
* indexable as a real URL instead of a `#/` fragment.
*/
function generate404(): Plugin {
return {
name: "generate-404",
apply: "build",
closeBundle() {
const dist = fileURLToPath(new URL("./dist", import.meta.url));
copyFileSync(`${dist}/index.html`, `${dist}/404.html`);
},
};
}
// GitHub Pages subpath: billowliu2.github.io/KimiSwitch/ // GitHub Pages subpath: billowliu2.github.io/KimiSwitch/
export default defineConfig({ export default defineConfig({
base: "/KimiSwitch/", base: "/KimiSwitch/",
plugins: [react()], plugins: [react(), generate404()],
resolve: { resolve: {
alias: { "@": "/src" }, alias: { "@": "/src" },
}, },