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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for maniac-0.5.0.tar.gz
Algorithm Hash digest
SHA256 89976f16d32d6ba0708e5fb997871846684941f5e5eec72cae46151278667d24
MD5 eba6f2cf7c16cbecdba3fc1b36171f36
BLAKE2b-256 faeb7a9b08323c58751b381a0f0379fb4aabe8cfa4a01e333fe4e8b0e457dc5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: maniac-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 43.6 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2e054690c006cca98c3f26aaa584d6b10f070dcfba7128c86abc798077d4188
MD5 a8f215e7473d532312e271d9a06bc5bf
BLAKE2b-256 1ee9f550340c5bdb610e2c5b22aac097b7188a7c8b8e9e16b3bb1a4f062330e7

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