customize


Description:

public async string customize (Connection connection, Options options) throws Error

Customizes the model name based on options, creating a temporary model if needed.

Returns the model name to use for chat operations. If num_ctx is set (not auto), creates a temporary model variant with the specified context size. The temp model name follows the pattern: `ollmchat-temp/{base}-ctx{N}K` where N is num_ctx in K.

If the temp model already exists, it is reused. If it doesn't exist, it is created using the Ollama create API with a Modelfile containing FROM {base} and PARAMETER num_ctx.

Parameters:

connection

The connection to use for API calls

options

The options containing num_ctx setting

Returns:

The model name to use (either base name or temp model name)

Exceptions:

Error

if model creation fails