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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for maniac-0.4.0.tar.gz
Algorithm Hash digest
SHA256 371a1141ef20927c1150fe0acce7700624c7b2099f19889e0cd5ec4bcb457bdf
MD5 caee2454b2d08e08655191e7a8a8584a
BLAKE2b-256 b27d7b1e18e90fab0e99105b0d36255d3cd5bd32682c77c0b43a913719e741ae

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for maniac-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfb3e4b7b5a966c122e60ff623e9815202018e25150fc1dd15b3d1df8d4c1a1b
MD5 83350b031fb30079ccbc15977838aca6
BLAKE2b-256 94aafa0f2748308020d3900cc092cb5b3a6eb6968591adbcbb0209c484ec7648

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