Skip to main content

LLM inference SDK, for telemetry and internal model routing

Project description

Maniac Python Client

A minimal python client for Maniac's API. Supports chat completions and dataset uploads.

Installation

pip install maniac

Initialize the client

from maniac import Maniac

maniac = Maniac()

Run inference

#responses api
response = maniac.responses.create(
    model="openai/gpt-5",
    input="Hello!"
)

#completions api
completion = maniac.chat.completions.create(
    model="openai/gpt-5",
    messages=[
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
)

Create a container

container = maniac.containers.create(
    label = "my-container",
    model = "openai/gpt-5",
    instructions = "You can only speak spanish",
)

response = maniac.responses.create(
    container=container,
    input="Hello!"
)
print(response.output_text) #hola

Run inference with containers

# method 01: with container object
container = maniac.containers.get("my-container")
response = maniac.responses.create(
    container=container,
    input="Hello!"
)

# method 02: with model name
response = maniac.responses.create(
    model="maniac:my-container",
    input="hello!"
)

method 1 allows you to observe the container's functionality directly from the codebase, since the container object contains things like the optimized system prompt.
method 2 allows for full container functionality (telemetry, optimization, routing) while being directly compatible with third party tooling. For instance:

Usage with the OpenAI client

from openai import OpenAI

client = OpenAI(
    base_url = "https://inference.maniac.ai",
    api_key = os.getenv("MANIAC_API_KEY")
)

response = client.responses.create(
    model = "maniac:my-container",
    input = "Hello!",
)

Optimization

container = maniac.containers.get("my-container")
run = maniac.optimizations.create(
    container = container,
    stages = ["sft", "gepa", "grpo"]
)

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

maniac-0.3.8.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

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

maniac-0.3.8-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file maniac-0.3.8.tar.gz.

File metadata

  • Download URL: maniac-0.3.8.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maniac-0.3.8.tar.gz
Algorithm Hash digest
SHA256 71e42523fc47bbbbd8718fb4152fb6daf6e44e44dd0ae9f33bbdee7d0a0c1f59
MD5 6c62b42a7954613f4249bc7765b5d67b
BLAKE2b-256 cfbe2b35ebf1d36f874d784e281c5453af0bcaf7caa8b9a5133a7cae5acbba63

See more details on using hashes here.

File details

Details for the file maniac-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: maniac-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for maniac-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4db8f447e9003dc72bdf8d882252d29ab35caa555471faec4492755896eecb92
MD5 82cfc468238af16c6627e6307550aadc
BLAKE2b-256 81e716cb538296016797fd91edc32553c70a948d14591aec5cb04b4f0ba85da3

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