charmbracelet/fantasy

Build AI agents with Go. Multiple providers, multiple models, one API. 🧙

What it solves

Fantasy provides a unified API for building AI agents in the Go programming language, eliminating the need to write different code for every different AI provider or model.

How it works

It acts as a wrapper that allows developers to select a provider (such as OpenRouter, Azure, or Bedrock) and a specific model, then equip the agent with custom tools (functions the agent can call) and a system prompt to define its behavior.

Who it’s for

Go developers who want to integrate LLM-powered agents into their applications without being locked into a single AI provider.

Highlights

  • Multi-provider support including dedicated packages for Azure, Bedrock, and OpenRouter.
  • OpenAI-compatible layer for generic integration with other providers.
  • Support for custom agent tools to extend agent capabilities.
  • Compiles to native machine code for performance.

Related

  • Project
  • Project
  • Project
  • Project
  • Project