Coder Social home page Coder Social logo

deeptrain-community / chatnio Goto Github PK

View Code? Open in Web Editor NEW
2.4K 25.0 400.0 28.03 MB

🚀 Next Generation AI One-Stop Internationalization Solution. 🚀 下一代 AI 一站式 B/C 端解决方案,支持 OpenAI,Midjourney,Claude,讯飞星火,Stable Diffusion,DALL·E,ChatGLM,通义千问,腾讯混元,360 智脑,百川 AI,火山方舟,新必应,Gemini,Moonshot 等模型,支持对话分享,自定义预设,云端同步,模型市场,支持弹性计费和订阅计划模式,支持图片解析,支持联网搜索,支持模型缓存,丰富美观的后台管理与仪表盘数据统计。

Home Page: https://chatnio.net

License: Apache License 2.0

Go 30.50% HTML 0.15% TypeScript 55.65% JavaScript 0.61% Less 12.40% PHP 0.58% Rust 0.02% Dockerfile 0.08%
chatgpt golang react ai api api-gateway chat cross-platform gemini openai

chatnio's People

Contributors

lavanille777 avatar navee avatar sh1n3zz avatar yongman avatar ziantt avatar zmh-program avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatnio's Issues

支持订阅价格/配额自定义

当前仅可通过设置前后端的配置进行二开修改订阅价格。
计划可在后台设置订阅各个层级的金额和每月的配额使用量。

工程量较大,已经排到 v3.8.x 的 todo 中

支持 资源包

可设置自定义资源包,包括价格,有效期,次数配额,涵盖模型等。

支持 模型市场同步上游

支持模型市场同步上游,请求后再参考当前站点是否有上游的模型,选择【同步所有】或者【同步已有模型】,本站点已有模型不受影响。

支持内置模型在线率 Uptime

开启监控后,将对所有人提供“自定义市场模型”内模型各个时间的uptime情况,
类似于 uptime kuma 等,但是 kuma 这些需要每次请求都要消耗配额。
chatnio 内置的思路是分析每一次请求是否 error 的情况,
筛选出去超上下文等其他非异常报错情况,进行监控。

此功能作为长久计划。

连接已存在的MySQL数据库失败

现象描述

1、在1panel的面板环境下,已经安装MySQL和redis服务器在1panel-network(1panel面板的默认网络)。且我的MySQL、redis、chatnio在同一个网段,可以ping通。

{
    "Name": "1panel-network",
    "Id": "ded70d4xxxxxxxxxxxxxxxxxxxxxxxxxx0815",
    "Created": "xxxxxxxxxx",
    "Scope": "local",
    "Driver": "bridge",
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Options": null,
      "Config": [
        {
          "Subnet": "172.18.0.0/16",
          "Gateway": "172.18.0.1"
        }
      ]
    },
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "ConfigFrom": {
      "Network": ""
    },
    "ConfigOnly": false,
    "Containers": {
      "0b8f6fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2e3379e": {
        "Name": "chatnio",
        "EndpointID": "ee76bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx17a64a79293f",
        "MacAddress": "02:42:ac:12:00:0d",
        "IPv4Address": "172.18.0.13/16",
        "IPv6Address": ""
      },
      "0b9f1e9ffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6df76f7550b7": {
        "Name": "mysql",
        "EndpointID": "460678adb4xxxxxxxxxxxxxxxxxxxxxxxxxxxx9dfe5f645c7e79e10",
        "MacAddress": "02:42:ac:12:00:08",
        "IPv4Address": "172.18.0.8/16",
        "IPv6Address": ""
      },
      "d7cef7b56bafa71xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc295cd17985ea": {
        "Name": "redis",
        "EndpointID": "9f9a8aefxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx958f5fea",
        "MacAddress": "02:42:ac:12:00:09",
        "IPv4Address": "172.18.0.9/16",
        "IPv6Address": ""
      }
    },
    "Options": {},
    "Labels": {}
  }

image

使用的配置文件:

version: '3'
services:
  chatnio:
      image: programzmh/chatnio
      container_name: chatnio
      restart: always
      ports:
          - "8000:8094"
      environment:
          MYSQL_HOST: mysql
          MYSQL_USER: chanio
          MYSQL_PASSWORD: xxxxxxxxxxxx
          MYSQL_DATABASE: chanio
          REDIS_HOST: redis
          REDIS_PORT: 6379
          REDIS_PASSWORD: ""
          REDIS_DB: 0
          SERVE_STATIC: "true"
      volumes:
        - ./config:/config
        - ./logs:/logs

networks:
  1panel-network:
      external: true

这里的数据库和用户名就是chanio
image

数据库连接检测

在MySQL容器中,成功连接数据库
image

报错

报错如下:

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

2023/12/26 08:59:24 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:29 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:34 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:39 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:44 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:49 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds
2023/12/26 08:59:54 [connection] failed to connect to mysql server: mysql, will retry in 5 seconds

问题

请问,我的问题是什么,该怎么修改。

建议支持docker安装

我部署了一下,环境一直有问题,最后还是没成功。
如果能有docker就方便了

midjourney模型返回报错仍然消耗点数

在使用midjourney
Screenshot_2023-11-24-22-06-15-135_mark via
的过程中,出现如下报错:

100
100
100

error from midjourney: task failed: [Blocked] You have been blocked from accessing Midjourney. This happens on repeated or serious ToS violations.
和如下报错
error from midjourney: task failed: The resource is being rate limited.
在这两个报错情况中,chatnio都对我执行了0.5个点的扣费。
而一般情况下,没有给出图片,理应不执行扣费。在这个方面,希望能够进行一定程度的错误识别和不扣费机制。

claude2 無法使用

無論網頁還是api選用claude2的時候只會顯示500 internal error 或i don't understand

使用api时除chatgpt以外均不可用

使用api时除chatgpt以外均不可用

我在使用js sdk调用时,发现model处填写除'gpt-3.5-turbo'以外的值(如gpt-4,zhipu-chatglm-lite)都会报错You don't have enough quota to use this model. please buy or subscribe to get more.而gpt-3.5-turbo正常使用。
setKey了,getQuota()也能正常返回,getConversations()只能返回在网页端的对话结果,点还剩190多,绝对不会不够。
经过测试,model处瞎填一个也会返回You don't have enough quota to use this model. please buy or subscribe to get more.。
我认为这可能是个bug,所以搁这反馈一下。
测试环境:安卓11,webview(通过via),http正常,使用sdk编译成js。
附图片:Uploading Screenshot_2023-10-31-19-29-22-358_bin.mt.plus.jpg…

运行缓慢

很好的平台,但是到了晚上会出现运行异常缓慢问题,怀疑API滥用,希望能够加入限制,更好的活下去!

支持 应用广场 预设市场及开放模型接入市场

1、应用功能(即目前的预设设置)
应用广场:支持用户上下架、后台审核
应用创建:包含标题、头像、标签、简介、说明(点击后在对话页面展示的说明文本)、预设(参照playground,前置语后置语)、是否公开
(另:预设内容建议隐藏,当前为公开)
2、stt
3、ai群聊
等等......
不知道是否会向此方向开发,毕竟目前市面其他商业版或开源已经有很多功能非常完善的项目

Docker 镜像支持 ARM 64 架构 | Add support for ARM64 Arch. to the Docker image

When deploying with docker-compose, I encountered the error message:

redis    | 1:C 11 Jan 2024 11:46:16.480 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis    | 1:C 11 Jan 2024 11:46:16.480 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis    | 1:C 11 Jan 2024 11:46:16.480 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis    | 1:M 11 Jan 2024 11:46:16.481 * monotonic clock: POSIX clock_gettime
redis    | 1:M 11 Jan 2024 11:46:16.481 * Running mode=standalone, port=6379.
redis    | 1:M 11 Jan 2024 11:46:16.485 * Server initialized
redis    | 1:M 11 Jan 2024 11:46:16.485 * Ready to accept connections tcp
db       | 2024-01-11 11:46:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.2.0-1.el8 started.
chatnio  | exec ./chat: exec format error
db       | 2024-01-11 11:46:16+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db       | 2024-01-11 11:46:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.2.0-1.el8 started.
chatnio exited with code 0
db       | 2024-01-11 11:46:17+00:00 [Note] [Entrypoint]: Initializing database files
db       | 2024-01-11T11:46:17.271991Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
db       | 2024-01-11T11:46:17.273823Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.

With the assistance of the QQ group admin, it was discovered that the issue was due to the current Docker image not supporting servers with the arm64 architecture. So, I'm hoping that Chatnio could consider adding support for ARM64 Docker images.

仍不支持工具调用

LobeChat 启用 DALL·E 插件后,提示tools参数无法识别

{
  "endpoint": "https://api.ch****io.net/v1",
  "error": {
    "message": "request failed with status: 404 Not Found\n```json\n{\n  \"error\": {\n    \"code\": null,\n    \"message\": \"Unrecognized request argument supplied: tools (request id: 20240116112013152371537GyMqJ50T)\",\n    \"param\": \"\",\n    \"type\": \"invalid_request_error\"\n  }\n}\n```",
    "type": "chatnio_api_error"
  }
}

支持模型市场自定义

当前渠道和首页的模型市场无关联,当前只能二开更改 ~/app/src/conf.ts 进行自行打包部署。
计划可通过后台设置模型图片,模型 ID,包含的模型 ID 列表,Tag 等功能

工程量大,已经排到 v3.8.x 的 todo 中。

支持利润分销功能

类似于 CloseAI,各大 IDC 的分销机制,
后台管理可以设置是否开启和分销利润。可支持 代理 高级代理等二级分销功能。
此类相较于 chatnio 的邀请码来说,实际产生消费,从根源解决批量注册刷余额。

作为长久计划考虑。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.