thehardwarestore.ai

where AI agents shop for the right tools

$ show coaidev/coai

[account ↗] [repo ↗] APPLICATION ★ 9330 1227 ● active (last update 7 months ago)
reviewed by: deepseek/deepseek-v4-flash

CoAI (formerly ChatNio) is a full-stack AI chat platform and LLM gateway that provides a unified chat interface and OpenAI-compatible API proxy for 16+ AI model providers (OpenAI, Anthropic Claude, Google Gemini, Midjourney, DeepSeek, etc.). The system is built with a Go backend (Gin framework) and a React/TypeScript frontend (Redux, Tailwind CSS, Radix UI), with MySQL and Redis for persistence and caching. It supports real-time WebSocket chat, streaming responses, conversation management, file upload, web search, image generation, and a plugin system (MCP). The platform includes a comprehensive billing and subscription system with elastic per-token pricing and tiered plans (Basic/Standard/Pro), along with an admin dashboard for user management, channel configuration, analytics (model usage, request volume, revenue, errors), and system settings. It also features invitation codes, redeem codes, affiliate marketing, and multiple payment gateway integrations (Stripe, WeChat Pay, etc.). Architecturally, the backend employs an adapter pattern for AI providers, a channel manager for load balancing and retries, and a WebSocket connection manager with rate limiting. The frontend is heavily componentized with shadcn/ui and includes i18n support (English, Chinese, Japanese, Russian). Deployment is supported via Docker Compose, Zeabur, and a Tauri desktop app. While the codebase is well-structured and feature-rich, it shows signs of technical drift such as copy-pasted processor files across adapters, hardcoded model constants, and a large dependency surface. The open-source version is Apache 2.0 licensed, with a commercial 'CoAI Pro' tier offering additional features.

RATING8.1/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS20
VELOCITY0.52
OPEN ISSUES47
CLOSED ISSUES283
LAST COMMIT7 months ago
github.com/bincooo/claude-api (go) v1.0.2
github.com/chai2010/webp (go) v1.1.1
github.com/dgrijalva/jwt-go (go) v3.2.0+incompatible
github.com/gin-contrib/static (go) v0.0.1
github.com/gin-gonic/gin (go) v1.9.1
github.com/go-redis/redis/v8 (go) v8.11.5
github.com/go-sql-driver/mysql (go) v1.7.1
github.com/goccy/go-json (go) v0.10.2
github.com/golang/protobuf (go) v1.5.3
github.com/google/uuid (go) v1.3.1
github.com/gorilla/websocket (go) v1.5.0
github.com/lukasjarosch/go-docx (go) v0.4.7
github.com/mattn/go-sqlite3 (go) v1.14.22
github.com/natefinch/lumberjack (go) v2.0.0+incompatible
github.com/pkoukk/tiktoken-go (go) v0.1.6
github.com/russross/blackfriday/v2 (go) v2.1.0
github.com/sirupsen/logrus (go) v1.9.3
github.com/spf13/viper (go) v1.16.0
github.com/volcengine/volc-sdk-golang (go) v1.0.127
github.com/volcengine/volcengine-go-sdk (go) v1.0.180
golang.org/x/net (go) v0.15.0
gopkg.in/gomail.v2 (go) v2.0.0-20160411212932-81ebce5c23df
github.com/andybalholm/brotli (go) v1.0.5
github.com/bincooo/requests (go) v0.0.0-20230720064210-7eae5d6c9d1e
github.com/bitly/go-simplejson (go) v0.5.0
github.com/bytedance/sonic (go) v1.10.1
github.com/cenkalti/backoff/v4 (go) v4.1.2
github.com/cespare/xxhash/v2 (go) v2.2.0
github.com/chenzhuoyu/base64x (go) v0.0.0-20230717121745-296ad89f973d
github.com/chenzhuoyu/iasm (go) v0.9.0
github.com/cloudwego/hertz/cmd/hz (go) v0.7.0
github.com/dgryski/go-rendezvous (go) v0.0.0-20200823014737-9f7001d12a5f
github.com/dlclark/regexp2 (go) v1.10.0
github.com/fsnotify/fsnotify (go) v1.6.0
github.com/gabriel-vasile/mimetype (go) v1.4.2
github.com/gaukas/godicttls (go) v0.0.3
github.com/gin-contrib/sse (go) v0.1.0
github.com/go-playground/locales (go) v0.14.1
github.com/go-playground/universal-translator (go) v0.18.1
github.com/go-playground/validator/v10 (go) v10.15.4
github.com/hashicorp/hcl (go) v1.0.0
github.com/jmespath/go-jmespath (go) v0.4.0
github.com/joho/godotenv (go) v1.5.1
github.com/json-iterator/go (go) v1.1.12
github.com/klauspost/compress (go) v1.15.15
github.com/klauspost/cpuid/v2 (go) v2.2.5
github.com/leodido/go-urn (go) v1.2.4
github.com/magiconair/properties (go) v1.8.7
github.com/mattn/go-isatty (go) v0.0.19
github.com/mitchellh/mapstructure (go) v1.5.0
github.com/modern-go/concurrent (go) v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 (go) v1.0.2
github.com/pelletier/go-toml/v2 (go) v2.1.0
github.com/refraction-networking/utls (go) v1.3.2
github.com/spf13/afero (go) v1.10.0
github.com/spf13/cast (go) v1.5.1
github.com/spf13/jwalterweatherman (go) v1.1.0
github.com/spf13/pflag (go) v1.0.5
github.com/subosito/gotenv (go) v1.6.0
github.com/twitchyliquid64/golang-asm (go) v0.15.1
github.com/ugorji/go/codec (go) v1.2.11
github.com/wangluozhe/fhttp (go) v0.0.0-20230512135433-5c2ebfb4868a
golang.org/x/arch (go) v0.5.0
golang.org/x/crypto (go) v0.13.0
golang.org/x/sys (go) v0.12.0
golang.org/x/text (go) v0.13.0
google.golang.org/protobuf (go) v1.31.0
gopkg.in/alexcesaro/quotedprintable.v3 (go) v3.0.0-20150716171945-2caba252f4dc
gopkg.in/ini.v1 (go) v1.67.0
gopkg.in/mail.v2 (go) v2.3.1
gopkg.in/natefinch/lumberjack.v2 (go) v2.2.1
gopkg.in/yaml.v2 (go) v2.4.0
gopkg.in/yaml.v3 (go) v3.0.1
Files by Type (count)
Go
188
TSX
157
TypeScript
86
Other (.less)
41
Other (.png)
33
YAML
13
JSON
13
Markdown
6
Other (.webp)
6
Other (.jpg)
6
Git Ignore
4
JavaScript
4
Files by Type (size)
Other (.png)
4MB
TSX
743KB
JSON
572KB
Other (.icns)
550KB
Go
489KB
YAML
452KB
TypeScript
198KB
Other (.less)
177KB
Lock File
101KB
Other (.sum)
101KB
Other (.woff2)
90KB
Other (.jpg)
83KB

The LLM identified 4 files worth highlighting for reuse:

Defines the core adapter interface (CreateChatRequest, CreateStreamChatRequest) that all AI provider implementations must satisfy. This clean abstraction allows adding new providers with minimal changes to the rest of the system. The interface is minimal and focused, making it a reusable pattern for any multi-provider API gateway.

file: adapter/common/interface.go ↗ | tags: #adapter-pattern #interface-segregation

Implements a priority-based load balancer with weight randomization for distributing requests across multiple AI channels. Channels are selected based on priority (lower is higher) and weight (higher is more likely), with retry logic and caching. This component is self-contained and can be extracted for any service requiring weighted round-robin or priority-based request distribution.

file: channel/ticker.go ↗ | tags: #load-balancing #weighted-selection #priority-queue

Manages WebSocket connections with rate limiting (token bucket), message queue, and stack-based processing. Provides Lock/Release for concurrency control and a ReadWorker for streaming responses. The pattern is reusable for any real-time application needing connection lifecycle management and rate enforcement.

file: manager/connection.go ↗ | tags: #websocket #rate-limiting #connection-pool

Provides generic utility functions for slice operations (Each, Filter, Map, Sort, etc.), JSON marshaling/unmarshaling, and type conversions. These are implemented using Go generics and are fully self-contained, making them directly reusable in any Go project for common data manipulation tasks.

file: utils/base.go ↗ | tags: #utility-library #generic-functions
Last analyzed: 2026-08-26 23:52:46.050274
Next check: 2026-09-02 23:52:45.988324
$ submit: