Swift SDK for AI provider APIs, with optional key protection
Top 89.6% on sourcepulse
This Swift library provides clients for interacting with various AI providers, including OpenAI, Gemini, Anthropic, and others. It aims to simplify AI API integration into iOS and macOS applications, offering a unified interface for making requests. The library supports both direct API calls and proxied requests through a secure backend for API key protection.
How It Works
The library abstracts the complexities of different AI provider APIs into a consistent Swift interface. Users can choose to initialize services directly with their own API keys (BYOK) or use a proxied approach. The proxied approach leverages a backend service that enhances security by implementing certificate pinning, DeviceCheck verification, split key encryption, and per-user/per-IP rate limiting, protecting API keys and managing costs.
Quick Start & Requirements
github.com/lzell/aiproxyswift
.AIProxy.configure()
during app launch.Highlighted Details
Maintenance & Community
The project is actively maintained, with contributions welcomed. Details on contributing and community channels are available in the README.
Licensing & Compatibility
The library is released under the MIT license, allowing for commercial use and integration with closed-source applications.
Limitations & Caveats
The README mentions that some advanced features, like specific Replicate model interactions or tool calls with Llama/TogetherAI, might require further development or have specific limitations. Users should consult the detailed examples for each provider for precise usage and potential caveats.
2 days ago
1 day