Add hosted datasets API client and eval bridge#136
Merged
petyosi merged 5 commits intoJun 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a hosted datasets Platform API client (logfire/datasets + @pydantic/logfire-node/datasets) and a high-level bridge to round-trip logfire/evals datasets to/from hosted datasets, while also refactoring managed variables’ JSON requests to use a shared internal Platform HTTP transport.
Changes:
- Add
LogfireAPIClienthosted datasets CRUD/import client (API key auth, base URL inference, typed error mapping) and Node helpercreateLogfireAPIClient(). - Add eval bridge APIs
pushEvaluationDataset()/getEvaluationDataset()with evaluator spec round-tripping and JSON normalization + serializer/parser hooks. - Introduce internal
PlatformAPIClienttransport and migrate managed variables’ JSON calls onto it (keeping SSE on the existing event-stream path).
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new hosted datasets client entrypoints and server-side API key guidance. |
| plans/017-hosted-evaluation-dataset-bridge.md | Design plan/spec for the eval bridge APIs and behavior. |
| plans/016-hosted-datasets-api-client.md | Design plan/spec for the hosted datasets client and Node helper. |
| packages/logfire-node/vite.config.ts | Adds datasets build entry and ensures it’s not bundled. |
| packages/logfire-node/src/datasets.ts | Implements Node helper that reads LOGFIRE_API_KEY / LOGFIRE_BASE_URL and re-exports core client. |
| packages/logfire-node/src/test/datasets.test.ts | Tests Node helper env handling and method availability. |
| packages/logfire-node/README.md | Documents hosted datasets usage from the Node package. |
| packages/logfire-node/package.json | Exports the new ./datasets entrypoint. |
| packages/logfire-api/vite.config.ts | Adds datasets entry to build outputs. |
| packages/logfire-api/src/vars/index.ts | Migrates managed variables JSON calls to shared PlatformAPIClient transport. |
| packages/logfire-api/src/vars.test.ts | Adds coverage for 204 delete handling, timeout behavior, and SSE staying on event-stream fetch path. |
| packages/logfire-api/src/platform/http.ts | Adds shared internal HTTP transport (requestJson, auth, timeout, JSON/error parsing). |
| packages/logfire-api/src/platform/errors.ts | Adds shared transport error types used by datasets/vars. |
| packages/logfire-api/src/logfireApiConfig.ts | Extends base URL inference for org-ID API keys and staging regions. |
| packages/logfire-api/src/logfireApiConfig.test.ts | Adds tests for trimming, org-ID token parsing, and staging regions. |
| packages/logfire-api/src/datasets/json.ts | Implements hosted JSON normalization + serializeValue escape hatch for eval pushes. |
| packages/logfire-api/src/datasets/index.ts | Implements hosted datasets client + pushEvaluationDataset / getEvaluationDataset APIs. |
| packages/logfire-api/src/datasets/evaluation.ts | Implements conversion between hosted exports and local eval Dataset/Case objects and evaluator spec mapping. |
| packages/logfire-api/src/datasets.test.ts | Tests hosted datasets client transport behavior, endpoints, and error mapping. |
| packages/logfire-api/src/datasets.evaluation.test.ts | Tests eval bridge push/fetch flows, evaluator handling, and JSON normalization behavior. |
| packages/logfire-api/README.md | Documents hosted datasets usage from the core package. |
| packages/logfire-api/package.json | Exports the new ./datasets entrypoint. |
| docs/evals.md | Documents high-level eval workflow via hosted datasets and distinguishes raw hosted JSON APIs. |
| .changeset/hosted-evaluation-datasets.md | Release note for the eval bridge addition (minor bumps). |
| .changeset/hosted-datasets-client.md | Release note for the hosted datasets client and Node helper (minor bumps). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
petyosi
deleted the
petyo/pyd-3528-add-hosted-datasets-api-client-support-to-logfire-js
branch
June 2, 2026 15:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
logfire/datasetsand@pydantic/logfire-node/datasets, including dataset/case CRUD, bulk import, metadata/export retrieval, API key auth, base URL inference, and platform error mapping.pushEvaluationDataset()andgetEvaluationDataset()so locallogfire/evalsdatasets can round-trip through hosted datasets with evaluator specs, JSON normalization, and serializer/parser hooks.PlatformAPIClientwhile keeping SSE stream requests on their event-stream fetch path.Linear
Validation
pnpm run check