Skip to content
May 21, 2024Tuesday
  1. Modal Blog31

    Fine-tuning Stable Diffusion on Heroicons to Create an Infinite Icon Library

    Modal fine-tuned a Stable Diffusion model on the roughly 300-SVG Heroicons library to generate new black-and-white line icons in that style, including ones for concepts like barack-obama and golden-retriever. The full pipeline — downloading the pretrained model, full fine-tuning with HuggingFace Diffusers' train_text_to_image.py script, and serving a Gradio web UI — runs on Modal's serverless GPU platform. The write-up walks through dataset prep (SVG-to-PNG conversion, white backgrounds, caption metadata.csv) and notes that full fine-tuning worked best, though LoRA-style parallel adapters can also work for small datasets.

April 26, 2024Friday
  1. Modal Blog50

    Fine-tuning an open source embedding model to beat OpenAI's text-embedding-3-small

    A fine-tuned open source embedding model can outperform OpenAI's text-embedding-3-small in accuracy at lower cost using only a handful of examples. Modal ran an experiment on the Quora duplicate-questions dataset to find how much fine-tuning data a simple question-answering use case needs, and describes how to build one on its serverless infrastructure.

March 26, 2024Tuesday
  1. Modal Blog22

    How Ramp automated receipt processing with fine-tuned LLMs on Modal

    Ramp used Modal to fine-tune its LLMs and build a text-to-structured-JSON model for receipt management, cutting receipts requiring manual intervention by 34% on infrastructure estimated 79% cheaper than major LLM providers like OpenAI. Modal functions trained many candidate models in parallel, persisted weights to Modal volumes, and served a parametrized inference endpoint. One engineer also ported a PII-stripping script for 25,000 invoices to Modal, parallelizing it on 256 cloud workers to finish in 20 minutes for $100 instead of 3 days locally.

March 14, 2024Thursday
  1. Modal Blog36

    Modal's modal-http: Serving Web Functions on Serverless Infrastructure

    Modal built modal-http, an HTTP and WebSocket stack that lets its serverless functions accept web requests, with full WebSocket support recently completed. Unlike AWS Lambda's 15-minute and 50 MB limits, Modal containers can use up to 64 CPUs, 336 GB of memory and 8 Nvidia H100 GPUs, so the team translates HTTP into function calls rather than fronting containers with a conventional reverse proxy.

January 23, 2024Tuesday
  1. Modal Blog40

    Embedding English Wikipedia in under 15 minutes with Modal and Hugging Face TEI

    Modal and Hugging Face's Text Embedding Inference server can embed the entire English Wikipedia in about 15 minutes for just over $15, using Modal's serverless GPU scaling. The post argues open-source embedding models beat API-based ones like OpenAI's text-embedding-ada-002 for production RAG, since they can be fine-tuned on user data and avoid rate limits and per-token costs.

July 21, 2023Friday
  1. Cursor Changelog62

    Cursor analyzes Llama-2-70B inference cost and latency against GPT-3.5

    Cursor measured Llama-2-70B inference on 2 80-GB A100 GPUs and found it over 3x cheaper than GPT-3.5 for prompt tokens but far more expensive for generated tokens at small batch sizes. Prompt processing costs about $0.00042 per 1K tokens versus GPT-3.5's $0.0015, while generation reaches $0.066 per 1K tokens at batch size 1 and only approaches GPT-3.5 pricing at large batches that push time to first token to several seconds. Cursor recommends open-source models for prompt-heavy tasks like classification and reranking, and closed-source APIs for generation-heavy workloads.

    Why it matters: Cursor's measured cost and latency data shows when self-hosting Llama-2-70B beats GPT-3.5 and when it does not, offering a reusable framework for open-source model serving decisions.