Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.axioniclabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Python SDK for the Axionic platform. Remote inference via the Axionic API, local model loading via TransformerLens, steering vectors, SAE behavior monitoring, runtime policies, and a local OpenAI-compatible server. Install from PyPI:
pip install mechanex
transformer_lens and pyyaml are required at runtime but are not automatically installed by pip. Install them separately if you plan to use local model loading or SAE features:
pip install transformer_lens pyyaml

Two Modes of Operation

Generation, steering, and SAE operations run on Axionic-hosted GPU infrastructure. No local hardware requirements beyond running the SDK.
  • Requires an API key (ax_ + 48 hex characters)
  • Credits are deducted per inference call
  • Supports all sampling methods including ADS
  • Model does not need to fit in local memory
import mechanex as mx

mx.set_key("ax_your_key_here")
result = mx.generation.generate("Explain sparse autoencoders in one paragraph.")
print(result)

Execution Mode

Control where operations run with set_execution_mode():
ModeBehavior
"auto" (default)Remote if authenticated, local fallback if a model is loaded
"remote"Always use the Axionic API. Fails if not authenticated.
"local"Always use the locally loaded model. Fails if no model loaded.
mx.set_execution_mode("local")   # force local-only
mx.set_execution_mode("remote")  # force API-only
mx.set_execution_mode("auto")    # default fallback behavior
ADS, guided-generation, constrained-beam-search, speculative-decoding, and ensemble-sampling are remote-only regardless of execution mode. Steering perceptrons are also remote-only.