Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
api: remove unused sampling parameters (#10581)
Jeffrey Morganfa9973cd7f51
diff --git a/api/types.go b/api/types.goindex 5e838f886..602f93da8 100644--- a/api/types.go+++ b/api/types.go@@ -271,9 +271,6 @@ type Options struct {RepeatPenalty float32 `json:"repeat_penalty,omitempty"`PresencePenalty float32 `json:"presence_penalty,omitempty"`FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`- Mirostat int `json:"mirostat,omitempty"`- MirostatTau float32 `json:"mirostat_tau,omitempty"`- MirostatEta float32 `json:"mirostat_eta,omitempty"`Stop []string `json:"stop,omitempty"`}@@ -648,9 +645,6 @@ func DefaultOptions() Options {RepeatPenalty: 1.1,PresencePenalty: 0.0,FrequencyPenalty: 0.0,- Mirostat: 0,- MirostatTau: 5.0,- MirostatEta: 0.1,Seed: -1,Runner: Runner{diff --git a/docs/api.md b/docs/api.mdindex df5edff6d..b2b11573d 100644--- a/docs/api.md+++ b/docs/api.md@@ -394,9 +394,6 @@ curl http://localhost:11434/api/generate -d '{"repeat_penalty": 1.2,"presence_penalty": 1.5,"frequency_penalty": 1.0,- "mirostat": 1,- "mirostat_tau": 0.8,- "mirostat_eta": 0.6,"penalize_newline": true,"stop": ["\n", "user:"],"numa": false,diff --git a/docs/modelfile.md b/docs/modelfile.mdindex a71183f40..6513873ce 100644--- a/docs/modelfile.md+++ b/docs/modelfile.md@@ -150,9 +150,6 @@ PARAMETER <parameter> <parametervalue>| Parameter | Description | Value Type | Example Usage || -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------------------- |-| mirostat | Enable Mirostat sampling for controlling perplexity. (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0) | int | mirostat 0 |-| mirostat_eta | Influences how quickly the algorithm responds to feedback from the generated text. A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive. (Default: 0.1) | float | mirostat_eta 0.1 |-| mirostat_tau | Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0) | float | mirostat_tau 5.0 || num_ctx | Sets the size of the context window used to generate the next token. (Default: 2048) | int | num_ctx 4096 || repeat_last_n | Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx) | int | repeat_last_n 64 || repeat_penalty | Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1) | float | repeat_penalty 1.1 |diff --git a/llama/llama.go b/llama/llama.goindex 40598f518..3e157c0ac 100644--- a/llama/llama.go+++ b/llama/llama.go@@ -587,9 +587,6 @@ type SamplingParams struct {PenaltyRepeat float32PenaltyFreq float32PenaltyPresent float32- Mirostat int- MirostatTau float32- MirostatEta float32PenalizeNl boolSeed uint32Grammar string@@ -606,9 +603,6 @@ func NewSamplingContext(model *Model, params SamplingParams) (*SamplingContext,cparams.penalty_repeat = C.float(params.PenaltyRepeat)cparams.penalty_freq = C.float(params.PenaltyFreq)cparams.penalty_present = C.float(params.PenaltyFreq)- cparams.mirostat = C.int32_t(params.Mirostat)- cparams.mirostat_tau = C.float(params.MirostatTau)- cparams.mirostat_eta = C.float(params.MirostatEta)cparams.seed = C.uint32_t(params.Seed)grammar := C.CString(params.Grammar)diff --git a/llama/sampling_ext.cpp b/llama/sampling_ext.cppindex 6a025c906..78b889bd7 100644--- a/llama/sampling_ext.cpp+++ b/llama/sampling_ext.cpp@@ -19,9 +19,6 @@ struct common_sampler *common_sampler_cinit(const struct llama_model *model, strsparams.penalty_repeat = params->penalty_repeat;sparams.penalty_freq = params->penalty_freq;sparams.penalty_present = params->penalty_present;- sparams.mirostat = params->mirostat;- sparams.mirostat_tau = params->mirostat_tau;- sparams.mirostat_eta = params->mirostat_eta;sparams.seed = params->seed;sparams.grammar = params->grammar;sparams.xtc_probability = 0.0;diff --git a/llama/sampling_ext.h b/llama/sampling_ext.hindex a9e610ba2..3302e6efa 100644--- a/llama/sampling_ext.h+++ b/llama/sampling_ext.h@@ -20,9 +20,6 @@ extern "C"float penalty_repeat;float penalty_freq;float penalty_present;- int32_t mirostat;- float mirostat_tau;- float mirostat_eta;uint32_t seed;char *grammar;};diff --git a/parser/parser.go b/parser/parser.goindex 7c94d2002..96eae9c04 100644--- a/parser/parser.go+++ b/parser/parser.go@@ -46,6 +46,9 @@ var deprecatedParameters = []string{"logits_all","vocab_only","use_mlock",+ "mirostat",+ "mirostat_tau",+ "mirostat_eta",}// CreateRequest creates a new *api.CreateRequest from an existing Modelfilediff --git a/parser/parser_test.go b/parser/parser_test.goindex c848479c6..7d5a808ba 100644--- a/parser/parser_test.go+++ b/parser/parser_test.go@@ -492,9 +492,6 @@ func TestParseFileParameters(t *testing.T) {"repeat_penalty 1.0": {"repeat_penalty", "1.0"},"presence_penalty 1.0": {"presence_penalty", "1.0"},"frequency_penalty 1.0": {"frequency_penalty", "1.0"},- "mirostat 1": {"mirostat", "1"},- "mirostat_tau 1.0": {"mirostat_tau", "1.0"},- "mirostat_eta 1.0": {"mirostat_eta", "1.0"},"penalize_newline true": {"penalize_newline", "true"},"stop ### User:": {"stop", "### User:"},"stop ### User: ": {"stop", "### User:"},diff --git a/runner/llamarunner/runner.go b/runner/llamarunner/runner.goindex 5b7d6c317..5341d4fb1 100644--- a/runner/llamarunner/runner.go+++ b/runner/llamarunner/runner.go@@ -583,9 +583,6 @@ func (s *Server) completion(w http.ResponseWriter, r *http.Request) {PenaltyRepeat: req.Options.RepeatPenalty,PenaltyFreq: req.Options.FrequencyPenalty,PenaltyPresent: req.Options.PresencePenalty,- Mirostat: req.Options.Mirostat,- MirostatTau: req.Options.MirostatTau,- MirostatEta: req.Options.MirostatEta,Seed: uint32(req.Options.Seed),Grammar: req.Grammar,}