Files
sovereign_ai/SovereignAI-Starter/start-api.ps1
T

23 lines
885 B
PowerShell

$ErrorActionPreference = 'Stop'
$project = Split-Path -Parent $MyInvocation.MyCommand.Path
$env:GROQ_API_KEY = if ($env:GROQ_API_KEY) {
$env:GROQ_API_KEY
} else {
[Environment]::GetEnvironmentVariable('GROQ_API_KEY', 'User')
}
if ($env:GROQ_API_KEY) {
Write-Host 'Groq transcription: configured (key hidden)'
} else {
Write-Warning 'GROQ_API_KEY is not configured; local chat works, but voice transcription will return 503.'
}
$ollama = Invoke-RestMethod -Uri 'http://127.0.0.1:11434/api/tags' -TimeoutSec 5
$model = if ($env:LOCAL_MODEL) {
$env:LOCAL_MODEL
} else {
'qwen2.5:1.5b-instruct-q4_K_M'
}
if (-not ($ollama.models.name -contains $model)) {
throw "Ollama is running, but model '$model' is missing. Run: ollama pull $model"
}
& (Join-Path $project '.venv\Scripts\python.exe') -m uvicorn app.main:app --app-dir $project --host 127.0.0.1 --port 8000