OpenAIKit  by OpenDive

Swift SDK for OpenAI API

created 2 years ago
267 stars

Top 96.7% on sourcepulse

GitHubView on GitHub
Project Summary

OpenAIKit is a community-maintained Swift SDK for the OpenAI API, designed to simplify AI integration for Swift developers. It provides a Swifty interface to OpenAI's powerful models, including GPT-3, GPT-4, DALL-E 2, and Whisper, enabling features like text generation, image creation, and audio transcription.

How It Works

The SDK leverages Swift's modern features, including Swift Concurrency, to offer an asynchronous and idiomatic API. It abstracts the underlying RESTful calls to OpenAI's endpoints, providing type-safe parameters and responses. This approach aims to reduce the complexity of direct API interaction, making it easier for developers to integrate advanced AI capabilities into their applications.

Quick Start & Requirements

  • Installation: Via Swift Package Manager (SPM) in Xcode or Package.swift.
  • Requirements: iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, visionOS 1.0+. Requires Swift 5.7+.
  • API Keys: Requires an OpenAI API key, which should be managed securely (e.g., via environment variables or secrets management), not hardcoded.
  • Documentation: OpenAIKit Documentation

Highlighted Details

  • Supports DALL-E 2 image generation, edits, and variations.
  • Provides access to GPT-3 and GPT-4 for completions, chat, and embeddings.
  • Includes streaming capabilities for chat completions.
  • Integrates OpenAI's Whisper model for audio transcription and translation.

Maintenance & Community

This is a community-maintained project. Contributions via issues and pull requests are welcomed.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: OpenAI API usage is subject to OpenAI's Usage Policies.

Limitations & Caveats

The project notes the deprecation of OpenAI's older Completions API, recommending migration to the Chat Completions API. Migration from v1.x to v2.x requires updating model parameter usage from strings to enums.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.