Skip to content

RxInfer Client

A Python client for interacting with RxInferServer.

Features

  • Simple and intuitive API
  • Type hints for better IDE support
  • Comprehensive documentation
  • Built on top of OpenAPI specification
  • Automatic API key generation
  • Configurable server URL
  • Organized functionality through logical subfields

Client Structure

The client functionality is organized into several subfields: - server: Access to server-related operations (e.g., ping, health checks) - authentication: Authentication and token management - models: Model management and operations (create, delete, etc.)

Quick Examples

from rxinferclient import RxInferClient

# Initialize with default settings
client = RxInferClient()

# Or with custom server URL
client = RxInferClient(server_url="http://localhost:8000/v1")

# Check server status
response = client.server.ping_server()
assert response.status == 'ok'

# Work with models
response = client.models.create_model_instance({
    "model_name": "BetaBernoulli-v1",
})
instance_id = response.instance_id

# Clean up
client.models.delete_model_instance(instance_id=instance_id)

Documentation

API Reference

RxInferClient(api_key=None, server_url=None)

High-level client for the RxInfer API.

This class provides a more user-friendly interface to the RxInfer API, wrapping the auto-generated client code.

The client functionality is organized into several subfields
  • server: Access to server-related operations via ServerApi
  • authentication: Authentication and token management via AuthenticationApi
  • models: Model management and operations via ModelsApi

Examples:

Initialize the client (will auto-generate API key if not provided):

>>> client = RxInferClient()

Initialize with custom server URL:

>>> client = RxInferClient(server_url="http://localhost:8000/v1")

Check server status:

>>> response = client.server.ping_server()
>>> assert response.status == 'ok'

Create and manage model instances:

>>> # Create a new model instance
>>> response = client.models.create_model_instance({
...     "model_name": "BetaBernoulli-v1",
... })
>>> instance_id = response.instance_id
>>> 
>>> # Delete the model instance when done
>>> client.models.delete_model_instance(instance_id=instance_id)

Initialize the RxInfer client.

PARAMETER DESCRIPTION
api_key

Optional API key for authentication. If not provided, the client will attempt to generate a temporary API key.

TYPE: Optional[str] DEFAULT: None

server_url

Optional server URL. If provided, overrides the default server URL configuration.

TYPE: Optional[str] DEFAULT: None