Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli/cmd/geniex/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func serve() *cobra.Command {
serveCmd.Flags().String("host", "127.0.0.1:18181", "Default server address (env: GENIEX_HOST)")
serveCmd.Flags().String("origins", "*", "Default CORS origins (env: GENIEX_ORIGINS)")
serveCmd.Flags().Int("keepalive", 300, "Keepalive seconds (env: GENIEX_KEEPALIVE)")
serveCmd.Flags().String("webui-dir", "", "Serve a llama.cpp Web UI static build from this directory (env: GENIEX_WEBUIDIR)")
serveCmd.Flags().String("model", "", "Default model for requests that omit model (env: GENIEX_MODEL)")
// Model-load defaults applied when a request omits them (llama_cpp only;
// per-request body fields still override).
serveCmd.Flags().Int32("nctx", 4096, "Default context window size, llama_cpp only (env: GENIEX_NCTX)")
Expand All @@ -43,6 +45,8 @@ func serve() *cobra.Command {
viper.BindPFlag("host", serveCmd.Flags().Lookup("host"))
viper.BindPFlag("origins", serveCmd.Flags().Lookup("origins"))
viper.BindPFlag("keepalive", serveCmd.Flags().Lookup("keepalive"))
viper.BindPFlag("webuidir", serveCmd.Flags().Lookup("webui-dir"))
viper.BindPFlag("model", serveCmd.Flags().Lookup("model"))
viper.BindPFlag("nctx", serveCmd.Flags().Lookup("nctx"))
viper.BindPFlag("ngl", serveCmd.Flags().Lookup("ngl"))
viper.BindPFlag("compute", serveCmd.Flags().Lookup("compute"))
Expand Down
4 changes: 4 additions & 0 deletions cli/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Config struct {
Host string // Server host and port (default: "127.0.0.1:18181")
Origins string // Allowed CORS origins (default: "*")
KeepAlive int64 // Connection keep-alive timeout in seconds (default: 300)
WebUIDir string // Optional llama.cpp Web UI static build directory
Model string // Default model for requests that omit the model field
// Model-load defaults applied when a request omits them (llama_cpp only;
// per-request body fields still override). Compute is the alias resolved by
// the SDK (sdk/src/device.cpp); empty means the SDK's own default.
Expand All @@ -40,6 +42,8 @@ func init() {
// ENV only param need to set default here
viper.SetDefault("hftoken", "") // Default empty token
viper.SetDefault("log", "none") // Default log level
viper.SetDefault("webuidir", "")
viper.SetDefault("model", "")

viper.SetEnvPrefix("geniex")
viper.AutomaticEnv()
Expand Down
2 changes: 2 additions & 0 deletions cli/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ go_library(
srcs = [
"route.go",
"server.go",
"webui.go",
],
importpath = "github.com/qualcomm/GenieX/cli/server",
visibility = ["//visibility:public"],
Expand All @@ -26,4 +27,5 @@ go_cgo_test(
"server_test.go",
],
embed = [":server"],
deps = ["@com_github_gin_gonic_gin//:gin"],
)
1 change: 1 addition & 0 deletions cli/server/handler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ go_cgo_test(
name = "handler_test",
srcs = ["package_test.go"],
embed = [":handler"],
deps = ["//bindings/go:geniex_sdk_go"],
)
Loading