57 lines
2.3 KiB
PowerShell
57 lines
2.3 KiB
PowerShell
# Private-LLM Service - FastAPI Starter
|
|
# Powered by PowerOn
|
|
|
|
Write-Host "============================================================" -ForegroundColor Cyan
|
|
Write-Host " Private-LLM Service - KI-Dokumentenanalyse" -ForegroundColor White
|
|
Write-Host " Powered by PowerOn (FastAPI + Uvicorn)" -ForegroundColor Magenta
|
|
Write-Host "============================================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Ollama mit CORS starten (optional)
|
|
Write-Host "[1/3] Starte Ollama mit CORS-Freigabe..." -ForegroundColor Yellow
|
|
$env:OLLAMA_ORIGINS = "*"
|
|
|
|
# Versuche Ollama zu finden und zu starten
|
|
$ollamaPath = Get-Command ollama -ErrorAction SilentlyContinue
|
|
if ($ollamaPath) {
|
|
Start-Process -FilePath $ollamaPath.Source -ArgumentList "serve" -WindowStyle Minimized
|
|
Write-Host " Ollama gestartet" -ForegroundColor Green
|
|
} else {
|
|
# Fallback: Standard-Installationspfade pruefen
|
|
$defaultPaths = @(
|
|
"$env:LOCALAPPDATA\Programs\Ollama\ollama.exe",
|
|
"$env:ProgramFiles\Ollama\ollama.exe",
|
|
"C:\Users\$env:USERNAME\AppData\Local\Programs\Ollama\ollama.exe"
|
|
)
|
|
$found = $false
|
|
foreach ($path in $defaultPaths) {
|
|
if (Test-Path $path) {
|
|
Start-Process -FilePath $path -ArgumentList "serve" -WindowStyle Minimized
|
|
Write-Host " Ollama gestartet von: $path" -ForegroundColor Green
|
|
$found = $true
|
|
break
|
|
}
|
|
}
|
|
if (-not $found) {
|
|
Write-Host " Ollama nicht gefunden - bitte manuell starten!" -ForegroundColor Red
|
|
Write-Host " Setze OLLAMA_ORIGINS=* vor dem Start" -ForegroundColor Gray
|
|
}
|
|
}
|
|
|
|
Start-Sleep -Seconds 2
|
|
|
|
# Dependencies installieren
|
|
Write-Host "[2/3] Installiere Python Dependencies..." -ForegroundColor Yellow
|
|
pip install -r requirements.txt --quiet
|
|
|
|
Write-Host "[3/3] Starte FastAPI Server (Uvicorn)..." -ForegroundColor Yellow
|
|
Write-Host ""
|
|
Write-Host "Server URL: http://localhost:5000" -ForegroundColor Green
|
|
Write-Host "API Docs: http://localhost:5000/docs" -ForegroundColor Green
|
|
Write-Host "OpenAPI JSON: http://localhost:5000/openapi.json" -ForegroundColor Gray
|
|
Write-Host ""
|
|
Write-Host "Druecke Ctrl+C zum Beenden" -ForegroundColor Gray
|
|
Write-Host ""
|
|
|
|
# FastAPI Server mit Uvicorn starten
|
|
uvicorn app:app --host 0.0.0.0 --port 5000 --reload
|