Skip to main content

Deployment

An agent is deployed when you call .save(), and the same definition runs in the cloud or on-prem.

ModeWhere it runsUse it for
Cloudaixplain's managed cloud, serverlessThe default. No infrastructure to manage, and scaling is handled for you.
On-premYour own infrastructure, including air-gapped networksData that must stay inside your network

Try it​

Get a saved agent by its ID and run it. In production, read the key from an environment variable.

import os
from aixplain import Aixplain

aix = Aixplain(api_key=os.environ["AIXPLAIN_API_KEY"])

AGENT_ID = "YOUR_AGENT_ID" # from agent.id after .save()

agent = aix.Agent.get(AGENT_ID)
result = agent.run("Ticket: The export button returns a 500 error since this morning.")
print(result.status)
print(result.data.output)
Show output

Call from any language​

Agent runs are asynchronous over HTTP. Start the run, then poll the URL returned in data until completed is true.

import os
import time
import requests

AGENT_ID = "YOUR_AGENT_ID" # from agent.id after .save()
headers = {"x-api-key": os.environ["AIXPLAIN_API_KEY"], "Content-Type": "application/json"}

start = requests.post(
f"https://platform-api.aixplain.com/v2/agents/{AGENT_ID}/run",
headers=headers,
json={"query": "Ticket: The export button returns a 500 error since this morning."},
timeout=30,
).json()

while True:
result = requests.get(start["data"], headers=headers, timeout=30).json()
if result["completed"]:
break
time.sleep(2)

print(result["status"])
print(result["data"]["output"])
Show output

The REST API page covers run parameters, multi-turn conversations and errors, with JavaScript and curl examples.

Cloud​

Cloud is the default: every saved agent runs on aixplain's managed infrastructure and is billed per run. Watch usage, cost and run traces in the aixplain app.

Before you go live:

  • Test the agent on representative and adversarial inputs, and read result.data.steps to confirm which tools ran.
  • Add Inspectors for safety, quality and compliance checks.
  • Cap cost, time and iterations per run with a budget.
  • Scope access and quotas with API keys and Rate limiting.

On-prem​

On-prem runs the aixplain platform inside your own infrastructure, including air-gapped networks with no outbound connectivity.

What you getDetails
Same agentsAgents, tools and governance work as they do in the cloud. Some services are not available on-prem.
Containerized servicesLinux containers (Docker or Docker Compose), scaled behind a load balancer. You provision GPU nodes for model serving.
Air-gapped installSigned offline bundles, signed patch bundles checked by SHA-256, and licenses that validate locally.
No staff accessaixplain staff have no access to your environment. Data, models, logs and telemetry stay in your network.

To scope an on-prem deployment, contact aixplain.

Next steps​

  • Triggers: run a deployed agent on a schedule or when an event fires.
  • REST API: call agents and models from any language.
  • API keys: create scoped keys for each environment.
  • Rate limiting: cap requests, tokens and credits per key.