Skip to content

Continue doesn't allow setting penalty parameters for Ollama provider #3053

Description

@0rzech

Before submitting your bug report

Relevant environment info

- Continue version: v0.8.58

Description

Ollama allows setting repeat_penalty, presence_penalty and frequency_penalty when doing API calls [1], neither of which can be used with it within Continue [2].

Also, available Ollama options [3] seem to be modelled after Model File [4] (which AFAIU is used to create models [5], not to make API calls), rather than API options from [1].

This is important, because Ollama sets repeat_penalty to 1.1 by default and instruction-tuned models should not penalize repetitions [6][7]. So to use these with Continue and Ollama, one has to create custom models just to hardcode this parameter.

  1. https://github.com/ollama/ollama/blob/a820d2b2673f7f8035e3a2a6f93c83af465f841c/docs/api.md#request-7
  2. private _getModelFileParams(options: CompletionOptions): ModelFileParams {
    return {
    temperature: options.temperature,
    top_p: options.topP,
    top_k: options.topK,
    num_predict: options.maxTokens,
    stop: options.stop,
    num_ctx: this.contextLength,
    mirostat: options.mirostat,
    num_thread: options.numThreads,
    use_mmap: options.useMmap,
    min_p: options.minP,
    };
    }
  3. // See https://github.com/ollama/ollama/blob/main/docs/modelfile.md for details on each parameter
    interface ModelFileParams {
    mirostat?: number;
    mirostat_eta?: number;
    mirostat_tau?: number;
    num_ctx?: number;
    repeat_last_n?: number;
    repeat_penalty?: number;
    temperature?: number;
    seed?: number;
    stop?: string | string[];
    tfs_z?: number;
    num_predict?: number;
    top_k?: number;
    top_p?: number;
    min_p?: number;
    // deprecated?
    num_thread?: number;
    use_mmap?: boolean;
    num_gqa?: number;
    num_gpu?: number;
    }
  4. https://github.com/ollama/ollama/blob/a820d2b2673f7f8035e3a2a6f93c83af465f841c/docs/modelfile.md#valid-parameters-and-values
  5. https://github.com/ollama/ollama/blob/a820d2b2673f7f8035e3a2a6f93c83af465f841c/docs/modelfile.md#ollama-model-file
  6. https://huggingface.co/google/gemma-2-2b-it-GGUF#gemma-model-card
  7. https://huggingface.co/google/gemma-7b-it/discussions/38#65d7b14adb51f7c160769fa1

To reproduce

No response

Log output

No response

Metadata

Metadata

Assignees

Labels

area:configurationRelates to configuration optionskind:bugIndicates an unexpected problem or unintended behaviorneeds-triagepriority:mediumIndicates medium priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions