Spaces:
Running
A newer version of the Gradio SDK is available: 6.14.0
β‘ Grokflow
Build AI-powered apps visually β no code needed.
Grokflow is a block-based AI app builder that runs on Hugging Face Spaces, powered by xAI's Grok model. Snap together input blocks, AI blocks, and output blocks to create custom AI workflows in minutes.
What it does
Grokflow lets you build AI apps the same way you'd build with Lego β one block at a time. Connect blocks using {{variable}} references and hit Run All to execute the whole pipeline.
Block types
| Block | Type | Description |
|---|---|---|
| π Text Input | Input | Free-form text the user fills in |
| β° Dropdown | Input | Choose from a list of options |
| β Slider | Input | Numeric value picker with min/max/step |
| β¦ AI Generate | AI | Generate text from a prompt template |
| π¬ AI Chat | AI | Full multi-turn conversation with Grok |
| β³ AI Transform | AI | Rewrite or edit text with a prompt |
| β¦ Display | Output | Show the value of any variable |
How to use
1. Add blocks
Click any block button in the toolbar to add it to your canvas.
2. Name your variables
Each block has a variable name (e.g. block_1). This is how other blocks reference its value.
3. Connect blocks
In any AI prompt, use {{variable_name}} to inject another block's value. For example:
Write a {{tone}} blog post about {{topic}}.
Where tone and topic are variable names from your input blocks.
4. Run
- Click βΆ on a single block to run just that block
- Click βΆ Run All to execute all blocks in order (inputs β AI β display)
Example app: Blog Post Generator
| Block | Type | Config |
|---|---|---|
| Topic | Text Input | Variable: topic |
| Tone | Dropdown | Options: Professional, Casual, Funny Β· Variable: tone |
| Writer | AI Generate | Prompt: Write a {{tone}} 3-paragraph blog post about {{topic}}. |
| Result | Display | Shows: {{writer}} |
Hit Run All β instant blog post.
Setup on Hugging Face Spaces
Files needed
your-space/
βββ app.py
βββ requirements.txt
Add your API key
- Go to your Space β Settings β Variables and secrets
- Add a new secret:
- Name:
XAI_API_KEY - Value: your xAI API key from console.x.ai
- Name:
Deploy
Push both files β the Space builds automatically. Takes about 60 seconds.
Model
Grokflow uses xAI Grok via the OpenAI-compatible API endpoint:
https://api.x.ai/v1/chat/completions
model: grok-4-1-fast-non-reasoning
Tech stack
- Gradio β UI framework
- xAI Grok API β language model
- Python β all logic, no JavaScript, no HTML files
Tips
- Variable names must be a single word with no spaces (e.g.
my_topicnotmy topic) - AI blocks run in the order they appear β put inputs first, AI blocks second, display blocks last
- The AI Chat block keeps full conversation history within a session
- Use the system prompt field to give each AI block a specific persona or set of instructions
License
MIT β free to use, fork, and build on.
