(address: string)
| 445 | } |
| 446 | |
| 447 | public async checkServer(address: string): Promise<{ status: 'online' | 'offline'; error?: string }> { |
| 448 | try { |
| 449 | const response = await platformFetch(`${address}/v1/models`, { |
| 450 | method: 'GET', |
| 451 | headers: { 'Content-Type': 'application/json' }, |
| 452 | }); |
| 453 | |
| 454 | if (response.ok) { |
| 455 | return { status: 'online' }; |
| 456 | } |
| 457 | |
| 458 | return { |
| 459 | status: 'offline', |
| 460 | error: `Server responded with status ${response.status}` |
| 461 | }; |
| 462 | } catch (error) { |
| 463 | return { |
| 464 | status: 'offline', |
| 465 | error: 'Could not connect to server' |
| 466 | }; |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | // =========================================================================== |
| 471 | // Local Model Management (unified interface) |
no test coverage detected