Skip to main content

Integrate neoapi.ai LLM Analytics with your LLM pipelines.

Project description

NeoAPI SDK

The official Python SDK for integrating neoapi.ai LLM Analytics with your LLM pipelines. Monitor, analyze, and optimize your Language Model outputs with both asynchronous and synchronous implementations.

Installation

pip install neoapi-sdk

Quick Start

from neoapi import NeoApiClient, track_llm_output

# Initialize the client
client = NeoApiClient(api_key="your-api-key")  # Or use NEOAPI_API_KEY env variable

# Track LLM outputs with the decorator
@track_llm_output(
    client=client,
    project="my_project",
    group="my_group"
)
async def my_llm_function():
    return "LLM generated text"

# Start the client before use
await client.start()

# Use your function
result = await my_llm_function()

# Clean up when done
await client.stop()

Key Features

  • Asynchronous and synchronous client implementations
  • Automatic batching with configurable retry mechanisms
  • Dynamic performance optimization
  • Simple decorator-based tracking
  • Robust error handling
  • Flexible metadata support

Configuration

Client Options

client = NeoApiClient(
    api_key="your-api-key",      # Optional if NEOAPI_API_KEY is set
    check_frequency=10,          # Send every Nth LLM output
)

Environment Variables

  • NEOAPI_API_KEY: Your NeoAPI API key (allows client initialization without api_key parameter)
  • NEOAPI_API_URL: Optional custom API endpoint URL

Advanced Usage

@track_llm_output(
    client=client,
    project="my_project",        # Organize outputs by project
    group="my_group",           # Group related outputs
    analysis_slug="my_analysis", # Unique analysis identifier
    need_analysis_response=True, # Receive analysis results
    format_json_output=True,     # Pretty-print JSON responses
    metadata={"key": "value"}    # Add custom tracking data
)

License

MIT License

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neoapi-sdk-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

neoapi_sdk-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file neoapi-sdk-0.1.1.tar.gz.

File metadata

  • Download URL: neoapi-sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for neoapi-sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2fd722a315d4a45b7ada9713dc50560775c43d3fadd881f5ac7c8b6ffb4f6d7
MD5 de4e94c338ca79b9a9454b84a488de4b
BLAKE2b-256 88ef729716cfb4bdd458a60bc7c298218dc7b3a4ece741a6b5990f3b2cd6dd0d

See more details on using hashes here.

File details

Details for the file neoapi_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: neoapi_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for neoapi_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7fd0ea2615563220418f3b472e706d1f7775018f2560ddd45c2060ae4ec69b2
MD5 012f16eaf7286cb4e1208087f1a1904a
BLAKE2b-256 64bb17a50a741a05e529bfb9f676eb2a7d2e14bb3ed064e3f9226a1bc7c1b1be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page