Skip to main content

The official Python client for the Brocode AI unified API

Project description

Brocode AI Python SDK

The official Python library for the Brocode AI unified API. Access over 100+ frontier AI models via a single standardized interface.

Installation

pip install brocodeai

Usage

You need a Brocode AI API key. Get yours at the Brocode AI Dashboard.

import os
from brocodeai import BrocodeAI

# Initialize the client. It will automatically look for the BROCODEAI_API_KEY environment variable.
client = BrocodeAI(
    api_key=os.environ.get("BROCODEAI_API_KEY"),
)

# Chat Completions
chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Say this is a test",
        }
    ],
    model="meta/llama-3.1-70b-instruct",
)

print(chat_completion.choices[0].message.content)

# Embeddings
embedding = client.embeddings.create(
    input="Convert this text to an embedding.",
    model="nvidia/nv-embedqa-e5-v5"
)
print(embedding.data[0].embedding)

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

brocodeai-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

brocodeai-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file brocodeai-0.1.0.tar.gz.

File metadata

  • Download URL: brocodeai-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for brocodeai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc284eb81e240d4489ca30da12bcdcda70d6b4ce7a34c3ecd423248ba21c4311
MD5 2d4515cd17986f35a16093418f2930a2
BLAKE2b-256 1690aad6a6449453737485f68d015825d852a393206e8f35abf52b11cf68571c

See more details on using hashes here.

File details

Details for the file brocodeai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brocodeai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for brocodeai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f64a58dc8ba6fd1a6363f6c03600a56b7692fc68294dfb7f46e42283e38e529
MD5 51aa3e8035a8a39fb182fbce72810735
BLAKE2b-256 d681a5ad4199556f3afa1a266a8ef3d7433b27f65e76fd1dbed408eeae5bbc75

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