Skip to main content

Python SDK for the Big-O LLM Gateway — OpenAI-compatible access to AWS Bedrock and Azure OpenAI with LlamaIndex and Haystack integrations

Project description

Big-O Python SDK

Python SDK for the Big-O LLM Gateway, a 100% OpenAI-compatible API that provides unified access to multiple LLM providers (AWS Bedrock, Azure OpenAI).

Installation

pip install big-o-sdk

With optional framework integrations:

pip install big-o-sdk[llamaindex]   # + LlamaIndex LLM and embeddings
pip install big-o-sdk[haystack]     # + Haystack embeddings
pip install big-o-sdk[all]          # everything

For development:

git clone https://gitlab.com/virtuele-gemeente-assistent/big-o-sdk.git
cd big-o-sdk
uv sync

Configuration

Set credentials as environment variables or in a .env file:

BIG_O_CLIENT_ID=your-client-id
BIG_O_CLIENT_SECRET=your-client-secret
BIG_O_CHAT_MODEL=gpt-4o-mini
BIG_O_EMBEDDING_MODEL=text-embedding-3-large

Quick Start

Framework-agnostic (recommended)

Use BigOTokenProvider to get credentials for any OpenAI-compatible framework:

from big_o_sdk import BigOConfig, BigOTokenProvider

config = BigOConfig.from_env()
provider = BigOTokenProvider(config)
creds = await provider.get_credentials(model="gpt-4o-mini")
# → {"base_url": "https://...", "api_key": "eyJ...", "model": "gpt-4o-mini"}

Use the credentials with any framework:

# LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(**creds)

# LlamaIndex
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(**creds)

# Agno
from agno.models.openai import OpenAIChat
llm = OpenAIChat(**creds)

# Raw OpenAI SDK
from openai import AsyncOpenAI
client = AsyncOpenAI(base_url=creds["base_url"], api_key=creds["api_key"])

Lightweight completions (no framework needed)

from big_o_sdk import BigOConfig, BigOClient

config = BigOConfig.from_env()
async with BigOClient(config) as client:
    answer = await client.complete("Say hello", model="gpt-4o-mini")
    print(answer)

LlamaIndex (optional)

pip install big-o-sdk[llamaindex]
from big_o_sdk import BigOConfig, BigOLLM

config = BigOConfig.from_env()
llm = BigOLLM(config)
response = await llm.acomplete("Hello!")
await llm.close()

Haystack embeddings (optional)

pip install big-o-sdk[haystack]
from big_o_sdk import BigOConfig
from big_o_sdk.embedders.haystack import BigOTextEmbedder

config = BigOConfig.from_env()
embedder = BigOTextEmbedder(config)
result = embedder.run(text="What is AI?")

Gateway status

from big_o_sdk import BigOConfig, BigOClient

config = BigOConfig.from_env()
async with BigOClient(config) as client:
    await client.health()
    await client.ping()
    models = await client.models()

BigOConfig

Environment Variable Default
BIG_O_CLIENT_ID (required)
BIG_O_CLIENT_SECRET (required)
BIG_O_BASE_URL https://devops.versnellers.nl/bigo/api
BIG_O_CHAT_MODEL gpt-4o-mini
BIG_O_EMBEDDING_MODEL text-embedding-3-large
BIG_O_CONTEXT_WINDOW 128000

Authentication

JWT tokens are managed automatically:

  1. Fetch token via OAuth2 Client Credentials
  2. Cache and refresh 30 seconds before expiry
  3. Pass transparently to the underlying client

Architecture

big_o_sdk core (always available, <1s startup)
├── BigOConfig          Configuration and credentials
├── BigOClient          Lightweight completions, chat, health, models
├── BigOTokenProvider   Fresh JWT tokens for any framework
├── BigOAuthenticator   OAuth2 token lifecycle
└── errors              Domain-specific exceptions

big_o_sdk[llamaindex] (optional)
├── BigOLLM             LlamaIndex LLM wrapper
└── BigOEmbedding       LlamaIndex embedding wrapper

big_o_sdk[haystack] (optional)
├── BigOTextEmbedder    Haystack text embedder
└── BigODocumentEmbedder Haystack document embedder

Project Structure

src/big_o_sdk/
├── config.py             BigOConfig
├── errors.py             Domain exceptions
├── auth.py               BigOAuthenticator
├── client.py             BigOClient (complete, chat, health, models)
├── token_provider.py     BigOTokenProvider
├── mixins.py             Shared token refresh logic
├── agents/
│   └── llamaindex.py     BigOLLM
└── embedders/
    ├── llamaindex.py     BigOEmbedding
    └── haystack.py       BigOTextEmbedder, BigODocumentEmbedder

Related Projects

  • ai-orchestration: RAG chatbot using LlamaIndex agents and Haystack embeddings
  • scrapy: Web scraper with Haystack document indexing and hybrid search

License

EUPL v1.2, see LICENSE for details.

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

big_o_sdk-1.2.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

big_o_sdk-1.2.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file big_o_sdk-1.2.1.tar.gz.

File metadata

  • Download URL: big_o_sdk-1.2.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for big_o_sdk-1.2.1.tar.gz
Algorithm Hash digest
SHA256 d069790b2fa6ce2f5d32a19120a570b051cbf735d484f5623de0a47265035007
MD5 a45223e6f29287f93b50b84bee1ef322
BLAKE2b-256 cea60470eb0eb791c9371525fb98bdb9766d16357caca14eb98699719b05216f

See more details on using hashes here.

File details

Details for the file big_o_sdk-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: big_o_sdk-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for big_o_sdk-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 35582d384a7e74b1e7c6cb96410648929ea5092e757d9aca55c3b3319e4abed9
MD5 374d7be8105588106844c1c59b2c222b
BLAKE2b-256 38781f0ef91c6a55e41066e86d3a2066a64de63e4933b93df231f5b56843f016

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