mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-04 07:46:16 +02:00
fix(ai-chat): fixes to getExternalOllamaGpuInfo
getExternalOllamaGpuInfo — skip the container check and go straight to the URL if ai.remoteOllamaUrl is set getSystemInfo — in the OLLAMA_NOT_FOUND branch, also attempt the external probe instead of immediately giving up
This commit is contained in:
parent
94eea4484a
commit
632a4eca9a
|
|
@ -154,18 +154,22 @@ export class SystemService {
|
||||||
vram: number
|
vram: number
|
||||||
}> | null> {
|
}> | null> {
|
||||||
try {
|
try {
|
||||||
const containers = await this.dockerService.docker.listContainers({ all: false })
|
// If a remote Ollama URL is configured, use it directly without requiring a local container
|
||||||
const ollamaContainer = containers.find((c) => c.Names.includes(`/${SERVICE_NAMES.OLLAMA}`))
|
const remoteOllamaUrl = await KVStore.getValue('ai.remoteOllamaUrl')
|
||||||
if (!ollamaContainer) {
|
if (!remoteOllamaUrl) {
|
||||||
return null
|
const containers = await this.dockerService.docker.listContainers({ all: false })
|
||||||
|
const ollamaContainer = containers.find((c) => c.Names.includes(`/${SERVICE_NAMES.OLLAMA}`))
|
||||||
|
if (!ollamaContainer) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const actualImage = (ollamaContainer.Image || '').toLowerCase()
|
||||||
|
if (actualImage.includes('ollama/ollama') || actualImage.startsWith('ollama:')) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const actualImage = (ollamaContainer.Image || '').toLowerCase()
|
const ollamaUrl = remoteOllamaUrl || (await this.dockerService.getServiceURL(SERVICE_NAMES.OLLAMA))
|
||||||
if (actualImage.includes('ollama/ollama') || actualImage.startsWith('ollama:')) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const ollamaUrl = await this.dockerService.getServiceURL(SERVICE_NAMES.OLLAMA)
|
|
||||||
if (!ollamaUrl) {
|
if (!ollamaUrl) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
@ -354,7 +358,21 @@ export class SystemService {
|
||||||
gpuHealth.status = 'ok'
|
gpuHealth.status = 'ok'
|
||||||
gpuHealth.ollamaGpuAccessible = true
|
gpuHealth.ollamaGpuAccessible = true
|
||||||
} else if (nvidiaInfo === 'OLLAMA_NOT_FOUND') {
|
} else if (nvidiaInfo === 'OLLAMA_NOT_FOUND') {
|
||||||
gpuHealth.status = 'ollama_not_installed'
|
// No local Ollama container — check if a remote Ollama URL is configured
|
||||||
|
const externalOllamaGpu = await this.getExternalOllamaGpuInfo()
|
||||||
|
if (externalOllamaGpu) {
|
||||||
|
graphics.controllers = externalOllamaGpu.map((gpu) => ({
|
||||||
|
model: gpu.model,
|
||||||
|
vendor: gpu.vendor,
|
||||||
|
bus: '',
|
||||||
|
vram: gpu.vram,
|
||||||
|
vramDynamic: false,
|
||||||
|
}))
|
||||||
|
gpuHealth.status = 'ok'
|
||||||
|
gpuHealth.ollamaGpuAccessible = true
|
||||||
|
} else {
|
||||||
|
gpuHealth.status = 'ollama_not_installed'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const externalOllamaGpu = await this.getExternalOllamaGpuInfo()
|
const externalOllamaGpu = await this.getExternalOllamaGpuInfo()
|
||||||
if (externalOllamaGpu) {
|
if (externalOllamaGpu) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user