GenKit is a library that abstracts away all the differences across generative AI platforms. It's sort of like a lightweight LangChain for Swift. The goal is to make native Swift development with generative AI fast, easy and fun!
Sessions are the highest level of abstraction and the easiest to use. They run in a loop and call out to tools as needed and send tool responses back to the model until it completes its work.
Services are a common interface for working across many platforms. They allow you to seamlessly switch out the underlying platform without changing any code.
- Chat Service
- Embedding Service
- Image Service
- Model Service
- Transcription Service
- Tool Service
- Vision Service
- Speech Service
Provider packages are swift interfaces that talk directly to model provider REST APIs. You can use these directly but their APIs vary slightly.
- Mistral (chats, embeddings, models)
- Ollama (chats, embeddings, models, vision)
- OpenAI (chats, embeddings, models, images, transcriptions, vision, speech)
- Perplexity (chats, models)
- Anthropic (chats, models)
- ElevenLabs (speech, models)
- Google (chat, models)
Heat is a good example of how GenKit can be used.