Skip to main content

Quick Diagnostics

1

Check Server Status

Expected response:
2

Verify Provider Health

3

List Available Models

4

Check Logs


Connection Issues

Server Won’t Start

Symptom: bind: address already in use or port 18080 conflict.Cause: Another process is using port 18080.Solution:
  1. Find the process using the port:
  2. Kill the conflicting process or change switchAILocal’s port:
    config.yaml
  3. Restart switchAILocal:
Symptom: config.yaml not found or configuration errors.Cause: Missing or incorrectly named configuration file.Solution:
Symptom: failed to create auth directory or permission errors.Cause: Insufficient permissions for ~/.switchailocal/.Solution:

Connection Refused

Symptom: connection refused when making requests.Checklist:
  • Is the server running? Check with ps aux | grep switchAILocal
  • Is it listening on the correct port? Verify with lsof -i :18080
  • Are you using the correct host? Try 127.0.0.1 instead of localhost
  • Check firewall rules: sudo ufw status
Solution:
Symptom: failed to connect to Ollama or timeout errors.Solution:
  1. Verify Ollama is running:
  2. Check config.yaml:
  3. For Docker deployments, use host gateway:

Authentication Errors

OAuth Failures

Symptom: timeout waiting for OAuth callback.Cause: Browser didn’t complete the OAuth flow within the timeout period.Solution:
  1. Ensure port 3000 is available for the callback server
  2. Try the login command again
  3. Complete the browser authorization quickly
  4. Check firewall isn’t blocking localhost:3000
Symptom: OAuth state parameter is invalid.Cause: CSRF token mismatch or expired session.Solution:
  1. Clear OAuth state files:
  2. Retry the login:
Symptom: GEMINI_CLIENT_ID not found or missing credentials.Cause: OAuth environment variables not configured.Solution:Option 1: Use CLI wrappers instead (recommended):
Option 2: Set environment variables:

API Key Errors

Symptom: 401 Unauthorized or invalid api key.Cause: Incorrect or missing API key in requests.Solution:
  1. Verify the API key matches config.yaml:
  2. Include the key in your request:
  3. For provider API keys, check they’re correctly formatted:
Symptom: Requests fail with authentication errors.Solution:Check which authentication method is configured:

Provider Errors

Model Not Found

Symptom: model not found or no matching provider.Cause: Model not configured or provider prefix incorrect.Solution:
  1. List available models:
  2. Use correct provider prefix:
  3. Trigger model discovery:
Symptom: gemini: command not found or CLI tool errors.Cause: CLI tool not installed or not in PATH.Solution:
  1. Install the CLI tool:
  2. Verify installation:
  3. Authenticate the CLI:

Rate Limiting

Symptom: 429 Too Many Requests or rate limit errors.Cause: Exceeded provider API rate limits.Solution:
  1. Configure multiple credentials for load balancing:
    config.yaml
  2. Enable automatic quota rotation:
    config.yaml
  3. Implement retry logic:
    config.yaml
Symptom: quota exceeded or billing errors.Cause: API quota limits reached.Solution:
  1. Check quota status:
  2. Add fallback providers:
    config.yaml
  3. Monitor usage:
    config.yaml

Request Failures

Timeout Errors

Symptom: Requests timeout before completion.Cause: Slow provider response or network issues.Solution:
  1. Increase client timeout:
  2. Check provider health:
  3. Use faster models:
    config.yaml
Symptom: Streaming responses stop mid-completion.Cause: SSE connection lost or provider timeout.Solution:
  1. Enable keepalive:
    config.yaml
  2. Check network stability
  3. Reduce request complexity (shorter prompts, smaller context)

Response Errors

Symptom: JSON parsing errors or incomplete responses.Cause: Provider returned invalid JSON or protocol mismatch.Solution:
  1. Enable debug logging:
    config.yaml
  2. Check logs for raw responses:
  3. Verify model supports the requested format
Symptom: API returns empty content or null values.Cause: Provider error, rate limit, or safety filter.Solution:
  1. Check provider status:
  2. Review the request for safety issues (if using content filters)
  3. Try a different provider:

Cortex Router Issues

Intelligence System

Symptom: router model failed or classification errors.Cause: Configured router model is not available.Solution:
  1. Verify router model exists:
  2. Update router model in config:
    config.yaml
  3. Use a local model for faster classification:
Symptom: Embedding errors or semantic matching failures.Cause: Embedding model not loaded or ONNX runtime missing.Solution:
  1. Download embedding model:
  2. Disable semantic tier if not needed:
    config.yaml
  3. Check ONNX runtime installation:
Symptom: Skills directory errors or skill matching failures.Cause: Skills directory not found or misconfigured.Solution:
  1. Verify skills directory exists:
  2. Check config path:
    config.yaml
  3. Reload skills:

Docker-Specific Issues

Symptom: Docker container exits immediately.Solution:
  1. Check logs:
  2. Verify config.yaml is mounted:
  3. Check volume permissions:
Symptom: Container can’t connect to Ollama/LM Studio on host.Solution:Use host.docker.internal instead of localhost:
config.yaml
Symptom: Permission denied on mounted volumes.Solution:

Memory System Issues

Symptom: Analytics show stale data or zero values.Cause: Memory system disabled or directory permissions.Solution:
  1. Verify auth directory is writable:
  2. Check memory files exist:
  3. Enable usage statistics:
    config.yaml

Performance Issues

Symptom: Requests take longer than expected.Solution:
  1. Use local models for routing:
    config.yaml
  2. Enable semantic cache:
    config.yaml
  3. Reduce classification overhead:
    config.yaml
Symptom: Process consumes excessive RAM.Solution:
  1. Limit cache sizes:
    config.yaml
  2. Disable unused features:
    config.yaml
  3. Set Docker resource limits:
    docker-compose.yml

Getting Help

Debug Mode

Enable verbose logging:
config.yaml

Collect Diagnostic Information

Report Issues

If you encounter a bug, please report it with:
  1. Description: What happened vs. what you expected
  2. Steps to Reproduce: Exact commands or API calls
  3. Environment: OS, Docker version, switchAILocal version
  4. Logs: Relevant error messages (with sensitive data removed)
  5. Configuration: Sanitized config.yaml snippet
GitHub Issues: https://github.com/traylinx/switchAILocal/issues

Next Steps

Setup Providers

Configure your AI providers correctly

Management Dashboard

Monitor system health and performance