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
Apache License 2.0
This SDK is licensed under the Apache License 2.0. While the SDK itself is open source, access to the NeoAPI services may require a valid subscription and API key. For pricing and subscription details, visit neoapi.ai.
Resources
- Documentation: https://www.neoapi.ai/docs
- Source Code: https://github.com/neoapi-ai/neoapi-python
- Support: hello@neoapi.ai
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.2.tar.gz
(9.0 kB
view details)
Built Distribution
File details
Details for the file neoapi-sdk-0.1.2.tar.gz
.
File metadata
- Download URL: neoapi-sdk-0.1.2.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cd2dca4ba53a3da5e18e0af734418cc33eb286ee682aefec7ed70aeb4274c01 |
|
MD5 | 1b3a3b6dde7f48f7bc8ce6fc42230b69 |
|
BLAKE2b-256 | 6a76f8ddb35dcf5a1cc03b2e4a6d0d00e84f10edc918b1f242154eb20628bcba |
File details
Details for the file neoapi_sdk-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: neoapi_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7bac833d1943f1b9d9afe1c8b36c38d437e59a68c09ff36ee3b4962141f7df1 |
|
MD5 | 30d8114a0e28b2ee47eb6204ef820018 |
|
BLAKE2b-256 | 33a31f165fae06c4b54ca2fa87963fc4db5a7a346172032cdd8743fea9650469 |