File size: 1,333 Bytes
2498dad
 
be6685b
 
 
2498dad
 
 
be6685b
2498dad
 
 
be6685b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: CodeBook
emoji: πŸ†
colorFrom: purple
colorTo: red
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: true
short_description: Advanced AI workflowing system.
---

# πŸ€– CodeBook AI Workflow Space: Code or Book Generator with Self-Critique

This Hugging Face Space refines an **idea** into either:
- A *complete code project* (pseudocode β†’ snippet β†’ full code), or
- A *structured story* (Start β†’ Development β†’ Climax β†’ Conclusion β†’ End).

After creation, **two AI critics** rate and explain the output, and the system automatically refines it based on their feedback β€” a full *AI self-improvement loop*.

## 🧩 Workflow

1. Input your **idea** and choose **Code mode** or **Book mode**.
2. The AI refines your prompt.
3. It builds content step-by-step.
4. Two critics analyze and rate it.
5. The main model refines the output using that feedback.

## πŸ› οΈ Models Used
- Prompt refiner: `mistralai/Mixtral-8x7B-Instruct-v0.1`
- Code generator: `codellama/CodeLlama-7b-Instruct-hf`
- Book generator: `mistralai/Mixtral-8x7B-Instruct-v0.1`
- Critics: `google/gemma-2-9b-it`, `meta-llama/Meta-Llama-3-8B-Instruct`

You can modify these to lighter or open-source models depending on performance limits.

## πŸš€ Deployment
Push this repo to Hugging Face as a Space and select β€œGradio” as the SDK.