aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-ollama.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-06 06:00:27 +0200
committerAgando <roduccomm@gmail.com>2026-06-06 06:00:27 +0200
commitccc7d9956559d2195e20345e7a794662b52cd403 (patch)
tree757354fbfec5c75b4577b2cb620d5ab1582e19b1 /modules/core/module-ollama.js
parentb538577cd0a4292e4cd4ca1c9f9829fc7e133caa (diff)
auto: 2026-06-06_06:00 changes
Diffstat (limited to 'modules/core/module-ollama.js')
-rw-r--r--modules/core/module-ollama.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/core/module-ollama.js b/modules/core/module-ollama.js
index ba8ad57..aec52d4 100644
--- a/modules/core/module-ollama.js
+++ b/modules/core/module-ollama.js
@@ -30,9 +30,8 @@ class OllamaModule {
this.terminal.updateOllamaStatus();
};
this.commands['ollamamodels'] = () => {
- const models = this.terminal.ollamaManager.getModels();
- if(models.length === 0) return this.terminal.print("No models found. Connect first.");
- models.forEach(m => this.terminal.print(`${m.name} (${(m.size/1e9).toFixed(1)}GB)`));
+ // Redirect to the consolidated models command
+ this.listModels();
};
this.commands['ollamasetmodel'] = (args) => {
if(!args[0]) return this.terminal.print("Usage: ollamasetmodel <name>", 'warning');
@@ -62,7 +61,7 @@ class OllamaModule {
this.commands['model-run'] = (args) => this.runModel(args);
}
async listModels() {
- const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434';
+ const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434';
try {
const response = await fetch(`${endpoint}/api/tags`);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
@@ -95,7 +94,7 @@ class OllamaModule {
if (!args[0]) {
this.terminal.print("Usage: model-info <model-name>", "warning"); return;
}
- const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434';
+ const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434';
try {
const response = await fetch(`${endpoint}/api/show`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },