DEV Community

Cover image for Vanilla worker playground for cloudflare AI
Casualwriter
Casualwriter

Posted on

3 1

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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more