Exploring the Kosmoy SDK

The Kosmoy SDK is a powerful Python library that empowers your code to leverage the secure and governed AI infrastructure of Kosmoy Gateways. It provides access to models and routers configured in Kosmoy Studio and enables rich observability via Kosmoy Insights, all while offering seamless integration with popular frameworks like OpenAI’s SDK and LangChain.

Unlock the Power of Kosmoy’s Governance in Your Code

By integrating the Kosmoy SDK into your Python applications, you can:

  • Connect to Kosmoy Studio: Establish a secure connection between your code and a registered Coded App within Kosmoy Studio.
  • Access Kosmoy Gateways: Interact with Kosmoy Gateways, granting your application access to a defined set of AI models and routers.
  • Leverage Guardrails and Routers: Benefit from the Guardrails and Routers configured in Kosmoy Studio, ensuring that your application adheres to organizational policies and utilizes AI resources effectively.
  • Simplify AI Application Management: Streamline the development and management of your AI applications with a unified and governed approach.
  • Monitor and Optimize: Gain valuable insights into your application’s performance, usage, and costs through Kosmoy Studio’s Insights section. Track errors, warnings, cost metrics, and usage patterns to optimize your AI deployments.
  • Compatibility with OpenAI SDK: The Kosmoy SDK is designed to be compatible with the OpenAI SDK, allowing for a smooth transition and minimal code changes if you are already using OpenAI’s Python library.
  • Built-in LangChain Support: The SDK provides built-in support for LangChain, making it easier to integrate Kosmoy’s capabilities into your LangChain-based applications.

Key Concepts

  • Coded Apps: Represent your code artifacts (e.g., AI assistants, Python applications) within Kosmoy Studio. They are linked to Kosmoy Gateways through the SDK.
  • Gateways: Control access to AI models and routers, enforcing organizational policies and ensuring secure interactions.
  • Routers: Define intelligent routing logic for directing requests to different models (e.g., Failover, Load Balancing).
  • Guardrails: Implement safety guidelines and filters to ensure responsible AI usage (e.g., Toxic Language detection, Prompt Injection prevention).
  • Models: Represent AI models (e.g., LLMs) that have been registered and configured in Kosmoy Studio.

Seamless Integration with a Governance-Focused Platform

The Kosmoy SDK stands out by providing a direct link to Kosmoy Studio’s governance features. This means your applications automatically inherit the security, control, and monitoring capabilities built into the Kosmoy platform.

Explore the Code:

Want to delve deeper into the SDK’s inner workings or contribute to its development? Check out the Kosmoy SDK GitHub repository: https://github.com/KosmoyAI/kosmoy-sdk