ilkerandClaude Opus 5 b7417e1a69 Phase 1 (1/2): scheduler pipeline, endpoint registry, metric scraping
The code behind plan §7.3-7.6:

- breaker: folds cooldown and circuit breaking into one component
  (FailureThreshold=1 gives LiteLLM-style cooldown), with exponential backoff
  and half-open probes.
- endpoint: live state registry. Inflight counting, staleness detection, drain
  rate derived from counters. A scrape failure does not trip the breaker — the
  engine may be serving fine while only its metrics endpoint is down.
- scrape: parses the §7.6 metric contract. Errors when any of the mandatory
  three is missing; the metric name mapping is overridable, since names drift
  between versions (plan §14).
- scheduler: the filter -> score -> pick pipeline. A "strategy" is now just a
  set of scorer weights; chat, batch and long-context are the same code with
  different weights. Scorers: queue, kv (hard penalty above the ceiling),
  inflight, load, weight, session (bounded-load consistent hashing). Pickers:
  max-score, p2c, softmax, round-robin.

Decision carries the rationale — which scorer produced what, which filter
dropped how many. Tuning the weights without that is guesswork.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 01:15:21 +02:00
2026-09-16 01:00:03 +02:00
2026-09-16 01:00:03 +02:00
2026-09-16 01:00:03 +02:00
2026-09-16 01:00:03 +02:00
2026-09-16 01:00:03 +02:00
2026-09-16 01:00:03 +02:00

llmgw

Çoklu InfiniBand fabric ve heterojen GPU için tek binary LLM gateway.

Kendi GPU sunucularında çalışan LLM'leri (vLLM / SGLang) tek bir OpenAI uyumlu uç noktadan sunar. Tasarım dokümanı: llmgw-plan.md.

Durum

Faz Kapsam Durum
0 İskelet + sim-engine ✅
1 Statik router (filter/score/pick, streaming proxy) ⬜
1.5 Admission control (öncelik bantları) ⬜
2 Agent: GPU/IB keşfi, tek-node engine ⬜
3 Control plane: katalog, scheduler, reconciler ⬜
4 Multi-node & fabric farkındalığı ⬜
5 Tenancy, prefix affinity, bench ⬜

Kurulum

make build      # bin/llmgw
make test       # birim testleri
make race       # yarış dedektörüyle

sim-engine

Gerçek bir inference engine'in router açısından önemli davranışlarını simüle eder; GPU olmadan geliştirme ve test yapabilmek için. Modellediği şeyler:

  • continuous batching (sınırlı eşzamanlı dizi sayısı)
  • KV cache blok muhasebesi; blok yetmediğinde kuyruğa alma (head-of-line blocking dahil)
  • otomatik prefix cache (zincirlenmiş blok hash'leri + LRU) ve cache hit'in TTFT'ye etkisi
  • batch büyüdükçe token başına gecikmenin artması
  • istemci koptuğunda isteğin batch'ten düşürülüp blokların bırakılması
  • vLLM metrik adlarıyla /metrics
./bin/llmgw sim-engine --listen :8000 --model llama-3.3-70b

curl -N localhost:8000/v1/chat/completions \
  -H 'content-type: application/json' \
  -d '{"messages":[{"role":"user","content":"merhaba"}],"max_tokens":8,"stream":true}'

Yük/gecikme davranışını ayarlamak için: --max-num-seqs, --num-gpu-blocks, --prefill-tps, --decode-tps, --batch-contention, --prefix-cache-blocks. Kaos testleri için: --fail-rate, deterministik koşu için --seed.

Engine metrik kontratı

Router'ın yönlendirme yapabilmesi için bir engine'in vermesi zorunlu üç metrik (plan §7.6). sim-engine bunları gerçek vLLM adlarıyla yayınlar:

vllm:num_requests_running
vllm:num_requests_waiting
vllm:kv_cache_usage_perc

Modül yolu

gitea.mynodes.xyz/ilker/llmgw. Değiştirmek için:

make rename NEW=git.ornek.com/ekip/llmgw
S
Description
No description provided
Readme
26 MiB
0 Stars 2 Watchers 1 Forks
v0.16.3
Latest
2026-11-03 09:56:29 +01:00
Languages
Go 81.1%
JavaScript 15.2%
HTML 2.6%
CSS 0.6%
Python 0.2%
Other 0.2%