Ariver
2026-06-02 f4194105fe06baa18f0145cc59e1914f96f2d4cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package model
 
const (
    DefaultModelID = "sensevoice-zh"
)
 
type ModelProfile struct {
    ID                   string
    DisplayName          string
    BackendKind          string
    Tier                 string
    SupportedLanguageIDs []string
    RecommendedFor       []string
    Description          string
    ApproxSize           string
    DownloadURLs         []string
    InstallDirName       string
    LegacyDirNames       []string
    RequiredFiles        []RequiredFileRule
    ProviderOrder        []string
    NumThreads           int
}
 
type RequiredFileRule struct {
    Role     string
    AllOf    []string
    AnyOf    []string
    Required bool
}
 
type LanguageProfile struct {
    ID              string
    DisplayName     string
    UILocale        string
    SystemMatchers  []string
    DefaultModelID  string
    UpgradeModelIDs []string
}
 
type ModelInstallStatus string
 
const (
    ModelNotInstalled              ModelInstallStatus = "not_installed"
    ModelInstalledValid            ModelInstallStatus = "installed_valid"
    ModelInstalledIncomplete       ModelInstallStatus = "installed_incomplete"
    ModelStateInvalidFallbackFound ModelInstallStatus = "state_invalid_fallback_found"
    ModelStateInvalidNoFallback    ModelInstallStatus = "state_invalid_no_fallback"
)
 
type ResolvedModel struct {
    ModelID       string
    Profile       ModelProfile
    RootDir       string
    SourceDirKind string
    Files         map[string]string
    BackendKind   string
    ProviderOrder []string
    Status        ModelInstallStatus
    Missing       []string
    Problems      []string
}
 
func (r ResolvedModel) IsUsable() bool {
    return r.Status == ModelInstalledValid || r.Status == ModelStateInvalidFallbackFound
}