Strata (github.com/Niko1221/Strata) keeps a mixture-of-experts model's experts in RAM and the ones used most in VRAM; on cuda01's RTX 6000 it serves Qwen3.8-Flash-Next 125B at 70-87 tokens a second to one client. - engines/strata.go: the adapter. The agent starts llmgw strata-serve, which runs Strata's setup the way its desktop app does (STRATA_CONTROL_INSTALL: installs nothing, writes only under the replica's and the node's directories) on the fetched GGUF files, points the configuration it writes at the installed engine, and execs Strata's server. The key goes in STRATA_API_KEY, never on a command line. - A profile's args go to setup: --family, --size (setup's --model, which is the source everywhere else), --context, --parallel, ... Flags that move files or pick the engine or GPU are refused. - provision: the source pinned by digest in a Python environment, and the release's prebuilt engine unpacked beside it, checked against the digest GitHub publishes: CUDA 13 (7.5+, driver 580) or CUDA 12.9 (6.0-8.9, driver 575). Python builds can now carry release assets. - Metrics are vLLM's names under /metrics/prometheus. - The catalog wants one card and a family, and a directory, not one .gguf. Opt-in: not in DefaultEngines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
1.9 KiB
Go
76 lines
1.9 KiB
Go
// Package cli builds llmgw's command line surface.
|
|
package cli
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/obs"
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/version"
|
|
)
|
|
|
|
type globalFlags struct {
|
|
logLevel string
|
|
logFormat string
|
|
}
|
|
|
|
var global globalFlags
|
|
|
|
// Root returns the root command with all subcommands attached.
|
|
func Root() *cobra.Command {
|
|
root := &cobra.Command{
|
|
Use: "llmgw",
|
|
Short: "LLM gateway for multi-fabric InfiniBand and heterogeneous GPU clusters",
|
|
Long: "llmgw serves LLMs running on your own GPU servers behind a single\n" +
|
|
"OpenAI-compatible endpoint. One binary, different roles per subcommand.",
|
|
Version: version.Version,
|
|
SilenceUsage: true,
|
|
SilenceErrors: true,
|
|
PersistentPreRun: func(_ *cobra.Command, _ []string) {
|
|
obs.Setup(obs.Options{Level: global.logLevel, Format: global.logFormat})
|
|
},
|
|
// Bare, in a terminal: the setup screens or the console. Otherwise
|
|
// the help, as before.
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
if interactive(cmd) {
|
|
return runHome(cmd)
|
|
}
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
|
|
pf := root.PersistentFlags()
|
|
pf.StringVar(&global.logLevel, "log-level", "info", "log level: debug|info|warn|error")
|
|
pf.StringVar(&global.logFormat, "log-format", "text", "log format: text|json")
|
|
|
|
root.AddCommand(
|
|
newServerCmd(),
|
|
newAgentCmd(),
|
|
newCtlCmd(),
|
|
newTenancyCmd(),
|
|
newUsersCmd(),
|
|
newOrgCmd(),
|
|
newMirrorCmd(),
|
|
newBundleCmd(),
|
|
newSimEngineCmd(),
|
|
newComfyUIGateCmd(),
|
|
newStrataServeCmd(),
|
|
newDoctorCmd(),
|
|
newNodeCmd(),
|
|
newSelfUpgradeCmd(),
|
|
newReleaseCmd(),
|
|
newJoinCmd(),
|
|
newFirewallCmd(),
|
|
newWipeCmd(),
|
|
newDocsCmd(),
|
|
)
|
|
// status, start, stop and restart: the whole system; service: this
|
|
// machine's services.
|
|
root.AddCommand(newSystemCmds()...)
|
|
root.AddCommand(newServiceCmd())
|
|
return root
|
|
}
|
|
|
|
func logger() *slog.Logger { return slog.Default() }
|