DEV Community

Cover image for Vanilla worker playground for cloudflare AI
Casualwriter
Casualwriter

Posted on

Vanilla worker playground for cloudflare AI

This is a submission for the Cloudflare AI Challenge.

What I Built

Vanilla worker playground for cloudflare AI, also act as cloudflare API proxy.

Demo

Demo: https://playground.pingshan.uk/

Image description

My Code

github: https://github.com/casualwriter/vanilla-worker-playground
source: https://github.com/casualwriter/vanilla-worker-playground/blob/main/vanilla-worker-playground.js

Journey

I just explorer to use cloudflare AI API, and make the worker as API proxy first, and code the html page locally.

the html page is very simple in less than 300 lines code, and I realize that I can put it inside worker. that's really happy thing with small html page.

It is a chatbot for all major AI chat models available in clouflare AI API, which may switch different AI modes during a conversation. After play with cluoflare AI models, the conversation may export/print for reference. btw, this program also support voice recognition (sorry not use AI now). If have time, I will use cloudflare AI for voice recognition and speak.

In additional, this worker also acts as API proxy enable html page calling clouflare API anywhere.

Hope you like it, have a nice day,


dev user name: casualwriter
https://dev.to/casualwriter

Top comments (0)