Comments, doc comments, test names, error and log messages, CLI help, README, Makefile, CI step names and the design document are now all in English. No behaviour changes; the full suite passes under the race detector. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b7417e1a69
commit
28029eb43b
21 files changed
+910
-869
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Package cli, llmgw'nin komut satırı yüzeyini kurar.
|
||||
// Package cli builds llmgw's command line surface.
|
||||
package cli
|
||||
|
||||
import (
|
||||
@@ -17,13 +17,13 @@ type globalFlags struct {
|
||||
|
||||
var global globalFlags
|
||||
|
||||
// Root, kök komutu ve tüm alt komutları döner.
|
||||
// Root returns the root command with all subcommands attached.
|
||||
func Root() *cobra.Command {
|
||||
root := &cobra.Command{
|
||||
Use: "llmgw",
|
||||
Short: "Çoklu IB fabric ve heterojen GPU için LLM gateway",
|
||||
Long: "llmgw, kendi GPU sunucularında çalışan LLM'leri tek bir OpenAI uyumlu\n" +
|
||||
"uç noktadan sunar. Tek binary, alt komutla farklı roller.",
|
||||
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,
|
||||
@@ -33,8 +33,8 @@ func Root() *cobra.Command {
|
||||
}
|
||||
|
||||
pf := root.PersistentFlags()
|
||||
pf.StringVar(&global.logLevel, "log-level", "info", "log seviyesi: debug|info|warn|error")
|
||||
pf.StringVar(&global.logFormat, "log-format", "text", "log biçimi: text|json")
|
||||
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(),
|
||||
|
||||
+19
-19
@@ -20,10 +20,10 @@ func newSimEngineCmd() *cobra.Command {
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "sim-engine",
|
||||
Short: "OpenAI uyumlu sahte inference engine (test için)",
|
||||
Long: "Gerçek bir engine'in router açısından önemli davranışlarını simüle eder:\n" +
|
||||
"continuous batching, KV blok muhasebesi, prefix cache, vLLM formatında /metrics.\n" +
|
||||
"Router'ı GPU olmadan test etmek için kullanılır.",
|
||||
Short: "OpenAI-compatible fake inference engine (for testing)",
|
||||
Long: "Simulates the engine behaviours that matter to the router:\n" +
|
||||
"continuous batching, KV block accounting, prefix caching, and vLLM-shaped\n" +
|
||||
"/metrics. Lets the router be developed and tested without GPUs.",
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
log := logger()
|
||||
eng := sim.New(cfg)
|
||||
@@ -39,7 +39,7 @@ func newSimEngineCmd() *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info("sim-engine dinliyor",
|
||||
log.Info("sim-engine listening",
|
||||
"addr", ln.Addr().String(),
|
||||
"model", cfg.Model,
|
||||
"max_num_seqs", cfg.MaxNumSeqs,
|
||||
@@ -60,7 +60,7 @@ func newSimEngineCmd() *cobra.Command {
|
||||
}
|
||||
return err
|
||||
case <-ctx.Done():
|
||||
log.Info("kapanıyor")
|
||||
log.Info("shutting down")
|
||||
shutCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
return srv.Shutdown(shutCtx)
|
||||
@@ -69,19 +69,19 @@ func newSimEngineCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
f := cmd.Flags()
|
||||
f.StringVar(&listen, "listen", ":8000", "dinlenecek adres")
|
||||
f.StringVar(&cfg.Model, "model", cfg.Model, "sunulan model adı")
|
||||
f.IntVar(&cfg.MaxNumSeqs, "max-num-seqs", cfg.MaxNumSeqs, "eşzamanlı dizi sayısı (batch kapasitesi)")
|
||||
f.IntVar(&cfg.BlockSize, "block-size", cfg.BlockSize, "KV blok başına token")
|
||||
f.IntVar(&cfg.NumGPUBlocks, "num-gpu-blocks", cfg.NumGPUBlocks, "toplam KV cache bloğu")
|
||||
f.IntVar(&cfg.PrefixCacheBlocks, "prefix-cache-blocks", cfg.PrefixCacheBlocks, "prefix cache blok kapasitesi (0=kapalı)")
|
||||
f.Float64Var(&cfg.PrefillTokensPerSec, "prefill-tps", cfg.PrefillTokensPerSec, "prefill hızı (token/sn, engine geneli)")
|
||||
f.Float64Var(&cfg.DecodeTokensPerSec, "decode-tps", cfg.DecodeTokensPerSec, "tek dizi decode hızı (token/sn)")
|
||||
f.Float64Var(&cfg.BatchContention, "batch-contention", cfg.BatchContention, "batch'teki her ek dizinin yavaşlatma katsayısı")
|
||||
f.IntVar(&cfg.DefaultOutputTokens, "default-output-tokens", cfg.DefaultOutputTokens, "max_tokens verilmezse üretilecek token")
|
||||
f.DurationVar(&cfg.Tick, "tick", cfg.Tick, "simülasyon adımı")
|
||||
f.Float64Var(&cfg.FailRate, "fail-rate", 0, "isteklerin yapay hata oranı (kaos testi)")
|
||||
f.Int64Var(&cfg.Seed, "seed", 0, "rastgelelik tohumu (0=zaman)")
|
||||
f.StringVar(&listen, "listen", ":8000", "address to listen on")
|
||||
f.StringVar(&cfg.Model, "model", cfg.Model, "model name to serve")
|
||||
f.IntVar(&cfg.MaxNumSeqs, "max-num-seqs", cfg.MaxNumSeqs, "concurrent sequences (continuous batch capacity)")
|
||||
f.IntVar(&cfg.BlockSize, "block-size", cfg.BlockSize, "tokens per KV cache block")
|
||||
f.IntVar(&cfg.NumGPUBlocks, "num-gpu-blocks", cfg.NumGPUBlocks, "total KV cache blocks")
|
||||
f.IntVar(&cfg.PrefixCacheBlocks, "prefix-cache-blocks", cfg.PrefixCacheBlocks, "prefix cache capacity in blocks (0 disables)")
|
||||
f.Float64Var(&cfg.PrefillTokensPerSec, "prefill-tps", cfg.PrefillTokensPerSec, "prefill rate in tokens/sec, shared engine-wide")
|
||||
f.Float64Var(&cfg.DecodeTokensPerSec, "decode-tps", cfg.DecodeTokensPerSec, "single-sequence decode rate in tokens/sec")
|
||||
f.Float64Var(&cfg.BatchContention, "batch-contention", cfg.BatchContention, "per-extra-sequence decode slowdown factor")
|
||||
f.IntVar(&cfg.DefaultOutputTokens, "default-output-tokens", cfg.DefaultOutputTokens, "tokens generated when max_tokens is absent")
|
||||
f.DurationVar(&cfg.Tick, "tick", cfg.Tick, "simulation step")
|
||||
f.Float64Var(&cfg.FailRate, "fail-rate", 0, "fraction of requests failed artificially (chaos testing)")
|
||||
f.Int64Var(&cfg.Seed, "seed", 0, "random seed (0 = time-based)")
|
||||
|
||||
return cmd
|
||||
}
|
||||
+12
-12
@@ -6,19 +6,19 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// errNotImplemented, henüz yazılmamış fazların komutları için.
|
||||
var errNotImplemented = errors.New("bu komut henüz uygulanmadı (bkz. llmgw-plan.md §11)")
|
||||
// errNotImplemented marks commands belonging to phases not yet built.
|
||||
var errNotImplemented = errors.New("not implemented yet (see llmgw-plan.md §11)")
|
||||
|
||||
func newServerCmd() *cobra.Command {
|
||||
var configPath string
|
||||
cmd := &cobra.Command{
|
||||
Use: "server",
|
||||
Short: "Router + control plane (Faz 1-3)",
|
||||
Short: "Router and control plane (phases 1-3)",
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
return errNotImplemented
|
||||
},
|
||||
}
|
||||
cmd.Flags().StringVar(&configPath, "config", "server.yaml", "konfigürasyon dosyası")
|
||||
cmd.Flags().StringVar(&configPath, "config", "server.yaml", "configuration file")
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -26,26 +26,26 @@ func newAgentCmd() *cobra.Command {
|
||||
var configPath string
|
||||
cmd := &cobra.Command{
|
||||
Use: "agent",
|
||||
Short: "GPU node'unda çalışan agent (Faz 2)",
|
||||
Short: "Node agent running on each GPU host (phase 2)",
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
return errNotImplemented
|
||||
},
|
||||
}
|
||||
cmd.Flags().StringVar(&configPath, "config", "agent.yaml", "konfigürasyon dosyası")
|
||||
cmd.Flags().StringVar(&configPath, "config", "agent.yaml", "configuration file")
|
||||
return cmd
|
||||
}
|
||||
|
||||
func newCtlCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "ctl",
|
||||
Short: "Yönetim CLI'ı (Faz 3)",
|
||||
Short: "Administrative CLI (phase 3)",
|
||||
}
|
||||
for _, sub := range []struct{ use, short string }{
|
||||
{"nodes", "node'ları listele"},
|
||||
{"models", "model kataloğunu göster"},
|
||||
{"replicas", "replikaları listele"},
|
||||
{"explain-placement", "bir modelin neden yerleştirilemediğini açıkla"},
|
||||
{"bench", "profil kapasitesini ölç (§10)"},
|
||||
{"nodes", "list nodes"},
|
||||
{"models", "show the model catalog"},
|
||||
{"replicas", "list replicas"},
|
||||
{"explain-placement", "explain why a model could not be placed"},
|
||||
{"bench", "measure profile capacity (§10)"},
|
||||
} {
|
||||
cmd.AddCommand(&cobra.Command{
|
||||
Use: sub.use,
|
||||
|
||||
Reference in new issue
Block a user