NexusAI Platform Read Guide

v3.0.2 📅 Last updated: March 15, 2025 ⏱️ Reading time: ~12 min

Welcome to the NexusAI Platform Read Guide. This comprehensive walkthrough will help you understand the architecture, configure your environment, deploy intelligent agents, and integrate AI capabilities into your production systems efficiently.

ℹ️ Note

This guide assumes basic familiarity with REST APIs and Python. All code examples use the official nexusai-sdk v2.4+.

Prerequisites

Before beginning, ensure your development environment meets the following requirements:

  • Python 3.9 or higher installed
  • Active NexusAI account with API access
  • Valid API key with agent:deploy and model:run permissions
  • Git CLI for version control (recommended)
  • Minimum 4GB RAM for local model testing

You can generate and manage your API keys from the NexusAI Dashboard > Settings > API Keys.

Environment Setup

Initialize your project and install the required SDK packages using pip. We recommend using a virtual environment to avoid dependency conflicts.

Terminal
mkdir nexus-ai-project && cd nexus-ai-project
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install nexusai-sdk==2.4.1
pip install python-dotenv

Create a .env file to securely store your credentials:

.env
NEXUS_AI_API_KEY=your_api_key_here
NEXUS_AI_REGION=us-east-1
NEXUS_AI_LOG_LEVEL=INFO
⚠️ Security Warning

Never commit your .env file to version control. Add it to your .gitignore immediately.

Deploy Your First Agent

NexusAI uses a declarative agent configuration system. Below is a complete step-by-step process to spin up an NLP classification agent.

Initialize the Client

Import the SDK and authenticate using your environment variables.

client.py
import os
from nexusai import NexusClient, AgentConfig

client = NexusClient(
    api_key=os.getenv("NEXUS_AI_API_KEY"),
    region=os.getenv("NEXUS_AI_REGION")
)

Define Agent Configuration

Specify the model, input schema, and inference parameters.

agent_config.py
config = AgentConfig(
    name="sentiment-analyzer-v1",
    model="nexus-nlp-classifier-3.0",
    parameters={
        "temperature": 0.2,
        "max_tokens": 250,
        "output_format": "json"
    },
    input_schema={
        "text": "string",
        "language": "string"
    }
)

Deploy & Run Inference

Submit the configuration and trigger a test payload.

deploy.py
agent = client.agents.deploy(config)
print(f"✅ Agent deployed: {agent.id}")

response = agent.predict({
    "text": "The new AI integration exceeded our expectations."
    "language": "en"
})
print(response.json())

API Integration

The NexusAI REST API supports synchronous and asynchronous inference. Below are the core endpoints used in production workflows.

Endpoint Method Description
/v1/agents/{id}/predict POST Synchronous inference request
/v1/agents/{id}/predict/async POST Background job submission
/v1/models GET List available base models
/v1/jobs/{job_id}/status GET Check async job progress
💡 Pro Tip

For batch processing, use the async endpoint with webhook callbacks to handle responses without blocking your main thread.

Monitoring & Scaling

Production deployments require observability. NexusAI provides built-in metrics dashboards and auto-scaling policies.

  • Latency Tracking: P50, P90, P99 response times are logged automatically
  • Token Usage: Real-time consumption metrics per agent instance
  • Error Rates: Alert thresholds for 4xx/5xx responses
  • Auto-Scaling: Configure min/max instances based on queue depth

Access your metrics at app.nexusai.com/observability. You can also export logs to CloudWatch, Datadog, or Kafka streams.

Best Practices

  1. Cache Frequently Used Predictions: Use Redis or Memcached to reduce redundant API calls for identical inputs.
  2. Implement Retry Logic: Use exponential backoff for transient network errors (status 429 or 503).
  3. Validate Inputs Client-Side: Fail fast before sending payloads to reduce token waste.
  4. Version Your Agents: Never overwrite production configs. Use semantic versioning (e.g., v1.2.0).
  5. Monitor Token Drift: If your data distribution changes, retrain or fine-tune your model quarterly.

FAQ & Troubleshooting

Q: Why am I receiving a 403 Forbidden error?

This usually indicates an expired or misconfigured API key. Verify that your key has the correct scopes enabled in the dashboard. Regenerate if necessary.

Q: How do I handle large batch requests?

Use the chunking utility in the SDK: nexusai.utils.chunk_data(data, size=50). Process chunks asynchronously and aggregate results server-side.

Q: Can I run models locally for offline testing?

Yes. NexusAI supports local inference via NexusClient(mode="local"). Requires GPU RAM ≥ 8GB and the nexusai-core binary.

📞 Need Help?

Contact our engineering support team at support@nexusai.dev or join our Discord Developer Community for real-time assistance.