-
Notifications
You must be signed in to change notification settings - Fork 0
API
ChiefVenzox edited this page Jun 18, 2026
·
1 revision
Backend: FastAPI (backend/app/main.py). Frontend Vite proxy ile relative
URL kullanır (/api, /ws) — CORS derdi yok.
Tek seferde UI üretir (tam sonuç).
İstek
Yanıt
{
"id": 12,
"html": "<!DOCTYPE html>...",
"css": ".hero{...}",
"notes": "Kısa açıklama",
"raw": "@@HTML\n...",
"validation": { "ok": true, "issues": [], "warnings": [] }
}Token token (streaming) üretim. İstemci yukarıdaki istek JSON'unu yollar; sunucu:
{ "type": "token", "text": "<!DOCTYPE" } // çok kez
{ "type": "done", "id": 12, "html": "...", "css": "...",
"notes": "...", "validation": { ... } }
// hata olursa (tek terminal mesaj):
{ "type": "error", "message": "..." }Son üretimleri döndürür (SQLite).
{ "items": [ { "id": 12, "created_at": 1718, "instruction": "...",
"input": "...", "html": "...", "css": "...", "notes": "..." } ] }{ "ready": true, "device": "cuda", "params_m": 27.5 }backend/app/validation/validate.py — bağımlılıksız, MVP düzeyi:
- Üretilen kod boş mu?
- Temel HTML etiketleri var mı?
<!DOCTYPE>/ viewport meta? - HTML
<ve>dengesi - CSS
{ }(ve inline<style>) dengesi
{"ok": bool, "issues": [...], "warnings": [...]} döner. issues ok'u false
yapar; warnings sadece öneridir.
| değişken | varsayılan |
|---|---|
CHIEFUI_CKPT |
checkpoints/ckpt.pt |
CHIEFUI_TOKENIZER |
checkpoints/tokenizer.json |
CHIEFUI_DEVICE |
cuda varsa cuda, yoksa cpu |
CHIEFUI_DB |
database/history.db |
{ "instruction": "Create a hero section", "input": "Style: dark, orange #c45a26", "max_new_tokens": 512, "temperature": 0.8, "top_k": 40, "top_p": 0.95 }