feat: Ollama models command, with load/pull/delete and unload (#16)

This commit was merged in pull request #16.
This commit is contained in:
2026-10-05 09:43:00 +00:00
parent 05fd9ff13b
commit 26e05dea5b
22 changed files with 1948 additions and 65 deletions
+19
View File
@@ -3,10 +3,29 @@
export const DEFAULT_HOST = "https://ollama.com";
export const DEFAULT_MODEL = "gpt-oss:120b";
/**
* Hosts that run the models themselves rather than handing them to a server.
*
* Only these can be managed: `pull` and `delete` are operations on a machine the
* user controls, and against Ollama Cloud there is nothing to pull or remove.
*/
export const CLOUD_HOSTNAMES = new Set(["ollama.com", "api.ollama.com"]);
/** LocalStorage keys. The index is small; each session body gets its own key so saving one never rewrites the others. */
export const STORAGE_INDEX_KEY = "lam.sessions.index";
export const STORAGE_SESSION_PREFIX = "lam.session.";
/**
* The model picked in the Models command.
*
* Separate from the `model` preference because an extension cannot write its own
* preferences: Vicinae reads them once at startup and holds them in memory, so
* writing the config file has no effect until it restarts (verified against
* 0.29.1). A selection in LocalStorage takes effect immediately instead, which is
* the whole point of picking a model from a list.
*/
export const STORAGE_MODEL_KEY = "lam.model.selected";
/**
* How many rounds of tool calls one turn may spend before the model is told to
* answer with what it has.