Giter Site home page Giter Site logo

cyaban / cloudflare-ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from localuser-isback/cloudflare-ai

0.0 0.0 0.0 825 KB

A Free way to host your own gpt-like AI chatbot using cloudflares free AI worker.

License: GNU General Public License v3.0

JavaScript 57.21% CSS 37.10% HTML 5.69%

cloudflare-ai's Introduction

Cloudflare LLaMa Worker AI Chatbot

This project is a POC and a pretty basic (but will be updated!) way of creating your own chatbot using cloudflares new and 100% free (No KYC or credit card!) way to create an AI chatbot with a simple UI.

Steps

First create a cloudflare account. https://cloudflare.com/ this is 100% free and does not require any KYC. Max 100k requests per day. (on free plan)

  1) Create cloudflare account
  2) Go to https://dash.cloudflare.com/
  3) Click workers & pages
  4) Click overview
  5) Click create worker
  6) Name it whatever you want
  7) Click deploy
  8) Click edit code
  9) In this repo there is the CF folder and HTML folder, in the CF folder copy all the code inside the worker.js file.
  10) paste the code in & click save and deploy
  11) Copy the URL and save it since it will be needed.
  12) Next eather use cloudflare pages (recommened) or any other hosting site of your choice for static hosting such as netlify or github pages
  13) Upload ALL the files from the html folder and edit the script.js
  14) modify the API Url to the URL you got from your worker
  15) Profit!!

Basic API Explenation

The API is pretty simple, there are 3 main parts:

  1. the root page ==> "/"
  2. the API page "/:API"
  3. the query "/:API?q=%query"

The root page simply just redirects you to the API page with a randomly generated API key the API page shows the message history for that API key the query page is how the user sends messages and returns a responce.

Future updates:

1) Rate limiting your API
2) Password locking your API
3) Much better Frontend UI
4) Ability to keep UUID/apikey and go back to previous conversations (frontend)
5) Add markdown support on frontend
6) Ability to change models quickly and easily
7) Voice & audio to text via wisper (not any time soon)

Why this over the offical cloudflare API?

  1. custom domain.
  2. much more customization.
  3. ability to easily share your api without giving out any api keys.
  4. chat history (limited but better than none) and ID system.
  5. pre-made frontend

If you are using this project PLEASE provide credit it is greatly appricated :)

Logo

cloudflare-ai's People

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.