https://github.com/mrmps/lookalikeceleb
Find your celebrity twin with AI – React + Bun + Hono demo powered by Inference.net
https://github.com/mrmps/lookalikeceleb
ai bun celebrity doppelganger hono llm lookalike
Last synced: 8 months ago
JSON representation
Find your celebrity twin with AI – React + Bun + Hono demo powered by Inference.net
- Host: GitHub
- URL: https://github.com/mrmps/lookalikeceleb
- Owner: mrmps
- Created: 2025-06-22T09:26:05.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-22T02:20:13.000Z (11 months ago)
- Last Synced: 2025-07-22T02:36:21.480Z (11 months ago)
- Topics: ai, bun, celebrity, doppelganger, hono, llm, lookalike
- Language: TypeScript
- Homepage: https://www.lookalikeceleb.com/
- Size: 3.47 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🎬 LookalikeCeleb
Find your celebrity twin with AI • Open source • Powered by Inference.net
---
## 📸 How it works
1. **Upload a photo** (PNG/JPG, paste, or camera)
2. **AI analysis** via Inference.net Vision + LLM returns structured JSON with your top celebrity matches
3. **Results display** with hi-res images, similarity scores, and shareable cards
4. **Privacy-first** - no accounts, no storage, everything processed in memory
## 🔧 Features
- **Transparent AI** - structured JSON responses from Inference.net, not black-box results
- **Fast development** - full-stack multimodal demo in minutes with `pnpm run dev`
- **Type-safe** - JSON schema enforcement with TypeScript + Zod validation
- **Share-ready** - built-in card generator for social media (copy, download, platform links)
- **Production-ready** - Bun + Hono backend, Docker support, no vendor lock-in
- **Privacy-focused** - optional analytics, no data storage
## 🧰 Tech Stack
- **Frontend** – Vite • React 18 • shadcn/ui • TailwindCSS
- **Backend** – Bun runtime • Hono router • TypeScript end‑to‑end
- **AI** – [Inference.net Vision API](https://docs.inference.net/features/vision) + Structured Outputs
- **Deploy** – Railway, Vercel, Fly.io, or any Docker host
## 🚀 Quick Start
```bash
git clone https://github.com/yourrepo/lookalikeceleb.git
cd lookalikeceleb
pnpm install # or bun install / npm i
cp .env.example .env # add INFERENCE_API_KEY
pnpm run dev # frontend at http://localhost:5173
bun run server:index.ts # backend at http://localhost:3000
```
> **Tip:** Vite proxy is pre-configured — uploads hit `/api` on port 3000 automatically.
## 📊 Analytics (Optional)
LookalikeCeleb includes optional **Plausible Analytics** for privacy-friendly tracking:
```typescript
// In App.tsx - automatically skips if env vars not set
const plausible = Plausible({
domain: import.meta.env.VITE_PLAUSIBLE_DOMAIN,
apiHost: import.meta.env.VITE_PLAUSIBLE_HOST,
trackLocalhost: false, // Only tracks in production
});
```
### Setup (Optional)
Add to your `.env` file:
```env
VITE_PLAUSIBLE_DOMAIN=yourdomain.com
VITE_PLAUSIBLE_HOST=https://plausible.io
# Or use your own Plausible instance
```
### Remove Analytics
Simply delete the `useEffect` block in `src/App.tsx` or leave env vars unset.
> **Note:** Analytics only tracks in production (ignores localhost). No tracking = no data collected.
## 🏗️ Architecture
```mermaid
flowchart TD
A[Client React] --> B[API Matches Hono+Bun]
B --> C[Inference.net Vision LLM]
C --> B
B --> D[Image Search Proxy]
B --> A
```
**Flow:**
- Client uploads image to Hono API
- Server sends vision prompt to Inference.net with JSON schema
- AI returns structured celebrity matches
- Server fetches hi-res images via search proxy (avoids CORS)
- Combined response sent back to client
## ✨ API Example
Inference.net Request → Response
**Request**
```jsonc
POST https://api.inference.net/v1/chat/completions
{
"model": "google/gemma-3-27b-instruct/bf-16",
"messages": [
{"role":"user","content":[
{ "type":"image_url",
"image_url":{"url":"data:image/jpeg;base64,..." }
},
{ "type":"text",
"text":"Find top 3 celebrity look‑alikes with explanation."}
]}
],
"response_format":{
"type":"json_schema",
"json_schema":{
"type":"object",
"properties":{
"matches":{"type":"array","minItems":3,"maxItems":3,
"items":{
"type":"object",
"properties":{
"name":{"type":"string"},
"percentage":{"type":"number"},
"description":{"type":"string"}
},
"required":["name","percentage","description"]
}
}
}
}
}
}
```
**Response**
```json
{
"matches": [
{ "name":"Emma Stone","percentage":94,
"description":"Wide-set green eyes, pronounced cheekbones…" },
{ "name":"Ryan Gosling","percentage":87,
"description":"Similar jawline, nose bridge, blue eyes…" },
{ "name":"Zendaya","percentage":82,
"description":"Matching eyebrow arch, chin profile…" }
]
}
```
## 🚀 Deploy
| Platform | Instructions |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Railway | [](https://railway.com?referralCode=hKysZG) |
| Docker | `docker build -t lookalikeceleb . && docker run -p 3000:3000 --env-file .env lookalikeceleb` |
Set `INFERENCE_API_KEY` in your environment variables.
## 🤝 Contributing
We welcome contributions! Ideas for improvements:
- New share card templates
- Additional AI providers
- Performance optimizations
- Dark mode
- Mobile app version
1. Fork this repo
2. Create a feature branch: `git checkout -b my-feature`
3. Commit your changes and open a PR
## 📜 License
[MIT](LICENSE) - feel free to use this in your own projects.
---
> **A practical demo of multimodal AI for the open source community.
> Built to show what's possible with modern vision models.**