HoneyHive Python SDK v1.0 supports the HoneyHive v2 platform launch. Use this guide to upgrade v0.x projects to SDK v1 and adopt v2-ready tracing and evaluation patterns.Documentation Index
Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
Use this file to discover all available pages before exploring further.
Use a coding agent to migrate
Use a coding agent to migrate
What changed
| Area | v0.x | v1.0 |
|---|---|---|
| Client constructor | HoneyHive(bearer_auth=...) | HoneyHive(api_key=...) (project= and HH_PROJECT/HONEYHIVE_PROJECT are deprecated no-ops) |
| Evaluation module path | from honeyhive.evaluation import evaluate, evaluator | from honeyhive.experiments import evaluate, evaluator (legacy path still works with a DeprecationWarning) |
evaluate() arguments | Positional or keyword | Keyword-only after function |
| Dataset ground truth key | ground_truths | ground_truth |
| Client API responses | Nested dict-style access common | Typed response models use attribute access |
| Evaluated function input | Commonly (inputs, ground_truths) | A single datapoint dict |
| Evaluator parameters | outputs, inputs, ground_truths | outputs, inputs, ground_truth (or ground_truth=None to support unlabeled datapoints) |
| Async evaluated functions | Rejected (must be sync) | Supported (auto-detected) |
| Result display | Manual inspection | print_results=True, or print_results=False plus result.print_table() |
| Session isolation | Instance-level session state | create_session(), acreate_session(), and with_session() use OpenTelemetry baggage |
| Enrichment | Global helper functions common | Tracer instance methods recommended; enrich_session() free function now only accepts metadata |
1. Upgrade the package
honeyhive.__version__ is new in SDK v1; on v0.x it raises AttributeError because the attribute was not exported. To detect the installed version without importing honeyhive, use:2. Update HoneyHive client initialization
The HoneyHive client constructor takes different keyword arguments in v1.
bearer_authis renamed toapi_key. Passingbearer_auth=to v1 raisesTypeError.project=,HH_PROJECT, andHONEYHIVE_PROJECTare all deprecated no-ops in v1.0+.HoneyHive(project=...)andHoneyHiveTracer.init(project=...)emit aDeprecationWarningand ignore the value;evaluate(project=...)accepts the kwarg silently but it also has no functional effect. TheHH_PROJECTenv var is still parsed for backward compatibility but unused. The backend infers project context from the API key — use the API key for the project you want to write to. All of these will be removed in v2.0.server_url=still works;base_url=is also accepted as an alias in v1.
| v0.x | v1.0 |
|---|---|
client.session (singular) | Removed. Use client.sessions (plural). |
client.tools | Removed. |
client.projects | Removed. |
client.events, client.datapoints, client.datasets, client.metrics, client.configurations, client.experiments | Still available. |
| — | client.sessions, client.evaluations, client.charts are new in v1. |
3. Update direct client API usage
If you use lower-level client APIs such asclient.events, client.datapoints, client.datasets, or client.metrics, many nested request and response objects are typed Pydantic models in v1.
For responses, replace dict-style access with attribute access:
model_dump() on the typed model:
event_type can now raise pydantic.ValidationError at request-construction time instead of surfacing only as a backend error after the request is sent.
If your environment pins OpenTelemetry or Traceloop instrumentor versions, review those pins during the upgrade. SDK v1 requires newer minimum versions than older 0.x releases.
4. Use ground_truth in datasets
SDK v1 reads the singular ground_truth key from experiment datapoints. If your v0 datasets use ground_truths, rename that field in local datasets and dataset creation code.
This is a field-name change, not a restriction on the value shape. If you previously stored multiple expected values inside ground_truths, keep the same inner structure under ground_truth.
5. Update evaluated functions
In v1,evaluate() passes the full datapoint to your function. Read inputs and ground_truth from that datapoint.
6. Update evaluator parameters
In v1, evaluators can be plain functions.@evaluator is still accepted for compatibility but no longer required. Rename the third parameter to ground_truth so it matches the v1 dataset shape.
@evaluator remains available for compatibility, but plain functions can be passed directly in the evaluators list.
In v1, evaluators are invoked with only
(outputs, inputs) when a datapoint has no ground_truth. Declare the third parameter with a default (ground_truth=None) so your evaluator also runs on unlabeled datapoints; without a default, those calls raise TypeError.Evaluators should return either a scalar (
bool, int, float, str) or a flat dict whose score, explanation, and any extras are scalars. Nested or non-scalar values are dropped (with a warning) so they cannot silently distort run-comparison diffs.7. Update LLM evaluator templates
If you reference ground truth in evaluator prompts, update template variables.8. Use the v1 result summary
evaluate() returns an experiment result summary and prints a formatted table by default.
If you want to render the table yourself, pass print_results=False and call result.print_table(...) later.
print_results=False and let evaluate() print the table automatically.
9. Update enrichment calls
Free functions such asenrich_span() still work in v1, but instance methods are the primary pattern because they are explicit and work better with multiple tracers.
| Namespace | Use for |
|---|---|
metadata | Custom searchable context |
metrics | Scores, latency, token counts, numeric measurements |
feedback | Ratings, labels, corrections, ground truth |
inputs | Span or session input payloads |
outputs | Span or session output payloads |
config | Model and application configuration |
user_properties | User attributes |
10. Replace manual session state in concurrent apps
If your v0 integration reused one tracer across many requests, create request-scoped sessions in v1.with_session():
11. Simplify distributed tracing
v1 includes helpers for carrying OpenTelemetry trace context across services.12. Update imports from honeyhive.evaluation to honeyhive.experiments
The honeyhive.evaluation module is deprecated in v1 and will be removed in v2.0. Imports from it still work but emit a DeprecationWarning. Update the import path:
13. Update evaluate() call signature
In v1, every argument to evaluate() after function is keyword-only. If you previously passed any of dataset, evaluators, name, or project positionally, switch to keyword arguments.
The following v0 evaluate() parameters no longer exist in v1 and will raise TypeError if passed:
suiterun_concurrentlydisable_http_tracingmetadata
instrumentors: list of zero-argument factories returning OTEL instrumentor instances (e.g.[lambda: OpenAIInstrumentor()]); a fresh instance is created per datapoint.run_id: optional client-supplied run identifier.aggregate_function: backend aggregation function name ("average","sum","min","max").
evaluate() reads HONEYHIVE_API_KEY / HH_API_KEY for api_key. The project= keyword and any *_PROJECT environment variables are deprecated no-ops everywhere in the v1 SDK — the backend infers project context from the API key. Drop project= from your evaluate(), HoneyHive(), and HoneyHiveTracer.init() calls; use the API key for the project you want to write to. See section 2 for the full deprecation picture.
Troubleshooting
Ground truth does not appear in HoneyHive
Check that every datapoint usesground_truth, not only ground_truths. SDK v1 reads ground_truth from each datapoint.
Dict-style client response access breaks after upgrading
If you use direct client APIs, switch from subscripts to attributes on typed response models:model_dump() only when you need a plain dict for serialization or an external boundary.
TypeError: HoneyHive.__init__() got an unexpected keyword argument 'bearer_auth'
Replace HoneyHive(bearer_auth=...) with HoneyHive(api_key=...). See Update HoneyHive client initialization.
TypeError: enrich_session() got an unexpected keyword argument 'outputs'
The v1 enrich_session() free function only accepts metadata. Switch to the tracer instance method, tracer.enrich_session(outputs=..., metrics=..., ...). See Update enrichment calls.
Evaluators do not receive ground truth
Use the singular evaluator parameter:Traces from different requests share one session
Usecreate_session() or acreate_session() per request instead of mutating tracer.session_id or relying on session_start() in a shared server process.
Import errors after upgrading
Confirm the runtime is using the upgraded package:Migration checklist
- Upgrade to
honeyhive>=1.0.0 - Replace
HoneyHive(bearer_auth=...)withHoneyHive(api_key=...) - Drop
project=from all SDK calls (HoneyHive,HoneyHiveTracer.init,evaluate) and stop relying onHH_PROJECT/HONEYHIVE_PROJECTenv vars — the backend infers project from the API key - Replace removed sub-clients (
client.session,client.tools,client.projects) with their v1 equivalents where applicable - Update direct client API code from dict-style response access to typed-model attribute access
- Review request validation changes if you build payloads for
client.events,client.datapoints,client.datasets, orclient.metrics - Rename
ground_truthstoground_truthin datasets - Update evaluated functions to accept a datapoint dict
- Update evaluators to use
ground_truthand add a default (ground_truth=None) for unlabeled datapoints - Update LLM evaluator templates from
feedback.ground_truthstofeedback.ground_truth - Use tracer instance methods for new enrichment code
- Migrate
enrich_session(outputs=..., metrics=..., ...)free-function calls totracer.enrich_session(...) - Update imports from
honeyhive.evaluationtohoneyhive.experiments(or the top-levelhoneyhivepackage) - Convert positional
evaluate()arguments to keyword arguments and remove unsupported kwargs (suite,run_concurrently,disable_http_tracing,metadata) - Use
create_session()orwith_session()for request-scoped sessions - Review pinned OpenTelemetry or Traceloop instrumentor versions, if any
- Run an evaluation and confirm table output, scores, and ground truth render correctly
Related
Migrate from Logger to v1
Replace
honeyhive-logger calls with SDK v1 tracing.Migrate from honeyhive-bundled to v1
Replace the bundled package with the stable SDK.
Evaluation Quickstart
Run your first experiment with
evaluate().Tracer Initialization
Choose the right tracer and session pattern for your runtime.
Enriching Traces
Add metadata, metrics, feedback, and user properties to traces.

