Skip to content

evans-0/yoda-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌌 Yoda Speak β€” Galactic Translation Terminal

"Type your words. Translated, they shall be."

A Star Wars-themed translator that converts any text into Yoda's iconic speech pattern. Powered by Llama 4 Scout via Cloudflare Workers AI β€” no external API keys needed.

πŸ”— Live demo: yoda-translate.pages.dev


✨ Features

  • πŸ€– AI-powered Yoda speech translation using Llama 4 Scout
  • ⚑ Serverless backend via Cloudflare Workers
  • πŸ›‘οΈ Per-IP rate limiting with Cloudflare KV
  • πŸ“œ Recent translations history (session-based)
  • 🌠 Animated starfield background
  • πŸ“‹ One-click copy to clipboard
  • πŸ“± Fully responsive design

πŸ—οΈ Architecture

Browser (Cloudflare Pages)
        β”‚
        β”‚  POST /  { text }
        β–Ό
Cloudflare Worker  ←── KV (rate limiting)
        β”‚
        β”‚  env.AI.run(llama-4-scout-17b-16e-instruct)
        β–Ό
Cloudflare Workers AI

πŸš€ Self-hosting

1. Deploy the Worker

  1. Go to workers.cloudflare.com and create a new Worker
  2. Paste the contents of worker.js
  3. Add bindings under Settings β†’ Bindings:
    • Workers AI β†’ variable name: AI
    • KV Namespace β†’ variable name: RATE_LIMIT (create namespace first under Storage & Databases β†’ Workers KV)
  4. Deploy

2. Deploy the Frontend

  1. Update WORKER_URL in index.html to your Worker URL
  2. Go to Workers & Pages β†’ Create β†’ Pages
  3. Upload index.html directly
  4. Deploy

πŸ“ Files

File Description
index.html Frontend β€” single-file UI with starfield, input, and output
worker.js Cloudflare Worker β€” rate limiting + Workers AI call
wrangler.toml Wrangler config β€” for Git-connected auto-deploys

βš™οΈ Rate Limiting

20 requests per IP per minute, enforced via Cloudflare KV. Resets automatically every 60 seconds.


πŸ› οΈ Tech Stack

  • Frontend: Vanilla HTML/CSS/JS, hosted on Cloudflare Pages
  • Backend: Cloudflare Workers (serverless)
  • AI: Llama 4 Scout (17B) via Cloudflare Workers AI
  • Storage: Cloudflare KV (rate limiting)

πŸ“„ License

MIT


May the Force be with you. ✨

About

Type anything. Into Yoda speech, it turns. 🌟

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors