Discover and explore top open-source AI tools and projects—updated daily.
cequence-ioUnified Scala client for OpenAI and leading LLM providers
Top 99.2% on SourcePulse
This Scala library provides a comprehensive, asynchronous client for interacting with OpenAI's API and a wide array of other major Large Language Model (LLM) providers. It aims to offer a unified, provider-neutral interface for developers to integrate LLM capabilities into their Scala applications, abstracting away provider-specific complexities and offering advanced features like typed streaming and batch processing.
How It Works
The core of the library is the OpenAIService, which acts as a facade over various LLM providers through adapters. It supports a broad range of LLM operations, including chat completions, image generation, embeddings, batch processing, and voice routines. A key innovation is its provider-neutral typed stream of ChatChunk events, enabling consistent handling of responses across different LLMs. The library includes its own WS client (defaulting to Play WS) and supports dependency injection via scala-guice.
Quick Start & Requirements
build.sbt:
"io.cequence" %% "openai-scala-client" % "1.3.0"
For streaming support, use "io.cequence" %% "openai-scala-client-stream" % "1.3.0". For a single dependency including all provider clients, use "io.cequence" %% "openai-scala-all" % "1.3.0".OPENAI_SCALA_CLIENT_API_KEY). Some providers may require additional client libraries.OPENAI_SCALA_CLIENT_API_KEY) or configuration files (openai-scala-client.conf).openai-scala-client-examples project.Highlighted Details
OpenAIService) for diverse LLM functionalities, including chat completions, image APIs, batch processing, and vision capabilities with provider-uniform attachments.ChatChunk events for handling streamed LLM responses consistently.Maintenance & Community
This project is community-maintained, created and primarily developed by Peter Banda. Development has been supported by Cequence.io. For announcements and LLM provider news, follow @0xbnd on X. Contact is available via openai-scala-client@cequence.io.
Licensing & Compatibility
The library is published under the permissive MIT License, allowing for commercial use and integration into closed-source projects.
Limitations & Caveats
Several OpenAI API endpoints and models are deprecated or have announced shutdown dates (e.g., Completions API models, Assistants API). The library reflects these changes, with some features marked as deprecated within the client itself. Provider-specific limitations may apply, such as differences in tool support or batch processing capabilities. The streaming API currently has an Akka dependency, though future abstraction is planned.
18 hours ago
1 week