Skip to main content

LLM Guardrails tailored to your Principles

Project description

LLM Guardrails tailored to your Principles

PyPI Version Python Versions GitHub License

Overview

Orbitals is a lightweight Python library for adding LLM guardrails in just a few lines of code. With Orbitals, you can add a governance layer tailored to user-specific principles. Rather than enforcing generic notions of safety, compliance, and correctness, Orbitals validates inputs (e.g., user requests) and outputs (e.g., assistant responses) against user-defined specifications and custom policies. This makes guardrails explicit, auditable, and aligned with the user's philosophy.

Key Features

  • User-defined specifications — Guardrails that match your use case and your custom policies, not generic safety rules
  • Simple integration — Add guardrails with minimal code changes
  • Open framework, open models — Orbitals is open-source and is a simple interface for our open models

Getting started

Installation

You can install Orbitals via pip:

pip install orbitals[all]

Basic Usage

Here's a quick example to get you started with Orbitals, in which we use the ScopeGuard module to guard an AI service (for example, a customer support chatbot) from user requests that violate specified principles or fall outside of the scope of the core task of the assistant.

from orbitals.scope_guard import ScopeGuard

ai_service_description = "You are a helpful assistant for ..."
user_message = "Can I buy ..."

guardrail = ScopeGuard()
result = guardrail.validate(user_message, ai_service_description)

The result of a guardrail validation will indicate whether the input or output passed the guardrail checks, along with details on any violations. You can then handle violations as needed, such as by rejecting the input or modifying the output. For example:

if result.scope_class.value == "Restricted" or result.scope_class.value == "Out of Scope":
    print("Request violates guardrail:", result.evidences)
else:
    # The user request is safe!
    # We can now pass it to the AI assistant for processing.
    ...

Available Guardrails

Orbitals currently provides the following guardrail modules:

Guardrail Description Hosting Options
ScopeGuard Classifies user queries against AI assistant specifications to detect out-of-scope requests, policy violations, and chit-chat Self-hosted / Cloud hosting
🚀 Coming Soon More guardrails are on the way — stay tuned for updates!

Hosting Options

  • Self-hosted: Use open-weight models that you can deploy on your own infrastructure, ensuring data privacy and control.
  • Cloud hosting: (Coming soon) Managed hosting options for ease of use and scalability

Documentation

For detailed documentation, including installation instructions, usage guides, and API references, please visit the Orbitals Documentation.

FAQ

  • Can I use Orbitals for commercial applications?
    Yes, Orbitals is designed to be used in both research and commercial applications. It is licensed under the Apache 2.0 License, which allows for commercial use.
  • Other questions?
    Feel free to reach out to us at orbitals@principled-intelligence.com!

Contributing

We welcome contributions from the community! If you'd like to contribute to Orbitals, please check out our Contributing Guide for guidelines on how to get started.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Contact

For questions, feedback, or support, please reach out to us at orbitals@principled-intelligence.com.


Built with ❤️ by Principled Intelligence
Follow us on LinkedIn for the latest updates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbitals-0.1.4.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orbitals-0.1.4-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file orbitals-0.1.4.tar.gz.

File metadata

  • Download URL: orbitals-0.1.4.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for orbitals-0.1.4.tar.gz
Algorithm Hash digest
SHA256 82c06852f85a802d31a1e6211b2d77eac60b6b09de22c8326d2126c77a55b6cf
MD5 39c95702815d58ce68c531bd7501b1d3
BLAKE2b-256 f85e4e592de1848ce8f68ebd3169288c51dad75402abecc530d63caebf76ae81

See more details on using hashes here.

File details

Details for the file orbitals-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: orbitals-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for orbitals-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7c419570d1e42305d09d86f08178d2762e5980b0f76d308c7a727ecf529b3c
MD5 f359b73845463c152aef65cacc4ecd93
BLAKE2b-256 c4cbd47efe5f510e9d29c0584c86d995e52b0e1b0025dced3538e0ca7f22d271

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page