Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
Fix case for NumCtx
Daniel Hiltgencff3f44f4a40
diff --git a/server/sched.go b/server/sched.goindex 87da1db47..71b535ae2 100644--- a/server/sched.go+++ b/server/sched.go@@ -23,7 +23,7 @@ type LlmRequest struct {ctx context.Context //nolint:containedctxmodel *Modelopts api.Options- origNumCTX int // Track the initial ctx request+ origNumCtx int // Track the initial ctx requestsessionDuration time.DurationsuccessCh chan *runnerReferrCh chan error@@ -118,8 +118,8 @@ func (s *Scheduler) processPending(ctx context.Context) {case pending := <-s.pendingReqCh:// Block other requests until we get this pending request runningpending.schedAttempts++- if pending.origNumCTX == 0 {- pending.origNumCTX = pending.opts.NumCtx+ if pending.origNumCtx == 0 {+ pending.origNumCtx = pending.opts.NumCtx}if pending.ctx.Err() != nil {@@ -135,7 +135,7 @@ func (s *Scheduler) processPending(ctx context.Context) {}// Keep NumCtx and numParallel in syncif numParallel > 1 {- pending.opts.NumCtx = pending.origNumCTX * numParallel+ pending.opts.NumCtx = pending.origNumCtx * numParallel}for {@@ -197,7 +197,7 @@ func (s *Scheduler) processPending(ctx context.Context) {// simplifying assumption of defaultParallel when in CPU modeif numParallel <= 0 {numParallel = defaultParallel- pending.opts.NumCtx = pending.origNumCTX * numParallel+ pending.opts.NumCtx = pending.origNumCtx * numParallel}if loadedCount == 0 {@@ -691,7 +691,7 @@ func pickBestFitGPUs(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numP// First attempt to fit the model into a single GPUfor _, p := range numParallelToTry {- req.opts.NumCtx = req.origNumCTX * p+ req.opts.NumCtx = req.origNumCtx * pif !envconfig.SchedSpread {for _, g := range sgl {if ok, estimatedVRAM = llm.PredictServerFit([]gpu.GpuInfo{g}, ggml, req.model.AdapterPaths, req.model.ProjectorPaths, req.opts); ok {@@ -709,7 +709,7 @@ func pickBestFitGPUs(req *LlmRequest, ggml *llm.GGML, gpus gpu.GpuInfoList, numP// Now try all the GPUsfor _, p := range numParallelToTry {- req.opts.NumCtx = req.origNumCTX * p+ req.opts.NumCtx = req.origNumCtx * pif ok, estimatedVRAM = llm.PredictServerFit(sgl, ggml, req.model.AdapterPaths, req.model.ProjectorPaths, req.opts); ok {slog.Info("new model will fit in available VRAM, loading", "model", req.model.ModelPath, "library", sgl[0].Library, "parallel", p, "required", format.HumanBytes2(estimatedVRAM))*numParallel = p