Installation & Setup
Get started with the Rhesis Python SDK - install the package, configure authentication, and learn the fundamental concepts including models, synthesizers, and metrics.
Installation
pip install rhesis-sdkGetting Started
The SDK can be used standalone or integrated with our platform. To communicate with our platform and to use LLMs provided by us you need to obtain an API key.
Obtain an API key
- Visit Rhesis App
- Sign up for a Rhesis account
- Navigate to your account settings
- Generate a new API key
Your API key will be in the format rh-XXXXXXXXXXXXXXXXXXXX.
Keep this key secure and never share it publicly.
Configure the SDK
You can configure the SDK either through environment variables or direct configuration:
Environment Variables:
export RHESIS_API_KEY="your-api-key"
export RHESIS_BASE_URL="https://api.rhesis.ai"Direct Configuration:
import rhesis
rhesis.api_key = "your-api-key"
rhesis.base_url = "https://api.rhesis.ai" # optionalBasic Usage
Once configured, you can start using the SDK to create and manage tests:
from rhesis.sdk import RhesisClient
# Initialize the client
client = RhesisClient()
# Create a test
test = client.create_test(
prompt="What is the capital of France?",
expected_response="Paris",
behavior="Accuracy"
)
# Run the test
result = client.run_test(test_id=test.id, endpoint_id="your-endpoint-id")
print(result)Next Steps - Explore the Platform Guide to understand how SDK integrates with the web interface - Check out Development for advanced SDK usage and API reference
- Learn about Core Concepts to understand the overall workflow