GithubHelp home page GithubHelp logo

voidxox / cloudflare-ai-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jazee6/cloudflare-ai-web

0.0 0.0 0.0 284 KB

支持GeminiPro Vision / Cloudflare Workers AI / ChatGPT的融合Web平台

Home Page: https://ai.jaze.top

License: Apache License 2.0

TypeScript 46.72% CSS 1.78% Vue 50.92% Dockerfile 0.58%

cloudflare-ai-web's Introduction

cloudflare-ai-web

AI 启动!

一键部署(推荐)

Deploy with Vercel

示例:https://ai.jaze.top

Docker

docker run -d --name cloudflare-ai-web \
  -e CF_TOKEN=YOUR_CF_TOKEN \
  -e CF_GATEWAY=YOUR_CF_GATEWAY \
  -p 3000:3000 \
  --restart=always \
  jazee6/cloudflare-ai-web

特性

  • 利用免费的 Cloudflare Workers AI 快速搭建文本生成、AI翻译、AI绘画平台
  • Vercel Edge Functions 部署,全球边缘网络加速,500000次免费额度,无限制响应时间
  • 支持 ChatGPT GeminiPro(Vision),支持开启访问密码,支持自定义域名

模型支持

  • 视觉 GeminiPro Vision
  • 文生图 stable-diffusion-xl-base-1.0
  • 文本生成 GeminiPro llama-2-7b-chat-fp16 llama-2-7b-chat-int8 mistral-7b-instruct-v0.1 gpt-3.5-turbo
  • 代码生成 codellama-7b-instruct-awq
  • 翻译 m2m100-1.2b

部署说明

环境变量

  • CF_TOKEN - Cloudflare Workers AI Token
  • CF_GATEWAY - Cloudflare AI Gateway URL
  • OPENAI_API_KEY - OpenAI API Key (需要ChatGPT时填写)
  • G_API_KEY - Google AI API Key (需要GeminiPro时填写)
  • G_API_URL - Google AI 反代 (非美国ip填写,或参考以下配置)
  • PASSWORD - 访问密码 (可选)

CF_TOKEN

https://dash.cloudflare.com/profile/api-tokens

  • 单击创建令牌
  • 使用Workers AI (Beta)模板
  • 单击继续以显示摘要
  • 单击创建令牌
  • 复制您的令牌,在vercel中设置环境变量

CF_GATEWAY

https://dash.cloudflare.com/

  • Cloudflare 侧栏 AI - AI Gateway
  • 添加新 AI Gateway
  • 填写名称和URL slug创建
  • 单击右上角API Endpoints
  • 复制您的Universal Endpoint,在vercel中设置环境变量

G_API_KEY

https://ai.google.dev/tutorials/rest_quickstart#set_up_your_api_key

G_API_URL

参考 https://github.com/Jazee6/gemini-proxy 搭建反代

或者在nuxt.config.ts中添加以下配置

nitro: {
    vercel: {
        regions: ["cle1", "iad1", "pdx1", "sfo1", "sin1", "syd1", "hnd1", "kix1"]
    }
}

Tips

  • 由于Workers AI 目前为开放 Beta 版,不建议用于生产数据和流量,限制 + 访问可能会发生变化
  • 请不要启用AI Gateway的缓存,否则可能会导致重复的回复
  • 请保持与Main分支同步,以便获取最新的功能和修复

Star History

Star History Chart

cloudflare-ai-web's People

Contributors

jazee6 avatar roshanca avatar

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.