Local AI Provider
CaseSolo supports firm-controlled local AI routing for Ollama, vLLM, and OpenAI-compatible local servers. The launch contract is policy-first: every local/cloud routing decision must be deterministic, privilege-aware, residency-aware, and auditable without leaking secrets.
Settings Shape
Local AI is stored in Firm.settings.localAI:
{
"enabled": true,
"type": "ollama",
"baseUrl": "http://gpu-node.internal:11434",
"model": "llama3.1:70b",
"apiKey": "optional-local-secret",
"maxConcurrency": 4,
"timeoutMs": 120000
}
Data residency is stored in Firm.settings.dataResidency:
{
"region": "us",
"mode": "local_preferred",
"forceLocal": false,
"allowCloudFallback": true
}
Supported mode values are cloud_allowed, local_preferred, and local_only. region: "on-prem" or forceLocal: true always normalizes to local_only.
Policy Rules
- Only
ADMINandSUPER_ADMINcan manage local AI settings or manually request a local provider. - Any authorized user can be routed to local AI when firm policy requires it for privileged, HIPAA-sensitive, or local-only residency work.
privilegedOnlyLocal: trueroutes privileged matters to the configured local provider and blocks cloud fallback if no local provider is available.local_preferreduses local AI when available and falls back to cloud only whenallowCloudFallbackis not false.- Local connection testing records an
ai.provider_selection_testedactivity with a redactedproviderSelectionaudit payload. - Settings changes record an
ai.local_settings_updatedactivity with redacted provider metadata and a provider-selection preview.
Implementation Points
parseLocalAIConfig()normalizes Ollama/vLLM defaults and ignores disabled providers.parseDataResidencyConfig()normalizes residency controls into one mode.resolveAIProviderSelection()returns an allowed/blocked decision with a secret-safeProviderSelectionAuditPayload.getComplianceAwareProvider()wraps the decision and returns eitherLocalAIProvideror the cloud default provider.redactLocalAIConfig()exposes provider type, model, endpoint host, andhasApiKey, never raw API keys.
Use the audit payload directly in Activity.metadata.providerSelection for AI execution, provider tests, and settings changes.