菜单导航

支持在线、离线all in one的AI模型空间入口
AIGC

支持在线、离线all in one的AI模型空间入口

NoiseNoise
2023-08-05

这是一个可以将 Huggingface Spaces魔搭创空间 及 Gradio ChatBot 自动转成免费 API 的 Npm 包。理论上支持所有带 chatbot 的空间,目前完美支持了 GPT4Free,ChatGPT,Llama 2,Vicuna,MPT-30B,Falcon,ChatGLM,通义千问 等众多模型空间

项目地址:https://github.com/weaigc/gradio-chatbot

直接使用:https://weaigc.github.io/gradio-chatbot-ui

快速上手

NPM

  • 体验 ChatGPT

npx gradio-chatbot
# or
npm install -g gradio-chatbot
chatbot
  • 体验 Llama2

chatbot 2
# 或者
chatbot https://huggingface.co/spaces/huggingface-projects/llama-2-13b-chat

更多用法请输入 chatbot help

Docker

docker build . -t gradio-server
docker run --rm -it -p 8000:8000 gradio-server

asciicasthttps://asciinema.org/a/0ki5smP795eyXdXGlx53UDmTB

安装

你可以使用 npm 或者 yarn 来安装 gradio-chatbot,Node 版本需要 >= 18。

npm install gradio-chatbot
# or
yarn add gradio-chatbot

使用

目前支持三种模式。

CLI模式

参考 快速上手

API服务

为了方便使用,提供了两种形式的接口。

curl http://127.0.0.1:8000/api/conversation \
  -H "Content-Type: application/json" \
  -d '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "hello"}],
   }'

API函数

import { GradioChatBot } from 'gradio-chatbot'

const bot = new GradioChatBot();

async function start() {
const message = await bot.chat('hello', {
onMessage(partialMsg) {
console.log('stream output:', partialMsg);
}
});
console.log('message', message);
}

start();

你也可以把你想要转换的空间地址输入进去,如 https://huggingface.co/spaces/h2oai/h2ogpt-chatbot

import { GradioChatBot } from 'gradio-chatbot'

const bot = new GradioChatBot({
  url: 'https://huggingface.co/spaces/h2oai/h2ogpt-chatbot',
  fnIndex: 35,
}); // 调用自定义 ChatBot 模型

async function start() {
  console.log(await bot.chat('Hello'));
}

start();

除此之外,Npm 包里面已经内置了 10 个流行的 Huggingface Spaces魔搭创空间,你可以直接传入模型序号使用

import { GradioChatBot } from 'gradio-chatbot';

const bot = new GradioChatBot('1'); // 使用内置1号模型
async function start() {
  console.log(await bot.chat('Tell me about ravens.'));
}

start();

更多示例请前往目录: Examples

注意:Huggingface 上的部分模型可能会收集你输入的信息,如果你对数据安全有要求,建议不要使用,使用自己搭建的模型是一个更好的选择。

版权声明

本文为「Noise」原创内容或编译整理;除特别说明外,文中图片并非个人手绘,可能来源于网络、AI 生成、截图等,后期使用 PhotoMator / Procreate 进行处理,仅用于学习与交流。如涉及版权或来源标注不全,请联系处理。未经授权,禁止用于商业用途,禁止抹除水印。转载请注明出处与链接并保留本声明。

...

评论 (0)

评论功能加载中...
Noise

Noise

执迷不悟

推荐阅读

Belin Doc-一键完成高质量文档翻译
AIGC

Belin Doc-一键完成高质量文档翻译

Noise | 2025-08-10

Belin Doc 是一款由 AI 驱动的免费、无限制 文档翻译工具。无需注册,没有限制。

截止发文,该产品属于新产品,未看到上架定价,未登录时可每日使用1000次,但任务有排队

官网:https://belindoc.com

功能

	文档翻译:支持多种格式的文档翻译,
544
eechat-跨平台本地部署LLM工具,支持mcp接入
AIGC

eechat-跨平台本地部署LLM工具,支持mcp接入

Noise | 2025-07-25

eechat 是一款开源免费的国产 AI 应用,支持 Windows、macOS 和 Linux,集成了聊天、多模态指令执行(MCP)、知识库问答(RAG)、语音识别(ASR)、语音合成(TTS)等功能模块。

	开箱即用,无需代码基础,适合非技术背景用户。
	免费开源,国产的免费
895
🔥AI时代神器!Revornix让你的资讯管理效率翻倍!🚀
AIGC

🔥AI时代神器!Revornix让你的资讯管理效率翻倍!🚀

Noise | 2025-07-16

这是一个集合了文档知识库、智能解析、AI助手、mcp、用户专栏等功能的现代化工具

官网:https://revornix.com/zh

目前该工具还处于不断完善中,你可以访问官网来查看最新开发状态及加入官方社群,下方来源于官方介绍
功能特性

	跨平台可用:当
453