CI / test (push) Has been cancelled
Plan v0.2'nin Faz 0 çıktısı. Yazılan sıraya göre:
- cobra tabanlı CLI iskeleti; server/agent/ctl komutları henüz stub.
- internal/sim: OpenAI uyumlu sahte inference engine. Router'ı GPU olmadan
gerçekçi koşullarda test edebilmek için gerçek bir engine'in router
açısından önemli davranışlarını modeller:
* continuous batching ve KV blok muhasebesi (head-of-line blocking dahil)
* zincirlenmiş blok hash'leri + LRU ile otomatik prefix cache
* batch büyüdükçe artan token gecikmesi
* istemci koptuğunda isteğin düşürülüp blokların bırakılması
* vLLM metrik adlarıyla /metrics (plan §7.6 engine kontratı)
- Testler: prefix hash zincirlemesi, LRU tahliyesi, iptal propagasyonu,
kuyruklama, SSE formatı, usage/cached_tokens, metriklerin gerçek
Prometheus parser'ıyla okunabilirliği.
- Gitea Actions CI: gofmt, vet, race detector.
Modül yolu gitea.mynodes.xyz/ilker/llmgw; `make rename` ile değiştirilebilir.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package cli
|
||
|
||
import (
|
||
"errors"
|
||
|
||
"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)")
|
||
|
||
func newServerCmd() *cobra.Command {
|
||
var configPath string
|
||
cmd := &cobra.Command{
|
||
Use: "server",
|
||
Short: "Router + control plane (Faz 1-3)",
|
||
RunE: func(_ *cobra.Command, _ []string) error {
|
||
return errNotImplemented
|
||
},
|
||
}
|
||
cmd.Flags().StringVar(&configPath, "config", "server.yaml", "konfigürasyon dosyası")
|
||
return cmd
|
||
}
|
||
|
||
func newAgentCmd() *cobra.Command {
|
||
var configPath string
|
||
cmd := &cobra.Command{
|
||
Use: "agent",
|
||
Short: "GPU node'unda çalışan agent (Faz 2)",
|
||
RunE: func(_ *cobra.Command, _ []string) error {
|
||
return errNotImplemented
|
||
},
|
||
}
|
||
cmd.Flags().StringVar(&configPath, "config", "agent.yaml", "konfigürasyon dosyası")
|
||
return cmd
|
||
}
|
||
|
||
func newCtlCmd() *cobra.Command {
|
||
cmd := &cobra.Command{
|
||
Use: "ctl",
|
||
Short: "Yönetim CLI'ı (Faz 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)"},
|
||
} {
|
||
cmd.AddCommand(&cobra.Command{
|
||
Use: sub.use,
|
||
Short: sub.short,
|
||
RunE: func(_ *cobra.Command, _ []string) error { return errNotImplemented },
|
||
})
|
||
}
|
||
return cmd
|
||
}
|