Skip to main content

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.

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.2.tar.gz (26.2 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.2-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for big_o_sdk-1.2.2.tar.gz
Algorithm Hash digest
SHA256 2aca504cca345e16f8ef517b7ef12fe2f773d37136dfd9bd37853610aeec46a7
MD5 6da301077dfdee5f4de3ca29f7f9dcf3
BLAKE2b-256 4f31dc46093475a9a6c37f832d85748e1c7f6a55bb00e35130f09113fbe0906d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for big_o_sdk-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e331a1e7c3d1edae0068adb6cc204c6e98b4225b18be2c875beccb145c32dc1
MD5 8fa182f7eba9d1ca2f0c9e84530f93c3
BLAKE2b-256 9e167fa764298f9f8a40f6b9af8176d2e3b8525aefffdf031fb91d1e1b177be8

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 Sentry Error logging StatusPage Status page