Parameters & Experiments
Manage typed configuration for your AI application. Define a schema once, create experiments with different values, and resolve the active configuration at runtime.
For the conceptual overview (schemas, versions, environments, visibility), see Parameters and Experiments. This page covers the SDK API.
Quick start
Defining schemas
A schema declares the typed slots your project supports. Each field has a name, a type, and an optional default.
You can pass bare Python values as defaults — the SDK wraps them automatically:
Push the schema with Parameters.put_schema():
Read it back:
Supported types
| Type | Python type | Example default |
|---|---|---|
text | str | Multi-line prompt text |
string | str | "gpt-4o" |
number | float | 0.7 |
integer | int | 1024 |
boolean | bool | True |
enum | str | "text" (requires options) |
model_ref | UUID | Reference to a Rhesis model |
secret_ref | UUID | Reference to a stored secret |
Resolving parameters
Parameters.get() accepts a project name or UUID and returns a ResolvedParameters mapping:
Accessing values
Values are unwrapped to native Python types automatically based on the schema. Use dot access, dictionary access, or .get() with a fallback:
Explicit typed accessors
For runtime type validation, typed accessors are also available. These raise TypeError on a type mismatch and return None (or your default) for missing keys:
get_str() accepts both text and string types, useful when you don’t care about the distinction.
Provenance
Every ResolvedParameters carries metadata about where the values came from:
Caching
- Version lookups are cached forever (versions are immutable).
- Environment and experiment lookups are cached with a 60-second TTL.
Force a re-fetch:
Managing environments
Experiments
See Experiments entity for the full CRUD reference. The most common workflows:
Step-by-step
One-liner with publish()
publish() does create, commit, share, and promote in a single call.
Viewing results
Retrieve aggregated test-run statistics for an experiment:
Running tests with parameters
Pass an Experiment object, or raw experiment_id / version / environment strings, to TestSet.execute() to pin a test run to a specific configuration:
When you pass only experiment_id without a version, the backend automatically resolves to the experiment’s latest version. You don’t need to look up the version hash yourself.
The resolved values are snapshotted at queue time. Moving an environment after the run is queued does not affect it.
Reading parameters from a test run
Connector injection
When the platform runs tests against your @endpoint-decorated function, resolved parameters are available in the request_mapping as \{\{ params.<name> \}\} — the same syntax used for REST endpoints.
Request mapping (recommended)
Parameters are rendered through the same Jinja2 template engine as input, test_id, and other platform variables. During a test run with an experiment, params.model resolves to the experiment’s value. Without an experiment, the default() filter provides the fallback.
Context-resolved fetch
For production code that calls Parameters.get() internally, the platform also sets a context variable so the same call returns the experiment snapshot during test runs — no network request, no branching:
Next Steps
- Experiments entity reference for the full CRUD API
- Connector Injection for protocol details
- Experiments concepts for the mental model (versions, environments, visibility)