--- title: Mini Coding Agent emoji: ⚡ colorFrom: purple colorTo: blue sdk: gradio sdk_version: 4.44.0 app_file: app.py pinned: false license: mit --- # ⚡ Mini Coding Agent A multi-file project scaffolding agent. Describe what you want to build, the agent emits a complete runnable codebase you can download as a `.zip`. ## Architecture ``` Browser ──► Gradio (Python, app.py) ──► Elixir backend (HTTP) ──► LLM provider ╲ ╲► (fallback: direct LLM call from Python) ``` - **Frontend** — `app.py`: Gradio chat UI, provider picker, API-key prompt, streaming tokens, file extraction, zip download. - **Backend** — `elixir_backend/`: Elixir/Plug HTTP service that holds the agent loop and proxies to OpenAI / Anthropic / Groq with SSE streaming. - **Fallback** — if the Elixir backend is unreachable (the default on a plain Gradio Space), the Python frontend talks to the LLM directly, so the Space works out-of-the-box. ## Deploy options on Hugging Face ### Option 1 — Gradio SDK Space (simplest, recommended) Just push `app.py` + `requirements.txt` + this README to a Gradio Space. The Elixir backend is skipped (frontend uses the direct fallback). Set `ELIXIR_BACKEND_URL` to a non-existent URL or leave default. ### Option 2 — Docker Space (Python + Elixir together) Use the included `Dockerfile` to run both processes in one container. Change your Space SDK to `docker` in this README's frontmatter: ```yaml sdk: docker app_port: 7860 ``` ## Local dev ```bash # Terminal 1 — Elixir backend cd elixir_backend mix deps.get mix run --no-halt # listens on :4000 # Terminal 2 — Gradio frontend pip install -r requirements.txt python app.py # http://localhost:7860 ``` ## Providers | Provider | Model | Get a key | | --------- | ---------------------------- | -------------------------------------------------- | | OpenAI | `gpt-4o-mini` | https://platform.openai.com/api-keys | | Anthropic | `claude-3-5-sonnet-latest` | https://console.anthropic.com/settings/keys | | Groq | `llama-3.3-70b-versatile` | https://console.groq.com/keys (free tier) | API keys stay in the Gradio session — they are never persisted. ## License MIT