mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-12-05 08:03:01 +00:00
feat(pricing): 模型广场支持推荐顺序和按用量排序
- 模型广场的排序新增「推荐」「请求最多」「Token 最多」,默认按推荐排序;未设置时与原来的按名称排序一致 - 模型管理新增「模型广场排序」,可选手动排序、使用最多、置顶 + 使用最多,按请求数或 Token 统计近 1/7/30 天用量 - 公开的定价接口只返回排序结果,不返回各模型的用量
This commit is contained in:
34 files changed
+1526
-34
No files matched your search
@@ -525,6 +525,7 @@
|
||||
"failed to invalidate tokens cache for user %d: %s": "清除用户 %d 的令牌缓存失败: %s",
|
||||
"failed to invalidate user cache after hard deleting user %d: %v": "永久删除用户 %d 后清除用户缓存失败: %v",
|
||||
"failed to load custom OAuth providers: %s": "加载自定义 OAuth 提供商失败: %s",
|
||||
"failed to load model usage for the model square: %s": "加载模型广场的模型用量失败: %s",
|
||||
"failed to load options from database: %s": "从数据库加载设置失败: %s",
|
||||
"failed to load tool prices, using hardcoded fallbacks: %s": "加载工具价格失败,将使用硬编码兜底: %s",
|
||||
"failed to marshal gemini response: %s": "序列化 Gemini 响应失败: %s",
|
||||
|
||||
@@ -261,6 +261,97 @@ func TestModelSquareGroupVisibility(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestModelSquareOrderFollowsSavedSetting(t *testing.T) {
|
||||
originalGroups := setting.UserUsableGroups2JSONString()
|
||||
originalOrder := *operation_setting.GetModelSquareSetting()
|
||||
originalDataExport := common.DataExportEnabled
|
||||
t.Cleanup(func() {
|
||||
require.NoError(t, setting.UpdateUserUsableGroupsByJSONString(originalGroups))
|
||||
*operation_setting.GetModelSquareSetting() = originalOrder
|
||||
common.DataExportEnabled = originalDataExport
|
||||
})
|
||||
|
||||
for _, dialect := range []struct{ kind, env string }{{"sqlite", ""}, {"mysql", "TEST_MYSQL_DSN"}, {"postgres", "TEST_POSTGRES_DSN"}} {
|
||||
t.Run(dialect.kind, func(t *testing.T) {
|
||||
if dialect.env != "" && os.Getenv(dialect.env) == "" {
|
||||
t.Skip("set " + dialect.env + " to run this database")
|
||||
}
|
||||
db := modelManagementDB(t, dialect.kind, os.Getenv(dialect.env))
|
||||
// The service caches usage across databases, so usage ordering is
|
||||
// covered in the service tests and the query is checked directly below.
|
||||
common.DataExportEnabled = false
|
||||
*operation_setting.GetModelSquareSetting() = operation_setting.ModelSquareSetting{SortMode: "manual", SortMetric: "tokens", SortDays: 7, SortModels: []string{}}
|
||||
require.NoError(t, setting.UpdateUserUsableGroupsByJSONString(`{"default":"Public"}`))
|
||||
vendor := model.Vendor{Name: "Acme", Icon: "Acme.Color"}
|
||||
require.NoError(t, db.Create(&vendor).Error)
|
||||
require.NoError(t, db.Create(&model.Model{ModelName: "vip-only", Icon: "Vip.Color", VendorID: vendor.Id, Status: 1}).Error)
|
||||
require.NoError(t, db.Create(&[]model.Ability{
|
||||
{Model: "alpha", Group: "default", ChannelId: 1, Enabled: true},
|
||||
{Model: "gamma", Group: "default", ChannelId: 1, Enabled: true},
|
||||
{Model: "vip-only", Group: "vip", ChannelId: 1, Enabled: true},
|
||||
}).Error)
|
||||
model.InvalidatePricingCache()
|
||||
t.Cleanup(model.InvalidatePricingCache)
|
||||
|
||||
manual := []string{"gamma", "alpha"}
|
||||
for _, step := range []struct {
|
||||
key, value string
|
||||
rejected bool
|
||||
want []string
|
||||
}{
|
||||
{want: []string{}},
|
||||
{key: "model_square_setting.sort_models", value: `["gamma","vip-only","alpha","gamma"]`, want: manual},
|
||||
{key: "model_square_setting.sort_mode", value: "random", rejected: true, want: manual},
|
||||
{key: "model_square_setting.sort_metric", value: "cost", rejected: true, want: manual},
|
||||
{key: "model_square_setting.sort_days", value: "3", rejected: true, want: manual},
|
||||
{key: "model_square_setting.sort_models", value: `"gamma"`, rejected: true, want: manual},
|
||||
} {
|
||||
if step.key != "" {
|
||||
err := model.UpdateOption(step.key, step.value)
|
||||
if step.rejected {
|
||||
require.Error(t, err, step.key)
|
||||
} else {
|
||||
require.NoError(t, err, step.key)
|
||||
}
|
||||
}
|
||||
recorder := httptest.NewRecorder()
|
||||
ctx, _ := gin.CreateTestContext(recorder)
|
||||
ctx.Request = httptest.NewRequest(http.MethodGet, "/api/pricing", nil)
|
||||
GetPricing(ctx)
|
||||
require.Equal(t, http.StatusOK, recorder.Code)
|
||||
var response struct {
|
||||
ModelOrder map[string][]string `json:"model_order"`
|
||||
}
|
||||
require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response))
|
||||
assert.Equal(t, map[string][]string{"recommended": step.want, "requests": {}, "tokens": {}}, response.ModelOrder, step.key)
|
||||
}
|
||||
|
||||
// The admin preview offers the models of every group.
|
||||
assert.ElementsMatch(t, []modelSquareUsage{
|
||||
{ModelName: "alpha"},
|
||||
{ModelName: "gamma"},
|
||||
{ModelName: "vip-only", Icon: "Vip.Color", VendorName: "Acme", VendorIcon: "Acme.Color"},
|
||||
}, modelSquareData[[]modelSquareUsage](t, GetModelSquareUsage, "/api/models/square_usage?days=7", ""))
|
||||
|
||||
require.NoError(t, db.AutoMigrate(&model.QuotaData{}))
|
||||
now := time.Now().Unix()
|
||||
require.NoError(t, db.Create(&[]model.QuotaData{
|
||||
{UserID: 1, Username: "a", ModelName: "alpha", CreatedAt: now - 3600, Count: 3, TokenUsed: 100},
|
||||
{UserID: 2, Username: "b", ModelName: "alpha", CreatedAt: now - 7200, Count: 2},
|
||||
{UserID: 1, Username: "a", ModelName: "vip-only", CreatedAt: now - 3600, Count: 1},
|
||||
{UserID: 1, Username: "a", ModelName: "gamma", CreatedAt: now - 8*24*3600, Count: 9, TokenUsed: 900},
|
||||
{UserID: 1, Username: "a", ModelName: "", CreatedAt: now - 3600, Count: 4, TokenUsed: 40},
|
||||
}).Error)
|
||||
totals, err := model.GetModelUsageTotals(now-7*24*3600, now)
|
||||
require.NoError(t, err)
|
||||
assert.ElementsMatch(t, []model.ModelUsageTotal{
|
||||
{ModelName: "alpha", Requests: 5, Tokens: 100},
|
||||
{ModelName: "vip-only", Requests: 1},
|
||||
}, totals)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func decodeUserModelsResponse(t *testing.T, recorder *httptest.ResponseRecorder) []string {
|
||||
t.Helper()
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/constant"
|
||||
"github.com/QuantumNous/new-api/model"
|
||||
"github.com/QuantumNous/new-api/service"
|
||||
"github.com/QuantumNous/new-api/setting/operation_setting"
|
||||
"github.com/QuantumNous/new-api/setting/ratio_setting"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -60,10 +64,59 @@ func GetPricing(c *gin.Context) {
|
||||
"usable_group": usableGroup,
|
||||
"supported_endpoint": model.GetSupportedEndpointMap(),
|
||||
"auto_groups": service.GetUserAutoGroup(userGroup),
|
||||
"model_order": service.BuildModelSquareOrder(pricing),
|
||||
"pricing_version": "a42d372ccf0b5dd13ecf71203521f9d2",
|
||||
})
|
||||
}
|
||||
|
||||
type modelSquareUsage struct {
|
||||
ModelName string `json:"model_name"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
VendorName string `json:"vendor_name,omitempty"`
|
||||
VendorIcon string `json:"vendor_icon,omitempty"`
|
||||
Requests int64 `json:"requests"`
|
||||
Tokens int64 `json:"tokens"`
|
||||
}
|
||||
|
||||
// GetModelSquareUsage lists every model of the model square, whichever group
|
||||
// can see it, with its usage for the order preview.
|
||||
func GetModelSquareUsage(c *gin.Context) {
|
||||
days := c.DefaultQuery("days", "7")
|
||||
if err := operation_setting.ValidateModelSquareOption("model_square_setting.sort_days", days); err != nil {
|
||||
common.ApiErrorStatus(c, http.StatusBadRequest, err)
|
||||
return
|
||||
}
|
||||
dayCount, _ := strconv.Atoi(days)
|
||||
totals, err := service.GetModelUsageTotals(dayCount)
|
||||
if err != nil {
|
||||
common.ApiError(c, err)
|
||||
return
|
||||
}
|
||||
usage := make(map[string]model.ModelUsageTotal, len(totals))
|
||||
for _, total := range totals {
|
||||
usage[total.ModelName] = total
|
||||
}
|
||||
pricing := model.GetPricing()
|
||||
vendors := make(map[int]model.PricingVendor)
|
||||
for _, vendor := range model.GetVendors() {
|
||||
vendors[vendor.ID] = vendor
|
||||
}
|
||||
rows := make([]modelSquareUsage, 0, len(pricing))
|
||||
for _, item := range pricing {
|
||||
vendor := vendors[item.VendorID]
|
||||
total := usage[item.ModelName]
|
||||
rows = append(rows, modelSquareUsage{
|
||||
ModelName: item.ModelName,
|
||||
Icon: item.Icon,
|
||||
VendorName: vendor.Name,
|
||||
VendorIcon: vendor.Icon,
|
||||
Requests: total.Requests,
|
||||
Tokens: total.Tokens,
|
||||
})
|
||||
}
|
||||
common.ApiSuccess(c, rows)
|
||||
}
|
||||
|
||||
func ResetModelRatio(c *gin.Context) {
|
||||
defaultStr := ratio_setting.DefaultModelRatio2JSONString()
|
||||
err := model.UpdateOption("ModelRatio", defaultStr)
|
||||
|
||||
@@ -282,6 +282,7 @@ var accessTokenRouteRules = map[string]accessTokenRouteRule{
|
||||
"POST /api/models/sync_upstream": accessTokenScopeRule("model:write"),
|
||||
"POST /api/models/delete": accessTokenScopeRule("model:write"),
|
||||
"GET /api/models/missing": accessTokenScopeRule("model:read"),
|
||||
"GET /api/models/square_usage": accessTokenScopeRule("log:read"),
|
||||
"GET /api/models/": accessTokenScopeRule("model:read"),
|
||||
"GET /api/models/search": accessTokenScopeRule("model:read"),
|
||||
"GET /api/models/:id": accessTokenScopeRule("model:read"),
|
||||
|
||||
@@ -246,6 +246,9 @@ func validateOptionValue(key string, value string) error {
|
||||
if err := operation_setting.ValidateEpaySignOption(key, value); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := operation_setting.ValidateModelSquareOption(key, value); err != nil {
|
||||
return err
|
||||
}
|
||||
if key == "EmailProvider" || key == "ResendApiKey" || key == "ResendFrom" {
|
||||
if key == "EmailProvider" && value != "smtp" && value != "resend" {
|
||||
return common.NewMessage("Email sending method must be SMTP or Resend")
|
||||
|
||||
@@ -31,6 +31,25 @@ func GetRankingQuotaTotals(startTime int64, endTime int64) ([]RankingQuotaTotal,
|
||||
return rows, err
|
||||
}
|
||||
|
||||
type ModelUsageTotal struct {
|
||||
ModelName string `json:"model_name"`
|
||||
Requests int64 `json:"requests"`
|
||||
Tokens int64 `json:"tokens"`
|
||||
}
|
||||
|
||||
// GetModelUsageTotals sums requests and tokens per model, including models
|
||||
// that used no tokens.
|
||||
func GetModelUsageTotals(startTime int64, endTime int64) ([]ModelUsageTotal, error) {
|
||||
var rows []ModelUsageTotal
|
||||
query := DB.Table("quota_data").
|
||||
Select("model_name, sum(count) as requests, sum(token_used) as tokens").
|
||||
Where("model_name <> ''").
|
||||
Group("model_name")
|
||||
query = applyRankingQuotaTimeRange(query, startTime, endTime)
|
||||
err := query.Find(&rows).Error
|
||||
return rows, err
|
||||
}
|
||||
|
||||
func GetRankingQuotaBuckets(startTime int64, endTime int64, bucketSize int64) ([]RankingQuotaBucket, error) {
|
||||
if bucketSize <= 0 {
|
||||
bucketSize = 3600
|
||||
|
||||
@@ -416,6 +416,7 @@ func SetApiRouter(router *gin.Engine) {
|
||||
modelsRoute.POST("/sync_upstream", controller.SyncUpstreamModels)
|
||||
modelsRoute.POST("/delete", controller.BatchDeleteModelMeta)
|
||||
modelsRoute.GET("/missing", controller.GetMissingModels)
|
||||
modelsRoute.GET("/square_usage", controller.GetModelSquareUsage)
|
||||
modelsRoute.GET("/", controller.GetAllModelsMeta)
|
||||
modelsRoute.GET("/search", controller.SearchModelsMeta)
|
||||
modelsRoute.GET("/:id", controller.GetModelMeta)
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/model"
|
||||
"github.com/QuantumNous/new-api/setting/operation_setting"
|
||||
)
|
||||
|
||||
// ModelSquareOrder lists model names for the model square sorts. Models
|
||||
// missing from a list follow it by name. It holds no usage figures, because
|
||||
// the model square can be public while the rankings page is off.
|
||||
type ModelSquareOrder struct {
|
||||
Recommended []string `json:"recommended"`
|
||||
Requests []string `json:"requests"`
|
||||
Tokens []string `json:"tokens"`
|
||||
}
|
||||
|
||||
type modelUsageCacheItem struct {
|
||||
expiresAt time.Time
|
||||
totals []model.ModelUsageTotal
|
||||
}
|
||||
|
||||
var (
|
||||
modelUsageCacheMu sync.Mutex
|
||||
modelUsageCache = map[int]modelUsageCacheItem{}
|
||||
)
|
||||
|
||||
// GetModelUsageTotals returns each model's usage over the last days, cached
|
||||
// like the rankings. Without dashboard data there is no usage.
|
||||
func GetModelUsageTotals(days int) ([]model.ModelUsageTotal, error) {
|
||||
if !common.DataExportEnabled {
|
||||
return nil, nil
|
||||
}
|
||||
now := time.Now()
|
||||
modelUsageCacheMu.Lock()
|
||||
item, ok := modelUsageCache[days]
|
||||
modelUsageCacheMu.Unlock()
|
||||
if ok && now.Before(item.expiresAt) {
|
||||
return item.totals, nil
|
||||
}
|
||||
|
||||
totals, err := model.GetModelUsageTotals(now.AddDate(0, 0, -days).Unix(), now.Unix())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
modelUsageCacheMu.Lock()
|
||||
modelUsageCache[days] = modelUsageCacheItem{expiresAt: now.Add(rankingCacheTTL), totals: totals}
|
||||
modelUsageCacheMu.Unlock()
|
||||
return totals, nil
|
||||
}
|
||||
|
||||
// BuildModelSquareOrder orders the listed models for the model square sorts.
|
||||
// Names that are not listed are left out.
|
||||
func BuildModelSquareOrder(pricing []model.Pricing) ModelSquareOrder {
|
||||
listed := make(map[string]struct{}, len(pricing))
|
||||
for _, item := range pricing {
|
||||
listed[item.ModelName] = struct{}{}
|
||||
}
|
||||
setting := operation_setting.GetModelSquareSetting()
|
||||
totals, err := GetModelUsageTotals(setting.SortDays)
|
||||
if err != nil {
|
||||
common.SysError(common.LogText("failed to load model usage for the model square: %s", err.Error()))
|
||||
}
|
||||
order := ModelSquareOrder{
|
||||
Requests: modelNamesByUsage(totals, operation_setting.ModelSquareMetricRequests, listed),
|
||||
Tokens: modelNamesByUsage(totals, operation_setting.ModelSquareMetricTokens, listed),
|
||||
}
|
||||
byMetric := order.Tokens
|
||||
if setting.SortMetric == operation_setting.ModelSquareMetricRequests {
|
||||
byMetric = order.Requests
|
||||
}
|
||||
if setting.SortMode == operation_setting.ModelSquareSortUsage {
|
||||
order.Recommended = byMetric
|
||||
return order
|
||||
}
|
||||
|
||||
order.Recommended = make([]string, 0, len(setting.SortModels))
|
||||
for _, name := range setting.SortModels {
|
||||
if _, ok := listed[name]; ok && !slices.Contains(order.Recommended, name) {
|
||||
order.Recommended = append(order.Recommended, name)
|
||||
}
|
||||
}
|
||||
if setting.SortMode == operation_setting.ModelSquareSortMixed {
|
||||
pinned := len(order.Recommended)
|
||||
for _, name := range byMetric {
|
||||
if !slices.Contains(order.Recommended[:pinned], name) {
|
||||
order.Recommended = append(order.Recommended, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
return order
|
||||
}
|
||||
|
||||
// modelNamesByUsage lists the listed models that have usage of the metric,
|
||||
// most used first and equal usage in byte order, as the web console does.
|
||||
func modelNamesByUsage(totals []model.ModelUsageTotal, metric string, listed map[string]struct{}) []string {
|
||||
usage := make(map[string]int64, len(totals))
|
||||
names := make([]string, 0, len(totals))
|
||||
for _, total := range totals {
|
||||
value := total.Tokens
|
||||
if metric == operation_setting.ModelSquareMetricRequests {
|
||||
value = total.Requests
|
||||
}
|
||||
if _, ok := listed[total.ModelName]; ok && value > 0 {
|
||||
usage[total.ModelName] = value
|
||||
names = append(names, total.ModelName)
|
||||
}
|
||||
}
|
||||
slices.SortFunc(names, func(a, b string) int {
|
||||
return cmp.Or(cmp.Compare(usage[b], usage[a]), strings.Compare(a, b))
|
||||
})
|
||||
return names
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/model"
|
||||
"github.com/QuantumNous/new-api/setting/operation_setting"
|
||||
"github.com/glebarez/sqlite"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func TestBuildModelSquareOrder(t *testing.T) {
|
||||
database, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
|
||||
require.NoError(t, err)
|
||||
sqlDB, err := database.DB()
|
||||
require.NoError(t, err)
|
||||
sqlDB.SetMaxOpenConns(1)
|
||||
require.NoError(t, database.AutoMigrate(&model.QuotaData{}))
|
||||
previousDB := model.DB
|
||||
previousOrder := *operation_setting.GetModelSquareSetting()
|
||||
previousDataExport := common.DataExportEnabled
|
||||
model.DB = database
|
||||
t.Cleanup(func() {
|
||||
model.DB = previousDB
|
||||
*operation_setting.GetModelSquareSetting() = previousOrder
|
||||
common.DataExportEnabled = previousDataExport
|
||||
modelUsageCache = map[int]modelUsageCacheItem{}
|
||||
_ = sqlDB.Close()
|
||||
})
|
||||
|
||||
hourAgo := time.Now().Add(-time.Hour).Unix()
|
||||
require.NoError(t, database.Create(&[]model.QuotaData{
|
||||
{ModelName: "gamma", CreatedAt: hourAgo, Count: 5, TokenUsed: 900},
|
||||
// Ties with gamma: byte order puts upper case first.
|
||||
{ModelName: "Kappa", CreatedAt: hourAgo, Count: 5, TokenUsed: 900},
|
||||
{ModelName: "beta", CreatedAt: hourAgo, Count: 9, TokenUsed: 100},
|
||||
{ModelName: "beta", CreatedAt: hourAgo - 3600, Count: 1, TokenUsed: 50},
|
||||
// Per-call models can have requests without tokens.
|
||||
{ModelName: "delta", CreatedAt: hourAgo, Count: 3},
|
||||
{ModelName: "alpha", CreatedAt: hourAgo - 10*24*3600, Count: 99, TokenUsed: 9999},
|
||||
{ModelName: "retired", CreatedAt: hourAgo, Count: 50, TokenUsed: 5000},
|
||||
}).Error)
|
||||
pricing := []model.Pricing{{ModelName: "alpha"}, {ModelName: "beta"}, {ModelName: "delta"}, {ModelName: "gamma"}, {ModelName: "Kappa"}, {ModelName: "zeta"}}
|
||||
requests := []string{"beta", "Kappa", "gamma", "delta"}
|
||||
tokens := []string{"Kappa", "gamma", "beta"}
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
setting operation_setting.ModelSquareSetting
|
||||
dataExport bool
|
||||
want ModelSquareOrder
|
||||
}{
|
||||
{
|
||||
name: "no config keeps name order",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "manual", SortMetric: "tokens", SortDays: 7, SortModels: []string{}},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: []string{}, Requests: requests, Tokens: tokens},
|
||||
},
|
||||
{
|
||||
name: "manual drops unlisted and repeated names",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "manual", SortMetric: "tokens", SortDays: 7, SortModels: []string{"zeta", "retired", "alpha", "zeta"}},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: []string{"zeta", "alpha"}, Requests: requests, Tokens: tokens},
|
||||
},
|
||||
{
|
||||
name: "most requests",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "usage", SortMetric: "requests", SortDays: 7},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: requests, Requests: requests, Tokens: tokens},
|
||||
},
|
||||
{
|
||||
name: "most tokens leaves models without tokens to the name tail",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "usage", SortMetric: "tokens", SortDays: 7},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: tokens, Requests: requests, Tokens: tokens},
|
||||
},
|
||||
{
|
||||
name: "pinned models come before the most used",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "mixed", SortMetric: "tokens", SortDays: 7, SortModels: []string{"delta", "retired", "beta"}},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: []string{"delta", "beta", "Kappa", "gamma"}, Requests: requests, Tokens: tokens},
|
||||
},
|
||||
{
|
||||
name: "longer period counts older usage",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "usage", SortMetric: "tokens", SortDays: 30},
|
||||
dataExport: true,
|
||||
want: ModelSquareOrder{Recommended: []string{"alpha", "Kappa", "gamma", "beta"}, Requests: []string{"alpha", "beta", "Kappa", "gamma", "delta"}, Tokens: []string{"alpha", "Kappa", "gamma", "beta"}},
|
||||
},
|
||||
{
|
||||
name: "without dashboard data usage sorts fall back to names",
|
||||
setting: operation_setting.ModelSquareSetting{SortMode: "mixed", SortMetric: "requests", SortDays: 7, SortModels: []string{"gamma"}},
|
||||
want: ModelSquareOrder{Recommended: []string{"gamma"}, Requests: []string{}, Tokens: []string{}},
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
*operation_setting.GetModelSquareSetting() = tc.setting
|
||||
common.DataExportEnabled = tc.dataExport
|
||||
modelUsageCache = map[int]modelUsageCacheItem{}
|
||||
|
||||
assert.Equal(t, tc.want, BuildModelSquareOrder(pricing))
|
||||
})
|
||||
}
|
||||
|
||||
// The public model square gets names only, never usage figures.
|
||||
*operation_setting.GetModelSquareSetting() = operation_setting.ModelSquareSetting{SortMode: "usage", SortMetric: "requests", SortDays: 7}
|
||||
common.DataExportEnabled = true
|
||||
encoded, err := common.Marshal(BuildModelSquareOrder(pricing))
|
||||
require.NoError(t, err)
|
||||
assert.JSONEq(t, `{"recommended":["beta","Kappa","gamma","delta"],"requests":["beta","Kappa","gamma","delta"],"tokens":["Kappa","gamma","beta"]}`, string(encoded))
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package operation_setting
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/setting/config"
|
||||
)
|
||||
|
||||
const (
|
||||
ModelSquareSortManual = "manual"
|
||||
ModelSquareSortUsage = "usage"
|
||||
ModelSquareSortMixed = "mixed"
|
||||
|
||||
ModelSquareMetricRequests = "requests"
|
||||
ModelSquareMetricTokens = "tokens"
|
||||
)
|
||||
|
||||
// ModelSquareSetting holds the Recommended order of the model square.
|
||||
type ModelSquareSetting struct {
|
||||
SortMode string `json:"sort_mode"` // manual, usage or mixed
|
||||
SortMetric string `json:"sort_metric"` // usage metric: requests or tokens
|
||||
SortDays int `json:"sort_days"` // usage period in days: 1, 7 or 30
|
||||
SortModels []string `json:"sort_models"` // manual order, or the pinned models in mixed mode
|
||||
}
|
||||
|
||||
// An empty manual list keeps the model square in name order.
|
||||
var modelSquareSetting = ModelSquareSetting{
|
||||
SortMode: ModelSquareSortManual,
|
||||
SortMetric: ModelSquareMetricTokens,
|
||||
SortDays: 7,
|
||||
SortModels: []string{},
|
||||
}
|
||||
|
||||
func init() {
|
||||
config.GlobalConfig.Register("model_square_setting", &modelSquareSetting)
|
||||
}
|
||||
|
||||
func GetModelSquareSetting() *ModelSquareSetting {
|
||||
return &modelSquareSetting
|
||||
}
|
||||
|
||||
// ValidateModelSquareOption rejects model square order values the square cannot use.
|
||||
func ValidateModelSquareOption(key, value string) error {
|
||||
setting, ok := strings.CutPrefix(key, "model_square_setting.")
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
valid := false
|
||||
switch setting {
|
||||
case "sort_mode":
|
||||
valid = slices.Contains([]string{ModelSquareSortManual, ModelSquareSortUsage, ModelSquareSortMixed}, value)
|
||||
case "sort_metric":
|
||||
valid = value == ModelSquareMetricRequests || value == ModelSquareMetricTokens
|
||||
case "sort_days":
|
||||
valid = slices.Contains([]string{"1", "7", "30"}, value)
|
||||
case "sort_models":
|
||||
var names []string
|
||||
valid = common.UnmarshalJsonStr(value, &names) == nil
|
||||
}
|
||||
if !valid {
|
||||
return common.NewMessage("Invalid model square order setting")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
Copyright (C) 2023-2026 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { render, screen, waitFor, within } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import { toast } from 'sonner'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { api } from '@/lib/api'
|
||||
|
||||
import { ModelSquareOrderDialog } from '../components/dialogs/model-square-order-dialog'
|
||||
|
||||
function mockApi(
|
||||
saved: Record<string, string>,
|
||||
usage: Record<string, { requests: number; tokens: number }> = {}
|
||||
) {
|
||||
vi.spyOn(api, 'get').mockImplementation(async (url: string) => {
|
||||
if (url === '/api/option/') {
|
||||
const data = Object.entries(saved).map(([key, value]) => ({
|
||||
key,
|
||||
value,
|
||||
}))
|
||||
return { data: { success: true, data } }
|
||||
}
|
||||
if (url === '/api/models/square_usage') {
|
||||
// Every square model, including ones only other groups can see
|
||||
const data = ['alpha', 'beta', 'gamma'].map((name) => ({
|
||||
model_name: name,
|
||||
vendor_name: 'Acme',
|
||||
requests: usage[name]?.requests ?? 0,
|
||||
tokens: usage[name]?.tokens ?? 0,
|
||||
}))
|
||||
return { data: { success: true, data } }
|
||||
}
|
||||
return { data: { success: true, data: {} } }
|
||||
})
|
||||
return vi.spyOn(api, 'put').mockResolvedValue({ data: { success: true } })
|
||||
}
|
||||
|
||||
function renderDialog(onOpenChange = vi.fn()) {
|
||||
const client = new QueryClient({
|
||||
defaultOptions: { queries: { retry: false }, mutations: { retry: false } },
|
||||
})
|
||||
const view = render(
|
||||
<QueryClientProvider client={client}>
|
||||
<ModelSquareOrderDialog open onOpenChange={onOpenChange} />
|
||||
</QueryClientProvider>
|
||||
)
|
||||
return {
|
||||
rerender: (open: boolean) =>
|
||||
view.rerender(
|
||||
<QueryClientProvider client={client}>
|
||||
<ModelSquareOrderDialog open={open} onOpenChange={onOpenChange} />
|
||||
</QueryClientProvider>
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
describe('model square order dialog', () => {
|
||||
it('keeps list edits as a draft and saves only the changed setting', async () => {
|
||||
const put = mockApi({
|
||||
'model_square_setting.sort_mode': 'manual',
|
||||
'model_square_setting.sort_models': '["beta","alpha"]',
|
||||
})
|
||||
const user = userEvent.setup()
|
||||
renderDialog()
|
||||
|
||||
await user.click(
|
||||
await screen.findByRole('button', { name: 'Move alpha up' })
|
||||
)
|
||||
await user.click(screen.getByRole('button', { name: 'Remove beta' }))
|
||||
await user.click(screen.getByRole('combobox', { name: 'Add model' }))
|
||||
await user.click(await screen.findByRole('option', { name: /gamma/ }))
|
||||
expect(screen.getByRole('button', { name: 'Remove gamma' })).toBeVisible()
|
||||
expect(put).not.toHaveBeenCalled()
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Save' }))
|
||||
|
||||
await waitFor(() => expect(put).toHaveBeenCalledTimes(1))
|
||||
expect(put).toHaveBeenCalledWith('/api/option/', {
|
||||
key: 'model_square_setting.sort_models',
|
||||
value: '["alpha","gamma"]',
|
||||
})
|
||||
})
|
||||
|
||||
it('shows one success toast for several changed settings', async () => {
|
||||
const put = mockApi({ 'model_square_setting.sort_mode': 'manual' })
|
||||
const success = vi.spyOn(toast, 'success')
|
||||
const onOpenChange = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
renderDialog(onOpenChange)
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: 'Most used' }))
|
||||
await user.click(screen.getByRole('button', { name: 'Requests' }))
|
||||
await user.click(screen.getByRole('button', { name: 'Save' }))
|
||||
|
||||
await waitFor(() => expect(onOpenChange).toHaveBeenCalledWith(false))
|
||||
expect(put).toHaveBeenCalledTimes(2)
|
||||
expect(success).toHaveBeenCalledTimes(1)
|
||||
expect(success).toHaveBeenCalledWith('Setting updated successfully')
|
||||
})
|
||||
|
||||
it('keeps the dialog and the draft open when saving fails', async () => {
|
||||
const put = mockApi({ 'model_square_setting.sort_mode': 'manual' })
|
||||
put.mockResolvedValueOnce({ data: { success: true } })
|
||||
put.mockResolvedValueOnce({
|
||||
data: { success: false, message: 'Invalid model square order setting' },
|
||||
})
|
||||
const success = vi.spyOn(toast, 'success')
|
||||
const error = vi.spyOn(toast, 'error')
|
||||
const onOpenChange = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
renderDialog(onOpenChange)
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: 'Most used' }))
|
||||
await user.click(screen.getByRole('button', { name: 'Requests' }))
|
||||
await user.click(screen.getByRole('button', { name: 'Save' }))
|
||||
|
||||
await waitFor(() => expect(error).toHaveBeenCalledTimes(1))
|
||||
expect(error).toHaveBeenCalledWith('Invalid model square order setting')
|
||||
expect(success).not.toHaveBeenCalled()
|
||||
expect(onOpenChange).not.toHaveBeenCalled()
|
||||
expect(screen.getByRole('button', { name: 'Requests' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true'
|
||||
)
|
||||
})
|
||||
|
||||
it('discards the draft when the dialog is cancelled', async () => {
|
||||
const put = mockApi({ 'model_square_setting.sort_mode': 'manual' })
|
||||
const onOpenChange = vi.fn()
|
||||
const user = userEvent.setup()
|
||||
const dialog = renderDialog(onOpenChange)
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: 'Most used' }))
|
||||
expect(screen.getByRole('button', { name: 'Most used' })).toHaveAttribute(
|
||||
'aria-pressed',
|
||||
'true'
|
||||
)
|
||||
await user.click(screen.getByRole('button', { name: 'Cancel' }))
|
||||
expect(onOpenChange).toHaveBeenCalledWith(false)
|
||||
dialog.rerender(false)
|
||||
dialog.rerender(true)
|
||||
|
||||
expect(
|
||||
await screen.findByRole('button', { name: 'Manual order' })
|
||||
).toHaveAttribute('aria-pressed', 'true')
|
||||
expect(put).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('ranks the other models by the chosen metric after the pinned ones', async () => {
|
||||
mockApi(
|
||||
{
|
||||
'model_square_setting.sort_mode': 'mixed',
|
||||
'model_square_setting.sort_metric': 'tokens',
|
||||
'model_square_setting.sort_models': '["beta"]',
|
||||
},
|
||||
{
|
||||
gamma: { requests: 3, tokens: 9000 },
|
||||
alpha: { requests: 8, tokens: 100 },
|
||||
}
|
||||
)
|
||||
const user = userEvent.setup()
|
||||
renderDialog()
|
||||
|
||||
const others = await screen.findByRole('list', { name: 'Other models' })
|
||||
const rows = () => within(others).getAllByRole('listitem')
|
||||
expect(rows()).toHaveLength(2)
|
||||
expect(rows()[0]).toHaveTextContent(/^2.*gamma.*9K$/)
|
||||
expect(rows()[1]).toHaveTextContent(/^3.*alpha.*100$/)
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Requests' }))
|
||||
|
||||
expect(rows()[0]).toHaveTextContent(/^2.*alpha.*8$/)
|
||||
expect(rows()[1]).toHaveTextContent(/^3.*gamma.*3$/)
|
||||
})
|
||||
|
||||
it('says the order falls back to names when there is no usage', async () => {
|
||||
mockApi({ 'model_square_setting.sort_mode': 'usage' })
|
||||
renderDialog()
|
||||
|
||||
expect(
|
||||
await screen.findByText('No usage data, so models are ordered by name.')
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
SyncUpstreamResponse,
|
||||
PreviewUpstreamDiffResponse,
|
||||
MissingModelsResponse,
|
||||
ModelSquareUsageResponse,
|
||||
PrefillGroupsResponse,
|
||||
SyncLocale,
|
||||
SyncSource,
|
||||
@@ -240,6 +241,17 @@ export async function getMissingModels(): Promise<MissingModelsResponse> {
|
||||
return res.data
|
||||
}
|
||||
|
||||
/**
|
||||
* Get every model square model with its usage over the last days, for the
|
||||
* model square order
|
||||
*/
|
||||
export async function getModelSquareUsage(
|
||||
days: number
|
||||
): Promise<ModelSquareUsageResponse> {
|
||||
const res = await api.get('/api/models/square_usage', { params: { days } })
|
||||
return res.data
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prefill groups
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,450 @@
|
||||
/*
|
||||
Copyright (C) 2023-2026 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import {
|
||||
keepPreviousData,
|
||||
useMutation,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
import { Reorder } from 'motion/react'
|
||||
import { useMemo, useState, type ReactNode } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { AutoGroupOrderItem } from '@/components/auto-group-order-item'
|
||||
import { Dialog } from '@/components/dialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Combobox } from '@/components/ui/combobox'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select'
|
||||
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'
|
||||
import { compareModelUsage } from '@/features/pricing/lib/filters'
|
||||
import { updateSystemOption } from '@/features/system-settings/api'
|
||||
import {
|
||||
getOptionValue,
|
||||
useSystemOptions,
|
||||
} from '@/features/system-settings/hooks/use-system-options'
|
||||
import type { UpdateOptionRequest } from '@/features/system-settings/types'
|
||||
import {
|
||||
SEGMENTED_SWITCH_CLASS,
|
||||
SEGMENTED_SWITCH_ITEM_CLASS,
|
||||
} from '@/features/task-plugins/components/plugin-kind-switch'
|
||||
import { toIntlLocale } from '@/i18n/languages'
|
||||
import { formatCompactNumber } from '@/lib/format'
|
||||
import { handleServerError } from '@/lib/handle-server-error'
|
||||
import { getLobeIcon } from '@/lib/lobe-icon'
|
||||
import { requireServerSuccess } from '@/lib/server-error-message'
|
||||
|
||||
import { getModelSquareUsage } from '../../api'
|
||||
import { modelsQueryKeys } from '../../lib'
|
||||
import type { ModelSquareUsage } from '../../types'
|
||||
|
||||
const MODE_KEY = 'model_square_setting.sort_mode'
|
||||
const METRIC_KEY = 'model_square_setting.sort_metric'
|
||||
const DAYS_KEY = 'model_square_setting.sort_days'
|
||||
const MODELS_KEY = 'model_square_setting.sort_models'
|
||||
|
||||
// The saved settings; with no setting the square stays in name order.
|
||||
const DEFAULT_ORDER = {
|
||||
[MODE_KEY]: 'manual',
|
||||
[METRIC_KEY]: 'tokens',
|
||||
[DAYS_KEY]: 7,
|
||||
[MODELS_KEY]: [] as string[],
|
||||
}
|
||||
|
||||
type OrderOptions = typeof DEFAULT_ORDER
|
||||
|
||||
const PREVIEW_LIMIT = 10
|
||||
|
||||
function modelIcon(name: string, model?: ModelSquareUsage): ReactNode {
|
||||
return getLobeIcon(model?.icon || model?.vendor_icon || name, 18)
|
||||
}
|
||||
|
||||
function ModelIconTile(props: { children: ReactNode }) {
|
||||
return (
|
||||
<span
|
||||
aria-hidden='true'
|
||||
className='bg-muted/50 flex size-8 shrink-0 items-center justify-center rounded-md'
|
||||
>
|
||||
{props.children}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
type ModelSquareOrderDialogProps = {
|
||||
open: boolean
|
||||
onOpenChange: (open: boolean) => void
|
||||
}
|
||||
|
||||
/** Lets the root admin choose the Recommended order of the model square. */
|
||||
export function ModelSquareOrderDialog(props: ModelSquareOrderDialogProps) {
|
||||
const { t, i18n } = useTranslation()
|
||||
const locale = toIntlLocale(i18n.resolvedLanguage || i18n.language)
|
||||
const queryClient = useQueryClient()
|
||||
const optionsQuery = useSystemOptions()
|
||||
const [draft, setDraft] = useState<OrderOptions | null>(null)
|
||||
|
||||
const saved = getOptionValue(optionsQuery.data?.data, DEFAULT_ORDER)
|
||||
const order = draft ?? saved
|
||||
const mode = order[MODE_KEY]
|
||||
const metric = order[METRIC_KEY]
|
||||
const days = order[DAYS_KEY]
|
||||
const listed = order[MODELS_KEY]
|
||||
const usesUsage = mode !== 'manual'
|
||||
|
||||
// Every square model, whichever group can see it, with its usage
|
||||
const usageQuery = useQuery({
|
||||
queryKey: modelsQueryKeys.squareUsage(days),
|
||||
queryFn: async () => requireServerSuccess(await getModelSquareUsage(days)),
|
||||
enabled: props.open,
|
||||
placeholderData: keepPreviousData,
|
||||
})
|
||||
const squareModels = useMemo(
|
||||
() => usageQuery.data?.data ?? [],
|
||||
[usageQuery.data]
|
||||
)
|
||||
|
||||
const modelByName = useMemo(
|
||||
() => new Map(squareModels.map((model) => [model.model_name, model])),
|
||||
[squareModels]
|
||||
)
|
||||
|
||||
const ranked = useMemo(() => {
|
||||
const pinned = mode === 'mixed' ? listed : []
|
||||
return squareModels
|
||||
.filter((model) => !pinned.includes(model.model_name))
|
||||
.map((model) => ({
|
||||
model,
|
||||
name: model.model_name,
|
||||
usage: metric === 'requests' ? model.requests : model.tokens,
|
||||
}))
|
||||
.sort(compareModelUsage)
|
||||
}, [metric, mode, listed, squareModels])
|
||||
const hasUsage = ranked.some((row) => row.usage > 0)
|
||||
|
||||
const update = (changes: Partial<OrderOptions>) =>
|
||||
setDraft({ ...order, ...changes })
|
||||
|
||||
const moveModel = (index: number, direction: 'up' | 'down') => {
|
||||
const target = direction === 'up' ? index - 1 : index + 1
|
||||
if (target < 0 || target >= listed.length) return
|
||||
const next = [...listed]
|
||||
;[next[index], next[target]] = [next[target], next[index]]
|
||||
update({ [MODELS_KEY]: next })
|
||||
}
|
||||
|
||||
const handleOpenChange = (open: boolean) => {
|
||||
if (!open) setDraft(null)
|
||||
props.onOpenChange(open)
|
||||
}
|
||||
|
||||
// One toast for the whole order, however many settings changed
|
||||
const saveOrder = useMutation({
|
||||
mutationFn: async (changes: UpdateOptionRequest[]) => {
|
||||
for (const change of changes) {
|
||||
requireServerSuccess(await updateSystemOption(change))
|
||||
}
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['pricing'] })
|
||||
toast.success(t('Setting updated successfully'))
|
||||
handleOpenChange(false)
|
||||
},
|
||||
onError: (error) => handleServerError(error, t('Failed to update setting')),
|
||||
onSettled: () =>
|
||||
queryClient.invalidateQueries({ queryKey: ['system-options'] }),
|
||||
})
|
||||
|
||||
const handleSave = () => {
|
||||
const keys = Object.keys(order) as (keyof OrderOptions)[]
|
||||
saveOrder.mutate(
|
||||
keys
|
||||
.filter(
|
||||
(key) => JSON.stringify(order[key]) !== JSON.stringify(saved[key])
|
||||
)
|
||||
.map((key) => {
|
||||
const value = order[key]
|
||||
return {
|
||||
key,
|
||||
value: Array.isArray(value) ? JSON.stringify(value) : value,
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const modes = [
|
||||
{ value: 'manual', label: t('Manual order') },
|
||||
{ value: 'usage', label: t('Most used') },
|
||||
{ value: 'mixed', label: t('Pinned + most used') },
|
||||
]
|
||||
const periods = [
|
||||
{ value: '1', label: t('Last 1 day') },
|
||||
{ value: '7', label: t('Last 7 days') },
|
||||
{ value: '30', label: t('Last 30 days') },
|
||||
]
|
||||
const metricLabel = metric === 'requests' ? t('Requests') : t('Tokens')
|
||||
const addLabel = mode === 'mixed' ? t('Add pinned model') : t('Add model')
|
||||
const candidates = squareModels
|
||||
.filter((model) => !listed.includes(model.model_name))
|
||||
.map((model) => ({
|
||||
value: model.model_name,
|
||||
label: model.model_name,
|
||||
description: model.vendor_name,
|
||||
icon: modelIcon(model.model_name, model),
|
||||
}))
|
||||
const previewRows = ranked.slice(0, PREVIEW_LIMIT)
|
||||
const hiddenCount = ranked.length - previewRows.length
|
||||
const rankOffset = mode === 'mixed' ? listed.length : 0
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={props.open}
|
||||
onOpenChange={handleOpenChange}
|
||||
title={t('Model square order')}
|
||||
description={t(
|
||||
'Choose the default order of the model square. Users can still pick another sort.'
|
||||
)}
|
||||
contentClassName='sm:max-w-xl'
|
||||
footer={
|
||||
<>
|
||||
<Button variant='outline' onClick={() => handleOpenChange(false)}>
|
||||
{t('Cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
disabled={
|
||||
draft === null || !optionsQuery.isSuccess || saveOrder.isPending
|
||||
}
|
||||
>
|
||||
{t('Save')}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<div className='flex flex-col gap-5'>
|
||||
<div className='flex flex-col gap-2'>
|
||||
<div className='text-sm font-medium'>{t('Sort method')}</div>
|
||||
<ToggleGroup
|
||||
value={[mode]}
|
||||
onValueChange={(values) => {
|
||||
const next = values.find((value) => value !== mode)
|
||||
if (next) update({ [MODE_KEY]: next })
|
||||
}}
|
||||
aria-label={t('Sort method')}
|
||||
spacing={1}
|
||||
className={SEGMENTED_SWITCH_CLASS}
|
||||
>
|
||||
{modes.map((item) => (
|
||||
<ToggleGroupItem
|
||||
key={item.value}
|
||||
value={item.value}
|
||||
className={SEGMENTED_SWITCH_ITEM_CLASS}
|
||||
>
|
||||
{item.label}
|
||||
</ToggleGroupItem>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
</div>
|
||||
|
||||
{usesUsage && (
|
||||
<div className='flex flex-wrap items-start gap-6'>
|
||||
<div className='flex flex-col gap-2'>
|
||||
<div className='text-sm font-medium'>{t('Rank by')}</div>
|
||||
<ToggleGroup
|
||||
value={[metric]}
|
||||
onValueChange={(values) => {
|
||||
const next = values.find((value) => value !== metric)
|
||||
if (next) update({ [METRIC_KEY]: next })
|
||||
}}
|
||||
variant='outline'
|
||||
size='sm'
|
||||
aria-label={t('Rank by')}
|
||||
>
|
||||
<ToggleGroupItem value='requests'>
|
||||
{t('Requests')}
|
||||
</ToggleGroupItem>
|
||||
<ToggleGroupItem value='tokens'>{t('Tokens')}</ToggleGroupItem>
|
||||
</ToggleGroup>
|
||||
</div>
|
||||
<div className='flex flex-col gap-2'>
|
||||
<div className='text-sm font-medium'>{t('Period')}</div>
|
||||
<Select
|
||||
items={periods}
|
||||
value={String(days)}
|
||||
onValueChange={(value) => update({ [DAYS_KEY]: Number(value) })}
|
||||
>
|
||||
<SelectTrigger
|
||||
size='sm'
|
||||
className='w-36'
|
||||
aria-label={t('Period')}
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent alignItemWithTrigger={false}>
|
||||
<SelectGroup>
|
||||
{periods.map((period) => (
|
||||
<SelectItem key={period.value} value={period.value}>
|
||||
{period.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{mode !== 'usage' && (
|
||||
<div className='flex flex-col gap-2'>
|
||||
<div className='flex items-baseline justify-between gap-3'>
|
||||
<div className='text-sm font-medium'>
|
||||
{mode === 'mixed' ? t('Pinned models') : t('Model order')}
|
||||
</div>
|
||||
{listed.length > 1 && (
|
||||
<div className='text-muted-foreground text-xs'>
|
||||
{t('Drag to reorder')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{listed.length > 0 && (
|
||||
<Reorder.Group
|
||||
axis='y'
|
||||
values={listed}
|
||||
onReorder={(next: string[]) => update({ [MODELS_KEY]: next })}
|
||||
className='flex flex-col gap-2'
|
||||
>
|
||||
{listed.map((name, index) => {
|
||||
const model = modelByName.get(name)
|
||||
return (
|
||||
<AutoGroupOrderItem
|
||||
key={name}
|
||||
group={name}
|
||||
index={index}
|
||||
count={listed.length}
|
||||
leading={
|
||||
<ModelIconTile>{modelIcon(name, model)}</ModelIconTile>
|
||||
}
|
||||
onMove={moveModel}
|
||||
onRemove={(removed) =>
|
||||
update({
|
||||
[MODELS_KEY]: listed.filter(
|
||||
(item) => item !== removed
|
||||
),
|
||||
})
|
||||
}
|
||||
>
|
||||
{model?.vendor_name && (
|
||||
<span className='text-muted-foreground text-xs'>
|
||||
{model.vendor_name}
|
||||
</span>
|
||||
)}
|
||||
</AutoGroupOrderItem>
|
||||
)
|
||||
})}
|
||||
</Reorder.Group>
|
||||
)}
|
||||
<Combobox
|
||||
aria-label={addLabel}
|
||||
options={candidates}
|
||||
value=''
|
||||
onValueChange={(name) => {
|
||||
if (name && !listed.includes(name)) {
|
||||
update({ [MODELS_KEY]: [...listed, name] })
|
||||
}
|
||||
}}
|
||||
placeholder={addLabel}
|
||||
className='sm:w-72'
|
||||
/>
|
||||
{mode === 'manual' && (
|
||||
<p className='text-sm'>
|
||||
{t('Models not in the list follow by name.')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{usesUsage && usageQuery.isSuccess && (
|
||||
<div className='flex flex-col gap-2'>
|
||||
<div className='flex items-baseline justify-between gap-3'>
|
||||
<div className='text-sm font-medium'>
|
||||
{mode === 'mixed' ? t('Other models') : t('Current order')}
|
||||
</div>
|
||||
{hasUsage && (
|
||||
<div className='text-muted-foreground text-xs'>
|
||||
{metricLabel}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!hasUsage && (
|
||||
<p className='text-sm'>
|
||||
{t('No usage data, so models are ordered by name.')}
|
||||
</p>
|
||||
)}
|
||||
{hasUsage && (
|
||||
<ol
|
||||
aria-label={
|
||||
mode === 'mixed' ? t('Other models') : t('Current order')
|
||||
}
|
||||
className='flex flex-col gap-2'
|
||||
>
|
||||
{previewRows.map((row, index) => (
|
||||
<li
|
||||
key={row.model.model_name}
|
||||
className='flex min-w-0 items-center gap-2 rounded-lg border p-2'
|
||||
>
|
||||
<span className='text-muted-foreground w-7 shrink-0 text-center text-sm tabular-nums'>
|
||||
{rankOffset + index + 1}
|
||||
</span>
|
||||
<ModelIconTile>
|
||||
{modelIcon(row.model.model_name, row.model)}
|
||||
</ModelIconTile>
|
||||
<div className='flex min-w-0 flex-1 flex-wrap items-center gap-2'>
|
||||
<span className='min-w-0 truncate text-sm font-medium'>
|
||||
{row.model.model_name}
|
||||
</span>
|
||||
{row.model.vendor_name && (
|
||||
<span className='text-muted-foreground text-xs'>
|
||||
{row.model.vendor_name}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<span className='shrink-0 pe-1 text-sm tabular-nums'>
|
||||
{formatCompactNumber(row.usage, locale)}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
)}
|
||||
{hasUsage && hiddenCount > 0 && (
|
||||
<p className='text-muted-foreground text-sm'>
|
||||
{t('And {{count}} more models', { count: hiddenCount })}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { DescriptionDialog } from './dialogs/description-dialog'
|
||||
import { MissingModelsDialog } from './dialogs/missing-models-dialog'
|
||||
import { ModelSquareOrderDialog } from './dialogs/model-square-order-dialog'
|
||||
import { PrefillGroupManagement } from './dialogs/prefill-group-management'
|
||||
import { PriceSyncDialog } from './dialogs/price-sync-dialog'
|
||||
import { SyncWizardDialog } from './dialogs/sync-wizard-dialog'
|
||||
@@ -73,6 +74,11 @@ export function ModelsDialogs() {
|
||||
onOpenChange={(v) => !v && setOpen(null)}
|
||||
/>
|
||||
|
||||
<ModelSquareOrderDialog
|
||||
open={open === 'model-square-order'}
|
||||
onOpenChange={(v) => !v && setOpen(null)}
|
||||
/>
|
||||
|
||||
{/* Prefill Groups Management */}
|
||||
<PrefillGroupManagement
|
||||
open={open === 'prefill-groups'}
|
||||
|
||||
@@ -29,6 +29,8 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { useCanEditModelPricing } from '@/features/model-pricing/api'
|
||||
import { ROLE } from '@/lib/roles'
|
||||
import { useAuthStore } from '@/stores/auth-store'
|
||||
|
||||
import { useModels } from './models-provider'
|
||||
|
||||
@@ -36,6 +38,10 @@ export function ModelsPrimaryButtons() {
|
||||
const { t } = useTranslation()
|
||||
const { setOpen, setCurrentRow } = useModels()
|
||||
const canPrice = useCanEditModelPricing()
|
||||
// The order is a site setting, which only the root user can save.
|
||||
const isRoot = useAuthStore(
|
||||
(state) => state.auth.user?.role === ROLE.SUPER_ADMIN
|
||||
)
|
||||
|
||||
const handleCreateModel = () => {
|
||||
setCurrentRow(null)
|
||||
@@ -68,6 +74,15 @@ export function ModelsPrimaryButtons() {
|
||||
{t('Sync pricing')}
|
||||
</Button>
|
||||
)}
|
||||
{isRoot && (
|
||||
<Button
|
||||
onClick={() => setOpen('model-square-order')}
|
||||
variant='outline'
|
||||
size='sm'
|
||||
>
|
||||
{t('Model square order')}
|
||||
</Button>
|
||||
)}
|
||||
{/* Create Model */}
|
||||
<Button onClick={handleCreateModel} size='sm'>
|
||||
<Plus className='h-4 w-4' />
|
||||
|
||||
@@ -42,6 +42,7 @@ type DialogType =
|
||||
| 'missing-models'
|
||||
| 'sync-wizard'
|
||||
| 'prefill-groups'
|
||||
| 'model-square-order'
|
||||
| 'description'
|
||||
| null
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ export const modelsQueryKeys = {
|
||||
[...modelsQueryKeys.lists(), filters] as const,
|
||||
detail: (id: number) => [...modelsQueryKeys.all, 'detail', id] as const,
|
||||
missing: () => [...modelsQueryKeys.all, 'missing'] as const,
|
||||
squareUsage: (days: number) =>
|
||||
[...modelsQueryKeys.all, 'square-usage', days] as const,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -249,6 +249,21 @@ export interface MissingModelsResponse {
|
||||
data?: string[]
|
||||
}
|
||||
|
||||
export type ModelSquareUsage = {
|
||||
model_name: string
|
||||
icon?: string
|
||||
vendor_name?: string
|
||||
vendor_icon?: string
|
||||
requests: number
|
||||
tokens: number
|
||||
}
|
||||
|
||||
export interface ModelSquareUsageResponse {
|
||||
success: boolean
|
||||
message?: string
|
||||
data?: ModelSquareUsage[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefill groups response
|
||||
*/
|
||||
|
||||
@@ -362,6 +362,28 @@ describe('pricing controls', () => {
|
||||
expect(props.onSortChange).toHaveBeenCalledWith('input-price-low')
|
||||
})
|
||||
|
||||
it('lists the model order sorts above the name and price sorts', async () => {
|
||||
const props = { ...toolbarProps(), sortBy: 'recommended' }
|
||||
const user = userEvent.setup()
|
||||
render(<PricingToolbar {...props} />)
|
||||
await user.click(screen.getByRole('button', { name: 'Recommended' }))
|
||||
const [orderGroup, otherGroup] = within(
|
||||
await screen.findByRole('menu')
|
||||
).getAllByRole('group')
|
||||
expect(
|
||||
within(orderGroup)
|
||||
.getAllByRole('menuitem')
|
||||
.map((item) => item.textContent)
|
||||
).toEqual(['Recommended', 'Most requests', 'Most tokens'])
|
||||
expect(within(otherGroup).getAllByRole('menuitem')[0]).toHaveTextContent(
|
||||
'Name'
|
||||
)
|
||||
await user.click(
|
||||
within(orderGroup).getByRole('menuitem', { name: 'Most requests' })
|
||||
)
|
||||
expect(props.onSortChange).toHaveBeenCalledWith('requests')
|
||||
})
|
||||
|
||||
it('opens mobile filters from the left, selects a group, and restores focus on close', async () => {
|
||||
const props = toolbarProps()
|
||||
const user = userEvent.setup()
|
||||
|
||||
@@ -16,11 +16,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { useSearch } from '@tanstack/react-router'
|
||||
import { renderHook } from '@testing-library/react'
|
||||
import { afterEach, describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { SORT_OPTIONS } from '../constants'
|
||||
import { sortModels } from '../lib/filters'
|
||||
import type { PricingModel } from '../types'
|
||||
import { useFilters } from '../hooks/use-filters'
|
||||
import { compareModelUsage, sortModels } from '../lib/filters'
|
||||
import type { ModelOrder, PricingModel } from '../types'
|
||||
|
||||
vi.mock('@tanstack/react-router', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('@tanstack/react-router')>()),
|
||||
useSearch: vi.fn(() => ({})),
|
||||
}))
|
||||
|
||||
afterEach(() => {
|
||||
vi.mocked(useSearch).mockReturnValue({})
|
||||
})
|
||||
|
||||
function pricingModel(
|
||||
modelName: string,
|
||||
@@ -157,3 +169,71 @@ test('sorts a plugin model by the token price its ordinary requests pay', () =>
|
||||
'expr-task',
|
||||
])
|
||||
})
|
||||
|
||||
describe('model order sorting', () => {
|
||||
const squareModels = ['beta', 'Alpha', 'delta', 'gamma'].map((name) =>
|
||||
pricingModel(name, {})
|
||||
)
|
||||
const order: ModelOrder = {
|
||||
recommended: ['retired', 'gamma', 'beta'],
|
||||
requests: ['delta', 'gamma'],
|
||||
tokens: [],
|
||||
}
|
||||
const nameOrder = ['Alpha', 'beta', 'delta', 'gamma']
|
||||
|
||||
test.each([
|
||||
[SORT_OPTIONS.RECOMMENDED, order, ['gamma', 'beta', 'Alpha', 'delta']],
|
||||
[SORT_OPTIONS.MOST_REQUESTS, order, ['delta', 'gamma', 'Alpha', 'beta']],
|
||||
[SORT_OPTIONS.MOST_TOKENS, order, nameOrder],
|
||||
[SORT_OPTIONS.RECOMMENDED, undefined, nameOrder],
|
||||
])(
|
||||
'%s puts listed models first and the rest by name',
|
||||
(sortBy, modelOrder, expected) => {
|
||||
expect(
|
||||
sortModels(squareModels, sortBy, modelOrder).map((m) => m.model_name)
|
||||
).toEqual(expected)
|
||||
}
|
||||
)
|
||||
|
||||
test('defaults to the recommended order without a sort in the link', () => {
|
||||
const { result } = renderHook(() => useFilters(squareModels, order))
|
||||
|
||||
expect(result.current.sortBy).toBe(SORT_OPTIONS.RECOMMENDED)
|
||||
expect(result.current.filteredModels.map((m) => m.model_name)).toEqual([
|
||||
'gamma',
|
||||
'beta',
|
||||
'Alpha',
|
||||
'delta',
|
||||
])
|
||||
})
|
||||
|
||||
test('keeps name order for old links with sort=name', () => {
|
||||
vi.mocked(useSearch).mockReturnValue({ sort: 'name' })
|
||||
|
||||
const { result } = renderHook(() => useFilters(squareModels, order))
|
||||
|
||||
expect(result.current.filteredModels.map((m) => m.model_name)).toEqual(
|
||||
nameOrder
|
||||
)
|
||||
})
|
||||
|
||||
test('breaks usage ties like the server and lists unused models by name', () => {
|
||||
const rows = [
|
||||
{ name: 'gamma', usage: 5 },
|
||||
{ name: 'Zeta', usage: 0 },
|
||||
{ name: 'Kappa', usage: 5 },
|
||||
{ name: 'beta', usage: 0 },
|
||||
{ name: 'delta', usage: 9 },
|
||||
]
|
||||
|
||||
// The server lists Kappa before gamma (byte order); unused models
|
||||
// follow the name sort, which puts beta before Zeta.
|
||||
expect(rows.sort(compareModelUsage).map((row) => row.name)).toEqual([
|
||||
'delta',
|
||||
'Kappa',
|
||||
'gamma',
|
||||
'beta',
|
||||
'Zeta',
|
||||
])
|
||||
})
|
||||
})
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { ArrowUpDown, Check, Filter } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
import { Fragment, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { DataTableViewModeToggle } from '@/components/data-table'
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import {
|
||||
@@ -45,7 +46,12 @@ import {
|
||||
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import { getSortLabels, type SortOption, type ViewMode } from '../constants'
|
||||
import {
|
||||
getSortLabels,
|
||||
MODEL_ORDER_SORTS,
|
||||
type SortOption,
|
||||
type ViewMode,
|
||||
} from '../constants'
|
||||
import type { PricingModel, PricingVendor, TokenUnit } from '../types'
|
||||
import { PricingSidebar } from './pricing-sidebar'
|
||||
|
||||
@@ -84,6 +90,17 @@ export function PricingToolbar(props: PricingToolbarProps) {
|
||||
const { t } = useTranslation()
|
||||
const [mobileFiltersOpen, setMobileFiltersOpen] = useState(false)
|
||||
const sortLabels = getSortLabels(t)
|
||||
const sortEntries = Object.entries(sortLabels)
|
||||
const sortGroups = [
|
||||
{
|
||||
id: 'order',
|
||||
entries: sortEntries.filter(([value]) => MODEL_ORDER_SORTS.has(value)),
|
||||
},
|
||||
{
|
||||
id: 'other',
|
||||
entries: sortEntries.filter(([value]) => !MODEL_ORDER_SORTS.has(value)),
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div className='bg-card rounded-xl border p-3'>
|
||||
@@ -164,23 +181,28 @@ export function PricingToolbar(props: PricingToolbarProps) {
|
||||
<span>{sortLabels[props.sortBy as SortOption] || t('Sort')}</span>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align='end' className='w-44'>
|
||||
<DropdownMenuGroup>
|
||||
{Object.entries(sortLabels).map(([value, label]) => (
|
||||
<DropdownMenuItem
|
||||
key={value}
|
||||
onClick={() => props.onSortChange(value)}
|
||||
className='gap-2'
|
||||
>
|
||||
<Check
|
||||
className={cn(
|
||||
'size-4 shrink-0',
|
||||
props.sortBy === value ? 'opacity-100' : 'opacity-0'
|
||||
)}
|
||||
/>
|
||||
{label}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
</DropdownMenuGroup>
|
||||
{sortGroups.map((group, index) => (
|
||||
<Fragment key={group.id}>
|
||||
{index > 0 && <DropdownMenuSeparator />}
|
||||
<DropdownMenuGroup>
|
||||
{group.entries.map(([value, label]) => (
|
||||
<DropdownMenuItem
|
||||
key={value}
|
||||
onClick={() => props.onSortChange(value)}
|
||||
className='gap-2'
|
||||
>
|
||||
<Check
|
||||
className={cn(
|
||||
'size-4 shrink-0',
|
||||
props.sortBy === value ? 'opacity-100' : 'opacity-0'
|
||||
)}
|
||||
/>
|
||||
{label}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
</DropdownMenuGroup>
|
||||
</Fragment>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { type TFunction } from 'i18next'
|
||||
import type { TFunction } from 'i18next'
|
||||
|
||||
import type { TokenUnit } from './types'
|
||||
|
||||
@@ -26,6 +26,9 @@ import type { TokenUnit } from './types'
|
||||
|
||||
/** Sort options for pricing models */
|
||||
export const SORT_OPTIONS = {
|
||||
RECOMMENDED: 'recommended',
|
||||
MOST_REQUESTS: 'requests',
|
||||
MOST_TOKENS: 'tokens',
|
||||
NAME: 'name',
|
||||
INPUT_PRICE_LOW: 'input-price-low',
|
||||
INPUT_PRICE_HIGH: 'input-price-high',
|
||||
@@ -37,8 +40,18 @@ export const SORT_OPTIONS = {
|
||||
|
||||
export type SortOption = (typeof SORT_OPTIONS)[keyof typeof SORT_OPTIONS]
|
||||
|
||||
/** Sorts that follow the model order sent with the pricing data. */
|
||||
export const MODEL_ORDER_SORTS: ReadonlySet<string> = new Set([
|
||||
SORT_OPTIONS.RECOMMENDED,
|
||||
SORT_OPTIONS.MOST_REQUESTS,
|
||||
SORT_OPTIONS.MOST_TOKENS,
|
||||
])
|
||||
|
||||
export function getSortLabels(t: TFunction): Record<SortOption, string> {
|
||||
return {
|
||||
[SORT_OPTIONS.RECOMMENDED]: t('Recommended'),
|
||||
[SORT_OPTIONS.MOST_REQUESTS]: t('Most requests'),
|
||||
[SORT_OPTIONS.MOST_TOKENS]: t('Most tokens'),
|
||||
[SORT_OPTIONS.NAME]: t('Name'),
|
||||
[SORT_OPTIONS.INPUT_PRICE_LOW]: t('Input Price: Low to High'),
|
||||
[SORT_OPTIONS.INPUT_PRICE_HIGH]: t('Input Price: High to Low'),
|
||||
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
type ViewMode,
|
||||
} from '../constants'
|
||||
import { filterAndSortModels, extractAllTags } from '../lib/filters'
|
||||
import type { PricingModel, TokenUnit } from '../types'
|
||||
import type { ModelOrder, PricingModel, TokenUnit } from '../types'
|
||||
|
||||
type FilterState = {
|
||||
search?: string
|
||||
@@ -53,7 +53,7 @@ function normalizeViewMode(value: unknown): ViewMode {
|
||||
return VIEW_MODES.CARD
|
||||
}
|
||||
|
||||
export function useFilters(models: PricingModel[]) {
|
||||
export function useFilters(models: PricingModel[], modelOrder?: ModelOrder) {
|
||||
const search = useSearch({ from: '/pricing/' })
|
||||
const [filterState, setFilterState] = useState<FilterState>(() => ({
|
||||
search: search.search,
|
||||
@@ -70,7 +70,7 @@ export function useFilters(models: PricingModel[]) {
|
||||
|
||||
const searchInput = filterState.search || ''
|
||||
const debouncedSearchInput = useDebounce(searchInput, 200)
|
||||
const sortBy = filterState.sort || SORT_OPTIONS.NAME
|
||||
const sortBy = filterState.sort || SORT_OPTIONS.RECOMMENDED
|
||||
const vendorFilter = filterState.vendor || FILTER_ALL
|
||||
const groupFilter = filterState.group || FILTER_ALL
|
||||
const quotaTypeFilter = filterState.quotaType || QUOTA_TYPES.ALL
|
||||
@@ -99,7 +99,7 @@ export function useFilters(models: PricingModel[]) {
|
||||
)
|
||||
const setSortBy = useCallback(
|
||||
(v: string) =>
|
||||
updateFilters({ sort: v === SORT_OPTIONS.NAME ? undefined : v }),
|
||||
updateFilters({ sort: v === SORT_OPTIONS.RECOMMENDED ? undefined : v }),
|
||||
[updateFilters]
|
||||
)
|
||||
const setVendorFilter = useCallback(
|
||||
@@ -157,9 +157,11 @@ export function useFilters(models: PricingModel[]) {
|
||||
endpointType: endpointTypeFilter,
|
||||
tag: tagFilter,
|
||||
sortBy,
|
||||
modelOrder,
|
||||
})
|
||||
}, [
|
||||
models,
|
||||
modelOrder,
|
||||
debouncedSearchInput,
|
||||
vendorFilter,
|
||||
groupFilter,
|
||||
|
||||
@@ -71,6 +71,7 @@ export function usePricingData(enabled = true) {
|
||||
usableGroup: data?.usable_group ?? {},
|
||||
endpointMap: data?.supported_endpoint ?? {},
|
||||
autoGroups: data?.auto_groups ?? [],
|
||||
modelOrder: data?.model_order,
|
||||
isLoading,
|
||||
error,
|
||||
refetch,
|
||||
|
||||
@@ -49,6 +49,7 @@ export function Pricing() {
|
||||
usableGroup,
|
||||
endpointMap,
|
||||
autoGroups,
|
||||
modelOrder,
|
||||
isLoading,
|
||||
priceRate,
|
||||
usdExchangeRate,
|
||||
@@ -81,7 +82,7 @@ export function Pricing() {
|
||||
availableTags,
|
||||
clearFilters,
|
||||
clearSearch,
|
||||
} = useFilters(models || [])
|
||||
} = useFilters(models || [], modelOrder)
|
||||
|
||||
const handleModelClick = useCallback((modelName: string) => {
|
||||
setSelectedModelName(modelName)
|
||||
|
||||
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import {
|
||||
SORT_OPTIONS,
|
||||
MODEL_ORDER_SORTS,
|
||||
FILTER_ALL,
|
||||
QUOTA_TYPES,
|
||||
QUOTA_TYPE_VALUES,
|
||||
@@ -25,7 +26,7 @@ import {
|
||||
type QuotaTypeOption,
|
||||
type SortOption,
|
||||
} from '../constants'
|
||||
import type { PricingModel } from '../types'
|
||||
import type { ModelOrder, PricingModel } from '../types'
|
||||
import { compileBillingExpression } from './billing-expression/parser'
|
||||
import { visitExpression } from './billing-expression/types'
|
||||
import {
|
||||
@@ -189,12 +190,32 @@ function getSortPrice(
|
||||
return calculateTokenPrice(model, kind, 1)
|
||||
}
|
||||
|
||||
function compareModelNames(a: PricingModel, b: PricingModel): number {
|
||||
return (a.model_name || '').localeCompare(b.model_name || '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Orders models for the usage sorts of the model square: most used first,
|
||||
* equal usage in plain string order like the server's list, and models
|
||||
* without usage by name like the rest of the square.
|
||||
*/
|
||||
export function compareModelUsage(
|
||||
a: { name: string; usage: number },
|
||||
b: { name: string; usage: number }
|
||||
): number {
|
||||
if (a.usage !== b.usage) return b.usage - a.usage
|
||||
if (a.usage === 0) return a.name.localeCompare(b.name)
|
||||
if (a.name === b.name) return 0
|
||||
return a.name < b.name ? -1 : 1
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort models by specified option
|
||||
*/
|
||||
export function sortModels(
|
||||
models: PricingModel[],
|
||||
sortBy: string
|
||||
sortBy: string,
|
||||
modelOrder?: ModelOrder
|
||||
): PricingModel[] {
|
||||
const sorted = [...models]
|
||||
|
||||
@@ -216,11 +237,21 @@ export function sortModels(
|
||||
return sorted
|
||||
}
|
||||
|
||||
if (MODEL_ORDER_SORTS.has(sortBy)) {
|
||||
// Models missing from the order follow it by name
|
||||
const order = modelOrder?.[sortBy as keyof ModelOrder] ?? []
|
||||
const rank = new Map(order.map((name, index) => [name, index]))
|
||||
sorted.sort(
|
||||
(a, b) =>
|
||||
(rank.get(a.model_name) ?? order.length) -
|
||||
(rank.get(b.model_name) ?? order.length) || compareModelNames(a, b)
|
||||
)
|
||||
return sorted
|
||||
}
|
||||
|
||||
switch (sortBy) {
|
||||
case SORT_OPTIONS.NAME:
|
||||
sorted.sort((a, b) =>
|
||||
(a.model_name || '').localeCompare(b.model_name || '')
|
||||
)
|
||||
sorted.sort(compareModelNames)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -240,6 +271,7 @@ export function filterAndSortModels(
|
||||
endpointType: string
|
||||
tag: string
|
||||
sortBy: string
|
||||
modelOrder?: ModelOrder
|
||||
}
|
||||
): PricingModel[] {
|
||||
let result = filterBySearch(models, filters.search)
|
||||
@@ -248,7 +280,7 @@ export function filterAndSortModels(
|
||||
result = filterByQuotaType(result, filters.quotaType)
|
||||
result = filterByEndpointType(result, filters.endpointType)
|
||||
result = filterByTag(result, filters.tag)
|
||||
result = sortModels(result, filters.sortBy)
|
||||
result = sortModels(result, filters.sortBy, filters.modelOrder)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -123,6 +123,9 @@ export type ModelCapability =
|
||||
| 'caching'
|
||||
| 'embeddings'
|
||||
|
||||
/** Model names in each server-ordered sort; unlisted models follow by name. */
|
||||
export type ModelOrder = Record<'recommended' | 'requests' | 'tokens', string[]>
|
||||
|
||||
export type PricingData = {
|
||||
success: boolean
|
||||
message?: string
|
||||
@@ -132,6 +135,7 @@ export type PricingData = {
|
||||
usable_group: Record<string, { desc: string; ratio: number }>
|
||||
supported_endpoint: Record<string, string>
|
||||
auto_groups: string[]
|
||||
model_order?: ModelOrder
|
||||
}
|
||||
|
||||
export type TokenUnit = 'M' | 'K'
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "Add param/header",
|
||||
"Add payment method": "Add payment method",
|
||||
"Add photos or files": "Add photos or files",
|
||||
"Add pinned model": "Add pinned model",
|
||||
"Add prefix": "Add prefix",
|
||||
"Add pricing branch": "Add pricing branch",
|
||||
"Add product": "Add product",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.",
|
||||
"Choose the bundle type and define the items inside it.": "Choose the bundle type and define the items inside it.",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "Choose the default charts, range, and time granularity for model analytics.",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "Choose the default order of the model square. Users can still pick another sort.",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "Choose the domain used when this Passkey was created, then try again.",
|
||||
"Choose usage categories": "Choose usage categories",
|
||||
"Choose where to fetch upstream metadata.": "Choose where to fetch upstream metadata.",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "Current models for the longest channel in this tag. May not include all models from all channels.",
|
||||
"Current models: {{count}}": "Current models: {{count}}",
|
||||
"Current month": "Current month",
|
||||
"Current order": "Current order",
|
||||
"Current Password": "Current Password",
|
||||
"Current password is incorrect.": "Current password is incorrect.",
|
||||
"Current period price": "Current period price",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "Drag the handle to move a channel.",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "Drag to change priority. Use arrow keys to move, Escape to cancel.",
|
||||
"Drag to move": "Drag to move",
|
||||
"Drag to reorder": "Drag to reorder",
|
||||
"Drag to resize": "Drag to resize",
|
||||
"Drag to set channel priority": "Drag to set channel priority",
|
||||
"Draw": "Draw",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "Invalid JSON in parameter override template",
|
||||
"Invalid JSON string.": "Invalid JSON string.",
|
||||
"Invalid model mapping format": "Invalid model mapping format",
|
||||
"Invalid model square order setting": "Invalid model square order setting",
|
||||
"Invalid parameters": "Invalid parameters",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.",
|
||||
"Invalid Passkey login state": "Invalid Passkey login state",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "Language preference saved",
|
||||
"Language Preferences": "Language Preferences",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "Language preferences sync across your signed-in devices and affect API error messages.",
|
||||
"Last 1 day": "Last 1 day",
|
||||
"Last 24h usage": "Last 24h usage",
|
||||
"Last 30 days": "Last 30 days",
|
||||
"Last 30 days uptime": "Last 30 days uptime",
|
||||
"Last 7 days": "Last 7 days",
|
||||
"Last active {{time}} · Expires {{expires}}": "Last active {{time}} · Expires {{expires}}",
|
||||
"Last check time": "Last check time",
|
||||
"Last detected addable models": "Last detected addable models",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "Manage your security settings and account access",
|
||||
"Mantle (Messages API)": "Mantle (Messages API)",
|
||||
"Manual Disabled": "Manual Disabled",
|
||||
"Manual order": "Manual order",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.",
|
||||
"Map request model names to actual provider model names (JSON format)": "Map request model names to actual provider model names (JSON format)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "Model name is too long: {{model}}",
|
||||
"Model names copied to clipboard": "Model names copied to clipboard",
|
||||
"Model not found": "Model not found",
|
||||
"Model order": "Model order",
|
||||
"Model performance metrics": "Model performance metrics",
|
||||
"Model Price": "Model Price",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "Model price {{model_price}}, group ratio {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "Model shown in model square",
|
||||
"Model source": "Model source",
|
||||
"Model Square": "Model Square",
|
||||
"Model square order": "Model square order",
|
||||
"Model square visibility": "Model square visibility",
|
||||
"Model sync": "Model sync",
|
||||
"Model Tags": "Model Tags",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "Models losing the most positions",
|
||||
"Models needing price updates: {{modelCount}}": "Models needing price updates: {{modelCount}}",
|
||||
"Models not in list, may fail to invoke": "Models not in list, may fail to invoke",
|
||||
"Models not in the list follow by name.": "Models not in the list follow by name.",
|
||||
"Models source": "Models source",
|
||||
"Models that are being used but not configured in the system": "Models that are being used but not configured in the system",
|
||||
"Models that skip thinking suffix processing": "Models that skip thinking suffix processing",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "More templates...",
|
||||
"More than 999 days left": "More than 999 days left",
|
||||
"More...": "More...",
|
||||
"Most requests": "Most requests",
|
||||
"Most tokens": "Most tokens",
|
||||
"Most used": "Most used",
|
||||
"Most-used models in the selected period and category": "Most-used models in the selected period and category",
|
||||
"Move": "Move",
|
||||
"Move {{group}} down": "Move {{group}} down",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "No uptime data available",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "No Uptime Kuma groups yet. Click \"Add Group\" to create one.",
|
||||
"No uptime monitoring configured": "No uptime monitoring configured",
|
||||
"No usage data, so models are ordered by name.": "No usage data, so models are ordered by name.",
|
||||
"No usage guide for this version.": "No usage guide for this version.",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "No usage logs available. Logs will appear here once API calls are made.",
|
||||
"No user information available": "No user information available",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "Pick models and derive the other side with a rule to create request-to-upstream mappings.",
|
||||
"Pick or create both a store and a product before saving.": "Pick or create both a store and a product before saving.",
|
||||
"Ping Interval (seconds)": "Ping Interval (seconds)",
|
||||
"Pinned + most used": "Pinned + most used",
|
||||
"Pinned models": "Pinned models",
|
||||
"Plan": "Plan",
|
||||
"Plan amount is too low": "Plan amount is too low",
|
||||
"Plan ID": "Plan ID",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "Radius",
|
||||
"Random": "Random",
|
||||
"Randomly select a key from the pool for each request": "Randomly select a key from the pool for each request",
|
||||
"Rank by": "Rank by",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.",
|
||||
"Rankings": "Rankings",
|
||||
"Rate Limit Windows": "Rate Limit Windows",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "Sort by ID",
|
||||
"Sort by priority to drag channels": "Sort by priority to drag channels",
|
||||
"Sort channels by": "Sort channels by",
|
||||
"Sort method": "Sort method",
|
||||
"Sort Order": "Sort Order",
|
||||
"Sort priority": "Sort priority",
|
||||
"Source": "Source",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "Ajouter un param / un en-tête",
|
||||
"Add payment method": "Ajouter un mode de paiement",
|
||||
"Add photos or files": "Ajouter des photos ou des fichiers",
|
||||
"Add pinned model": "Épingler un modèle",
|
||||
"Add prefix": "Ajouter un préfixe",
|
||||
"Add pricing branch": "Ajouter une branche tarifaire",
|
||||
"Add product": "Ajouter un produit",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "Choisissez les prix selon l’utilisation du cache signalée par le fournisseur. Les écritures standard, Claude 1 heure et GPT 12 heures sont facturées séparément.",
|
||||
"Choose the bundle type and define the items inside it.": "Choisissez le type de bundle et définissez les éléments qu'il contient.",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "Choisissez les graphiques, la plage et la granularité temporelle par défaut pour l'analyse des modèles.",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "Choisissez l’ordre par défaut de la place des modèles. Les utilisateurs peuvent toujours choisir un autre tri.",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "Choisissez le domaine utilisé lors de la création de cette clé d’accès, puis réessayez.",
|
||||
"Choose usage categories": "Catégories d’utilisation",
|
||||
"Choose where to fetch upstream metadata.": "Choisissez où récupérer les métadonnées amont.",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "Modèles actuels pour le canal le plus long de cette balise. Peut ne pas inclure tous les modèles de tous les canaux.",
|
||||
"Current models: {{count}}": "Modèles actuels : {{count}}",
|
||||
"Current month": "Ce mois-ci",
|
||||
"Current order": "Ordre actuel",
|
||||
"Current Password": "Mot de passe actuel",
|
||||
"Current password is incorrect.": "Le mot de passe actuel est incorrect.",
|
||||
"Current period price": "Prix de la période actuelle",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "Faites glisser la poignée pour déplacer un canal.",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "Glissez pour modifier la priorité. Flèches pour déplacer, Échap pour annuler.",
|
||||
"Drag to move": "Glisser pour déplacer",
|
||||
"Drag to reorder": "Faites glisser pour réorganiser",
|
||||
"Drag to resize": "Glisser pour redimensionner",
|
||||
"Drag to set channel priority": "Réorganiser la priorité des canaux",
|
||||
"Draw": "Dessin",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "JSON invalide dans le modèle de remplacement de paramètres",
|
||||
"Invalid JSON string.": "Chaîne JSON invalide.",
|
||||
"Invalid model mapping format": "Format de mappage de modèle invalide",
|
||||
"Invalid model square order setting": "Réglage d’ordre de la place des modèles invalide",
|
||||
"Invalid parameters": "Paramètres invalides",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "Domaine de clé d’accès invalide. Saisissez un domaine sans protocole, port, chemin ni caractère générique.",
|
||||
"Invalid Passkey login state": "État de connexion Passkey invalide",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "Préférence de langue enregistrée",
|
||||
"Language Preferences": "Préférences de langue",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "Les préférences de langue se synchronisent sur vos appareils connectés et affectent les messages d'erreur de l'API.",
|
||||
"Last 1 day": "Dernier jour",
|
||||
"Last 24h usage": "Utilisation 24h",
|
||||
"Last 30 days": "30 derniers jours",
|
||||
"Last 30 days uptime": "Disponibilité 30 derniers jours",
|
||||
"Last 7 days": "7 derniers jours",
|
||||
"Last active {{time}} · Expires {{expires}}": "Dernière activité {{time}} · Expire le {{expires}}",
|
||||
"Last check time": "Dernière vérification",
|
||||
"Last detected addable models": "Derniers modèles ajoutables détectés",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "Gérer vos paramètres de sécurité et l'accès à votre compte",
|
||||
"Mantle (Messages API)": "Mantle (Messages API)",
|
||||
"Manual Disabled": "Désactivé manuellement",
|
||||
"Manual order": "Ordre manuel",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "Mapper les champs de la réponse des informations utilisateur vers les attributs utilisateur locaux. Supporte les chemins imbriqués (par exemple ocs.data.id).",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "Mapper les identifiants de modèle aux versions de l'API Gemini. Une entrée `default` s'applique lorsqu'aucune correspondance spécifique n'est trouvée.",
|
||||
"Map request model names to actual provider model names (JSON format)": "Mapper les noms de modèles de requête aux noms réels de modèles du fournisseur (format JSON)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "Nom de modèle trop long : {{model}}",
|
||||
"Model names copied to clipboard": "Noms des modèles copiés dans le presse-papiers",
|
||||
"Model not found": "Modèle introuvable",
|
||||
"Model order": "Ordre des modèles",
|
||||
"Model performance metrics": "Indicateurs de performance des modèles",
|
||||
"Model Price": "Prix du modèle",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "Prix du modèle {{model_price}}, ratio du groupe {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "Modèle affiché dans la galerie",
|
||||
"Model source": "Source du modèle",
|
||||
"Model Square": "Place des modèles",
|
||||
"Model square order": "Ordre de la place des modèles",
|
||||
"Model square visibility": "Visibilité",
|
||||
"Model sync": "Synchronisation des modèles",
|
||||
"Model Tags": "Tags de modèle",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "Modèles qui perdent le plus de places",
|
||||
"Models needing price updates: {{modelCount}}": "Modèles dont les tarifs sont à revoir : {{modelCount}}",
|
||||
"Models not in list, may fail to invoke": "Modèles non listés, peut échouer lors de l'invocation",
|
||||
"Models not in the list follow by name.": "Les modèles absents de la liste suivent par ordre de nom.",
|
||||
"Models source": "Source des modèles",
|
||||
"Models that are being used but not configured in the system": "Modèles utilisés mais non configurés dans le système",
|
||||
"Models that skip thinking suffix processing": "Modèles qui ignorent le traitement des suffixes thinking",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "Autres modèles…",
|
||||
"More than 999 days left": "Plus de 999 jours restants",
|
||||
"More...": "Plus...",
|
||||
"Most requests": "Les plus demandés",
|
||||
"Most tokens": "Le plus de jetons",
|
||||
"Most used": "Les plus utilisés",
|
||||
"Most-used models in the selected period and category": "Modèles les plus utilisés dans la période et catégorie choisies",
|
||||
"Move": "Déplacer",
|
||||
"Move {{group}} down": "Déplacer {{group}} vers le bas",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "Aucune donnée de disponibilité disponible",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "Aucun groupe Uptime Kuma pour l'instant. Cliquez sur « Ajouter un groupe » pour en créer un.",
|
||||
"No uptime monitoring configured": "Aucune surveillance de disponibilité configurée",
|
||||
"No usage data, so models are ordered by name.": "Aucune donnée d’utilisation : les modèles sont classés par nom.",
|
||||
"No usage guide for this version.": "Aucun guide d'utilisation pour cette version.",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "Aucun journal d'utilisation. Les journaux apparaîtront ici une fois les appels API effectués.",
|
||||
"No user information available": "Aucune information utilisateur disponible",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "Choisissez des modèles et dérivez l'autre côté avec une règle pour créer des correspondances requête → amont.",
|
||||
"Pick or create both a store and a product before saving.": "Choisissez ou créez à la fois une boutique et un produit avant d’enregistrer.",
|
||||
"Ping Interval (seconds)": "Intervalle de ping (secondes)",
|
||||
"Pinned + most used": "Épinglés + les plus utilisés",
|
||||
"Pinned models": "Modèles épinglés",
|
||||
"Plan": "Plan",
|
||||
"Plan amount is too low": "Le montant du forfait est trop faible",
|
||||
"Plan ID": "ID du forfait",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "Rayon",
|
||||
"Random": "Aléatoire",
|
||||
"Randomly select a key from the pool for each request": "Sélectionner aléatoirement une clé du pool pour chaque requête",
|
||||
"Rank by": "Classer par",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "Les données de classement sont actuellement simulées à des fins d'aperçu et seront remplacées par des analyses en direct une fois l'intégration backend livrée.",
|
||||
"Rankings": "Classements",
|
||||
"Rate Limit Windows": "Fenêtres de limitation",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "Trier par ID",
|
||||
"Sort by priority to drag channels": "Triez par priorité pour déplacer les canaux",
|
||||
"Sort channels by": "Trier les canaux par",
|
||||
"Sort method": "Mode de tri",
|
||||
"Sort Order": "Ordre de tri",
|
||||
"Sort priority": "Priorité de tri",
|
||||
"Source": "Source",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "パラメータ/ヘッダーを追加",
|
||||
"Add payment method": "決済方法を追加",
|
||||
"Add photos or files": "写真やファイルを追加",
|
||||
"Add pinned model": "ピン留めするモデルを追加",
|
||||
"Add prefix": "プレフィックスを追加",
|
||||
"Add pricing branch": "料金分岐を追加",
|
||||
"Add product": "製品を追加",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "上流サービスの使用量に合わせて課金項目を選択します。通常の書き込み、Claude の1時間書き込み、GPT の12時間書き込みには個別の単価を設定します。",
|
||||
"Choose the bundle type and define the items inside it.": "バンドルタイプを選択し、その中のアイテムを定義してください。",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "モデル分析のデフォルトチャート、範囲、時間粒度を選択します。",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "モデル広場の既定の並び順を決めます。ユーザーは別の並べ替えに切り替えられます。",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "このパスキーの作成時に使用したドメインを選び、再試行してください。",
|
||||
"Choose usage categories": "使用量の項目を選択",
|
||||
"Choose where to fetch upstream metadata.": "アップストリームのメタデータをどこからフェッチするかを選択してください。",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "このタグ内の最も長いチャネルの現在のモデル。すべてのチャネルのすべてのモデルが含まれているわけではない場合があります。",
|
||||
"Current models: {{count}}": "現在のモデル:{{count}} 件",
|
||||
"Current month": "今月",
|
||||
"Current order": "現在の順序",
|
||||
"Current Password": "現在のパスワード",
|
||||
"Current password is incorrect.": "現在のパスワードが正しくありません。",
|
||||
"Current period price": "現在の時間帯の料金",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "ハンドルをドラッグしてチャネルを移動します。",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "ドラッグで優先度を変更。矢印キーで移動、Esc でキャンセル。",
|
||||
"Drag to move": "ドラッグして移動",
|
||||
"Drag to reorder": "ドラッグで並べ替え",
|
||||
"Drag to resize": "ドラッグしてサイズ変更",
|
||||
"Drag to set channel priority": "ドラッグでチャネルの優先度を変更",
|
||||
"Draw": "描画",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "パラメータオーバーライドテンプレートのJSONが無効です",
|
||||
"Invalid JSON string.": "無効な JSON 文字列です。",
|
||||
"Invalid model mapping format": "無効なモデルマッピング形式",
|
||||
"Invalid model square order setting": "モデル広場の並び順の設定が無効です",
|
||||
"Invalid parameters": "パラメーターが無効です",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "パスキードメインが無効です。プロトコル、ポート、パス、ワイルドカードを含めず、ドメインを入力してください。",
|
||||
"Invalid Passkey login state": "Passkey のログイン状態が無効です",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "言語設定を保存しました",
|
||||
"Language Preferences": "言語設定",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "言語設定はログイン中のすべてのデバイスで同期され、API のエラーメッセージ言語にも反映されます。",
|
||||
"Last 1 day": "過去 1 日",
|
||||
"Last 24h usage": "直近24時間の使用量",
|
||||
"Last 30 days": "過去 30 日",
|
||||
"Last 30 days uptime": "直近 30 日の稼働率",
|
||||
"Last 7 days": "過去 7 日",
|
||||
"Last active {{time}} · Expires {{expires}}": "最終利用 {{time}} · 有効期限 {{expires}}",
|
||||
"Last check time": "最終チェック時刻",
|
||||
"Last detected addable models": "最後に検出された追加可能モデル",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "セキュリティ設定とアカウントアクセスを管理する",
|
||||
"Mantle (Messages API)": "Mantle(Messages API)",
|
||||
"Manual Disabled": "手動無効",
|
||||
"Manual order": "手動で指定",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "ユーザー情報レスポンスのフィールドをローカルユーザー属性にマッピングします。ネストされたパスをサポートします (例: ocs.data.id)。",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "モデル識別子をGemini APIバージョンにマッピングします。特定の一致が見つからない場合は、`default`エントリが適用されます。",
|
||||
"Map request model names to actual provider model names (JSON format)": "リクエストのモデル名を実際のプロバイダーのモデル名にマッピング (JSON 形式)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "モデル名が長すぎます:{{model}}",
|
||||
"Model names copied to clipboard": "モデル名がクリップボードにコピーされました",
|
||||
"Model not found": "モデルが見つかりません",
|
||||
"Model order": "モデルの順序",
|
||||
"Model performance metrics": "モデル性能メトリクス",
|
||||
"Model Price": "モデル価格",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "モデル価格 {{model_price}}、グループ倍率 {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "モデル広場に表示しました",
|
||||
"Model source": "モデルの取得元",
|
||||
"Model Square": "モデル広場",
|
||||
"Model square order": "モデル広場の並び順",
|
||||
"Model square visibility": "一覧表示",
|
||||
"Model sync": "モデルの同期",
|
||||
"Model Tags": "モデルタグ",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "順位を最も落としているモデル",
|
||||
"Models needing price updates: {{modelCount}}": "価格の見直しが必要なモデル:{{modelCount}} 件",
|
||||
"Models not in list, may fail to invoke": "リストにないモデル、呼び出しに失敗する可能性があります",
|
||||
"Models not in the list follow by name.": "リストにないモデルは名前順で後に続きます。",
|
||||
"Models source": "モデルの取得元",
|
||||
"Models that are being used but not configured in the system": "使用されているがシステムに設定されていないモデル",
|
||||
"Models that skip thinking suffix processing": "thinking サフィックス処理をスキップするモデル",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "ほかのテンプレート…",
|
||||
"More than 999 days left": "999日以上",
|
||||
"More...": "その他...",
|
||||
"Most requests": "リクエスト数順",
|
||||
"Most tokens": "トークン数順",
|
||||
"Most used": "利用の多い順",
|
||||
"Most-used models in the selected period and category": "選択した期間とカテゴリで最も使われているモデル",
|
||||
"Move": "移動",
|
||||
"Move {{group}} down": "{{group}} を下に移動",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "稼働率データがありません",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "Uptime Kumaグループはまだありません。「グループを追加」をクリックして作成してください。",
|
||||
"No uptime monitoring configured": "アップタイム監視が設定されていません",
|
||||
"No usage data, so models are ordered by name.": "利用データがないため、モデルは名前順に並びます。",
|
||||
"No usage guide for this version.": "このバージョンの使用ガイドはありません。",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "使用ログはありません。API呼び出し後にログがここに表示されます。",
|
||||
"No user information available": "ユーザー情報はありません",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "モデルを選択し、ルールでもう一方の名前を生成して「リクエスト → 上流」のマッピングを作成します。",
|
||||
"Pick or create both a store and a product before saving.": "保存する前に、ストアと商品の両方を選択または作成してください。",
|
||||
"Ping Interval (seconds)": "Ping間隔(秒)",
|
||||
"Pinned + most used": "ピン留め + 利用の多い順",
|
||||
"Pinned models": "ピン留めしたモデル",
|
||||
"Plan": "プラン",
|
||||
"Plan amount is too low": "プランの金額が低すぎます",
|
||||
"Plan ID": "プラン ID",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "角丸",
|
||||
"Random": "ランダム",
|
||||
"Randomly select a key from the pool for each request": "各リクエストごとにプールからランダムにキーを選択",
|
||||
"Rank by": "集計基準",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "現在のランキングデータはプレビュー用のシミュレーションです。バックエンド連携が完了次第、リアルタイム分析データに置き換わります。",
|
||||
"Rankings": "ランキング",
|
||||
"Rate Limit Windows": "レート制限ウィンドウ",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "IDでソート",
|
||||
"Sort by priority to drag channels": "優先度順にするとドラッグできます",
|
||||
"Sort channels by": "チャンネルの並べ替え基準",
|
||||
"Sort method": "並べ替え方法",
|
||||
"Sort Order": "並び順",
|
||||
"Sort priority": "並び順の優先度",
|
||||
"Source": "ソース",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "Добавить param / header",
|
||||
"Add payment method": "Добавить способ оплаты",
|
||||
"Add photos or files": "Добавить фото или файлы",
|
||||
"Add pinned model": "Закрепить модель",
|
||||
"Add prefix": "Добавить префикс",
|
||||
"Add pricing branch": "Добавить ветвь тарификации",
|
||||
"Add product": "Добавить продукт",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "Выберите цены по данным провайдера об использовании кеша. Обычные записи, записи Claude на 1 час и GPT на 12 часов оплачиваются отдельно.",
|
||||
"Choose the bundle type and define the items inside it.": "Выберите тип пакета и определите элементы внутри него.",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "Выберите графики, диапазон и временную детализацию по умолчанию для аналитики моделей.",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "Выберите порядок моделей на витрине по умолчанию. Пользователи по-прежнему могут выбрать другую сортировку.",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "Выберите домен, использованный при создании этого ключа доступа, и повторите попытку.",
|
||||
"Choose usage categories": "Выбор категорий расхода",
|
||||
"Choose where to fetch upstream metadata.": "Выберите, откуда получать метаданные вышестоящего источника.",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "Текущие модели для самого длинного канала в этом теге. Может не включать все модели из всех каналов.",
|
||||
"Current models: {{count}}": "Текущие модели: {{count}}",
|
||||
"Current month": "Текущий месяц",
|
||||
"Current order": "Текущий порядок",
|
||||
"Current Password": "Текущий пароль",
|
||||
"Current password is incorrect.": "Текущий пароль неверен.",
|
||||
"Current period price": "Цена текущего периода",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "Перетащите канал за ручку.",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "Перетащите для изменения приоритета. Стрелки — перемещение, Esc — отмена.",
|
||||
"Drag to move": "Перетащите, чтобы переместить",
|
||||
"Drag to reorder": "Перетащите, чтобы изменить порядок",
|
||||
"Drag to resize": "Перетащите, чтобы изменить размер",
|
||||
"Drag to set channel priority": "Приоритет каналов перетаскиванием",
|
||||
"Draw": "Рисование",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "Недопустимый JSON в шаблоне переопределения параметров",
|
||||
"Invalid JSON string.": "Недопустимая строка JSON.",
|
||||
"Invalid model mapping format": "Неверный формат сопоставления моделей",
|
||||
"Invalid model square order setting": "Недопустимая настройка порядка витрины моделей",
|
||||
"Invalid parameters": "Недопустимые параметры",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "Недопустимый домен ключа доступа. Введите домен без протокола, порта, пути и подстановочных символов.",
|
||||
"Invalid Passkey login state": "Недопустимое состояние входа по Passkey",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "Языковая настройка сохранена",
|
||||
"Language Preferences": "Языковые настройки",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "Языковые настройки синхронизируются на всех ваших устройствах после входа и влияют на язык сообщений об ошибках API.",
|
||||
"Last 1 day": "За 1 день",
|
||||
"Last 24h usage": "Расход за 24ч",
|
||||
"Last 30 days": "За 30 дней",
|
||||
"Last 30 days uptime": "Доступность за 30 дней",
|
||||
"Last 7 days": "За 7 дней",
|
||||
"Last active {{time}} · Expires {{expires}}": "Последняя активность: {{time}} · Истекает: {{expires}}",
|
||||
"Last check time": "Время последней проверки",
|
||||
"Last detected addable models": "Последние обнаруженные модели для добавления",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "Управление настройками безопасности и доступом к аккаунту",
|
||||
"Mantle (Messages API)": "Mantle (Messages API)",
|
||||
"Manual Disabled": "Ручное отключение",
|
||||
"Manual order": "Вручную",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "Сопоставление полей из ответа информации о пользователе с локальными атрибутами пользователя. Поддерживает вложенные пути (например, ocs.data.id).",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "Сопоставьте идентификаторы моделей с версиями Gemini API. Запись `default` применяется, если не найдено конкретного совпадения.",
|
||||
"Map request model names to actual provider model names (JSON format)": "Сопоставление имён моделей запроса реальным именам моделей провайдера (формат JSON)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "Слишком длинное имя модели: {{model}}",
|
||||
"Model names copied to clipboard": "Названия моделей скопированы в буфер обмена",
|
||||
"Model not found": "Модель не найдена",
|
||||
"Model order": "Порядок моделей",
|
||||
"Model performance metrics": "Метрики производительности моделей",
|
||||
"Model Price": "Цена модели",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "Цена модели {{model_price}}, коэффициент группы {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "Модель отображается в каталоге",
|
||||
"Model source": "Источник модели",
|
||||
"Model Square": "Витрина моделей",
|
||||
"Model square order": "Порядок на витрине моделей",
|
||||
"Model square visibility": "В каталоге",
|
||||
"Model sync": "Синхронизация моделей",
|
||||
"Model Tags": "Теги моделей",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "Модели, потерявшие больше всего позиций",
|
||||
"Models needing price updates: {{modelCount}}": "Модели, требующие обновления цен: {{modelCount}}",
|
||||
"Models not in list, may fail to invoke": "Модели не в списке, вызов может не сработать",
|
||||
"Models not in the list follow by name.": "Модели не из списка идут следом по названию.",
|
||||
"Models source": "Источник моделей",
|
||||
"Models that are being used but not configured in the system": "Модели, которые используются, но не настроены в системе",
|
||||
"Models that skip thinking suffix processing": "Модели, пропускающие обработку суффиксов thinking",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "Другие шаблоны…",
|
||||
"More than 999 days left": "Более 999 дней",
|
||||
"More...": "Подробнее...",
|
||||
"Most requests": "Больше всего запросов",
|
||||
"Most tokens": "Больше всего токенов",
|
||||
"Most used": "Самые используемые",
|
||||
"Most-used models in the selected period and category": "Самые используемые модели в выбранном периоде и категории",
|
||||
"Move": "Переместить",
|
||||
"Move {{group}} down": "Переместить {{group}} вниз",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "Данные о доступности недоступны",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "Пока нет групп Uptime Kuma. Нажмите \"Добавить группу\", чтобы создать одну.",
|
||||
"No uptime monitoring configured": "Мониторинг доступности не настроен",
|
||||
"No usage data, so models are ordered by name.": "Нет данных об использовании, поэтому модели упорядочены по названию.",
|
||||
"No usage guide for this version.": "Для этой версии нет руководства.",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "Нет логов использования. Они появятся после вызовов API.",
|
||||
"No user information available": "Нет данных пользователя",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "Выберите модели и получите вторую сторону по правилу, чтобы создать сопоставления запрос → провайдер.",
|
||||
"Pick or create both a store and a product before saving.": "Перед сохранением выберите или создайте и магазин, и продукт.",
|
||||
"Ping Interval (seconds)": "Интервал Ping (секунды)",
|
||||
"Pinned + most used": "Закреплённые + самые используемые",
|
||||
"Pinned models": "Закреплённые модели",
|
||||
"Plan": "План",
|
||||
"Plan amount is too low": "Сумма плана слишком мала",
|
||||
"Plan ID": "ID плана",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "Радиус",
|
||||
"Random": "Случайный",
|
||||
"Randomly select a key from the pool for each request": "Случайно выбирать ключ из пула для каждого запроса",
|
||||
"Rank by": "Считать по",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "Сейчас данные рейтинга смоделированы для превью; после внедрения бэкенда они будут заменены реальной аналитикой.",
|
||||
"Rankings": "Рейтинги",
|
||||
"Rate Limit Windows": "Окна ограничения скорости",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "Сортировать по ID",
|
||||
"Sort by priority to drag channels": "Для перетаскивания выберите сортировку по приоритету",
|
||||
"Sort channels by": "Сортировать каналы по",
|
||||
"Sort method": "Способ сортировки",
|
||||
"Sort Order": "Порядок сортировки",
|
||||
"Sort priority": "Приоритет сортировки",
|
||||
"Source": "Источник",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "Thêm tham số/header",
|
||||
"Add payment method": "Thêm phương thức thanh toán",
|
||||
"Add photos or files": "Thêm ảnh hoặc tệp",
|
||||
"Add pinned model": "Ghim mô hình",
|
||||
"Add prefix": "Thêm tiền tố",
|
||||
"Add pricing branch": "Thêm nhánh tính phí",
|
||||
"Add product": "Thêm sản phẩm",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "Chọn đơn giá theo mức sử dụng bộ nhớ đệm do nhà cung cấp báo cáo. Ghi thông thường, ghi Claude 1 giờ và ghi GPT 12 giờ được định giá riêng.",
|
||||
"Choose the bundle type and define the items inside it.": "Chọn loại gói và định nghĩa các mục bên trong nó.",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "Chọn biểu đồ, khoảng thời gian và độ chi tiết thời gian mặc định cho phân tích mô hình.",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "Chọn thứ tự mặc định của quảng trường mô hình. Người dùng vẫn có thể chọn cách sắp xếp khác.",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "Chọn tên miền đã dùng khi tạo khóa truy cập này rồi thử lại.",
|
||||
"Choose usage categories": "Chọn loại mức sử dụng",
|
||||
"Choose where to fetch upstream metadata.": "Chọn nơi để tìm nạp siêu dữ liệu thượng nguồn.",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "Các mô hình hiện tại cho kênh dài nhất trong thẻ này. Có thể không bao gồm tất cả các mô hình từ tất cả các kênh.",
|
||||
"Current models: {{count}}": "Mô hình hiện tại: {{count}}",
|
||||
"Current month": "Tháng này",
|
||||
"Current order": "Thứ tự hiện tại",
|
||||
"Current Password": "Mật khẩu hiện tại",
|
||||
"Current password is incorrect.": "Mật khẩu hiện tại không đúng.",
|
||||
"Current period price": "Giá khung giờ hiện tại",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "Giữ và kéo tay nắm để di chuyển kênh.",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "Kéo để đổi độ ưu tiên. Dùng phím mũi tên để di chuyển, Esc để hủy.",
|
||||
"Drag to move": "Kéo để di chuyển",
|
||||
"Drag to reorder": "Kéo để sắp xếp lại",
|
||||
"Drag to resize": "Kéo để thay đổi kích cỡ",
|
||||
"Drag to set channel priority": "Kéo thả để đổi độ ưu tiên kênh",
|
||||
"Draw": "Vẽ",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "JSON không hợp lệ trong mẫu ghi đè tham số",
|
||||
"Invalid JSON string.": "Chuỗi JSON không hợp lệ.",
|
||||
"Invalid model mapping format": "Định dạng ánh xạ mô hình không hợp lệ",
|
||||
"Invalid model square order setting": "Cài đặt thứ tự quảng trường mô hình không hợp lệ",
|
||||
"Invalid parameters": "Tham số không hợp lệ",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "Tên miền khóa truy cập không hợp lệ. Chỉ nhập tên miền, không có giao thức, cổng, đường dẫn hoặc ký tự đại diện.",
|
||||
"Invalid Passkey login state": "Trạng thái đăng nhập bằng khóa truy cập không hợp lệ",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "Đã lưu tùy chọn ngôn ngữ",
|
||||
"Language Preferences": "Tùy chọn ngôn ngữ",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "Tùy chọn ngôn ngữ sẽ đồng bộ trên các thiết bị đã đăng nhập và ảnh hưởng đến ngôn ngữ thông báo lỗi API.",
|
||||
"Last 1 day": "1 ngày qua",
|
||||
"Last 24h usage": "Sử dụng 24h qua",
|
||||
"Last 30 days": "30 ngày qua",
|
||||
"Last 30 days uptime": "Uptime 30 ngày qua",
|
||||
"Last 7 days": "7 ngày qua",
|
||||
"Last active {{time}} · Expires {{expires}}": "Hoạt động gần nhất {{time}} · Hết hạn {{expires}}",
|
||||
"Last check time": "Thời gian kiểm tra gần nhất",
|
||||
"Last detected addable models": "Mô hình có thể thêm được phát hiện gần nhất",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "Quản lý cài đặt bảo mật và quyền truy cập tài khoản của bạn",
|
||||
"Mantle (Messages API)": "Mantle (Messages API)",
|
||||
"Manual Disabled": "Vô hiệu hóa thủ công",
|
||||
"Manual order": "Thủ công",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "Ánh xạ các trường từ phản hồi thông tin người dùng sang thuộc tính người dùng cục bộ. Hỗ trợ đường dẫn lồng nhau (ví dụ: ocs.data.id).",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "Ánh xạ các mã định danh mô hình với các phiên bản API Gemini. Một mục `default` áp dụng khi không tìm thấy kết quả khớp cụ thể nào.",
|
||||
"Map request model names to actual provider model names (JSON format)": "Ánh xạ tên mô hình yêu cầu đến tên mô hình thực tế của nhà cung cấp (định dạng JSON)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "Tên mô hình quá dài: {{model}}",
|
||||
"Model names copied to clipboard": "Tên mô hình đã được sao chép vào bộ nhớ tạm",
|
||||
"Model not found": "Không tìm thấy mô hình",
|
||||
"Model order": "Thứ tự mô hình",
|
||||
"Model performance metrics": "Chỉ số hiệu năng mô hình",
|
||||
"Model Price": "Giá mô hình",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "Giá mô hình {{model_price}}, hệ số nhóm {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "Đã hiển thị mô hình trong kho mô hình",
|
||||
"Model source": "Nguồn mô hình",
|
||||
"Model Square": "Quảng trường mô hình",
|
||||
"Model square order": "Thứ tự quảng trường mô hình",
|
||||
"Model square visibility": "Hiển thị",
|
||||
"Model sync": "Đồng bộ mô hình",
|
||||
"Model Tags": "Thẻ mô hình",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "Mô hình tụt hạng nhiều nhất",
|
||||
"Models needing price updates: {{modelCount}}": "Mô hình cần cập nhật giá: {{modelCount}}",
|
||||
"Models not in list, may fail to invoke": "Các mô hình không có trong danh sách, có thể gọi thất bại",
|
||||
"Models not in the list follow by name.": "Các mô hình không có trong danh sách sẽ xếp sau theo tên.",
|
||||
"Models source": "Nguồn mô hình",
|
||||
"Models that are being used but not configured in the system": "Mô hình đang được sử dụng nhưng chưa được cấu hình trong hệ thống",
|
||||
"Models that skip thinking suffix processing": "Mô hình bỏ qua xử lý hậu tố thinking",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "Thêm mẫu...",
|
||||
"More than 999 days left": "Hơn 999 ngày",
|
||||
"More...": "Thêm...",
|
||||
"Most requests": "Nhiều yêu cầu nhất",
|
||||
"Most tokens": "Nhiều mã thông báo nhất",
|
||||
"Most used": "Dùng nhiều nhất",
|
||||
"Most-used models in the selected period and category": "Mô hình được dùng nhiều nhất trong khoảng thời gian và danh mục đã chọn",
|
||||
"Move": "Di chuyển",
|
||||
"Move {{group}} down": "Di chuyển {{group}} xuống",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "Không có dữ liệu thời gian hoạt động",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "Chưa có nhóm Uptime Kuma nào. Nhấp vào \"Thêm nhóm\" để tạo một nhóm.",
|
||||
"No uptime monitoring configured": "Chưa cấu hình giám sát thời gian hoạt động",
|
||||
"No usage data, so models are ordered by name.": "Không có dữ liệu sử dụng, nên mô hình được xếp theo tên.",
|
||||
"No usage guide for this version.": "Phiên bản này chưa có hướng dẫn sử dụng.",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "Chưa có nhật ký sử dụng. Nhật ký sẽ hiển thị sau khi có gọi API.",
|
||||
"No user information available": "Không có thông tin người dùng",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "Chọn mô hình và tạo tên phía còn lại theo quy tắc để tạo ánh xạ yêu cầu → thượng nguồn.",
|
||||
"Pick or create both a store and a product before saving.": "Hãy chọn hoặc tạo cả cửa hàng và sản phẩm trước khi lưu.",
|
||||
"Ping Interval (seconds)": "Thời gian Ping (giây)",
|
||||
"Pinned + most used": "Ghim + dùng nhiều nhất",
|
||||
"Pinned models": "Mô hình được ghim",
|
||||
"Plan": "Gói",
|
||||
"Plan amount is too low": "Số tiền của gói quá thấp",
|
||||
"Plan ID": "ID gói",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "Bo góc",
|
||||
"Random": "Ngẫu nhiên",
|
||||
"Randomly select a key from the pool for each request": "Chọn ngẫu nhiên một khóa từ kho cho mỗi yêu cầu",
|
||||
"Rank by": "Tính theo",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "Dữ liệu xếp hạng hiện đang được mô phỏng để xem trước và sẽ được thay bằng dữ liệu thực sau khi tích hợp backend.",
|
||||
"Rankings": "Bảng xếp hạng",
|
||||
"Rate Limit Windows": "Cửa sổ giới hạn tốc độ",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "Sắp xếp theo ID",
|
||||
"Sort by priority to drag channels": "Sắp xếp theo độ ưu tiên để kéo kênh",
|
||||
"Sort channels by": "Sắp xếp kênh theo",
|
||||
"Sort method": "Cách sắp xếp",
|
||||
"Sort Order": "Thứ tự sắp xếp",
|
||||
"Sort priority": "Ưu tiên sắp xếp",
|
||||
"Source": "Nguồn",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "新增參數/Header",
|
||||
"Add payment method": "新增支付方式",
|
||||
"Add photos or files": "新增相片或檔案",
|
||||
"Add pinned model": "新增置頂模型",
|
||||
"Add prefix": "新增前綴",
|
||||
"Add pricing branch": "新增計費分支",
|
||||
"Add product": "新增產品",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "根據上游回傳的用量選擇計費項目。一般寫入、Claude 1 小時寫入和 GPT 12 小時寫入分別定價。",
|
||||
"Choose the bundle type and define the items inside it.": "選擇捆綁包類型並定義其中的項目。",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "選擇模型呼叫分析的預設圖表、範圍和時間粒度。",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "決定模型在模型廣場中的預設順序,使用者仍可自行切換排序。",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "請選擇建立此通行金鑰時使用的網域,然後重試。",
|
||||
"Choose usage categories": "按上游用量設定",
|
||||
"Choose where to fetch upstream metadata.": "選擇從何處獲取上游元數據。",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "此標籤中最長渠道的目前模型。可能不包括所有渠道的所有模型。",
|
||||
"Current models: {{count}}": "目前模型:{{count}} 個",
|
||||
"Current month": "本月",
|
||||
"Current order": "目前順序",
|
||||
"Current Password": "目前密碼",
|
||||
"Current password is incorrect.": "目前密碼不正確。",
|
||||
"Current period price": "目前時段價格",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "按住左側拖曳把手移動渠道。",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "拖曳調整優先級,也可使用方向鍵移動,Esc 取消。",
|
||||
"Drag to move": "拖曳以移動",
|
||||
"Drag to reorder": "拖曳調整順序",
|
||||
"Drag to resize": "拖曳以調整大小",
|
||||
"Drag to set channel priority": "拖曳調整渠道優先級",
|
||||
"Draw": "繪圖",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "參數覆蓋模板中的 JSON 格式無效",
|
||||
"Invalid JSON string.": "無效的 JSON 字串。",
|
||||
"Invalid model mapping format": "無效的模型映射格式",
|
||||
"Invalid model square order setting": "模型廣場排序設定無效",
|
||||
"Invalid parameters": "無效的參數",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "通行金鑰網域無效。請填寫網域,不包含通訊協定、連接埠、路徑或萬用字元。",
|
||||
"Invalid Passkey login state": "Passkey 登入狀態異常",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "語言偏好已儲存",
|
||||
"Language Preferences": "語言偏好",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "語言偏好會同步到您登入的所有設備,並影響 API 錯誤訊息語言。",
|
||||
"Last 1 day": "近 1 天",
|
||||
"Last 24h usage": "近 24 小時消耗",
|
||||
"Last 30 days": "近 30 天",
|
||||
"Last 30 days uptime": "近 30 天可用率",
|
||||
"Last 7 days": "近 7 天",
|
||||
"Last active {{time}} · Expires {{expires}}": "最後活動於 {{time}} · 到期時間 {{expires}}",
|
||||
"Last check time": "上次檢測時間",
|
||||
"Last detected addable models": "上次檢測到可加入模型",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "管理您的安全設定和用戶存取",
|
||||
"Mantle (Messages API)": "Mantle(Messages API)",
|
||||
"Manual Disabled": "手動停用",
|
||||
"Manual order": "手動排序",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "將用戶資訊回應中的欄位映射到本地用戶屬性。支援嵌套路徑(例如 ocs.data.id)。",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "將模型標識符映射到 Gemini API 版本。當未找到特定匹配項時,將套用 `default` 條目。",
|
||||
"Map request model names to actual provider model names (JSON format)": "將請求模型名稱映射到實際供應商模型名稱 (JSON 格式)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "模型名稱過長:{{model}}",
|
||||
"Model names copied to clipboard": "模型名稱已複製到剪貼簿",
|
||||
"Model not found": "模型未找到",
|
||||
"Model order": "模型順序",
|
||||
"Model performance metrics": "模型效能指標",
|
||||
"Model Price": "模型價格",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "模型價格 {{model_price}},分組倍率 {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "已在模型廣場顯示",
|
||||
"Model source": "模型來源",
|
||||
"Model Square": "模型廣場",
|
||||
"Model square order": "模型廣場排序",
|
||||
"Model square visibility": "廣場顯示",
|
||||
"Model sync": "模型同步",
|
||||
"Model Tags": "模型標籤",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "名次下滑最多的模型",
|
||||
"Models needing price updates: {{modelCount}}": "有 {{modelCount}} 個模型的價格需要處理",
|
||||
"Models not in list, may fail to invoke": "模型未加入列表,可能無法呼叫",
|
||||
"Models not in the list follow by name.": "未加入清單的模型依名稱排在後面。",
|
||||
"Models source": "模型來源",
|
||||
"Models that are being used but not configured in the system": "正在使用但未在系統中設定的模型",
|
||||
"Models that skip thinking suffix processing": "不自動處理思考後綴的模型",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "更多模板...",
|
||||
"More than 999 days left": "剩餘超過 999 日",
|
||||
"More...": "更多...",
|
||||
"Most requests": "請求最多",
|
||||
"Most tokens": "Token 最多",
|
||||
"Most used": "使用最多",
|
||||
"Most-used models in the selected period and category": "所選時間範圍與分類下使用率最高的模型",
|
||||
"Move": "移動",
|
||||
"Move {{group}} down": "將 {{group}} 下移",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "暫無可用率數據",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "暫無 Uptime Kuma 分組。點擊「新增分組」來建立一個。",
|
||||
"No uptime monitoring configured": "未設定正常執行時間監控",
|
||||
"No usage data, so models are ordered by name.": "沒有用量資料,模型依名稱排序。",
|
||||
"No usage guide for this version.": "這個版本沒有使用說明。",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "暫無使用日誌。發起 API 呼叫後日誌將顯示在此處。",
|
||||
"No user information available": "暫無用戶資訊",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "選擇模型並用規則衍生另一側名稱,產生「請求模型 → 上游模型」映射。",
|
||||
"Pick or create both a store and a product before saving.": "儲存前請同時選擇或建立店鋪和產品。",
|
||||
"Ping Interval (seconds)": "Ping 間隔(秒)",
|
||||
"Pinned + most used": "置頂 + 使用最多",
|
||||
"Pinned models": "置頂模型",
|
||||
"Plan": "套餐",
|
||||
"Plan amount is too low": "訂閱方案金額過低",
|
||||
"Plan ID": "方案 ID",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "圓角",
|
||||
"Random": "隨機",
|
||||
"Randomly select a key from the pool for each request": "每次請求從池中隨機選擇一個金鑰",
|
||||
"Rank by": "排序依據",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "目前排行榜數據為預覽用模擬數據,後端整合完成後將替換為真實分析數據。",
|
||||
"Rankings": "排行榜",
|
||||
"Rate Limit Windows": "速率限制窗口",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "使用 ID 排序",
|
||||
"Sort by priority to drag channels": "依優先級排序後可拖曳通道",
|
||||
"Sort channels by": "通道排序依據",
|
||||
"Sort method": "排序方式",
|
||||
"Sort Order": "排序",
|
||||
"Sort priority": "排序優先級",
|
||||
"Source": "來源",
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"Add param/header": "新增参数/Header",
|
||||
"Add payment method": "新增支付方式",
|
||||
"Add photos or files": "添加照片或文件",
|
||||
"Add pinned model": "添加置顶模型",
|
||||
"Add prefix": "添加前缀",
|
||||
"Add pricing branch": "添加计费分支",
|
||||
"Add product": "添加产品",
|
||||
@@ -1281,6 +1282,7 @@
|
||||
"Choose prices for the cache usage reported by the upstream. Standard writes, Claude 1-hour writes, and GPT 12-hour writes are separate categories.": "根据上游返回的用量选择计费项。普通写入、Claude 1 小时写入和 GPT 12 小时写入分别定价。",
|
||||
"Choose the bundle type and define the items inside it.": "选择捆绑包类型并定义其中的项目。",
|
||||
"Choose the default charts, range, and time granularity for model analytics.": "选择模型调用分析的默认图表、范围和时间粒度。",
|
||||
"Choose the default order of the model square. Users can still pick another sort.": "决定模型在模型广场里的默认顺序,用户仍可以自己切换排序。",
|
||||
"Choose the domain used when this Passkey was created, then try again.": "请选择创建此通行密钥时使用的域名,然后重试。",
|
||||
"Choose usage categories": "按上游用量配置",
|
||||
"Choose where to fetch upstream metadata.": "选择从何处获取上游元数据。",
|
||||
@@ -1815,6 +1817,7 @@
|
||||
"Current models for the longest channel in this tag. May not include all models from all channels.": "此标签中最长渠道的当前模型。可能不包括所有渠道的所有模型。",
|
||||
"Current models: {{count}}": "当前模型:{{count}} 个",
|
||||
"Current month": "本月",
|
||||
"Current order": "当前顺序",
|
||||
"Current Password": "当前密码",
|
||||
"Current password is incorrect.": "当前密码不正确。",
|
||||
"Current period price": "当前时段价格",
|
||||
@@ -2161,6 +2164,7 @@
|
||||
"Drag the handle to move a channel.": "按住左侧拖拽手柄移动渠道。",
|
||||
"Drag to change priority. Use arrow keys to move, Escape to cancel.": "拖拽调整优先级,也可使用方向键移动,Esc 取消。",
|
||||
"Drag to move": "拖动以移动",
|
||||
"Drag to reorder": "拖动调整顺序",
|
||||
"Drag to resize": "拖动以调整大小",
|
||||
"Drag to set channel priority": "拖拽调整渠道优先级",
|
||||
"Draw": "绘图",
|
||||
@@ -3445,6 +3449,7 @@
|
||||
"Invalid JSON in parameter override template": "参数覆盖模板中的 JSON 格式无效",
|
||||
"Invalid JSON string.": "无效的 JSON 字符串。",
|
||||
"Invalid model mapping format": "无效的模型映射格式",
|
||||
"Invalid model square order setting": "模型广场排序设置无效",
|
||||
"Invalid parameters": "无效的参数",
|
||||
"Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.": "通行密钥域名无效。请填写域名,不包含协议、端口、路径或通配符。",
|
||||
"Invalid Passkey login state": "Passkey 登录状态异常",
|
||||
@@ -3574,8 +3579,11 @@
|
||||
"Language preference saved": "语言偏好已保存",
|
||||
"Language Preferences": "语言偏好",
|
||||
"Language preferences sync across your signed-in devices and affect API error messages.": "语言偏好会同步到您登录的所有设备,并影响 API 错误消息语言。",
|
||||
"Last 1 day": "近 1 天",
|
||||
"Last 24h usage": "近 24 小时消耗",
|
||||
"Last 30 days": "近 30 天",
|
||||
"Last 30 days uptime": "近 30 天可用率",
|
||||
"Last 7 days": "近 7 天",
|
||||
"Last active {{time}} · Expires {{expires}}": "最后活跃于 {{time}} · 到期时间 {{expires}}",
|
||||
"Last check time": "上次检测时间",
|
||||
"Last detected addable models": "上次检测到可加入模型",
|
||||
@@ -3773,6 +3781,7 @@
|
||||
"Manage your security settings and account access": "管理您的安全设置和账户访问",
|
||||
"Mantle (Messages API)": "Mantle(Messages API)",
|
||||
"Manual Disabled": "手动禁用",
|
||||
"Manual order": "手动排序",
|
||||
"Map fields from the user info response to local user attributes. Supports nested paths (e.g. ocs.data.id).": "将用户信息响应中的字段映射到本地用户属性。支持嵌套路径(例如 ocs.data.id)。",
|
||||
"Map model identifiers to Gemini API versions. A `default` entry applies when no specific match is found.": "将模型标识符映射到 Gemini API 版本。当未找到特定匹配项时,将应用 `default` 条目。",
|
||||
"Map request model names to actual provider model names (JSON format)": "将请求模型名称映射到实际提供商模型名称 (JSON 格式)",
|
||||
@@ -3952,6 +3961,7 @@
|
||||
"Model name is too long: {{model}}": "模型名称过长:{{model}}",
|
||||
"Model names copied to clipboard": "模型名称已复制到剪贴板",
|
||||
"Model not found": "模型未找到",
|
||||
"Model order": "模型顺序",
|
||||
"Model performance metrics": "模型性能指标",
|
||||
"Model Price": "模型价格",
|
||||
"Model price {{model_price}}, group ratio {{group_ratio}}": "模型价格 {{model_price}},分组倍率 {{group_ratio}}",
|
||||
@@ -3978,6 +3988,7 @@
|
||||
"Model shown in model square": "已在模型广场显示",
|
||||
"Model source": "模型来源",
|
||||
"Model Square": "模型广场",
|
||||
"Model square order": "模型广场排序",
|
||||
"Model square visibility": "广场展示",
|
||||
"Model sync": "模型同步",
|
||||
"Model Tags": "模型标签",
|
||||
@@ -4009,6 +4020,7 @@
|
||||
"Models losing the most positions": "名次下滑最多的模型",
|
||||
"Models needing price updates: {{modelCount}}": "有 {{modelCount}} 个模型的价格需要处理",
|
||||
"Models not in list, may fail to invoke": "模型未加入列表,可能无法调用",
|
||||
"Models not in the list follow by name.": "没排进来的模型按名称排在后面。",
|
||||
"Models source": "模型来源",
|
||||
"Models that are being used but not configured in the system": "正在使用但未在系统中配置的模型",
|
||||
"Models that skip thinking suffix processing": "不自动处理思考后缀的模型",
|
||||
@@ -4039,6 +4051,9 @@
|
||||
"More templates...": "更多模板...",
|
||||
"More than 999 days left": "剩余超过 999 天",
|
||||
"More...": "更多...",
|
||||
"Most requests": "请求最多",
|
||||
"Most tokens": "Token 最多",
|
||||
"Most used": "使用最多",
|
||||
"Most-used models in the selected period and category": "所选时间范围与分类下使用率最高的模型",
|
||||
"Move": "移动",
|
||||
"Move {{group}} down": "将 {{group}} 下移",
|
||||
@@ -4379,6 +4394,7 @@
|
||||
"No uptime data available": "暂无可用率数据",
|
||||
"No Uptime Kuma groups yet. Click \"Add Group\" to create one.": "暂无 Uptime Kuma 分组。点击“添加分组”来创建一个。",
|
||||
"No uptime monitoring configured": "未配置正常运行时间监控",
|
||||
"No usage data, so models are ordered by name.": "没有用量数据,模型按名称排序。",
|
||||
"No usage guide for this version.": "这个版本没有使用说明。",
|
||||
"No usage logs available. Logs will appear here once API calls are made.": "暂无使用日志。发起 API 调用后日志将显示在此处。",
|
||||
"No user information available": "暂无用户信息",
|
||||
@@ -4899,6 +4915,8 @@
|
||||
"Pick models and derive the other side with a rule to create request-to-upstream mappings.": "选择模型并用规则派生另一侧名称,生成「请求模型 → 上游模型」映射。",
|
||||
"Pick or create both a store and a product before saving.": "保存前请同时选择或创建店铺和产品。",
|
||||
"Ping Interval (seconds)": "Ping 间隔(秒)",
|
||||
"Pinned + most used": "置顶 + 使用最多",
|
||||
"Pinned models": "置顶模型",
|
||||
"Plan": "套餐",
|
||||
"Plan amount is too low": "套餐金额过低",
|
||||
"Plan ID": "套餐 ID",
|
||||
@@ -5274,6 +5292,7 @@
|
||||
"Radius": "圆角",
|
||||
"Random": "随机",
|
||||
"Randomly select a key from the pool for each request": "每次请求从池中随机选择一个密钥",
|
||||
"Rank by": "按什么算",
|
||||
"Ranking data is currently simulated for preview purposes and will be replaced with live analytics once the backend integration ships.": "当前排行榜数据为预览用模拟数据,后端集成完成后将替换为真实分析数据。",
|
||||
"Rankings": "排行榜",
|
||||
"Rate Limit Windows": "速率限制窗口",
|
||||
@@ -6223,6 +6242,7 @@
|
||||
"Sort by ID": "使用 ID 排序",
|
||||
"Sort by priority to drag channels": "按优先级排序后可拖拽渠道",
|
||||
"Sort channels by": "渠道排序依据",
|
||||
"Sort method": "排序方式",
|
||||
"Sort Order": "排序",
|
||||
"Sort priority": "排序优先级",
|
||||
"Source": "来源",
|
||||
|
||||
Reference in new issue
Block a user