├── .gitignore ├── .gitattributes ├── images ├── gollm.png ├── rag-end-to-end.png ├── mcp-architecture.png ├── rag-architecture.png ├── code-editing-agent.png ├── mathematical-foundations.png ├── neural-networks-libraries.png ├── performance-characteristics.png ├── general-machine-learning-frameworks.png ├── integration-with-external-systems.png └── specialized-machine-learning-categories.png ├── books ├── 机器学习 Go语言实现.pdf └── Machine Learning with Go.pdf ├── LICENSE ├── README-zh.md ├── docs ├── 02-Model Context Protocol Implementations.md ├── 03-Large Language Model Tools.md ├── 06-Educational Resources.md ├── 01-AI and ML Benchmarks.md ├── 04-RAG Components.md └── 05-Machine Learning Libraries.md ├── README.md └── Overview.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pdf filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /images/gollm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/gollm.png -------------------------------------------------------------------------------- /images/rag-end-to-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/rag-end-to-end.png -------------------------------------------------------------------------------- /images/mcp-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/mcp-architecture.png -------------------------------------------------------------------------------- /images/rag-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/rag-architecture.png -------------------------------------------------------------------------------- /images/code-editing-agent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/code-editing-agent.png -------------------------------------------------------------------------------- /images/mathematical-foundations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/mathematical-foundations.png -------------------------------------------------------------------------------- /images/neural-networks-libraries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/neural-networks-libraries.png -------------------------------------------------------------------------------- /images/performance-characteristics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/performance-characteristics.png -------------------------------------------------------------------------------- /images/general-machine-learning-frameworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/general-machine-learning-frameworks.png -------------------------------------------------------------------------------- /images/integration-with-external-systems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/integration-with-external-systems.png -------------------------------------------------------------------------------- /books/机器学习 Go语言实现.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f81ead2080a8a3e624b4ef33b80b0d17b2c8ced91cc47c2d9d3e1efeb1339157 3 | size 71007111 4 | -------------------------------------------------------------------------------- /images/specialized-machine-learning-categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/promacanthus/awesome-golang-ai/HEAD/images/specialized-machine-learning-categories.png -------------------------------------------------------------------------------- /books/Machine Learning with Go.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf7e067482666fcb58f9cb5cdf201df295b6607c6331bba8eeb147fadf041f55 3 | size 6629651 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Bowen Zhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # Awesome Golang.AI 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/promacanthus/awesome-golang-ai?style=social)](https://github.com/promacanthus/awesome-golang-ai) 4 | [![GitHub forks](https://img.shields.io/github/forks/promacanthus/awesome-golang-ai?style=social)](https://github.com/promacanthus/awesome-golang-ai) 5 | [![License](https://img.shields.io/github/license/promacanthus/awesome-golang-ai)](LICENSE) 6 | [![GitHub last commit](https://img.shields.io/github/last-commit/promacanthus/awesome-golang-ai)](https://github.com/promacanthus/awesome-golang-ai/commits/main) 7 | 8 | --- 9 | 10 | **Language** | **语言** 11 | [English](README.md) | [中文](README-zh.md) 12 | 13 | --- 14 | 15 | ## 概述 16 | 17 | > 如需快速了解,请参阅 [Overview.md](Overview.md)。 18 | 19 | 本仓库是一个精选的资源列表,专注于使用 Go 编程语言进行人工智能(AI)和机器学习(ML)开发。它遵循流行的"awesome 列表"格式,将高质量、经过社区验证的工具、库、框架、基准测试和教育材料汇聚到一个有组织的参考资源中。 20 | 21 | 本仓库不包含可执行代码或软件项目。相反,它作为一个发现和参考工具,为对使用 Go 进行 AI 相关任务感兴趣的开发者、研究人员和工程师提供服务。该列表强调了 Go 在性能、并发性和系统级编程方面的优势,使其对构建可扩展的生产级 AI 应用程序特别有价值。 22 | 23 | 该仓库被划分为明确定义的类别,如基准测试、大语言模型(LLM)工具、检索增强生成(RAG)组件、通用机器学习库、神经网络和教育资源。每个条目都包含资源链接和功能或用途的简要描述。 24 | 25 | ## 收集范围 26 | 27 | awesome-golang-ai 列表涵盖了 AI 和 ML 领域的广泛内容,特别强调实用工具和评估框架。主要类别包括: 28 | 29 | - **[基准测试](docs/01-AI%20and%20ML%20Benchmarks.md)**:全面的评估套件,用于评估 LLM 在各个领域的能力,如代码生成、数学推理、多语言理解和现实世界软件工程任务。 30 | - **[模型上下文协议实现](docs/02-Model%20Context%20Protocol%20Implementations.md)**:与 MCP 相关的资源,包括与主要 AI 平台(OpenAI、Google、Anthropic)交互的 SDK、用于本地模型执行的开发工具如 Ollama、代理框架和基于 Go 的 transformer 模型实现。 31 | - **[大语言模型(LLMs)](docs/03-Large%20Language%20Model%20Tools.md)**:与 LLM 相关的资源,包括与主要 AI 平台(OpenAI、Google、Anthropic)交互的 SDK、用于本地模型执行的开发工具如 Ollama、代理框架和基于 Go 的 transformer 模型实现。 32 | - **[RAG(检索增强生成)](docs/04-RAG%20Components.md)**:构建 RAG 管道的工具,包括用于将 PDF 和办公文件转换为结构化格式的文档解析器、嵌入模型,以及用于高效相似性搜索的向量数据库,如 Milvus 和 Weaviate。 33 | - **[通用机器学习库](docs/05-Machine%20Learning%20Libraries.md)**:Go 中的基础 ML 库,支持回归、分类、聚类和数据操作等任务,包括 Gorgonia、Gonum 和 Golearn 等库。 34 | - **[神经网络和深度学习](docs/05-Machine%20Learning%20Libraries.md)**:用于构建和训练神经网络的专业库,包括前馈网络、自组织映射和循环架构的实现。 35 | - **[专业领域](docs/docs/05-Machine%20Learning%20Libraries.md)**:线性代数、概率分布、进化算法、图处理、异常检测和推荐系统的资源。 36 | - **[教育材料](docs/06-Educational%20Resources.md)**:支持在 Go 中学习和实验 AI 的书籍、教程和数据集。 37 | 38 | 该列表还包括新兴标准,如**模型上下文协议(MCP)**,它支持 LLM 应用程序与外部工具之间的集成,突出了项目对实用、可互操作的 AI 开发的关注。 39 | 40 | ## 目标受众 41 | 42 | 本仓库的主要受众包括: 43 | 44 | - **Go 开发者**:探索将 AI/ML 集成到应用程序中 45 | - **机器学习工程师**:寻求用于 AI 系统的高性能、并发后端 46 | - **研究人员**:评估 LLM 或在 Go 中构建实验管道 47 | - **DevOps 和 MLOps 工程师**:对在生产环境中部署 AI 模型感兴趣,这些环境中 Go 的效率和可靠性具有优势 48 | - **学生和学习者**:希望通过 Go 实现来学习 AI 概念 49 | 50 | 该列表旨在为具有不同技术专业水平的用户提供便利。虽然某些条目假设用户熟悉 AI 概念,但结构和分类允许初学者从基础库到高级框架逐步探索资源。 51 | 52 | ## 贡献指南 53 | 54 | 虽然仓库没有明确包含 `CONTRIBUTING.md` 文件或在 `README` 中详细的贡献说明,但它遵循 awesome 列表的标准做法。鼓励用户通过提交拉取请求来添加新的相关资源或改进现有条目。 55 | 56 | 理想的贡献包括: 57 | 58 | - 高质量、积极维护的项目 59 | - 文档完善的库和工具 60 | - 有已发布结果或学术支持的基准测试 61 | - 具有实用价值的教育资源 62 | 63 | 所有提交都应直接与 Go 中的 AI/ML 开发相关,并且必须提供清晰的描述和有效的链接。缺少正式指导方针表明贡献者在提出添加时应遵循列表的现有格式和结构。 64 | 65 | ## 如何使用此列表 66 | 67 | 用户可以通过多种方式利用 awesome-golang-ai 列表: 68 | 69 | - **发现**:浏览类别以找到与特定需求相关的工具,例如用于 RAG 的向量数据库或用于调用 LLM API 的 SDK。 70 | - **评估**:使用基准条目来比较模型性能或评估代码生成或数学推理等领域的能力。 71 | - **学习**:访问书籍和教程以建立在 Go 中使用 AI 的基础知识。 72 | - **开发**:将推荐的库和框架集成到项目中,以加速 AI 功能的实现。 73 | - **研究**:利用标准化的基准测试和数据集进行可重现的实验。 74 | 75 | 分层结构允许用户从广泛的类别快速导航到特定工具,使用户无需事先了解生态系统即可轻松定位资源。 76 | 77 | ## 在 Go AI 生态系统中策展的价值 78 | 79 | 由于与 Python 等语言相比,专注于 AI 的库数量相对较少,策展在 Go AI 生态系统中起着关键作用。通过将分散的资源汇聚到一个组织良好的列表中,awesome-golang-ai 降低了对使用 Go 进行 AI 感兴趣的开发者的入门门槛。 80 | 81 | 它通过突出成熟、维护良好的项目来促进最佳实践,并通过展示创新工具和研究来鼓励社区增长。该列表还有助于识别生态系统中的差距,指导未来的开发工作。 82 | 83 | 此外,随着 Go 在后端 AI 服务、微服务和云原生应用程序中的采用率增加,拥有集中化的参考确保开发者可以高效地构建强大、可扩展的 AI 系统,而不会牺牲性能或可靠性。 84 | 85 | ## Star 历史 86 | 87 | 88 | 89 | 90 | 91 | 92 | Star History of promacanthus/awesome-golang-ai 93 | 94 | 95 | 96 | 97 | 98 | ## Star 地理分布 99 | 100 | 101 | 102 | 103 | 104 | 105 | Star Geographical Distribution of promacanthus/awesome-golang-ai 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/02-Model Context Protocol Implementations.md: -------------------------------------------------------------------------------- 1 | # Model Context Protocol Implementations 2 | 3 | ## Introduction 4 | 5 | The Model Context Protocol (MCP) is a standardized framework designed to enhance AI model interoperability and context management by enabling seamless communication between large language models (LLMs) and external data sources, tools, and services. MCP facilitates structured data exchange, allowing AI applications to dynamically access and utilize real-time information, databases, APIs, and computational tools while maintaining contextual coherence. This protocol is particularly valuable in agent-based systems, retrieval-augmented generation (RAG), and multi-step reasoning workflows where context preservation and external tool integration are critical. 6 | 7 | In the Go ecosystem, several implementations of MCP have emerged to support high-performance, concurrent, and scalable AI applications. This document provides a comprehensive overview of the key Go-based MCP implementations listed in the awesome-golang-ai repository: mcp-go, mcp-golang, and gateway. Each implementation offers distinct architectural approaches, integration capabilities, and use cases, catering to different project requirements in terms of simplicity, flexibility, and performance. 8 | 9 | ## Core Components 10 | 11 | The core components related to Model Context Protocol in this repository are three distinct Go implementations that enable LLMs to interact with external systems: 12 | 13 | - **[mcp-go](https://github.com/mark3labs/mcp-go)**: A full-featured Go implementation of MCP that enables seamless integration between LLM applications and external data sources and tools. 14 | - **[mcp-golang](https://github.com/metoro-io/mcp-golang)**: A lightweight library that allows developers to write MCP servers in just a few lines of Go code, emphasizing developer productivity and rapid prototyping. 15 | - **[gateway](https://github.com/centralmind/gateway)**: A universal MCP server specifically optimized for databases and AI agents, acting as a middleware layer between LLMs and data backends. 16 | 17 | These components are not part of the local repository but are external projects referenced for their relevance to Go-based AI development using MCP. 18 | 19 | ## Architecture Overview 20 | 21 | The architecture of MCP implementations in Go follows a client-server model where LLM applications act as clients that send context-aware requests to MCP servers, which in turn interface with external tools, databases, or APIs. The protocol standardizes the format of these interactions, ensuring consistent data exchange and error handling. 22 | 23 | ![MCP Architecture](../images/mcp-architecture.png) 24 | 25 | ## Detailed Component Analysis 26 | 27 | ### [mcp-go](https://github.com/mark3labs/mcp-go) Analysis 28 | 29 | **mcp-go** is a comprehensive Go implementation of the Model Context Protocol, designed to facilitate seamless integration between LLM applications and external resources. It provides a robust foundation for building context-aware AI systems that can dynamically access tools and data. 30 | 31 | **Key Features**: 32 | 33 | - Full MCP specification compliance 34 | - Support for bidirectional context exchange 35 | - Extensible plugin architecture for custom tools 36 | - Built-in serialization and deserialization of context objects 37 | - Error handling and validation mechanisms 38 | 39 | This implementation is ideal for applications requiring deep integration with multiple external systems while maintaining strict context management. 40 | 41 | ### [mcp-golang](https://github.com/metoro-io/mcp-golang) Analysis 42 | 43 | **mcp-golang** is designed for simplicity and rapid development, allowing developers to create MCP servers with minimal code. Its primary value proposition is ease of use and fast prototyping. 44 | 45 | **Key Features**: 46 | 47 | - Minimal boilerplate code required 48 | - High-level abstractions for common MCP patterns 49 | - Easy routing and handler registration 50 | - Lightweight dependency footprint 51 | - Straightforward configuration options 52 | 53 | This implementation suits projects where development speed and simplicity are prioritized over advanced customization. 54 | 55 | ### [gateway](https://github.com/centralmind/gateway) Analysis 56 | 57 | **gateway** functions as a universal MCP server optimized for database interactions and AI agent workflows. It acts as a middleware layer that translates MCP requests into database queries and returns structured results. 58 | 59 | **Key Features:** 60 | 61 | - Database-native optimization 62 | - Query planning and execution 63 | - Connection pooling and performance tuning 64 | - Schema introspection and auto-discovery 65 | - Security and access control layers 66 | 67 | This implementation is best suited for AI applications that rely heavily on real-time data retrieval from structured databases. 68 | 69 | ## Performance Considerations 70 | 71 | When selecting an MCP implementation in Go, performance considerations should align with the application's operational requirements: 72 | 73 | - **mcp-go** offers balanced performance with extensibility, suitable for production-grade applications requiring reliable context management and tool integration. 74 | - **mcp-golang** prioritizes development speed and may have slightly higher overhead due to abstraction layers, making it ideal for prototyping and small-scale deployments. 75 | - **gateway** is optimized for database-intensive workloads, providing efficient query execution and connection management for data-heavy AI applications. 76 | 77 | All implementations benefit from Go's inherent advantages: low memory footprint, high concurrency support via goroutines, and fast execution speed, making them well-suited for real-time AI systems. 78 | 79 | ## Troubleshooting Guide 80 | 81 | While specific error handling mechanisms cannot be detailed without access to the source code of the referenced implementations, general troubleshooting principles for MCP systems in Go include: 82 | 83 | - Validate MCP message formats using schema checks 84 | - Implement structured logging for request/response tracing 85 | - Use Go's built-in panic recovery in server implementations 86 | - Monitor connection states with external resources 87 | - Test context serialization/deserialization thoroughly 88 | 89 | Developers should consult the respective GitHub repositories for detailed error codes, debugging tools, and community support channels. 90 | 91 | ## Conclusion 92 | 93 | The Model Context Protocol represents a significant advancement in AI interoperability, enabling LLMs to maintain context while interacting with external systems. In the Go ecosystem, mcp-go, mcp-golang, and gateway provide diverse options for implementing MCP, each catering to different development priorities: 94 | 95 | Choose mcp-go for full-featured, production-ready integrations 96 | Use mcp-golang for rapid prototyping and simple server implementations 97 | Select gateway for database-centric AI applications requiring optimized data access 98 | These implementations leverage Go's strengths in concurrency, performance, and reliability, making them excellent choices for building scalable, context-aware AI systems. As the MCP standard evolves, these Go libraries are likely to play a crucial role in advancing the capabilities of AI agents and LLM applications. 99 | -------------------------------------------------------------------------------- /docs/03-Large Language Model Tools.md: -------------------------------------------------------------------------------- 1 | # Large Language Model Tools 2 | 3 | ## Introduction 4 | 5 | The Go ecosystem offers a rich collection of tools for developing and deploying applications powered by Large Language Models (LLMs). These tools span various categories including GPT integrations, ChatGPT applications, agent frameworks, SDKs for LLM providers, and development tools. This document provides a comprehensive overview of notable tools in each category, their functionality, and practical usage patterns in Go. The analysis is based on the `awesome-golang-ai` repository, which curates high-quality AI-related tools and libraries for the Go programming language. 6 | 7 | ## GPT Integrations 8 | 9 | GPT integrations in the Go ecosystem enable developers to leverage pre-trained language models for various natural language processing tasks. One notable implementation is `gpt-go`, a minimal GPT model implemented from scratch in pure Go and trained on Jules Verne books. This project demonstrates how to build and train transformer-based models directly in Go, providing educational value for understanding the internals of language models. 10 | 11 | While `gpt-go` serves as a learning tool, it highlights Go's capability to handle machine learning workloads despite not being traditionally associated with deep learning. The implementation showcases Go's strengths in concurrency and memory management when processing sequential data. 12 | 13 | ## ChatGPT Apps 14 | 15 | ChatGPT applications in Go demonstrate practical use cases of LLM integration in real-world scenarios. Two prominent examples include [feishu-openai](https://github.com/ConnectAI-E/feishu-openai) and [chatgpt-telegram](https://github.com/m1guelpf/chatgpt-telegram). 16 | 17 | The [feishu-openai](https://github.com/ConnectAI-E/feishu-openai) integration connects Feishu (Lark) with multiple AI services including GPT-4, GPT-4V, DALL·E-3, and Whisper, creating an enhanced work experience. This application showcases how Go can serve as a backend for enterprise communication platforms, handling complex integrations with various AI services. 18 | 19 | The [chatgpt-telegram](https://github.com/m1guelpf/chatgpt-telegram) bot enables users to run their own ChatGPT-powered Telegram bot with a single command. This demonstrates Go's suitability for building lightweight, production-ready chat applications that can interface with LLM APIs. The simplicity of deployment highlights Go's strength in creating efficient, standalone applications. 20 | 21 | ## Agents 22 | 23 | Agent frameworks in Go enable the creation of autonomous systems capable of interacting, coordinating, and executing complex tasks. Several notable tools in this category provide different approaches to agent development. 24 | 25 | [swarmgo](https://github.com/prathyushnallamothu/swarmgo) is a Go package that allows developers to create AI agents capable of interaction and coordination. As an agents SDK, it provides the foundational components for building multi-agent systems where agents can collaborate on tasks. This framework is particularly valuable for creating distributed AI systems that require coordination between multiple specialized agents. 26 | 27 | [orra](https://github.com/orra-dev/orra) offers resilience for AI agent workflows, addressing the challenge of maintaining reliable operation in complex agent systems. This tool is essential for production environments where agent workflows must handle failures gracefully and maintain state consistency. 28 | 29 | [core](https://github.com/agent-api/core) is a fast, agnostic, and powerful Go AI framework designed for one-shot workflows and building autonomous agents. It supports integration with various LLM providers, making it a flexible choice for developers who need to work with multiple language model services. 30 | 31 | [enio](https://github.com/enio/enio) is the ultimate LLM/AI application development framework in Golang. 32 | 33 | The [code-editing-agent](https://github.com/promacanthus/code-editing-agent) provides a concrete example of an AI agent that edits code using the DeepSeek model. This implementation demonstrates how Go-based agents can perform specialized tasks like code modification, showcasing the practical application of agent technology in software development workflows. 34 | 35 | ![code-editing-agent](../images/code-editing-agent.png) 36 | 37 | ## SDKs 38 | 39 | Software Development Kits (SDKs) for LLM providers are essential tools that simplify integration with various language model services. The Go ecosystem offers several well-maintained SDKs that abstract away the complexities of API interactions. 40 | 41 | The official [openai-go](https://github.com/openai/openai-go) library provides access to OpenAI's API, offering type-safe interfaces and comprehensive documentation. For developers seeking alternatives, [go-openai](https://github.com/sashabaranov/go-openai) serves as a popular wrapper for OpenAI's ChatGPT, GPT-3, GPT-4, DALL·E, and Whisper APIs, providing additional convenience functions and community-driven features. 42 | 43 | For Google's AI services, the [generative-ai-go](https://github.com/google/generative-ai-go) SDK enables integration with Google's generative AI models. Developers working with Anthropic's models can use either the official [anthropic-sdk-go](https://github.com/anthropics/anthropic-sdk-go) or the community-maintained [go-anthropic](https://github.com/liushuangls/go-anthropic) wrapper for Claude API access. 44 | 45 | The [deepseek-go](https://github.com/cohesion-org/deepseek-go) client supports Deepseek models including R-1, Chat V3, and Coder, with additional support for external providers like Azure, OpenRouter, and Local Ollama. This demonstrates the trend toward multi-provider SDKs that allow developers to switch between different LLM services with minimal code changes. 46 | 47 | [gollm](https://github.com/teilomillet/gollm) provides a unified Go interface for multiple LLM providers, simplifying integration through flexible prompt management and common task functions. This abstraction layer allows developers to write provider-agnostic code, making it easier to experiment with different models or migrate between services. 48 | 49 | ![gollm](../images/gollm.png) 50 | 51 | ## DevTools 52 | 53 | Development tools for LLM applications in Go enhance the development workflow by providing frameworks and protocols that simplify common tasks. 54 | 55 | [langchaingo](https://github.com/tmc/langchaingo) brings the popular LangChain framework to Go, providing the easiest way to write LLM-based programs. This tool offers high-level abstractions for common patterns like chains, agents, and memory management, significantly reducing the complexity of building sophisticated LLM applications. 56 | 57 | [genkit](https://github.com/firebase/genkit) is an open-source framework for building AI-powered applications with familiar code-centric patterns. It emphasizes observability and evaluations, making it easier to develop, integrate, and test AI features. The framework works with various models and platforms, providing flexibility in technology choices. 58 | 59 | The Model Context Protocol (MCP) implementations like [mcp-go](https://github.com/mark3labs/mcp-go) and [mcp-golang](https://github.com/metoro-io/mcp-golang) enable seamless integration between LLM applications and external data sources and tools. These tools address the challenge of providing context to language models by standardizing how applications share information with AI systems. 60 | 61 | [fabric](https://github.com/danielmiessler/fabric) provides a modular framework for solving specific problems using crowdsourced AI prompts. This approach allows developers to leverage community knowledge while maintaining control over the prompt engineering process. 62 | 63 | ## Conclusion 64 | 65 | The Go ecosystem offers a comprehensive set of tools for developing LLM-powered applications, ranging from low-level SDKs to high-level frameworks. The language's strengths in concurrency, performance, and simplicity make it well-suited for building reliable and efficient AI applications. From GPT integrations and ChatGPT apps to sophisticated agent frameworks and development tools, Go provides the necessary components to create production-ready AI systems. As the field of artificial intelligence continues to evolve, the Go community is actively contributing tools that make it easier to leverage large language models in various applications. 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Golang.AI 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/promacanthus/awesome-golang-ai?style=social)](https://github.com/promacanthus/awesome-golang-ai) 4 | [![GitHub forks](https://img.shields.io/github/forks/promacanthus/awesome-golang-ai?style=social)](https://github.com/promacanthus/awesome-golang-ai) 5 | [![License](https://img.shields.io/github/license/promacanthus/awesome-golang-ai)](LICENSE) 6 | [![GitHub last commit](https://img.shields.io/github/last-commit/promacanthus/awesome-golang-ai)](https://github.com/promacanthus/awesome-golang-ai/commits/main) 7 | 8 | --- 9 | 10 | **Language** | **语言** 11 | [English](README.md) | [中文](README-zh.md) 12 | 13 | --- 14 | 15 | ## Overview 16 | 17 | > For a quick overview, please refer to [Overview.md](Overview.md). 18 | 19 | The repository is a curated list of resources focused on artificial intelligence (AI) and machine learning (ML) development using the Go programming language. It follows the popular "awesome list" format, which aggregates high-quality, community-vetted tools, libraries, frameworks, benchmarks, and educational materials into a single, organized reference. 20 | 21 | This repository does not contain executable code or software projects. Instead, it serves as a discovery and reference tool for developers, researchers, and engineers interested in leveraging Go for AI-related tasks. The list emphasizes Go's strengths in performance, concurrency, and system-level programming, making it particularly valuable for building scalable, production-grade AI applications. 22 | 23 | The repository is structured into well-defined categories such as benchmarks, large language model (LLM) tools, Retrieval-Augmented Generation (RAG) components, general machine learning libraries, neural networks, and educational resources. Each entry includes a link to the resource and a brief description of its functionality or purpose. 24 | 25 | ## Scope of the Collection 26 | 27 | The awesome-golang-ai list covers a broad spectrum of AI and ML domains, with a strong emphasis on practical tools and evaluation frameworks. Key categories include: 28 | 29 | - **[Benchmarks](docs/01-AI%20and%20ML%20Benchmarks.md)**: Comprehensive evaluation suites for assessing LLM capabilities across various domains such as code generation, mathematical reasoning, multilingual understanding, and real-world software engineering tasks. 30 | - **[Model Context Protocol Implementations](docs/02-Model%20Context%20Protocol%20Implementations.md)**: Resources related to MCP, including SDKs for interacting with major AI platforms (OpenAI, Google, Anthropic), development tools like Ollama for local model execution, agent frameworks, and Go-based implementations of transformer models. 31 | - **[Large Language Models (LLMs)](docs/03-Large%20Language%20Model%20Tools.md)**: Resources related to LLMs, including SDKs for interacting with major AI platforms (OpenAI, Google, Anthropic), development tools like Ollama for local model execution, agent frameworks, and Go-based implementations of transformer models. 32 | - **[RAG (Retrieval-Augmented Generation)](docs/04-RAG%20Components.md)**: Tools for building RAG pipelines, including document parsers for converting PDFs and office files to structured formats, embedding models, and vector databases like Milvus and Weaviate for efficient similarity search. 33 | - **[General Machine Learning Libraries](docs/05-Machine%20Learning%20Libraries.md)**: Foundational ML libraries in Go that support tasks such as regression, classification, clustering, and data manipulation, including libraries like Gorgonia, Gonum, and Golearn. 34 | - **[Neural Networks and Deep Learning](docs/05-Machine%20Learning%20Libraries.md)**: Specialized libraries for constructing and training neural networks, including implementations of feedforward networks, self-organizing maps, and recurrent architectures. 35 | - **[Specialized Domains](docs/docs/05-Machine%20Learning%20Libraries.md)**: Resources for linear algebra, probability distributions, evolutionary algorithms, graph processing, anomaly detection, and recommendation systems. 36 | - **[Educational Materials](docs/06-Educational%20Resources.md)**: Books, tutorials, and datasets to support learning and experimentation in AI with Go. 37 | 38 | The list also includes emerging standards like the **Model Context Protocol (MCP)**, which enables integration between LLM applications and external tools, highlighting the project’s focus on practical, interoperable AI development. 39 | 40 | ## Intended Audience 41 | 42 | The primary audience for this repository includes: 43 | 44 | - **Go Developers** exploring AI/ML integration into their applications 45 | - **Machine Learning Engineers** seeking performant, concurrent backends for AI systems 46 | - **Researchers** evaluating LLMs or building experimental pipelines in Go 47 | - **DevOps and MLOps Engineers** interested in deploying AI models in production environments where Go’s efficiency and reliability are advantageous 48 | - **Students and Learners** who want to study AI concepts through Go implementations 49 | 50 | The list is designed to be accessible to users with varying levels of technical expertise. While some entries assume familiarity with AI concepts, the structure and categorization allow beginners to explore resources progressively, from foundational libraries to advanced frameworks. 51 | 52 | ## Contribution Guidelines 53 | 54 | Although the repository does not explicitly include a `CONTRIBUTING.md` file or detailed contribution instructions within the `README`, it follows standard practices for awesome lists. Users are encouraged to contribute by submitting pull requests to add new, relevant resources or improve existing entries. 55 | 56 | Ideal contributions include: 57 | 58 | - High-quality, actively maintained projects 59 | - Well-documented libraries and tools 60 | - Benchmarks with published results or academic backing 61 | - Educational resources with practical value 62 | 63 | All submissions should be directly relevant to AI/ML development in Go and must provide clear descriptions and working links. The absence of formal guidelines suggests that contributors should follow the existing format and structure of the list when proposing additions. 64 | 65 | ## How to Use This List 66 | 67 | Users can leverage the awesome-golang-ai list in several ways: 68 | 69 | - **Discovery**: Browse categories to find tools relevant to specific needs, such as vector databases for RAG or SDKs for calling LLM APIs. 70 | - **Evaluation**: Use benchmark entries to compare model performance or assess capabilities in areas like code generation or mathematical reasoning. 71 | - **Learning**: Access books and tutorials to build foundational knowledge in AI with Go. 72 | - **Development**: Integrate recommended libraries and frameworks into projects to accelerate AI feature implementation. 73 | - **Research**: Utilize standardized benchmarks and datasets to conduct reproducible experiments. 74 | 75 | The hierarchical structure allows users to quickly navigate from broad categories to specific tools, making it easy to locate resources without prior knowledge of the ecosystem. 76 | 77 | ## Value of Curation in the Go AI Ecosystem 78 | 79 | Curation plays a critical role in the Go AI ecosystem due to the relatively smaller number of AI-focused libraries compared to languages like Python. By aggregating scattered resources into a single, well-organized list, awesome-golang-ai lowers the barrier to entry for developers interested in using Go for AI. 80 | 81 | It promotes best practices by highlighting mature, well-maintained projects and encourages community growth by showcasing innovative tools and research. The list also helps identify gaps in the ecosystem, guiding future development efforts. 82 | 83 | Furthermore, as Go gains traction in backend AI services, microservices, and cloud-native applications, having a centralized reference ensures that developers can efficiently build robust, scalable AI systems without sacrificing performance or reliability. 84 | 85 | ## Star History 86 | 87 | 88 | 89 | 90 | 91 | 92 | Star History of promacanthus/awesome-golang-ai 93 | 94 | 95 | 96 | 97 | 98 | ## Star Geographical Distribution 99 | 100 | 101 | 102 | 103 | 104 | 105 | Star Geographical Distribution of promacanthus/awesome-golang-ai 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/06-Educational Resources.md: -------------------------------------------------------------------------------- 1 | # Educational Resources 2 | 3 | ## Books 4 | 5 | The repository provides several key books that serve as foundational resources for AI development in Go: 6 | 7 | - [Machine Learning With Go](https://github.com/promacanthus/awesome-golang-ai/blob/main/books/Machine%20Learning%20with%20Go.pdf): A comprehensive guide that introduces machine learning concepts using Go. It covers basic algorithms, data preprocessing, and model evaluation, making it ideal for developers new to AI. The book includes practical examples and code snippets to help readers build their first ML models in Go. 8 | 9 | - [Machine-Learning-With-Go](https://github.com/promacanthus/Machine-Learning-With-Go): This repository contains example code that accompanies the "Machine Learning With Go" book. It provides hands-on implementations of various ML algorithms, allowing readers to experiment and deepen their understanding through practice. 10 | 11 | - [机器学习:Go语言实现](https://github.com/promacanthus/awesome-golang-ai/blob/main/books/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%20Go%E8%AF%AD%E8%A8%80%E5%AE%9E%E7%8E%B0.pdf): A Chinese-language resource that focuses on implementing machine learning algorithms in Go. It is suitable for native Chinese speakers seeking to learn AI programming with Go-specific examples and explanations. 12 | 13 | - [Go语言机器学习实战](https://book.douban.com/subject/35037170/): Another Chinese-language book that emphasizes practical applications of machine learning in Go. It covers real-world use cases and implementation strategies, making it valuable for intermediate developers looking to apply AI in production environments. 14 | 15 | These books collectively offer a strong foundation for developers at various proficiency levels, from beginners learning syntax to experienced engineers implementing complex models. 16 | 17 | ## Tutorials and Foundational Knowledge 18 | 19 | The repository includes curated tutorials and foundational knowledge materials to support structured learning: 20 | 21 | - Hands-on Reinforcement Learning: An interactive tutorial series that introduces reinforcement learning concepts with practical exercises. It uses Go-based examples to demonstrate core principles such as Q-learning, policy gradients, and deep reinforcement learning. This resource is ideal for developers interested in building AI agents that learn from interaction. 22 | These tutorials are designed to bridge theoretical knowledge with practical implementation, enabling learners to build working prototypes while understanding underlying AI principles. 23 | 24 | ## Mathematical Foundations 25 | 26 | A solid understanding of mathematics is essential for effective AI development. The repository highlights several libraries and resources that support mathematical computation in Go: 27 | 28 | - [gosl](https://github.com/muesli/gosl): A powerful numerical library that provides tools for linear algebra, eigenvalues, FFT, optimization, differential equations, and probability distributions. It is particularly useful for developers who need to implement custom mathematical models or understand the numerical underpinnings of machine learning algorithms. 29 | 30 | - [sparse](https://github.com/muesli/sparse): A library for sparse matrix operations, which are common in large-scale machine learning applications. It supports efficient storage and computation for high-dimensional data, making it suitable for scientific computing and ML tasks. 31 | 32 | - [godist](https://github.com/muesli/godist): A Go library for probability distributions and statistical methods. It enables developers to work with various distribution types (e.g., Gaussian, Poisson) and perform statistical inference, which is crucial for Bayesian modeling and uncertainty quantification. 33 | 34 | These libraries empower developers to implement mathematical algorithms from scratch, enhancing their understanding of how AI models operate internally. 35 | 36 | ## Algorithm Implementation Resources 37 | 38 | The repository contains numerous open-source implementations of AI algorithms in Go, providing excellent references for learning and development: 39 | 40 | - **Neural Networks**: Libraries like [gobrain](https://github.com/goml/gobrain), [go-deep](https://github.com/patrikeh/go-deep), and [gonn](https://github.com/gonn/gonn) offer implementations of feedforward, recurrent, and self-organizing neural networks. These are ideal for learning how neural networks are structured and trained in Go. 41 | 42 | - **General Machine Learning**: Libraries such as [goml](https://github.com/cdipaolo/goml), [golearn](https://github.com/sjwhitworth/golearn), and [gorgonia](https://github.com/gorgonia/gorgonia) provide tools for classification, regression, clustering, and more. [gonum](https://github.com/gonum/gonum) offers robust support for matrices and statistics, forming the backbone of many ML implementations. 43 | 44 | - **Specialized Algorithms**: 45 | - Decision Trees: [CloudForest](https://github.com/ryanbressler/CloudForest) supports Random Forest and Gradient Boosting. 46 | - Bayesian Classifiers: [bayesian](https://github.com/muesli/bayesian) and [multibayes](https://github.com/muesli/multibayes) enable probabilistic classification. 47 | - Clustering: [gokmeans](https://github.com/mash/gokmeans) and [kmeans](https://github.com/muesli/kmeans) provide k-means clustering implementations. 48 | - Evolutionary Algorithms: [eaopt](https://github.com/muesli/eaopt) supports genetic algorithms and particle swarm optimization. 49 | 50 | These implementations allow developers to study real-world code, understand algorithmic nuances, and adapt solutions to their own projects. 51 | 52 | ## Real-World Application Development 53 | 54 | For developers aiming to build production-grade AI applications, the repository includes frameworks and tools that facilitate real-world deployment: 55 | 56 | - **Large Language Model (LLM) Integration**: 57 | - [ollama](https://github.com/ollama/ollama): Enables local execution of LLMs like Llama 3.3 and Gemma 2. 58 | - [go-openai](https://github.com/andrewkroh/go-openai): Official API wrapper for OpenAI services including GPT-4 and DALL·E. 59 | - [langchaingo](https://github.com/andrewkroh/langchaingo): LangChain implementation for Go, simplifying the creation of LLM-powered applications. 60 | - **AI Agent Frameworks**: 61 | - [swarmgo](https://github.com/andrewkroh/swarmgo): Allows creation of coordinated AI agents. 62 | - [core](https://github.com/andrewkroh/core): A framework for building autonomous agents and one-shot workflows. 63 | - [code-editing-agent](https://github.com/andrewkroh/code-editing-agent): Example of a Go-based AI agent using DeepSeek for code editing. 64 | - **RAG (Retrieval-Augmented Generation)**: 65 | - [pachyderm](https://github.com/andrewkroh/pachyderm): Tools like pachyderm support data versioning and pipeline management. 66 | - [MinerU](https://github.com/andrewkroh/MinerU) and [marker](https://github.com/andrewkroh/marker) convert PDFs to structured formats for AI processing. 67 | - **Vector Databases**: 68 | - [milvus](https://github.com/andrewkroh/milvus) and [weaviate](https://github.com/andrewkroh/weaviate) provide scalable vector search capabilities essential for semantic retrieval in RAG systems. 69 | 70 | These tools enable developers to move beyond theoretical models and build scalable, real-world AI applications with Go. 71 | 72 | ## Learning Pathways for Beginners and Experts 73 | 74 | ### For Beginners 75 | 76 | 1. Start with **Machine Learning With Go** to learn basic syntax and ML concepts. 77 | 2. Practice with example code from the **Machine-Learning-With-Go** repository. 78 | 3. Explore **golearn** and **gonum** to implement simple models like linear regression and k-means clustering. 79 | 4. Build a basic neural network using **gobrain** or **go-deep**. 80 | 5. Complete the **Hands-on Reinforcement Learning** tutorial to understand agent-based AI. 81 | 82 | ### For Experts 83 | 84 | 1. Study **gorgonia** and **spago** to understand low-level ML framework design. 85 | 2. Implement custom algorithms using **gosl** for numerical computing. 86 | 3. Develop AI agents using **swarmgo** and **core**. 87 | 4. Integrate LLMs via **langchaingo** and **go-openai** into microservices. 88 | 5. Optimize performance using **gonum** and **sparse** for large-scale data processing. 89 | 90 | ### Complementary Hands-On Projects 91 | 92 | - **Beginner**: Create a spam classifier using Naive Bayes with the **bayesian** library. 93 | - **Intermediate**: Build a recommendation engine using **gorse**. 94 | - **Advanced**: Develop a multi-agent system using **swarmgo** that solves coding tasks. 95 | - **Expert**: Implement a RAG pipeline using **pachyderm**, **milvus**, and **ollama**. 96 | 97 | This progression ensures developers build both theoretical knowledge and practical skills. 98 | 99 | ## Team Training and Skill Development 100 | 101 | To foster team-wide expertise in Go-based AI development, organizations can leverage the following strategies: 102 | 103 | - **Structured Curriculum**: Use the "Machine Learning With Go" book as a core text for internal training programs. Assign chapters weekly with coding exercises using **golearn** and **gonum**. 104 | - **Code Reviews and Pair Programming**: Encourage teams to study open-source implementations like **gorgonia** and **spago** during code reviews. This promotes deep understanding of architectural patterns and best practices. 105 | - **Hackathons and Challenges**: Organize internal competitions using benchmarks like SWE-bench or HumanEval to solve real-world coding problems with AI agents. 106 | - **Knowledge Sharing**: Host regular sessions where team members present on specific libraries (e.g., CloudForest for decision trees or eaopt for evolutionary algorithms). 107 | - **Project-Based Learning**: Assign teams to build complete AI applications, such as a document processing pipeline using MinerU, pachyderm, and ollama, reinforcing full-stack AI development skills. 108 | 109 | By combining theoretical resources with practical projects, teams can systematically build expertise in Go-specific AI programming. 110 | -------------------------------------------------------------------------------- /docs/01-AI and ML Benchmarks.md: -------------------------------------------------------------------------------- 1 | # AI/ML Benchmarks 2 | 3 | ## Introduction 4 | 5 | The **AI/ML Benchmarks** category in the *awesome-golang-ai* repository provides a comprehensive collection of evaluation frameworks and datasets designed to assess various capabilities of artificial intelligence and machine learning models. These benchmarks are essential for developers and researchers aiming to validate model performance across diverse domains such as reasoning, language understanding, code generation, and multimodal tasks. While the repository itself does not contain Go-specific benchmark implementations, it curates external tools and datasets that can be integrated into Go-based AI/ML workflows using available Go SDKs and libraries. 6 | 7 | This document explores each benchmark subcategory listed in the README, explaining its purpose, summarizing key tools or datasets, and discussing their relevance to Go-based AI development. It also outlines practical integration workflows, performance metrics, and best practices for reliable evaluation. 8 | 9 | ## Real World Challenge 10 | 11 | Benchmarks in this category evaluate AI models on tasks that simulate real-world scenarios requiring complex reasoning and decision-making. 12 | 13 | - **[RPBench-Auto](https://github.com/boson-ai/RPBench-Auto)**: An automated pipeline for evaluating large language models (LLMs) in role-playing scenarios. It assesses a model's ability to maintain consistent personas, follow contextual cues, and generate human-like interactions. 14 | - **[SpreadsheetBench](https://github.com/RUCKBReasoning/SpreadsheetBench)**: Focuses on evaluating LLMs' capabilities in manipulating spreadsheets through natural language instructions. This benchmark tests practical skills in data transformation, formula generation, and error correction in real-world spreadsheet tasks. 15 | 16 | These benchmarks are relevant for Go developers building AI agents or automation tools that interact with users or process structured data. Integration typically involves using Go-based LLM wrappers (e.g., `go-openai`, `langchaingo`) to interface with models and execute benchmark tasks programmatically. 17 | 18 | ## Text-to-Speech (TTS) 19 | 20 | This category includes benchmarks focused on evaluating text-to-speech models for prosody, expressiveness, and linguistic accuracy. 21 | 22 | - **[emergenttts-eval-public](https://github.com/boson-ai/emergenttts-eval-public)**: A benchmark suite designed to test TTS models on complex linguistic and prosodic challenges. It evaluates how well models can generate speech with appropriate intonation, rhythm, and emotional expression based on textual input. 23 | 24 | While no Go-specific TTS evaluation tools are listed, developers can integrate these benchmarks into Go applications by leveraging external APIs or embedding Python-based evaluation scripts via inter-process communication. The `gollm` or `genkit` frameworks could facilitate such integrations by abstracting model interactions. 25 | 26 | ## English 27 | 28 | Benchmarks in this category assess English language understanding, reasoning, and commonsense capabilities of LLMs. 29 | 30 | - **[ARC-AGI](https://github.com/fchollet/ARC-AGI)**: The Abstraction and Reasoning Corpus evaluates abstract reasoning skills using visual pattern completion tasks. 31 | - **[ARC-Challenge](https://github.com/allenai/ARC-Solvers?tab=readme-ov-file)**: AI2 Reasoning Challenge (ARC) Set. 32 | - **[BBH (BIG-Bench Hard)](https://github.com/suzgunmirac/BIG-Bench-Hard)**: A subset of challenging tasks from the BIG-Bench suite that test advanced reasoning capabilities. 33 | - **[BIG-bench](https://github.com/google/BIG-bench)**: A collaborative benchmark with hundreds of tasks spanning diverse domains. 34 | - **[GPQA](https://github.com/idavidrein/gpqa)**: GPQA: A Graduate-Level Google-Proof Q&A Benchmark. 35 | - **[HelloSwag](https://github.com/rowanz/hellaswag)**: HellaSwag: Can a Machine *Really* Finish Your Sentence? 36 | - **[IFEval](https://huggingface.co/datasets/google/IFEval)**: Evaluates instruction-following fidelity using verifiable instruction types and dual metrics (strict/loose). 37 | - **[LiveBench](https://github.com/LiveBench/LiveBench)**: A contamination-free benchmark updated regularly to prevent overfitting. 38 | - **[MMLU](https://github.com/hendrycks/test), [MMLU-CF](https://github.com/microsoft/MMLU-CF), [MMLU-Pro](https://github.com/TIGER-AI-Lab/MMLU-Pro)**: Measure multitask language understanding across 57 subjects; MMLU-CF ensures no data leakage, while MMLU-Pro increases difficulty. 39 | - **[MTEB](https://github.com/embeddings-benchmark/mteb)**: Evaluates text embedding models across multiple tasks like classification, retrieval, and clustering. 40 | - **[PIQA](https://github.com/rowanz/piqa)**: Assesses physical commonsense reasoning. 41 | - **[WinoGrande](https://github.com/rowanz/wino_grande)**: An adversarial benchmark based on Winograd schemas to test coreference resolution. 42 | 43 | Go developers can use these benchmarks to validate models accessed via APIs (e.g., OpenAI, Anthropic) using Go SDKs like `openai-go` or `anthropic-sdk-go`. Results are typically interpreted as accuracy scores or pass rates per task. 44 | 45 | ## Chinese 46 | 47 | These benchmarks evaluate LLMs on Chinese language understanding and reasoning tasks. 48 | 49 | - **[C-Eval](https://github.com/hkust-nlp/ceval)**: A comprehensive evaluation suite for foundation models in Chinese, covering 52 subjects from humanities to STEM. 50 | - **[CMMLU](https://github.com/haonan-li/CMMLU)**: Similar to MMLU but focused on Chinese language understanding across diverse domains. 51 | - **[C-SimpleQA](https://github.com/OpenStellarTeam/ChineseSimpleQA)**: Evaluates factuality and correctness in Chinese question-answering systems. 52 | 53 | For Go-based applications targeting Chinese-speaking users, these benchmarks help ensure linguistic and cultural accuracy. Integration follows similar patterns as English benchmarks, using Go API clients to query models and process responses. 54 | 55 | ## Math 56 | 57 | Mathematical reasoning benchmarks test a model’s ability to solve problems ranging from elementary arithmetic to Olympiad-level challenges. 58 | 59 | - **[AIME](https://github.com/eth-sri/matharena)**: Evaluates performance on recent math competition problems. 60 | - **[grade-school-math (GSM8K)](https://github.com/openai/grade-school-math)**: Contains 8.5K grade school math word problems requiring multi-step reasoning. 61 | - **[MATH](https://github.com/hendrycks/math)**: A dataset of challenging mathematical problems with step-by-step solutions. 62 | - **[MathVista](https://github.com/lupantech/MathVista)**: Focuses on mathematical reasoning in visual contexts (e.g., charts, diagrams). 63 | - **[Omni-MATH](https://github.com/KbsdJames/Omni-MATH)**: Designed to assess Olympiad-level mathematical reasoning. 64 | - **[TAU-bench](https://github.com/sierra-research/tau-bench)**: Evaluates complex reasoning across multiple domains, including math. 65 | 66 | These benchmarks are critical for applications involving quantitative analysis or education. Go developers can integrate them by sending prompts to LLMs via Go SDKs and parsing outputs for correctness using automated evaluators. 67 | 68 | ## Code 69 | 70 | Code-related benchmarks evaluate programming capabilities, from code generation to debugging. 71 | 72 | - **[AIDER](https://github.com/Aider-AI/aider)**: Provides leaderboards comparing LLMs on code writing and editing tasks. 73 | - **[BFCL](https://gorilla.cs.berkeley.edu/blogs/8_berkeley_function_calling_leaderboard.html)**: Studies function-calling (tool use) capabilities of LLMs. 74 | - **[BigCodeBench](https://github.com/bigcode-project/bigcodebench/)**: Benchmarks code generation toward artificial general intelligence. 75 | - **[Code4Bench](https://github.com/code4bench/Code4Bench)**: Uses Codeforces data for program analysis evaluation. 76 | - **[CRUXEval](https://github.com/facebookresearch/cruxeval)**: Evaluates code reasoning, understanding, and execution. 77 | - **[HumanEval](https://github.com/openai/human-eval)**: A code generation benchmark with hand-written programming problems. 78 | - **[LiveCodeBench](https://github.com/LiveCodeBench/LiveCodeBench)**: Offers contamination-free evaluation of code generation. 79 | - **[MBPP](https://github.com/google-research/google-research/tree/master/mbpp)**: Crowd-sourced Python problems for entry-level programmers. 80 | - **[MultiPL-E](https://github.com/microsoft/MultiPL-E)**: Supports multiple programming languages in code generation evaluation. 81 | - **[multi-swe-bench](https://github.com/zhubowen/multi-swe-bench)**: Multilingual dataset for debugging real GitHub issues. 82 | - **[SWE-bench](https://github.com/zhubowen/SWE-bench)**: Evaluates LLMs on real-world software engineering bug fixes. 83 | 84 | Go developers can leverage these benchmarks to test AI-powered coding assistants. Tools like langchaingo or swarmgo enable building agents that interact with code repositories and execute benchmark tasks. Performance is measured using pass@k metrics or execution accuracy. 85 | 86 | ## Tool Use 87 | 88 | This category evaluates an LLM’s ability to utilize external tools and APIs effectively. 89 | 90 | - **[BFCL](https://gorilla.cs.berkeley.edu/blogs/8_berkeley_function_calling_leaderboard.html)**: Also listed under Code, it specifically assesses function-calling accuracy. 91 | - **[T-Eval](https://github.com/open-compass/T-Eval)**: Step-by-step evaluation of tool utilization capability. 92 | - **[WildBench](https://github.com/allenai/WildBench)**: Benchmarks LLMs using real user tasks from the wild. 93 | 94 | These benchmarks are crucial for AI agents that must interact with databases, APIs, or other services. In Go, developers can implement tool-calling logic using frameworks like mcp-go or core, which support Model Context Protocol (MCP) for standardized tool integration. 95 | 96 | ## Open ended 97 | 98 | Evaluates models on open-ended tasks without deterministic answers. 99 | 100 | - **[Arena-Hard](https://github.com/lmarena/arena-hard-auto)**: An automatic benchmark that pits models against each other in open-ended conversations, scored by other LLMs. 101 | 102 | Useful for chatbots and dialogue systems built in Go using frameworks like eino or fabric. Evaluation relies on LLM-as-a-judge methodologies. 103 | 104 | ## Safety 105 | 106 | No specific benchmarks are listed under Safety in the repository. However, safety evaluation generally involves testing for harmful content generation, bias, and ethical compliance. 107 | 108 | Future additions might include benchmarks like TruthfulQA or ToxiGen. Go-based safety layers can be implemented using prompt filtering and response moderation via API calls. 109 | 110 | ## False refusal 111 | 112 | Assesses whether models unnecessarily refuse valid requests due to over-cautious safety mechanisms. 113 | 114 | - **[Xstest](https://github.com/paul-rottger/xstest)**: Identifies exaggerated safety behaviors by testing models on benign prompts that resemble harmful ones. 115 | 116 | This benchmark helps fine-tune safety thresholds in AI applications. Go developers can integrate Xstest by running controlled evaluations using their deployed models and analyzing refusal rates. 117 | 118 | ## Multi-modal 119 | 120 | Evaluates models that process both text and visual inputs. 121 | 122 | - **[DPG-Bench](https://github.com/TencentQQGYLab/ELLA)**: Tests image generation from complex prompts. 123 | - **[geneval](https://github.com/djghosh13/geneval)**: Evaluates text-to-image alignment. 124 | - **[LongVideoBench](https://github.com/longvideobench/LongVideoBench)**: Assesses long video understanding. 125 | - **[MLVU](https://github.com/JUNJIE99/MLVU)**: Multi-task long video understanding. 126 | - **[perception_test](https://github.com/google-deepmind/perception_test)**: Diagnoses multimodal video model perception. 127 | - **[TempCompass](https://github.com/llyx97/TempCompass)**: Evaluates temporal reasoning in videos. 128 | - **[VBench](https://github.com/Vchitect/VBench)**: Comprehensive benchmark for video generation. 129 | - **[Video-MME](https://github.com/BradyFU/Video-MME)**: First comprehensive benchmark for multi-modal LLMs in video analysis. 130 | 131 | While Go lacks native multimodal model support, developers can integrate these benchmarks via API calls to external models (e.g., GPT-4V, Gemini). The `generative-ai-go` SDK enables interaction with Google’s multimodal models. 132 | 133 | ## Best Practices for Benchmark Selection and Execution 134 | 135 | When selecting and executing AI/ML benchmarks in Go environments, consider the following best practices: 136 | 137 | 1. Choose Domain-Relevant Benchmarks: Align benchmarks with your application’s use case (e.g., use MMLU for general knowledge, HumanEval for coding). 138 | 2. Avoid Data Contamination: Use contamination-free benchmarks like LiveBench or MMLU-CF to ensure valid results. 139 | 3. Standardize Evaluation Metrics: Use established metrics (e.g., accuracy, F1, pass@k) for consistency. 140 | 4. Automate Testing Workflows: Integrate benchmarks into CI/CD pipelines using Go testing frameworks. 141 | 5. Leverage Go SDKs: Use official or community-supported Go libraries (openai-go, langchaingo) to streamline model interaction. 142 | 6. Monitor Performance Over Time: Track model performance across versions to detect regressions. 143 | 7. Ensure Reproducibility: Document prompt templates, temperature settings, and evaluation scripts. 144 | 145 | Common challenges include lack of native Go support for certain benchmarks, dependency on external APIs, and difficulty in interpreting nuanced results. To mitigate these, encapsulate benchmark logic in reusable Go packages and use observability tools like genkit for tracing and evaluation. 146 | 147 | ## Conclusion 148 | 149 | The AI/ML Benchmarks section of the awesome-golang-ai repository serves as a valuable resource for evaluating LLMs across diverse capabilities. Although most benchmarks are not implemented natively in Go, they can be effectively integrated into Go-based AI applications using available SDKs and frameworks. By leveraging tools like `langchaingo`, `mcp-go`, and `gollm`, developers can build robust evaluation pipelines that ensure model reliability, accuracy, and safety. As the Go ecosystem continues to mature in AI/ML support, native benchmark implementations and wrappers are expected to emerge, further enhancing the language’s utility in this domain. 150 | -------------------------------------------------------------------------------- /docs/04-RAG Components.md: -------------------------------------------------------------------------------- 1 | # RAG Components 2 | 3 | ## Introduction 4 | 5 | Retrieval-Augmented Generation (RAG) is a powerful architectural pattern that enhances the accuracy and reliability of Large Language Models (LLMs) by integrating external knowledge sources during inference. This document provides a comprehensive overview of RAG components available in the Go ecosystem, focusing on Document Parsers, Pipeline and Data Versioning tools, Embedding libraries, and Vector Databases. The repository analyzed is a curated list of AI-related tools and libraries for Go, serving as a valuable resource for developers building AI applications with Golang. While the repository itself does not contain implementation code, it catalogs prominent tools and frameworks that can be used to construct complete RAG systems. 6 | 7 | ## RAG Architecture Overview 8 | 9 | Retrieval-Augmented Generation (RAG) architecture combines the generative capabilities of Large Language Models with external knowledge retrieval to produce more accurate and contextually relevant responses. The RAG process follows a two-phase approach: an offline indexing phase and an online retrieval-generation phase. In the indexing phase, documents are parsed, chunked into smaller segments, converted to vector embeddings using embedding models, and stored in a vector database with appropriate metadata. During inference, a user query is similarly converted to an embedding, used to retrieve the most relevant document chunks from the vector database, and then combined with the original query as context for the LLM to generate a response. This architecture significantly improves LLM accuracy by grounding responses in verifiable external knowledge, reduces hallucinations, and enables models to answer questions about domain-specific or up-to-date information not present in their training data. 10 | 11 | ![RAG Architecture](../images/rag-architecture.png) 12 | 13 | ## Document Parsers 14 | 15 | Document parsers are responsible for extracting text content from various file formats and converting them into a structured format suitable for downstream processing in RAG pipelines. These tools handle the complexities of different document structures, formatting, and encoding to ensure high-fidelity text extraction. In the Go ecosystem, while there are limited native document parsing libraries specifically for RAG, several powerful tools can be integrated into Go applications. The repository lists several document parsing tools, though many are implemented in other languages like Python. For Go applications, developers can either use these tools via subprocess calls or look for Go-native alternatives that provide similar functionality. 16 | 17 | ### Prominent Document Parsing Tools 18 | 19 | - **[markitdown](https://github.com/microsoft/markitdown)**: A Python tool for converting various file and office documents to Markdown format, preserving structural elements and formatting. 20 | - **[MinerU](https://github.com/opendatalab/MinerU)**: A high-quality tool for converting PDF documents to Markdown and JSON formats, maintaining document structure and metadata. 21 | - **[docling](https://github.com/docling-project/docling)**: A document processing tool designed to prepare documents for generative AI applications, handling various document types and formats. 22 | - **[marker](https://github.com/datalab-to/marker)**: A fast and accurate tool for converting PDF files to Markdown and JSON with high precision in text extraction and layout preservation. 23 | 24 | These document parsers play a crucial role in the initial stage of RAG pipelines by transforming unstructured or semi-structured documents into clean, structured text that can be effectively processed and indexed. The choice of parser depends on the specific document types being processed and the required output format for downstream components. 25 | 26 | ### Pipeline and Data Versioning Tools 27 | 28 | Pipeline and data versioning tools provide the infrastructure for managing the data flow and version control in RAG systems, ensuring reproducibility, traceability, and reliability of the knowledge retrieval process. These tools are essential for production-grade RAG applications where data evolves over time and maintaining historical versions is critical for auditing and debugging. They enable systematic processing of documents through various stages of the RAG pipeline while tracking changes and dependencies. 29 | 30 | ### [Pachyderm](https://github.com/pachyderm/pachyderm) 31 | 32 | Pachyderm is a prominent data-centric pipeline and data versioning tool listed in the repository. It provides a comprehensive platform for building data pipelines with built-in version control, enabling developers to track changes to datasets and processing logic over time. Pachyderm's data versioning capabilities are particularly valuable for RAG systems, as they allow organizations to maintain historical versions of their knowledge bases, track when specific information was added or modified, and reproduce results from specific points in time. This is crucial for compliance, auditing, and debugging scenarios where understanding the context of retrieved information is essential. 33 | 34 | Pachyderm integrates well with various data processing frameworks and can be used to orchestrate the entire RAG pipeline, from document ingestion and parsing to chunking, embedding generation, and storage in vector databases. Its container-based architecture allows for easy integration of different processing components, including those written in Go, making it a flexible choice for building robust RAG systems. 35 | 36 | ## Embedding Libraries and Benchmarks 37 | 38 | Embedding libraries and benchmarks are critical components in RAG systems, responsible for converting text into numerical vector representations that capture semantic meaning. These embeddings enable similarity search in vector databases, allowing the system to find relevant document chunks based on semantic similarity rather than exact keyword matching. While the repository doesn't list specific Go libraries for generating embeddings, it includes important benchmarks that help evaluate and compare embedding models. 39 | 40 | ### [MTEB (Massive Text Embedding Benchmark)](https://github.com/embeddings-benchmark/mteb) 41 | 42 | MTEB is an open-source benchmarking framework for evaluating and comparing text embedding models across eight tasks, including classification, retrieval, and clustering, using 58 datasets in 112 languages. It provides standardized performance metrics that help developers select the most appropriate embedding models for their specific use cases. When implementing RAG systems in Go, developers can use MTEB to evaluate different embedding models and choose those that perform best on tasks relevant to their application domain. 43 | 44 | ### [BRIGHT Benchmark](https://github.com/xlang-ai/BRIGHT) 45 | 46 | BRIGHT is a challenging benchmark for reasoning-intensive retrieval, featuring 12 diverse datasets across domains like mathematics, code, and biology. It evaluates retrieval models on complex, context-rich queries that require logical inference, making it particularly relevant for RAG systems that need to handle sophisticated user queries. By using BRIGHT to evaluate embedding models, developers can ensure their RAG systems are capable of retrieving relevant information for complex, multi-step reasoning tasks. 47 | 48 | For Go implementations, developers typically integrate with embedding models through APIs (such as OpenAI, Google Generative AI, or local models via Ollama) rather than implementing embedding generation directly in Go. The repository lists several tools that facilitate this integration, including SDKs for various LLM providers. 49 | 50 | ## Vector Databases 51 | 52 | Vector databases are specialized storage systems designed to efficiently store and retrieve high-dimensional vector embeddings, serving as the retrieval component in RAG architectures. They enable fast approximate nearest neighbor (ANN) search, which is essential for finding semantically similar document chunks in large knowledge bases. The repository lists several prominent vector databases that can be integrated with Go applications to build scalable RAG systems. 53 | 54 | ### [Milvus](https://github.com/milvus-io/milvus) 55 | 56 | Milvus is a high-performance, cloud-native vector database built specifically for scalable vector ANN search. It is optimized for handling large-scale vector data and provides advanced indexing algorithms to ensure fast retrieval even with billions of vectors. Milvus supports various distance metrics and indexing methods, allowing developers to tune performance based on their specific requirements. Its cloud-native architecture makes it suitable for distributed deployments, and it provides APIs that can be easily integrated with Go applications through available SDKs or HTTP interfaces. 57 | 58 | ### [Weaviate](https://github.com/weaviate/weaviate) 59 | 60 | Weaviate is an open-source vector database that stores both objects and vectors, enabling the combination of vector search with structured filtering. This hybrid approach allows for more sophisticated queries that can filter results based on metadata while still leveraging semantic similarity search. Weaviate's fault tolerance and scalability make it suitable for production RAG applications, and its GraphQL-based API provides a flexible interface for querying data. The ability to combine vector search with structured queries is particularly valuable in RAG systems where retrieval needs to consider both semantic relevance and metadata constraints (such as document source, date, or access permissions). 61 | 62 | ### [TiDB](https://github.com/pingcap/tidb) 63 | 64 | While primarily a distributed SQL database, TiDB is included in the vector database category of the repository, suggesting its potential use in hybrid retrieval scenarios. TiDB's distributed architecture and SQL capabilities make it suitable for storing structured metadata associated with vector embeddings, potentially serving as a complementary database to specialized vector databases in complex RAG architectures. 65 | 66 | These vector databases provide the foundation for the retrieval component of RAG systems, enabling efficient search through large knowledge bases to find the most relevant information for augmenting LLM prompts. 67 | 68 | ## Integration Patterns and Frameworks 69 | 70 | Several frameworks and tools in the Go ecosystem facilitate the integration of RAG components, providing abstractions and utilities that simplify the development of retrieval-augmented applications. These frameworks help manage the complexity of coordinating multiple components in a RAG pipeline, from document processing to retrieval and generation. 71 | 72 | ### [Langchaingo](https://github.com/tmc/langchaingo) 73 | 74 | Langchaingo is a Go implementation of the popular LangChain framework, providing tools and abstractions for building LLM-based applications in Go. It likely includes components for implementing RAG patterns, such as document loaders, text splitters, vector store integrations, and retrieval chains. By using Langchaingo, Go developers can leverage familiar patterns from the LangChain ecosystem while building applications in their preferred language. 75 | 76 | ### [Genkit](https://github.com/genkit/genkit) 77 | 78 | Genkit is an open-source framework for building AI-powered applications with code-centric patterns. It emphasizes observability and evaluations, making it easier to develop, integrate, and test AI features. Genkit works with various models and platforms, providing flexibility in choosing the underlying LLM and embedding providers. Its focus on developer experience and testing makes it suitable for building production-grade RAG applications. 79 | 80 | ### [Eino](https://github.com/enio/enio) 81 | 82 | Eino is described as the ultimate LLM/AI application development framework in Golang, suggesting comprehensive support for building complex AI applications, including those with RAG architectures. As a full-featured framework, it likely provides integrated support for the various components needed in RAG systems. 83 | 84 | ### [Gollm](https://github.com/gollm/gollm) 85 | 86 | Gollm provides a unified Go interface for multiple LLM providers, simplifying the integration of different models into RAG systems. This abstraction layer allows developers to switch between providers without changing their application code, providing flexibility in choosing the most appropriate LLM for their use case. 87 | 88 | These frameworks significantly reduce the complexity of implementing RAG systems in Go by providing pre-built components, handling integration details, and offering abstractions that encapsulate common patterns. 89 | 90 | ## End-to-End RAG Implementation Example 91 | 92 | This section outlines a conceptual end-to-end RAG implementation using Go and the tools referenced in the repository. While specific implementation details would depend on the chosen libraries and services, this example demonstrates the typical workflow and integration points. 93 | 94 | ![End-to-End RAG Implementation Example](../images/rag-end-to-end.png) 95 | 96 | The implementation would typically involve: 97 | 98 | 1. Using a document parser like MinerU or marker to extract text from various document formats 99 | 2. Processing the extracted text with a Go application that chunks the content into manageable segments 100 | 3. Using an embedding service (via API or local model) to convert text chunks into vector embeddings 101 | 4. Storing the embeddings and associated metadata in a vector database like Milvus or Weaviate 102 | 5. For inference, converting user queries to embeddings and retrieving relevant chunks 103 | 6. Augmenting the LLM prompt with retrieved context and generating a response 104 | 105 | The repository's listed tools like langchaingo or genkit could provide higher-level abstractions to simplify this implementation. 106 | 107 | ## Performance Optimization Techniques 108 | 109 | Building high-performance RAG systems requires careful consideration of various optimization techniques to ensure low latency and high throughput. These techniques span multiple components of the RAG architecture and are crucial for production deployments. 110 | 111 | ### Indexing and Retrieval Optimization 112 | 113 | - Chunking Strategies: Optimizing chunk size and overlap to balance context preservation with retrieval precision 114 | - Hybrid Search: Combining vector search with keyword-based or metadata filtering to improve retrieval accuracy 115 | - Indexing Algorithms: Selecting appropriate ANN algorithms (like HNSW, IVF) based on data size and query patterns 116 | - Caching: Implementing caching layers for frequent queries or retrieved results to reduce database load 117 | 118 | ### System Architecture Optimization 119 | 120 | - Asynchronous Processing: Using message queues and worker pools to handle document ingestion and indexing asynchronously 121 | - Load Balancing: Distributing queries across multiple vector database instances or embedding models 122 | - Connection Pooling: Managing database connections efficiently to handle high concurrency 123 | - Batch Processing: Processing multiple documents or queries in batches to improve throughput 124 | 125 | ### Resource Management 126 | 127 | - Memory Optimization: Using efficient data structures and garbage collection tuning for Go applications 128 | - Model Quantization: Using quantized embedding models to reduce memory footprint and improve inference speed 129 | - Distributed Deployment: Scaling components horizontally across multiple servers or containers 130 | 131 | These optimization techniques, combined with the robust tools and frameworks available for Go, enable the development of high-performance RAG systems capable of handling large knowledge bases and high query volumes. 132 | -------------------------------------------------------------------------------- /docs/05-Machine Learning Libraries.md: -------------------------------------------------------------------------------- 1 | # Machine Learning Libraries 2 | 3 | ## Introduction 4 | 5 | The Go programming language offers a growing ecosystem of machine learning libraries that leverage its strengths in concurrency, performance, and system-level programming. The "awesome-golang-ai" repository curates a comprehensive collection of tools and frameworks that enable developers to implement machine learning workflows entirely in Go. This document provides a detailed analysis of the key libraries available for numerical computing, model training, statistical analysis, and AI development in Go, focusing on their roles in modern ML workflows, implementation capabilities, and performance characteristics. 6 | 7 | ## General Machine Learning Frameworks 8 | 9 | The Go ecosystem features several comprehensive machine learning frameworks that provide high-level abstractions for building and training models. These frameworks serve as the foundation for various AI development workflows, offering tools for data preprocessing, model training, and evaluation. 10 | 11 | **[Gorgonia](https://github.com/gorgonia/gorgonia)** is a prominent library that facilitates machine learning in Go by providing computational graph capabilities similar to TensorFlow. It enables automatic differentiation and gradient computation, essential for training neural networks and other differentiable models. Gorgonia's design focuses on performance and flexibility, making it suitable for both research and production environments. 12 | 13 | **[Spago](https://github.com/nlpodyssey/spago)** stands out as a self-contained machine learning and natural language processing library written entirely in Go. It provides implementations of various ML algorithms and deep learning components without external dependencies, promoting ease of deployment and reproducibility. Spago's architecture supports both supervised and unsupervised learning tasks, with particular emphasis on NLP applications. 14 | 15 | **[Golearn](https://github.com/sjwhitworth/golearn)** offers a simple and customizable ML library with "batteries included" philosophy, providing ready-to-use implementations of common algorithms. It follows a design pattern similar to Python's scikit-learn, making it accessible to developers familiar with that ecosystem. Golearn supports various classification, regression, and clustering algorithms with consistent APIs. 16 | 17 | **[Goml](https://github.com/cdipaolo/goml)** specializes in online machine learning, enabling models to learn from data streams incrementally without requiring batch processing. This capability is particularly valuable for applications with continuous data ingestion and real-time learning requirements. 18 | 19 | ![general machine learning frameworks](../images/general-machine-learning-frameworks.png) 20 | 21 | ## Specialized Machine Learning Categories 22 | 23 | Beyond general frameworks, the Go ecosystem includes specialized libraries targeting specific ML domains and algorithmic approaches. 24 | 25 | ### Neural Networks 26 | 27 | The repository lists multiple neural network implementations, each with different design philosophies and use cases: 28 | 29 | - **[Gobrain](https://github.com/goml/gobrain)**: A straightforward neural network implementation suitable for educational purposes and simple applications 30 | - **[Go-deep](https://github.com/patrikeh/go-deep)**: An artificial neural network library with support for various activation functions and training algorithms 31 | - **[Neurgo](https://github.com/Neurgo/Neurgo)**: A neural network toolkit providing modular components for building custom architectures 32 | - **[Gonn](https://github.com/gonn/gonn)**: Implements multiple neural network types including backpropagation (BPNN), radial basis function (RBF), and perceptron networks 33 | 34 | ### Decision Trees and Ensembles 35 | 36 | **[CloudForest](https://github.com/ryanbressler/CloudForest)** is highlighted as a fast and flexible library for multi-threaded decision tree ensembles. It supports Random Forest and Gradient Boosting algorithms, specifically designed for high-dimensional heterogeneous data with missing values. CloudForest emphasizes speed and robustness, making it suitable for real-world machine learning tasks with complex data characteristics. 37 | 38 | ### Bayesian Classifiers 39 | 40 | The ecosystem includes bayesian for Naive Bayesian classification and multibayes for multiclass Naive Bayesian classification. These libraries provide probabilistic approaches to classification tasks, particularly effective for text classification and other high-dimensional categorical problems. 41 | 42 | ### Recommendation Engines 43 | 44 | Several recommendation system implementations are available: 45 | 46 | - **[Gorse](https://github.com/zhubowen/gorse)**: A comprehensive recommender system engine with support for collaborative filtering and content-based approaches 47 | - **[Regommend](https://github.com/zhubowen/regommend)**: A recommendation engine designed for integration into Go applications 48 | - **[Too](https://github.com/zhubowen/too)**: A simple recommendation engine built on top of Redis for fast in-memory operations 49 | 50 | ### Clustering Algorithms 51 | 52 | For unsupervised learning tasks, Go offers multiple k-means implementations: 53 | 54 | - **[Gokmeans](https://github.com/zhubowen/gokmeans)**: A k-means algorithm implementation with focus on performance 55 | - **[Kmeans](https://github.com/zhubowen/kmeans)**: Another k-means clustering implementation with straightforward API 56 | 57 | ![specialized machine learning categories](../images/specialized-machine-learning-categories.png) 58 | 59 | ## Numerical Computing and Mathematical Foundations 60 | 61 | Robust numerical computing capabilities form the mathematical foundation for machine learning implementations in Go. 62 | 63 | **[Gonum](https://github.com/gonum/gonum)** is a fundamental library that provides a comprehensive set of numeric tools for the Go programming language. It includes packages for: 64 | 65 | - Matrix operations and linear algebra 66 | - Statistical analysis and probability distributions 67 | - Mathematical optimization 68 | - Differential equations 69 | 70 | Gonum serves as the backbone for many higher-level ML libraries, providing efficient implementations of core mathematical operations. Its matrix package supports various operations essential for machine learning, including matrix multiplication, decomposition, and eigenvalue computation. 71 | 72 | For specialized linear algebra operations, Gosl offers extensive capabilities including eigenvalues, FFT, Bessel functions, and sparse matrix operations. The sparse library specifically addresses sparse matrix formats, which are crucial for handling high-dimensional data efficiently in scientific and machine learning applications. 73 | 74 | For probability distributions, Godist provides implementations of various probability distributions and associated statistical methods, enabling probabilistic modeling and Bayesian inference workflows. 75 | 76 | ![mathematical foundations](../images/mathematical-foundations.png) 77 | 78 | ## Neural Networks and Deep Learning 79 | 80 | The Go ecosystem provides several options for neural network and deep learning applications, ranging from educational implementations to production-ready frameworks. 81 | 82 | **[Gorgonia](https://github.com/gorgonia/gorgonia)** emerges as the most sophisticated option for deep learning in Go, offering computational graph construction and automatic differentiation. While the repository doesn't provide implementation details, Gorgonia's description suggests it supports the core operations required for deep learning: tensor operations, gradient computation, and backpropagation. 83 | 84 | **[Spago](https://github.com/nlpodyssey/spago)** positions itself as a self-contained deep learning framework with natural language processing capabilities. As a comprehensive library, it likely includes implementations of common neural network architectures such as feedforward networks, recurrent neural networks, and potentially transformer models. 85 | 86 | Specialized neural network libraries offer more focused functionality: 87 | 88 | - **[Gosom](https://github.com/milosgajdos/gosom)**: Implements self-organizing maps for unsupervised learning and dimensionality reduction 89 | - **[Go-perceptron-go](https://github.com/made2591/go-perceptron-go)**: Supports single, multi-layer, and recurrent neural networks 90 | - **[Gomind](https://github.com/surenderthakran/gomind)**: Provides a simplistic neural network library suitable for learning and prototyping 91 | 92 | For data manipulation and preprocessing, several DataFrame implementations are available: 93 | 94 | - **[Gota](https://github.com/go-gota/gota )**: Provides DataFrame functionality for data wrangling and analysis 95 | - **[Dataframe-go](https://github.com/rocketlaunchr/dataframe-go)**: Offers data frame capabilities for statistics and machine learning 96 | - **[Qframe](https://github.com/tobgu/qframe)**: Implements immutable data frames for reliable data manipulation 97 | 98 | ![neural networks libraries](../images/neural-networks-libraries.png) 99 | 100 | ## Model Definition and Training Workflows 101 | 102 | The Go ML ecosystem supports various model definition and training paradigms, though specific implementation details for tensor operations and gradient computation are not provided in the repository. 103 | 104 | Based on the libraries described, model definition in Go typically follows one of several patterns: 105 | 106 | 1. Imperative programming: Direct implementation of algorithms using Go's native syntax and control structures 107 | 2. Computational graphs: Declarative definition of operations using frameworks like Gorgonia 108 | 3. High-level APIs: Using pre-built components and estimators as in Golearn 109 | 110 | For gradient computation, Gorgonia likely implements reverse-mode automatic differentiation, enabling efficient computation of gradients for neural network training. This capability is essential for implementing backpropagation in deep learning models. 111 | 112 | Model training workflows in Go leverage the language's concurrency features to potentially parallelize operations across multiple cores. Libraries like CloudForest explicitly mention multi-threading support for decision tree ensembles, suggesting that performance optimization through parallel execution is a design consideration in the ecosystem. 113 | 114 | The regression library provides multivariable regression capabilities, while ridge implements ridge regression, offering regularized linear models for scenarios with multicollinearity or overfitting concerns. 115 | 116 | ## Integration with External Systems 117 | 118 | The repository highlights several libraries that facilitate integration between Go ML applications and external systems. 119 | 120 | **MCP (Model Context Protocol)** implementations like **mcp-go** and **mcp-golang** enable seamless integration between LLM applications and external data sources and tools. These libraries allow Go applications to interact with external systems through standardized protocols, enhancing interoperability. 121 | 122 | **[Gollm](https://github.com/zhubowen/gollm)** provides a unified interface for language model providers, simplifying integration with various LLM platforms. This abstraction layer allows developers to switch between different providers without changing their core application logic. 123 | 124 | For vector storage and similarity search, the ecosystem integrates with external databases: 125 | 126 | - **[Milvus](https://github.com/milvus-io/milvus)**: A high-performance, cloud-native vector database for scalable approximate nearest neighbor search 127 | - **[Weaviate](https://github.com/Weaviate/weaviate)**: An open-source vector database that combines vector search with structured filtering 128 | - **[TiDB](https://github.com/pingcap/tidb)**: A distributed SQL database that can be used for structured data storage alongside ML workflows 129 | 130 | The **[gpt4all-bindings](https://github.com/gpt4all/gpt4all-bindings)** provide interfaces to local LLMs, enabling integration with GPT4All models for offline inference scenarios. 131 | 132 | While the repository doesn't explicitly mention ONNX or other standard model format support, the presence of API wrappers for major LLM providers (**[openai-go](https://github.com/sashabaranov/openai-go)**, **[anthropic-sdk-go](https://github.com/anthropic/anthropic-sdk-go)**, **[deepseek-go](https://github.com/cohesion-org/deepseek-go)**) indicates strong integration capabilities with external AI services. 133 | 134 | ![integration with external systems](../images/integration-with-external-systems.png) 135 | 136 | ## Performance Characteristics 137 | 138 | Go's design principles translate into favorable performance characteristics for machine learning applications, particularly in production environments requiring low-latency inference and scalable training pipelines. 139 | 140 | The repository explicitly highlights Go's "inexplicable speed, easy debugging, concurrency" as advantages for AI applications. Several libraries emphasize performance-oriented design: 141 | 142 | - **[CloudForest](https://github.com/zhubowen/cloudforest)** is described as "fast" and "flexible" with multi-threaded support for decision tree ensembles 143 | - **[Milvus](https://github.com/milvus-io/milvus)** is characterized as "high-performance" and "cloud-native" for scalable vector search 144 | - **[Gota](https://github.com/go-gota/gota)** and other data manipulation libraries are designed for efficient data wrangling in ML workflows 145 | 146 | Go's native concurrency model enables parallel execution of ML operations across multiple CPU cores, which can significantly accelerate training and inference tasks. The language's efficient memory management and compilation to native code contribute to low-latency inference capabilities, making Go suitable for real-time ML applications. 147 | 148 | For scalable training pipelines, Go's strong support for distributed systems and microservices architecture allows ML workflows to be distributed across multiple nodes. The availability of cloud-native vector databases like Milvus further enhances scalability for similarity search operations in large-scale ML systems. 149 | 150 | The ecosystem also includes specialized libraries for performance-critical applications: 151 | 152 | - **[Anomalyzer](https://github.com/lytics/anomalyzer)** provides probabilistic anomaly detection for time series data 153 | - **[Morgoth](https://github.com/nathanielc/morgoth)** focuses on metric anomaly detection 154 | - **[Goanomaly](https://github.com/sec51/goanomaly)** implements Gaussian distribution-based anomaly detection 155 | 156 | These libraries suggest that the Go ML ecosystem is well-suited for monitoring and real-time analytics applications requiring low-latency processing. 157 | 158 | ![performance characteristics](../images/performance-characteristics.png) 159 | 160 | ## Conclusion 161 | 162 | The Go machine learning ecosystem offers a diverse collection of libraries that cater to various AI development needs, from general-purpose frameworks to specialized algorithms. Key strengths include performance, concurrency support, and seamless integration capabilities with external systems. 163 | 164 | Gorgonia and Spago emerge as the most comprehensive frameworks for deep learning and general ML tasks, while Gonum provides the essential mathematical foundation for numerical computing. The ecosystem demonstrates particular strength in production-oriented applications requiring low-latency inference and scalable architectures. 165 | 166 | For developers considering Go for ML applications, the ecosystem is well-suited for: 167 | 168 | - High-performance inference servers 169 | - Real-time analytics and monitoring systems 170 | - Distributed ML pipelines 171 | - Applications requiring tight integration with system-level components 172 | 173 | While the ecosystem may not yet match the breadth of Python's ML libraries, Go's performance characteristics and robust concurrency model make it an excellent choice for production ML systems where efficiency and reliability are paramount. 174 | -------------------------------------------------------------------------------- /Overview.md: -------------------------------------------------------------------------------- 1 | # Awesome Golang.ai 2 | 3 | Golang AI applications have incredible potential. With unique features like inexplicable speed, easy debugging, concurrency, and excellent libraries for ML, deep learning, and reinforcement learning. 4 | 5 | ## Benchmark 6 | 7 | - [ADeLe](https://kinds-of-intelligence-cfi.github.io/ADELE/): ADeLe v1.0 is a comprehensive AI evaluation framework that combines explanatory analysis and predictive modeling capabilities to systematically assess AI system performance across multiple dimensions. 8 | - [SWELancer](https://github.com/openai/SWELancer-Benchmark): The **SWE-Lancer-Benchmark** is designed to evaluate the capabilities of frontier LLMs in solving real-world freelance software engineering tasks, exploring their potential to generate economic value through complex software development scenarios. 9 | 10 | ### Real World Challenge 11 | 12 | - [RPBench-Auto](https://github.com/boson-ai/RPBench-Auto): An automated pipeline for evaluating LLMs for role-playing. 13 | - [SpreadsheetBench](https://github.com/RUCKBReasoning/SpreadsheetBench): Towards Challenging Real World Spreadsheet Manipulation. 14 | 15 | ### Text-to-Speech(TTS) 16 | 17 | - [emergenttts-eval-public](https://github.com/boson-ai/emergenttts-eval-public): Benchmark for evaluating TTS models on complex prosodic, expressiveness, and linguistic challenges. 18 | 19 | ### English 20 | 21 | - [ARC-AGI](https://github.com/fchollet/ARC-AGI): The Abstraction and Reasoning Corpus. 22 | - [ARC-Challenge](https://github.com/allenai/ARC-Solvers?tab=readme-ov-file): AI2 Reasoning Challenge (ARC) Set. 23 | - [BBH](https://github.com/suzgunmirac/BIG-Bench-Hard): Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them. 24 | - [BIG-bench](https://github.com/google/BIG-bench): Beyond the Imitation Game collaborative benchmark for measuring and extrapolating the capabilities of language models. 25 | - [GPQA](https://github.com/idavidrein/gpqa): GPQA: A Graduate-Level Google-Proof Q&A Benchmark. 26 | - [HelloSwag](https://github.com/rowanz/hellaswag): HellaSwag: Can a Machine _Really_ Finish Your Sentence? 27 | - [IFEval](https://huggingface.co/datasets/google/IFEval): IFEval is designed to systematically evaluate the instruction-following capabilities of large language models by incorporating 25 verifiable instruction types (e.g., format constraints, keyword inclusion) and applying dual strict-loose metrics for automated, objective assessment of model compliance. 28 | - [LiveBench](https://github.com/LiveBench/LiveBench): A Challenging, Contamination-Free LLM Benchmark. 29 | - [MMLU](https://github.com/hendrycks/test): Measuring Massive Multitask Language Understanding ICLR 2021. 30 | - [MMLU-CF](https://github.com/microsoft/MMLU-CF): A Contamination-free Multi-task Language Understanding Benchmark. 31 | - [MMLU-Pro](https://github.com/TIGER-AI-Lab/MMLU-Pro): [NeurIPS 2024] A More Robust and Challenging Multi-Task Language Understanding Benchmark. 32 | - [MTEB](https://github.com/embeddings-benchmark/mteb): Massive Text Embedding Benchmark. 33 | - [PIQA](https://github.com/ybisk/ybisk.github.io/tree/master/piqa): PIQA is a dataset for commonsense reasoning, and was created to investigate the physical knowledge of existing models in NLP. 34 | - [WinoGrande](https://github.com/allenai/winogrande): An Adversarial Winograd Schema Challenge at Scale. 35 | 36 | ### Chinese 37 | 38 | - [C-Eval](https://github.com/hkust-nlp/ceval): [NeurIPS 2023] A Chinese evaluation suite for foundation models. 39 | - [CMMLU](https://github.com/haonan-li/CMMLU): Measuring massive multitask language understanding in Chinese. 40 | - [C-SimpleQA](https://github.com/OpenStellarTeam/ChineseSimpleQA): A Chinese Factuality Evaluation for Large Language Models. 41 | 42 | ### Math 43 | 44 | - [AIME](https://github.com/eth-sri/matharena): Evaluation of LLMs on latest math competitions. 45 | - [grade-school-math](https://github.com/openai/grade-school-math): The GSM8K dataset contains 8.5K grade school math word problems designed to evaluate multi-step reasoning capabilities in language models, revealing that even large transformers struggle with these conceptually simple yet procedurally complex tasks. 46 | - [MATH](https://github.com/hendrycks/math): The MATH Dataset for NeurIPS 2021, is a benchmark for evaluating mathematical problem-solving capabilities, offering dataset loaders, evaluation code, and pre-training data. 47 | - [matharena](https://github.com/eth-sri/matharena?utm_source=chatgpt.com): Evaluation of LLMs on latest math competitions. 48 | - [MathVista](https://github.com/lupantech/MathVista): MathVista: data, code, and evaluation for Mathematical Reasoning in Visual Contexts. 49 | - [Omni-MATH](https://github.com/KbsdJames/Omni-MATH): Omni-MATH is a comprehensive and challenging benchmark specifically designed to assess LLMs' mathematical reasoning at the Olympiad level. 50 | - [imobench](https://github.com/google-deepmind/superhuman/tree/main/imobench): The IMO-Bench dataset is a gold-standard suite of rigorous mathematical reasoning benchmarks derived from International Mathematical Olympiad problems, used to test the limits of AI's ability to perform complex, robust mathematical proofs and derivations. 51 | - [TAU-bench](https://github.com/sierra-research/tau-bench): TauBench is an open-source benchmark suite designed to evaluate the performance of large language models (LLMs) on complex reasoning tasks across multiple domains. 52 | 53 | ### Code 54 | 55 | - [AIDER](https://github.com/Aider-AI/aider): The leaderboards page of aider presents a performance comparison of various LLMs in programming-related tasks, such as code writing and editing. 56 | - [BFCL](https://gorilla.cs.berkeley.edu/blogs/8_berkeley_function_calling_leaderboard.html): BFCL aims to provide a thorough study of the function-calling capability of different LLMs. 57 | - [BigCodeBench](https://github.com/bigcode-project/bigcodebench/): [ICLR'25] BigCodeBench: Benchmarking Code Generation Towards AGI. 58 | - [Code4Bench](https://github.com/code4bench/Code4Bench): A Mutildimensional Benchmark of Codeforces Data for Different Program Analysis Techniques. 59 | - [CRUXEval](https://github.com/facebookresearch/cruxeval): Code Reasoning, Understanding, and Execution Evaluation. 60 | - [HumanEval](https://github.com/openai/human-eval): Code for the paper "Evaluating Large Language Models Trained on Code". 61 | - [HLE](https://github.com/centerforaisafety/hle): Humanity's Last Exam. 62 | - [LiveCodeBench](https://github.com/LiveCodeBench/LiveCodeBench): Holistic and Contamination Free Evaluation of Large Language Models for Code. 63 | - [MBPP](https://github.com/google-research/google-research/tree/master/mbpp): The benchmark consists of around 1,000 crowd-sourced Python programming problems, designed to be solvable by entry level programmers, covering programming fundamentals, standard library functionality, and so on. 64 | - [MultiPL-E](https://github.com/nuprl/MultiPL-E): A multi-programming language benchmark for LLMs. 65 | - [multi-swe-bench](https://github.com/multi-swe-bench/multi-swe-bench): The Multi-SWE-bench project, developed by ByteDance's Doubao team, is the first open-source multilingual dataset for evaluating and enhancing large language models' ability to automatically debug code, covering 7 major programming languages (e.g., Java, C++, JavaScript) with real-world GitHub issues to benchmark "full-stack engineering" capabilities. 66 | 67 | ### Code Agent 68 | 69 | - [Multi-SWE-Bench](https://github.com/multi-swe-bench/multi-swe-bench): Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving. 70 | - [SWE-Bench](https://github.com/SWE-bench/SWE-bench): SWE-bench: Can Language Models Resolve Real-world Github Issues? 71 | - [Terminal‑Bench](https://github.com/laude-institute/terminal-bench): A benchmark for LLMs on complicated tasks in the terminal. 72 | 73 | ### Search Agent 74 | 75 | - [BrowseComp](https://github.com/openai/simple-evals/blob/main/browsecomp_eval.py): 76 | - [BrowseComp-Plus](https://github.com/texttron/BrowseComp-Plus): BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agent. 77 | 78 | ### Tool Use 79 | 80 | - [BFCL](https://github.com/ShishirPatil/gorilla/tree/main/berkeley-function-call-leaderboard): Training and Evaluating LLMs for Function Calls (Tool Calls). 81 | - [MCP-Bench](https://github.com/Accenture/mcp-bench): MCP-Bench: Benchmarking Tool-Using LLM Agents with Complex Real-World Tasks via MCP Servers. 82 | - [MCPMark](https://github.com/eval-sys/mcpmark): MCPMark is a comprehensive, stress-testing MCP benchmark designed to evaluate model and agent capabilities in real-world MCP use. 83 | - [MCP-Universe](https://github.com/SalesforceAIResearch/MCP-Universe): MCP-Universe is a comprehensive framework designed for developing, testing, and benchmarking AI agents. 84 | - [Tool Decathlon](https://github.com/hkust-nlp/Toolathlon):The Tool Decathlon: Benchmarking Language Agents for Diverse, Realistic, and Long-Horizon Task Execution. 85 | - [T-Eval](https://github.com/open-compass/T-Eval): [ACL2024] T-Eval: Evaluating Tool Utilization Capability of Large Language Models Step by Step. 86 | - [WildBench](https://github.com/allenai/WildBench): Benchmarking LLMs with Challenging Tasks from Real Users. 87 | - [τ²-Bench](https://github.com/sierra-research/tau2-bench): τ²-Bench: Evaluating Conversational Agents in a Dual-Control Environment. 88 | 89 | ### Computer Use 90 | 91 | - [OSWorld](https://github.com/xlang-ai/OSWorld): OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments. 92 | 93 | ### Open ended 94 | 95 | - [Arena-Hard](https://github.com/lmarena/arena-hard-auto): Arena-Hard-Auto: An automatic LLM benchmark. 96 | 97 | ### Visual Reasoning 98 | 99 | - [MMMU](https://github.com/MMMU-Benchmark/MMMU): MMMU: A Massive Multi-discipline Multimodal Understanding and Reasoning Benchmark for Expert AGI. 100 | 101 | ### Novel Problem Solving 102 | 103 | - [ARC-AGI](https://github.com/fchollet/arc-agi): The Abstraction and Reasoning Corpus. 104 | - [ARC-AGI-2](https://github.com/arcprize/ARC-AGI-2): ARC can be seen as a general artificial intelligence benchmark, as a program synthesis benchmark, or as a psychometric intelligence test. 105 | 106 | ### Safety 107 | 108 | ### False refusal 109 | 110 | - [Xstest](https://github.com/paul-rottger/xstest): Röttger et al. (NAACL 2024): "XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models". 111 | 112 | ### Multi-modal 113 | 114 | - [DPG-Bench](https://github.com/TencentQQGYLab/ELLA): The DPG benchmark tests a model’s ability to follow complex image generation prompts. 115 | - [geneval](https://github.com/djghosh13/geneval): GenEval: An object-focused framework for evaluating text-to-image alignment. 116 | - [LongVideoBench](https://github.com/longvideobench/LongVideoBench): [Neurips 24' D&B] Official Dataloader and Evaluation Scripts for LongVideoBench. 117 | - [MLVU](https://github.com/JUNJIE99/MLVU): Multi-task Long Video Understanding Benchmark. 118 | - [perception_test](https://github.com/google-deepmind/perception_test): A Diagnostic Benchmark for Multimodal Video Models is a multimodal benchmark designed to comprehensively evaluate the perception and reasoning skills of multimodal video models. 119 | - [TempCompass](https://github.com/llyx97/TempCompass): A benchmark to evaluate the temporal perception ability of Video LLMs. 120 | - [VBench](https://github.com/Vchitect/VBench): VBench is an open-source project aiming to build a comprehensive evaluation benchmark for video generation models. 121 | - [Video-MME](https://github.com/BradyFU/Video-MME): [CVPR 2025] Video-MME: The First-Ever Comprehensive Evaluation Benchmark of Multi-modal LLMs in Video Analysis. 122 | 123 | ## [Model Context Protocol](https://modelcontextprotocol.io/introduction) 124 | 125 | - [gateway](https://github.com/centralmind/gateway): Universal MCP-Server for your Databases optimized for LLMs and AI-Agents. 126 | - [mcp-go](https://github.com/mark3labs/mcp-go): A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools. 127 | - [mcp-golang](https://github.com/metoro-io/mcp-golang): Write Model Context Protocol servers in few lines of go code. 128 | - [registry](https://github.com/modelcontextprotocol/registry): A community driven registry service for Model Context Protocol (MCP) servers. 129 | 130 | ## Large Language Model 131 | 132 | ### GPT 133 | 134 | - [gpt-go](https://github.com/zakirullin/gpt-go): Tiny GPT implemented from scratch in pure Go. Trained on Jules Verne books. 135 | 136 | ### ChatGPT Apps 137 | 138 | - [feishu-openai](https://github.com/ConnectAI-E/feishu-openai): Feishu (Lark) integrated with (GPT-4 + GPT-4V + DALL·E-3 + Whisper) delivers an extraordinary work experience. 139 | - [chatgpt-telegram](https://github.com/m1guelpf/chatgpt-telegram): Run your own GPTChat Telegram bot, with a single command. 140 | 141 | ### Agent 142 | 143 | - [anyi](https://github.com/jieliu2000/anyi): A Golang autonomous AI agent framework for assisting real work. 144 | - [AgenticGoKit](https://github.com/kunalkushwaha/AgenticGoKit): Event-driven Agentic AI framework in Go. LLM-agnostic with MCP tool discovery, built-in observability, and production patterns. 145 | - [agent-sdk-go](https://github.com/pontus-devoteam/agent-sdk-go): Build AI agents in light speed. 146 | - [code-editing-agent](https://github.com/promacanthus/code-editing-agent): A Go-based AI agent that edits code using the DeepSeek model, offering a clear example of how AI agents work. 147 | 148 | ### SDKs 149 | 150 | - [anthropic-sdk-go](https://github.com/anthropics/anthropic-sdk-go): Access to Anthropic's safety-first language model APIs via Go. 151 | - [cohere-go](https://github.com/cohere-ai/cohere-go): Go Library for Accessing the Cohere API. 152 | - [deepseek-go](https://github.com/cohesion-org/deepseek-go): A Deepseek client written for Go supporting R-1, Chat V3, and Coder. Also supports external providers like Azure, OpenRouter and Local Ollama. 153 | - [go-anthropic](https://github.com/liushuangls/go-anthropic): Anthropic Claude API wrapper for Go. 154 | - [go-openai](https://github.com/sashabaranov/go-openai): OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go. 155 | - [go-genai](https://github.com/googleapis/go-genai): Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. 156 | - [generative-ai-go](https://github.com/google/generative-ai-go): Go SDK for Google Generative AI. 157 | - [openai-go](https://github.com/openai/openai-go): The official Go library for the OpenAI API. 158 | - [volcengine-go-sdk](https://github.com/volcengine/volcengine-go-sdk): The Volcengine Go SDK is the official Go language SDK for ByteDance's Volcengine cloud computing platform, providing developers with programmatic access to various cloud services through a standardized API interface. 159 | 160 | ### DevTools 161 | 162 | - [LocalAI](https://github.com/mudler/LocalAI): 🤖 The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. Features: Generate Text, Audio, Video, Images, Voice Cloning, Distributed, P2P inference. 163 | - [ollama](https://github.com/ollama/ollama): Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 2, and other large language models. 164 | - [go-attention](https://github.com/takara-ai/go-attention): A full attention mechanism and transformer in pure go. 165 | - [langchaingo](https://github.com/tmc/langchaingo): LangChain for Go, the easiest way to write LLM-based programs in Go. 166 | - [gpt4all-bindings](https://github.com/nomic-ai/gpt4all/tree/41c9013fa46a194b3e4fee6ced1b9d1b65e177ac/gpt4all-bindings/golang): GPT4All Language Bindings provide cross-language interfaces to easily integrate and interact with GPT4All's local LLMs, simplifying model loading and inference for developers. 167 | - [go-openai](https://github.com/sashabaranov/go-openai): OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go. 168 | - [llama.go](https://github.com/gotzmann/llama.go): llama.go is like llama.cpp in pure Golang. 169 | - [eino](https://github.com/cloudwego/eino): The ultimate LLM/AI application development framework in Golang. 170 | - [fabric](https://github.com/danielmiessler/fabric): fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere. 171 | - [genkit](https://github.com/firebase/genkit): An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to develop, integrate, and test AI features with observability and evaluations. Genkit works with various models and platforms. 172 | - [swarmgo](https://github.com/prathyushnallamothu/swarmgo): SwarmGo (agents-sdk-go) is a Go package that allows you to create AI agents capable of interacting, coordinating, and executing tasks. 173 | - [orra](https://github.com/orra-dev/orra): The orra-dev/orra project offers resilience for AI agent workflows. 174 | - [core](https://github.com/agent-api/core): A fast, agnostic, and powerful Go AI framework for one-shot workflows, building autonomous agents, and working with LLM providers. 175 | - [gollm](https://github.com/teilomillet/gollm): Unified Go interface for Language Model (LLM) providers. Simplifies LLM integration with flexible prompt management and common task functions. 176 | 177 | ## RAG (Retrieval Augmented Generation) 178 | 179 | ### Document Parser 180 | 181 | - [markitdown](https://github.com/microsoft/markitdown): Python tool for converting files and office documents to Markdown. 182 | - [MinerU](https://github.com/opendatalab/MinerU): A high-quality tool for convert PDF to Markdown and JSON. 183 | - [docling](https://github.com/docling-project/docling): Get your documents ready for gen AI. 184 | - [marker](https://github.com/datalab-to/marker): Convert PDF to markdown + JSON quickly with high accuracy. 185 | 186 | ### Pipeline and Data Version 187 | 188 | - [pachyderm](https://github.com/pachyderm/pachyderm): Data-Centric Pipelines and Data Versioning. 189 | 190 | ### Embedding 191 | 192 | - [embedding-knowledge-base](https://github.com/webws/embedding-knowledge-base): a local knowledge base based on chatgpt Embedding and qdrant, supporting data import and Q&A. 193 | 194 | #### Benchmark 195 | 196 | - [MTEB](https://github.com/embeddings-benchmark/mteb): MTEB (Massive Text Embedding Benchmark) is an open-source benchmarking framework for evaluating and comparing text embedding models across 8 tasks (e.g., classification, retrieval, clustering) using 58 datasets in 112 languages, providing standardized performance metrics for model selection. 197 | - [BRIGHT](https://github.com/xlang-ai/BRIGHT): BBRIGHT is a realistic, challenging benchmark for reasoning-intensive retrieval, featuring 12 diverse datasets (math, code, biology, etc.) to evaluate retrieval models across complex, context-rich queries requiring logical inference. 198 | 199 | ### Vector Database 200 | 201 | > Indexer and Retriever. 202 | 203 | - [chroma](https://github.com/chroma-core/chroma): Open-source search and retrieval database for AI applications. 204 | - [cli](https://github.com/pinecone-io/cli): Work seamlessly with Pinecone from the command line. 205 | - [milvus](https://github.com/milvus-io/milvus): Milvus is a high-performance, cloud-native vector database built for scalable vector ANN search. 206 | - [pinecone](https://github.com/pinecone-io/go-pinecone): Pinecone.io Golang Client. 207 | - [qdrant](https://github.com/qdrant/go-client): Go client for Qdrant vector search engine. 208 | - [tidb](https://github.com/pingcap/tidb): TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications. 209 | - [weaviate](https://github.com/weaviate/weaviate): Weaviate is an open-source vector database that stores both objects and vectors, allowing for the combination of vector search with structured filtering with the fault tolerance and scalability of a cloud-native database​. 210 | 211 | ## General Machine Learning libraries 212 | 213 | - [eaopt](https://github.com/MaxHalford/eaopt): Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution). 214 | - [go-datamining](https://github.com/vly/go-datamining): Basic collection of data mining algorithms implemented in Go. 215 | - [goml](https://github.com/cdipaolo/goml):On-line Machine Learning in Go (and so much more). 216 | - [golearn](https://github.com/sjwhitworth/golearn): simple and customizable batteries included ML library in Go. 217 | - [gonum](https://github.com/gonum/gonum):Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more. 218 | - [gorgonia](https://github.com/gorgonia/gorgonia): Gorgonia is a library that helps facilitate machine learning in Go. 219 | - [spago](https://github.com/nlpodyssey/spago): Self-contained Machine Learning and Natural Language Processing library in Go. 220 | - [goro](https://github.com/aunum/goro): A High-level Machine Learning Library for Go. 221 | - [goga](https://github.com/tomcraven/goga): Golang Genetic Algorithm. 222 | - [hep](https://github.com/go-hep/hep): hep is the mono repository holding all of go-hep.org/x/hep packages and tools. 223 | - [hector](https://github.com/xlvector/hector): Golang machine learning lib. 224 | - [sklearn](https://github.com/pa-m/sklearn): bits of sklearn ported to Go. 225 | - [stats](https://github.com/montanaflynn/stats): A well tested and comprehensive Golang statistics library package with no dependencies. 226 | - [tokenizer](https://github.com/sugarme/tokenizer): NLP tokenizers written in Go language. 227 | 228 | ## Neural Networks 229 | 230 | - [emergent](https://github.com/emer/emergent): Biologically based neural network simulations of the brain written in Go with a 3D GUI powered by Cogent Core. 231 | - [gobrain](https://github.com/goml/gobrain): Neural Networks written in go. 232 | - [go-ctr](https://github.com/auxten/go-ctr): Go DeepLearning based Recommendation Framework. 233 | - [go-deep](https://github.com/patrikeh/go-deep): Artificial Neural Network. 234 | - [go-infer](https://github.com/f8-pub/go-infer): Go framework for DL model inference and API deployment. 235 | - [gomid](https://github.com/surenderthakran/gomind): A simplistic Neural Network Library in Go. 236 | - [gomlx](https://github.com/gomlx/gomlx): An Accelerated Machine Learning Framework For Go. 237 | - [go-neural](https://github.com/NOX73/go-neural): Neural network implementation on golang. 238 | - [go-neural](https://github.com/milosgajdos/go-neural): Feedforward Neural Networks in Go. 239 | - [gonn](https://github.com/fxsjy/gonn): GoNN is an implementation of Neural Network in Go Language, which includes BPNN, RBF, PCN. 240 | - [gonn](https://github.com/sausheong/gonn): Building a simple neural network in Go. 241 | - [gosom](https://github.com/milosgajdos/gosom): Self-organizing maps in Go. 242 | - [go-perceptron-go](https://github.com/made2591/go-perceptron-go): A single / multi layer / recurrent neural network written in Golang. 243 | - [olivia](https://github.com/olivia-ai/olivia): Your new best friend powered by an artificial neural network. 244 | - [neurgo](https://github.com/tleyden/neurgo): Neural Network toolkit in Go. 245 | - [tensorflow](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/go): TensorFlow is an open source software library for numerical computation using data flow graphs. 246 | 247 | ## NLP (Natural Language Processing) 248 | 249 | - [jiagu](https://github.com/bububa/jiagu): Jiagu深度学习自然语言处理工具 知识图谱关系抽取 中文分词 词性标注 命名实体识别 情感分析 新词发现 关键词 文本摘要 文本聚类. 250 | - [lingua-go](https://github.com/pemistahl/lingua-go): The most accurate natural language detection library for Go, suitable for short text and mixed-language text. 251 | - [nlp](https://github.com/james-bowman/nlp): Selected Machine Learning algorithms for natural language processing and semantic analysis in Golang. 252 | 253 | ## Linear Algebra 254 | 255 | - [gosl](https://github.com/cpmech/gosl): Linear algebra, eigenvalues, FFT, Bessel, elliptic, orthogonal polys, geometry, NURBS, numerical quadrature, 3D transfinite interpolation, random numbers, Mersenne twister, probability distributions, optimisation, differential equations. 256 | - [sparse](https://github.com/james-bowman/sparse): Sparse matrix formats for linear algebra supporting scientific and machine learning applications. 257 | 258 | ## Probability Distributions 259 | 260 | - [godist](https://github.com/e-dard/godist): Probability distributions and associated methods in Go. 261 | 262 | ## Decision Trees 263 | 264 | - [CloudForest](https://github.com/ryanbressler/CloudForest): CloudForest is a fast, flexible Go library for multi-threaded decision tree ensembles (Random Forest, Gradient Boosting, etc.) designed for high-dimensional heterogeneous data with missing values, emphasizing speed and robustness for real-world machine learning tasks. 265 | 266 | ## Regression 267 | 268 | - [regression](https://github.com/sajari/regression): Multivariable regression library in Go. 269 | - [ridge](https://github.com/promacanthus/ridge): Ridge regression in Go. 270 | 271 | ## Bayesian Classifiers 272 | 273 | - [bayesian](https://github.com/jbrukh/bayesian): Naive Bayesian Classification for Golang. 274 | - [multibayes](https://github.com/lytics/multibayes): Multiclass Naive Bayesian Classification. 275 | 276 | ## Recommendation Engines 277 | 278 | - [regommend](https://github.com/muesli/regommend): Recommendation engine for Go. 279 | - [gorse](https://github.com/gorse-io/gorse): Gorse open source recommender system engine. 280 | - [too](https://github.com/FurqanSoftware/too): Simple recommendation engine implementation built on top of Redis. 281 | 282 | ## Evolutionary Algorithms 283 | 284 | - [eaopt](https://github.com/MaxHalford/eaopt): Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution). 285 | - [evo](https://github.com/cbarrick/evo): Evolutionary Algorithms in Go. 286 | 287 | ## Graph 288 | 289 | - [gocv](https://github.com/hybridgroup/gocv): Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO. 290 | - [go-face](https://github.com/Kagami/go-face): Face recognition with Go. 291 | - [gogl](https://github.com/sdboyer/gogl): A graph library in Go. 292 | - [imaging](https://github.com/disintegration/imaging): Imaging is a simple image processing package for Go. 293 | - [plot](https://github.com/gonum/plot): A repository for plotting and visualizing data. 294 | - [wasmvision](https://github.com/wasmvision/wasmvision): wasmVision gets you going with computer vision using WebAssembly. 295 | 296 | ## Cluster 297 | 298 | - [go-cluster](https://github.com/e-XpertSolutions/go-cluster): k-modes and k-prototypes clustering algorithms implementation in Go. 299 | - [gokmeans](https://github.com/mash/gokmeans): K-means algorithm implemented in Go (golang). 300 | - [kmeans](https://github.com/muesli/kmeans): k-means clustering algorithm implementation written in Go. 301 | 302 | ## Anomaly Detection 303 | 304 | - [morgoth](https://github.com/nathanielc/morgoth): Metric anomaly detection. 305 | - [anomalyzer](https://github.com/lytics/anomalyzer): Probabilistic anomaly detection for time series data. 306 | - [goanomaly](https://github.com/sec51/goanomaly): Golang library for anomaly detection. Uses the Gaussian distribution and the probability density formula. 307 | 308 | ## DataFrames 309 | 310 | - [gota](https://github.com/go-gota/gota): Gota: DataFrames and data wrangling in Go. 311 | - [dataframe-go](https://github.com/rocketlaunchr/dataframe-go): DataFrames for Go: For statistics, machine-learning, and data manipulation/exploration. 312 | - [qframe](https://github.com/tobgu/qframe): Immutable data frame for Go. 313 | 314 | ## Explaining Model 315 | 316 | - [lime](https://github.com/marcotcr/lime): Lime: Explaining the predictions of any machine learning classifier. 317 | 318 | # Books 319 | 320 | - [Machine Learning With go](https://github.com/promacanthus/awesome-golang-ai/blob/main/books/Machine%20Learning%20with%20Go.pdf) 321 | - [Machine-Learning-With-Go](https://github.com/promacanthus/Machine-Learning-With-Go): example code. 322 | - [Go Machine Learning Projects](https://github.com/PacktPublishing/Go-Machine-Learning-Projects): Go Machine Learning Projects, published by Packt. 323 | - [机器学习:Go语言实现](https://github.com/promacanthus/awesome-golang-ai/blob/main/books/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%20Go%E8%AF%AD%E8%A8%80%E5%AE%9E%E7%8E%B0.pdf) 324 | - [GO语言机器学习实战](https://book.douban.com/subject/35037170/) 325 | 326 | # Basic Knowledge 327 | 328 | ## Reinforcement Learning 329 | 330 | - [Hands-on Reinforcement Learning](https://hrl.boyuai.com/) 331 | 332 | # Datasets 333 | 334 | - [LendingClub]() 335 | --------------------------------------------------------------------------------