{"id":18719464,"url":"https://github.com/henomis/langfuse-go","last_synced_at":"2025-08-08T17:43:28.857Z","repository":{"id":229781784,"uuid":"777612004","full_name":"henomis/langfuse-go","owner":"henomis","description":"Langfuse Go SDK","archived":false,"fork":false,"pushed_at":"2024-05-01T15:49:24.000Z","size":25,"stargazers_count":22,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T08:47:33.162Z","etag":null,"topics":["ai","go","golang","langfuse","llm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henomis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-26T07:20:12.000Z","updated_at":"2025-03-21T11:21:44.000Z","dependencies_parsed_at":"2024-03-26T08:31:23.358Z","dependency_job_id":"53011a76-0a75-4c8e-83d3-ec1afbfb9c52","html_url":"https://github.com/henomis/langfuse-go","commit_stats":null,"previous_names":["henomis/langfuse-go"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henomis%2Flangfuse-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henomis%2Flangfuse-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henomis%2Flangfuse-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henomis%2Flangfuse-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henomis","download_url":"https://codeload.github.com/henomis/langfuse-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578867,"owners_count":21127713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","go","golang","langfuse","llm"],"created_at":"2024-11-07T13:26:10.297Z","updated_at":"2025-04-12T14:08:08.881Z","avatar_url":"https://github.com/henomis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Langfuse Go SDK\n\n\n[![GoDoc](https://godoc.org/github.com/henomis/langfuse-go?status.svg)](https://godoc.org/github.com/henomis/langfuse-go) [![Go Report Card](https://goreportcard.com/badge/github.com/henomis/langfuse-go)](https://goreportcard.com/report/github.com/henomis/langfuse-go) [![GitHub release](https://img.shields.io/github/release/henomis/langfuse-go.svg)](https://github.com/henomis/langfuse-go/releases)\n\nThis is [Langfuse](https://langfuse.com)'s **unofficial** Go client, designed to enable you to use Langfuse's services easily from your own applications.\n\n## Langfuse\n\n[Langfuse](https://langfuse.com) traces, evals, prompt management and metrics to debug and improve your LLM application.\n\n\n## API support\n\n| **Index Operations**  | **Status** |\n| --- | --- |\n| Trace | 🟢 | \n| Generation | 🟢 |\n| Span | 🟢 |\n| Event | 🟢 |\n| Score | 🟢 |\n\n\n\n\n## Getting started\n\n### Installation\n\nYou can load langfuse-go into your project by using:\n```\ngo get github.com/henomis/langfuse-go\n```\n\n\n### Configuration\nJust like the official Python SDK, these three environment variables will be used to configure the Langfuse client:\n\n- `LANGFUSE_HOST`: The host of the Langfuse service.\n- `LANGFUSE_PUBLIC_KEY`: Your public key for the Langfuse service.\n- `LANGFUSE_SECRET_KEY`: Your secret key for the Langfuse service.\n\n\n### Usage\n\nPlease refer to the [examples folder](examples/cmd/) to see how to use the SDK.\n\nHere below a simple usage example:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t\"github.com/henomis/langfuse-go\"\n\t\"github.com/henomis/langfuse-go/model\"\n)\n\nfunc main() {\n\tl := langfuse.New()\n\n\terr := l.Trace(\u0026model.Trace{Name: \"test-trace\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.Span(\u0026model.Span{Name: \"test-span\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.Generation(\n\t\t\u0026model.Generation{\n\t\t\tName:  \"test-generation\",\n\t\t\tModel: \"gpt-3.5-turbo\",\n\t\t\tModelParameters: model.M{\n\t\t\t\t\"maxTokens\":   \"1000\",\n\t\t\t\t\"temperature\": \"0.9\",\n\t\t\t},\n\t\t\tInput: []model.M{\n\t\t\t\t{\n\t\t\t\t\t\"role\":    \"system\",\n\t\t\t\t\t\"content\": \"You are a helpful assistant.\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"role\":    \"user\",\n\t\t\t\t\t\"content\": \"Please generate a summary of the following documents \\nThe engineering department defined the following OKR goals...\\nThe marketing department defined the following OKR goals...\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tMetadata: model.M{\n\t\t\t\t\"key\": \"value\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.Event(\n\t\t\u0026model.Event{\n\t\t\tName: \"test-event\",\n\t\t\tMetadata: model.M{\n\t\t\t\t\"key\": \"value\",\n\t\t\t},\n\t\t\tInput: model.M{\n\t\t\t\t\"key\": \"value\",\n\t\t\t},\n\t\t\tOutput: model.M{\n\t\t\t\t\"key\": \"value\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.GenerationEnd(\n\t\t\u0026model.Generation{\n\t\t\tOutput: model.M{\n\t\t\t\t\"completion\": \"The Q3 OKRs contain goals for multiple teams...\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.Score(\n\t\t\u0026model.Score{\n\t\t\tName:  \"test-score\",\n\t\t\tValue: 0.9,\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = l.SpanEnd(\u0026model.Span{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tl.Flush(context.Background())\n\n}\n```\n\n## Who uses langfuse-go?\n\n* [LinGoose](https://github.com/henomis/lingoose) Go framework for building awesome LLM apps\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenomis%2Flangfuse-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenomis%2Flangfuse-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenomis%2Flangfuse-go/lists"}