Making a web app generator with open ML models
A Node.js/Express server can generate web apps from a text prompt by streaming tokens from a code LLM (WizardCoder-15B on Hugging Face Inference Endpoints) straight into the browser as HTML. Prompt tuning does most of the work: terse imperative instructions, pre-seeding the output with `<html><body class=...>`, and requiring TailwindCSS so styles arrive inline without a stylesheet that stalls rendering. Image URLs come from a Stable Diffusion `/image` endpoint that the model is told to call. Alpine.js provides a minimal UI, and DaisyUI's shorthand classes cut token usage compared with verbose Tailwind utility classes.
Related posts
- Generate Images Locally with Docker Model Runner and Open WebUI
Docker mediumAdeptDocker Model Runner can now serve diffusion image models locally through an OpenAI-compatible /v1/images/generations endpoint. Paired with Open WebUI, that gives you private, offline image generation from a chat interface. Models are distributed as DDUF single-file artifacts via Docker Hub, `docker model launch openwebui` wires up the UI, and an admin setting points image generation at the diffusers endpoint. The walkthrough also covers calling the API directly with curl, including negative prompts, inference steps, guidance scale and seeds. Under the hood, the backend unpacks the DDUF into a Diffusers pipeline served by a version-pinned FastAPI server.
- Create an infinite icon library by fine-tuning Stable Diffusion
Modal mediumAdept
Stable Diffusion v1.5 is fully fine-tuned on the ~300-icon Heroicons set to generate new icons in a similar black-and-white line style. Captions are derived from icon names like "golden-retriever" or "barack-obama". The walkthrough covers choosing between full, sequential-adapter and parallel-adapter (LoRA) fine-tuning, then preparing the data: rasterizing SVGs to PNG, adding white backgrounds, and building a metadata.csv of captions. Training uses the Diffusers train_text_to_image script on an A100 via Modal, with 4000 steps, learning rate 1e-5, batch size 1 and 128px resolution. Weights are saved to a Modal Volume and served on a cheaper A10G behind a Gradio UI, and dataset preparation proved the hardest and most important part.
- Getting Started with the OpenAI SDK for Deno
Deno mediumAdeptOpenAI's official Deno SDK on deno.land/x is a TypeScript-first module loaded over HTTPS, which makes loading more efficient on edge platforms like Deno Deploy, Netlify and Supabase and gives VS Code type support without extra configuration. The walkthrough covers installing the SDK through an import map in deno.jsonc and setting OPENAI_API_KEY. It then builds three examples: text generation with GPT-4 Turbo, a single-file Hono JSX app that generates images with DALL-E 3, and image analysis with gpt-4-vision-preview through the chat completions API.
- Introducing Agents.js: Give tools to your LLMs using JavaScript
Hugging Face mediumAdeptAgents.js is a JavaScript library from huggingface.js that gives LLMs tool access in the browser or on Node. An HfAgent turns a plain-text command into JavaScript that chains multimodal tools such as textToImage, imageToText and textToSpeech, then evaluates that code and returns messages carrying strings or Blobs. Any async string-to-string function can stand in as the LLM, with OpenAI shown as an example, and custom tools are defined with a name, description, few-shot examples and a call function. Because the agent executes arbitrary generated code, generateCode followed by evaluateCode is recommended over run, so the code can be reviewed before it executes.
- Inference for PROs
Hugging Face mediumAdeptHugging Face PRO subscribers get curated, rate-limit-boosted HTTP inference endpoints served by text-generation-inference for models such as Llama 3, Mixtral 8x7B, Zephyr, Code Llama, Stable Diffusion XL and Bark, intended for prototyping rather than heavy production (Inference Endpoints is recommended for that). Usage is shown via curl, the huggingface_hub InferenceClient and the OpenAI-compatible Messages API, including Llama 2 chat templates and Code Llama's <PRE>/<SUF>/<MID> infilling format. Generation parameters (do_sample, temperature, top_k, top_p, repetition_penalty, max_new_tokens, stop_sequences, SDXL guidance and steps) are explained, along with disabling response caching via the x-use-cache: 0 header and token streaming.