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

Uploaded Python 3

File details

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

File metadata

  • Download URL: maniac-0.3.7.tar.gz
  • Upload date:
  • Size: 52.7 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.7.tar.gz
Algorithm Hash digest
SHA256 c345a1e42046ef7cabd51453ac3e4b8d5cfb24af2a7ac0eb6739c51e08816cc2
MD5 57da905e8340e487e4f6d829217f3f91
BLAKE2b-256 ba078549ba1e48abe8084db8684820e1c940cc90b802f1c5cb6a56709c8389fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: maniac-0.3.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 dd32e8c9be45d1e9ec3591ff7eef921a51449aca06fb6df9284215a658ace0d3
MD5 1ab2a5284d1848725ebc7d57ac2fa524
BLAKE2b-256 1de9f6d33e5ca8103b01265e4b4034a1348706f551bee6bd2b1b10f00744aa7b

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