Noveum.ai
Noveum Docs

Noveum SDK - Python Client

Professional Python SDK for programmatic access to the Noveum AI platform with 180+ API endpoints

The Noveum SDK is a comprehensive Python client library that provides both high-level convenience methods and low-level access to 180+ API endpoints for AI/ML evaluation, testing, and observability.

Key Features

✨ Complete API Coverage

180+ endpoints fully implemented across all API categories

🚀 Full IDE Support

Complete type hints, autocomplete, and docstrings

⚡ Async & Sync

Both async/await and synchronous support

🔐 Secure

API key authentication, HTTPS only, proper error handling

🧪 Production-Ready

Extensive test suite with integration and unit tests

🎯 Easy to Use

High-level wrapper for common operations

Installation

pip install noveum-sdk-python

From Source

git clone https://github.com/Noveum/noveum-sdk-python.git
cd noveum-sdk-python
pip install --upgrade pip setuptools wheel
pip install -e .

Quick Start

Basic Usage

import os
from noveum_api_client import NoveumClient

# Get API key from environment
api_key = os.getenv("NOVEUM_API_KEY")

# Initialize client
client = NoveumClient(api_key=api_key)

# List datasets
datasets = client.list_datasets(limit=10)
print(f"Found {len(datasets['data'])} datasets")

# Get dataset items
items = client.get_dataset_items("my-dataset", limit=50)
for item in items["data"]:
    print(f"Item: {item}")

# Get evaluation results
results = client.get_results(dataset_slug="my-dataset")
print(f"Results: {results['data']}")

Setting Your API Key

Option 1: Environment Variable (Recommended)

export NOVEUM_API_KEY="nv_your_api_key_here"

Option 2: Direct Initialization

from noveum_api_client import NoveumClient

client = NoveumClient(api_key="nv_your_api_key_here")

High-Level Client API

The NoveumClient class provides convenient methods for common operations.

List Datasets

response = client.list_datasets(limit=10)
print(f"Status: {response['status_code']}")
print(f"Datasets: {response['data']}")

Get Dataset Items

items = client.get_dataset_items("my-dataset", limit=100)
for item in items["data"]:
    print(f"Item ID: {item['id']}, Input: {item['input']}")

Get Evaluation Results

# Get all results
results = client.get_results()

# Filter by dataset
results = client.get_results(dataset_slug="my-dataset")

# Filter by item
results = client.get_results(item_id="item-123")

# Filter by scorer
results = client.get_results(scorer_id="factuality_scorer")

Common Use Cases

Use Case 1: CI/CD Regression Testing

Test your model/agent quality in CI/CD pipelines:

from noveum_api_client import NoveumClient

def test_agent_quality():
    client = NoveumClient(api_key="nv_...")
    
    # Get test dataset
    items = client.get_dataset_items("regression-tests")
    
    # Evaluate each item
    failed = 0
    for item in items["data"]:
        # Run your agent/model
        output = my_agent.run(item["input"])
        
        # Get evaluation results
        results = client.get_results(item_id=item["id"])
        
        # Check quality
        for result in results["data"]:
            if result.get("score", 0) < 0.8:
                print(f"❌ Item {item['id']} failed: {result['score']}")
                failed += 1
    
    # Assert
    assert failed == 0, f"{failed} items failed quality check"
    print("✅ All items passed quality check")

test_agent_quality()

Use Case 2: Batch Processing

Process all items in a dataset with pagination:

from noveum_api_client import NoveumClient

client = NoveumClient(api_key="nv_...")

# Get all items (with pagination)
offset = 0
while True:
    items = client.get_dataset_items("my-dataset", limit=100, offset=offset)
    
    if not items["data"]:
        break
    
    # Process each item
    for item in items["data"]:
        print(f"Processing item {item['id']}")
        # Your processing logic here
    
    offset += 100

Use Case 3: Result Analysis

Analyze evaluation results:

from noveum_api_client import NoveumClient

client = NoveumClient(api_key="nv_...")

# Get all results
results = client.get_results(limit=1000)

# Analyze
total = len(results["data"])
passed = sum(1 for r in results["data"] if r.get("passed"))
avg_score = sum(r.get("score", 0) for r in results["data"]) / total if total > 0 else 0

print(f"Total: {total}")
print(f"Passed: {passed} ({passed/total*100:.1f}%)")
print(f"Average Score: {avg_score:.2f}")

Advanced Configuration

Custom Base URL

client = NoveumClient(
    api_key="nv_...",
    base_url="https://custom.api.noveum.ai"
)

Custom Timeout

import httpx
from noveum_api_client import Client

client = Client(
    base_url="https://api.noveum.ai",
    timeout=httpx.Timeout(30.0)  # 30 second timeout
)

Context Manager

from noveum_api_client import NoveumClient

# Automatically closes connection
with NoveumClient(api_key="nv_...") as client:
    datasets = client.list_datasets()
    # Connection automatically closed

Response Format

All high-level client methods return a dictionary with:

{
    "status_code": 200,           # HTTP status code
    "data": {...},                # Response data (parsed JSON)
    "headers": {...}              # Response headers
}

Architecture

Two-Layer Architecture

Layer 1: Generated API Client

  • Auto-generated from OpenAPI schema
  • Low-level access to all endpoints
  • Full control over parameters
  • Both sync and async support

Layer 2: High-Level Wrapper (NoveumClient)

  • Convenient methods for common operations
  • Simplified API for typical use cases
  • Automatic error handling
  • Better developer experience
  • NovaEval - AI model evaluation with 73+ scorers
  • NovaPilot - Automated analysis of evaluation results
  • Python SDK - Lightweight tracing SDK

Support

Next Steps


Ready to build with Noveum? Install the SDK and start integrating with your AI applications!