SPB Git

spb/zyquo-router Public MIT

One local endpoint, every AI provider — a private OpenAI-compatible LLM gateway for your Mac (170 models, 12 providers).

Swift 95.7% Python 2.3% Shell 1.2% Makefile 0.9%
968 B · 35 lines swift
Raw Blame History
1//2//  ProviderRegistry.swift3//  Zyquo Router4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//89import Foundation1011/// Resolves the right client for a provider or custom model. The only place12/// that knows which wire format each provider speaks.13enum ProviderRegistry {14    static func client(for model: AIModel) -> ProviderClient {15        switch model.provider.wireFormat {16        case .anthropicMessages:17            return AnthropicClient()18        case .openAIChatCompletions:19            return OpenAICompatibleClient(20                provider: model.provider,21                baseURLOverride: model.customBaseURL22            )23        }24    }2526    static func client(for provider: ProviderID) -> ProviderClient {27        switch provider.wireFormat {28        case .anthropicMessages:29            return AnthropicClient()30        case .openAIChatCompletions:31            return OpenAICompatibleClient(provider: provider)32        }33    }34}35