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.
| connection |
The connection to use for API calls |
| options |
The options containing num_ctx setting |
|
The model name to use (either base name or temp model name) |
| Error |
if model creation fails |