Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/llm/llms/Ollama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ class Ollama extends BaseLLM implements ModelInstaller {
return this.modelMap[this.model] ?? this.model;
}

get contextLength() {
const DEFAULT_OLLAMA_CONTEXT_LENGTH = 8192; // twice of https://github.com/ollama/ollama/blob/29ddfc2cab7f5a83a96c3133094f67b22e4f27d1/envconfig/config.go#L185
return this._contextLength ?? DEFAULT_OLLAMA_CONTEXT_LENGTH;
}

private _getModelFileParams(
options: CompletionOptions,
): OllamaModelFileParams {
Expand Down
1 change: 1 addition & 0 deletions packages/llm-info/src/providers/os.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const OsLlms: Omit<LlmInfo, "provider">[] = [
{
model: "starcoder2:3b",
displayName: "StarCoder 2 3B",
contextLength: 8192,
},
];
Loading