Commit Graph
21 Commits
Author SHA1 Message Date
Sakurasan ef3025dd80 refactor: complete backend rewrite for multi-protocol proxy
Major rewrite of the Go backend to support:
- Three API format imports: openai, anthropic, compatible
- Three protocol conversions: Chat Completions, Responses, Messages
- Hub-and-spoke architecture with Chat as intermediate format

Deleted:
- opencat.go (old entry)
- store/, team/, pkg/team/, pkg/store/ (old data layer)
- internal/model/, internal/consts/ (old types)
- internal/service/team/, internal/controller/team/ (old handlers)
- llm/ (removed LLM client library, pure proxy mode)
- dist/, assets/ (old build artifacts)

Added:
- internal/store/ — 9 GORM models + multi-DB support
- internal/pkg/ — crypto (AES-GCM), apikey, jwt, ratelimit, resp, tokenizer
- internal/channel/ — channel selection, weighted LB, health checks
- internal/proxy/convert/ — 6 protocol conversion functions + SSE streaming
- internal/proxy/ — gateway with request dispatch and upstream selection
- internal/usage/ — async usage recorder with batch writes
- internal/api/ — management API (auth, users, keys, channels, models)
- Makefile for build/test/deploy

Fixed API to match frontend expectations:
- Login response wraps token in { data: { token } }
- GET /api/profile route added
- Profile response wraps user in { code, data }
- Role returned as number (10=admin, 1=user)
2026-08-30 11:49:31 +08:00
Sakurasan 8f6f3313f5 fix: custom_endpoint 2024-12-18 01:08:23 +08:00
Sakurasan c06dbde3da update realtime 2024-10-08 02:49:08 +08:00
Sakurasan 7fd82b43f4 refact & update new model 2024-09-13 21:32:10 +08:00
Sakurasan 27742362f8 update 2024-04-23 01:55:01 +08:00
Sakurasan c838e7be16 support dall-e 2023-11-23 18:03:15 +08:00
Sakurasan 4b79bca94f update 2023-09-17 20:33:53 +08:00
Sakurasan aa1d00cd55 claude doc 2023-09-16 21:18:32 +08:00
Sakurasan adbc388920 new: save/load user data 2023-07-09 21:02:46 +08:00
Sakurasan ec31eba72f update doc 2023-06-20 18:19:01 +08:00
Sakurasan 933a70a474 fix:gorm not autoIncrement && update doc 2023-06-12 21:32:27 +08:00
Sakurasan a2e929890b update doc 2023-06-01 18:21:54 +08:00
Sakurasan 631073fed0 update 2023-05-28 22:59:58 +08:00
Sakurasan 2890b817f9 azure openai 2023-05-28 01:18:45 +08:00
Sakurasan 9c04122680 azure openai 2023-05-27 22:47:32 +08:00
Sakurasan 0b22a3626a azure 2023-05-14 23:00:49 +08:00
Sakurasan 0dc1d13720 增加root_token查询 2023-05-02 01:57:42 +08:00
Sakurasan 8257cd9bd9 update 2023-04-03 19:32:18 +08:00
Sakurasan 232712e27d update README 2023-04-03 19:05:59 +08:00
Sakurasan 074a8e4267 update docker-compose && README 2023-03-30 19:37:05 +08:00
Sakurasan 6bf21b4bd7 first up 2023-03-30 02:27:54 +08:00