{"id":48433099,"url":"https://github.com/redpanda-data/ai-sdk-go","last_synced_at":"2026-04-06T11:30:31.110Z","repository":{"id":345780151,"uuid":"1090581446","full_name":"redpanda-data/ai-sdk-go","owner":"redpanda-data","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-20T18:14:28.000Z","size":4792,"stargazers_count":16,"open_issues_count":8,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-21T07:56:39.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redpanda-data.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-05T21:26:48.000Z","updated_at":"2026-03-21T04:19:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/redpanda-data/ai-sdk-go","commit_stats":null,"previous_names":["redpanda-data/ai-sdk-go"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/redpanda-data/ai-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpanda-data%2Fai-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpanda-data%2Fai-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpanda-data%2Fai-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpanda-data%2Fai-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redpanda-data","download_url":"https://codeload.github.com/redpanda-data/ai-sdk-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpanda-data%2Fai-sdk-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31471409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-04-06T11:30:29.645Z","updated_at":"2026-04-06T11:30:31.102Z","avatar_url":"https://github.com/redpanda-data.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redpanda AI SDK for Go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/redpanda-data/ai-sdk-go.svg)](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\nA Go SDK for building AI-powered applications with a unified interface across multiple LLM providers. Supports OpenAI, Anthropic, Google Gemini, AWS Bedrock, and any OpenAI-compatible API.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/gopher.png\" alt=\"Redpanda AI SDK Gopher\" width=\"400\"\u003e\n\u003c/p\u003e\n\n## Install\n\n```bash\ngo get github.com/redpanda-data/ai-sdk-go\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/redpanda-data/ai-sdk-go/llm\"\n\t\"github.com/redpanda-data/ai-sdk-go/providers/openai\"\n)\n\nfunc main() {\n\tprovider, err := openai.NewProvider(os.Getenv(\"OPENAI_API_KEY\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tmodel, err := provider.NewModel(openai.ModelGPT5_4)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresp, err := model.Generate(context.Background(), \u0026llm.Request{\n\t\tMessages: []llm.Message{\n\t\t\tllm.NewMessage(llm.RoleUser, llm.NewTextPart(\"Explain Go interfaces in two sentences.\")),\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(resp.TextContent())\n}\n```\n\n## Providers\n\n### Anthropic\n\n```go\nimport \"github.com/redpanda-data/ai-sdk-go/providers/anthropic\"\n\nprovider, err := anthropic.NewProvider(os.Getenv(\"ANTHROPIC_API_KEY\"))\nmodel, err := provider.NewModel(anthropic.ModelClaudeOpus46)\n```\n\n### Google Gemini\n\n```go\nimport \"github.com/redpanda-data/ai-sdk-go/providers/google\"\n\nprovider, err := google.NewProvider(ctx, os.Getenv(\"GOOGLE_API_KEY\"))\nmodel, err := provider.NewModel(google.ModelGemini31ProPreview)\n```\n\n### AWS Bedrock\n\n```go\nimport \"github.com/redpanda-data/ai-sdk-go/providers/bedrock\"\n\nprovider, err := bedrock.NewProvider(ctx) // uses AWS credential chain\nmodel, err := provider.NewModel(bedrock.ModelClaudeOpus46)\n```\n\n### OpenAI-Compatible\n\nWorks with DeepSeek, local models, or any OpenAI-compatible API.\n\n```go\nimport \"github.com/redpanda-data/ai-sdk-go/providers/openaicompat\"\n\nprovider, err := openaicompat.NewProvider(apiKey, openaicompat.WithBaseURL(\"https://api.deepseek.com\"))\nmodel, err := provider.NewModel(\"deepseek-chat\")\n```\n\n## Streaming\n\nUse `GenerateEvents` with Go's range-over-func for streaming responses:\n\n```go\nfor event, err := range model.GenerateEvents(ctx, req) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tswitch e := event.(type) {\n\tcase llm.ContentPartEvent:\n\t\tfmt.Print(e.Part.Text())\n\tcase llm.StreamEndEvent:\n\t\tif e.Error != nil {\n\t\t\tlog.Fatal(e.Error)\n\t\t}\n\t}\n}\n```\n\n## Agents \u0026 Tools\n\nBuild agentic workflows with tool registries and the LLM agent runner. Agents execute in a loop, calling tools and reasoning until a task is complete.\n\n```go\nimport (\n\t\"github.com/redpanda-data/ai-sdk-go/agent/llmagent\"\n\t\"github.com/redpanda-data/ai-sdk-go/tool\"\n)\n\nregistry := tool.NewRegistry(tool.RegistryConfig{})\nregistry.Register(myTool)\n\nagent, err := llmagent.New(\"my-agent\", \"You are a helpful assistant.\", model,\n\tllmagent.WithTools(registry),\n)\n```\n\nSee [`examples/`](examples/) for full working demos.\n\n## Key Packages\n\n- [`llm`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/llm) — Core types: `Model`, `Request`, `Response`, `Event`\n- [`agent`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/agent) — Agent framework and interceptor interfaces\n- [`agent/llmagent`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/agent/llmagent) — LLM-powered agent implementation\n- [`runner`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/runner) — Agent execution runner with session management\n- [`tool`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/tool) — Tool registry and execution\n- [`tool/mcp`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/tool/mcp) — Model Context Protocol integration\n- [`adapter/a2a`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/adapter/a2a) — Agent-to-Agent protocol adapter\n- [`llm/fakellm`](https://pkg.go.dev/github.com/redpanda-data/ai-sdk-go/llm/fakellm) — Test doubles for LLM models\n\n## Examples\n\nThe [`examples/`](examples/) directory contains runnable demos:\n\n- **[agent_as_tool](examples/agent_as_tool)** — Delegate subtasks to a nested agent for context isolation\n- **[agent_interceptors](examples/agent_interceptors)** — Observability and approval hooks for agent execution\n\n## License\n\nApache 2.0 — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredpanda-data%2Fai-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredpanda-data%2Fai-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredpanda-data%2Fai-sdk-go/lists"}