Replies: 3 comments 2 replies
|
@cpoepke Thanks a lot for raising this!
What are the code changes here exactly that would trigger such a run? The on-platform prompt experiments are using Generally, we would recommend here to use the Experiment runner SDK in order to create your own custom experiment pipeline that runs on your triggers: https://langfuse.com/docs/evaluation/experiments/experiments-via-sdk#experiment-runner-sdk |
|
Hi @cpoepke, we just published a Langfuse GitHub Action for running experiments in CI/CD: https://github.com/langfuse/experiment-action 🎉 Would be great if you could try it out when you have a chance and share any feedback 🙌🏻 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Currently, experiments (prompt + dataset + model evaluation runs) can only be triggered through the Langfuse UI via a tRPC procedure (
experimentsRouter.createExperimentinweb/src/features/experiments/server/router.ts) or run via SDK's. There is no public API to programmatically trigger experiment runs, which means:Proposed Solution
Two deliverables:
POST /api/public/v2/datasets/{datasetName}/runsRequest Body
{ "runName": "nightly-eval-2024-01-15", "promptName": "my-prompt", "promptVersion": "3", "description": "Nightly regression run", "modelConfig": { "provider": "openai", "model": "gpt-4o", "modelParams": { "temperature": 0, "max_tokens": 1024 } }, "structuredOutputSchema": {} }runNamepromptNamepromptVersion3,latest)descriptionmodelConfig.provideropenai,anthropic)modelConfig.modelgpt-4o)modelConfig.modelParamstemperature,max_tokens,top_p, etc.)structuredOutputSchemaResponse
{ "id": "clxyz...", "datasetId": "abc123", "datasetName": "my-eval-dataset", "runName": "nightly-eval-2024-01-15", "status": "queued", "createdAt": "2024-01-15T00:00:00.000Z" }Returns immediately with
queuedstatus. Callers pollGET /api/public/datasets/{name}/runs/{runName}for results.Architecture
Only new code: API endpoint, Zod schemas, and tests.
Implementation Plan
web/src/features/public-api/types/datasets.tsweb/src/pages/api/public/datasets/[name]/runs/index.tswithMiddlewares+createAuthedProjectAPIRoutefern/apis/server/definition/datasets.ymlweb/src/__tests__/async/experiment-run-api.servertest.tsGitHub Action:
langfuse/run-experimentA standalone GitHub Action (separate repository) that wraps the new API endpoint.
Questions for Maintainers
promptExperiments:CUDor create a new scope?langfuse/run-experiment-actionrepository?All reactions