Tip: only Ollama models in adapters list #1138
ColdSpirit0
started this conversation in
Adapters
Replies: 1 comment 1 reply
-
By default, the Ollama adapter only shows models that you have installed, via Ollama: schema = {
---@type CodeCompanion.Schema
model = {
order = 1,
mapping = "parameters",
type = "enum",
desc = "ID of the model to use.",
default = function(self)
return get_models(self, { last = true })
end,
choices = function(self)
return get_models(self)
end,
},
-- More schema options
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I don't use any API except Ollama so I needed to remove all other adapters and keep only the model list. To achieve this, I created a separate adapter for each Ollama model. I'm not sure this is the best way to do it, but it works for me. My Ollama instance is installed locally, so if you're using a separate server, you'll need to update the URL accordingly.
I also retrieve the
context_length
for each model and set it as thenum_ctx
option, allowing the model to use the maximum possible context size instead of just 2048. You can adjust this in the preset if needed.Configuration
Beta Was this translation helpful? Give feedback.
All reactions