sequenced.ai
Articles/Models & infrastructure/Blueprint//8 min read

Modal runs AI code as scalable functions with explicit resource choices

Modal connects Python functions to GPU and CPU infrastructure. Its appeal is rapid iteration, while cold starts, concurrency and persistent state still need design.

By Sequenced deskAI-assisted, source-led · how we work
Visit Modal website ↗
FunctionsCode-defined workloadsRun Python tasks on managed containers.
GPUsPer-function selectionChoose accelerator resources in code.
AutoscalingContainer-level controlsScale-out and warm capacity have explicit settings.
VolumesPersistent model artifactsStore data beyond an individual container.
Modal mark
Modalmodal.com · independent research

Represent this company? Verify your work email to access its workspace, or send the desk a factual correction.

Modal is a cloud platform for running code, especially AI workloads that need GPUs or substantial parallel execution. Developers define functions and their environments in code, and Modal runs them on managed infrastructure. That can shorten the route from a local experiment to a repeatable cloud job, provided the team designs for distributed execution, startup delays and persistent state.

In brief
  1. 01The development model Python functions declare dependencies and resource requirements.
  2. 02The operating question Container scaling is managed, but request shape and concurrency still belong to the application.
  3. 03The economic tradeoff Usage pricing rewards suitable workloads; keeping resources warm changes the bill.

01 / ProductThe unit of deployment is code with an execution environment

The Modal introduction describes a platform for running functions in the cloud without managing servers. A function’s environment and resource requests travel with its definition. This is different from manually preparing a long-lived GPU machine: the developer expresses what the work needs and invokes the managed execution path.

The GPU guide shows accelerator selection on a function and requires a valid payment method for GPU use. The chosen device must fit the workload’s memory and software requirements. The ability to request a GPU is not evidence that an arbitrary model will load or achieve useful throughput on it.

Modal’s broader platform also includes inference and sandbox-related products. For this blueprint, the concrete route is Functions with managed containers and persistent Volumes. Keeping that scope explicit matters because a sandbox, a hosted model endpoint and a Python function do not necessarily expose the same execution or billing contract.

02 / AudienceA useful fit for bursty jobs and teams working in Python

Modal is relevant to an AI team that wants to turn existing Python logic into a cloud workload without first building a Kubernetes platform. Examples include generating embeddings for a document import, evaluating model candidates or processing a collection of images. The work should have an identifiable input, output and resource profile rather than depending on an undocumented interactive session.

The model can also suit application endpoints, but response deadlines change the evaluation. An overnight import can tolerate startup and queued work that would frustrate a user waiting for an immediate preview. Choose the intended interaction first; serverless execution does not make every workload equally responsive at its first request.

The Replicate blueprint provides a useful comparison when consuming an existing model is enough. The Hugging Face blueprint covers model discovery and other deployment routes. Modal’s function-oriented approach is particularly relevant when the application needs its own code around the model, rather than only a standardized prediction call.

03 / WorkflowA proposed workflow for catalog image enrichment

Imagine a retailer creating searchable descriptions and embeddings for approved product images. This is a proposed Modal workflow, not a performed test. Begin with images the business is allowed to process, stable product identifiers and a small judged sample. Decide which attributes should be extracted and which must remain unknown when the image does not provide evidence.

Separate the input manifest from the files themselves. Each item should carry a product ID, image hash and desired processing version. The function can then write results keyed by that combination. If a job is retried, the application can recognize an already completed item instead of appending duplicate metadata to the catalog.

Define a pinned execution image and load an identified model artifact. Use a CPU step for file inspection or lightweight normalization and a GPU function for the model stage where that split is worthwhile. Avoid sending large image payloads back and forth unnecessarily; preserve a clear reference to the authoritative input and measure transfer overhead in the full job.

Use Volumes for artifacts that must outlive a container, such as downloaded model weights and intermediate outputs. Their commit and reload semantics matter when several containers share files. Publish a completed artifact under an immutable version and have consumers load that version explicitly, instead of expecting every running container to immediately observe an in-place file change.

Start with a short batch and compare descriptions with the judged sample. Check products that look visually similar but differ in material or dimensions, because the model should not invent facts absent from the image. Store those unknowns rather than asking a second generation pass to manufacture a complete-looking record.

Increase parallel execution gradually using the scaling guide. A larger container count can move the bottleneck to object storage, a downstream database or a third-party API. Record completion rate, retry volume and destination write errors at each step. A high model throughput figure is not useful if the catalog cannot safely ingest its outputs.

For an interactive preview route, follow the documented Web Functions approach and give long-running work an appropriate application interaction. Compare warm and first-request behavior with the same image sizes. Keep batch enrichment and user-facing previews independently configurable so a large import does not silently change the preview’s latency or cost.

04 / PricingUsage pricing still requires a workload-level estimate

ItemPublished amountBoundary
Starter$0 monthly plan feeCompute charged separately; $30 monthly free compute listed
Team$250 per month plus computeIncludes $100 monthly free compute
H100 SXM5$0.001097 per secondGPU resource only
L4$0.000222 per secondGPU resource only
Volumes$0.09 per GiB-monthPricing page lists 1 TiB-month free

USD plan and resource examples from Modal pricing, consulted 16 September 2026. GPU entries are per second and exclude other resource charges.

The GPU examples are resource prices rather than a complete function invoice. CPU, memory and applicable storage usage also matter, as do plan fees and credits. As illustrative arithmetic, 3,600 seconds at the displayed H100 rate is $3.9492 for GPU time alone. It is not a promise that a particular model can complete a useful task within that hour.

The billing guide explains account usage and payments. Keep plan credits distinct from a reduction in the resource tariff: a credit changes the amount due for eligible usage, not the amount of capacity a request consumes. Compare steady-state costs after temporary or included allowances when deciding whether a production workload is economical.

There is an important qualification to broad pay-for-use language. The cold-start guide says that keeping containers warm can incur charges for resources such as reserved GPUs and occupied memory while idle. A low-latency endpoint with a warm floor has a different spending profile from a batch job that can fully finish and release its resources.

For catalog enrichment, estimate cost per accepted item using observed task time, parallelism, reruns and failed outputs. Record startup separately so a large batch does not hide an expensive first invocation. If the business needs only a few interactive previews each day, evaluate whether the latency benefit of persistent warm resources justifies their retained cost.

05 / DistinctionsCode-defined execution makes experiments easier to reproduce

Function definitions can make the environment and resource choice visible in the same change review as the processing logic. This is useful when a model experiment becomes a recurring operational job. The review can show that a new version changed the model, dependency image or requested GPU, rather than leaving those differences hidden in a manually configured machine.

Autoscaling also provides a convenient boundary for independent items. Catalog images can often be processed separately, so the team can increase throughput without rewriting the whole application as a distributed training system. The function still needs explicit handling for partial failures: a collection with one corrupted image should produce a useful report of completed and rejected items.

Persistent Volumes help separate model distribution from function execution. That can reduce repeated downloads, but the release process must identify the weights being used. Treat a model artifact like a software dependency: keep its checksum and version, validate it before use and prevent a producer from overwriting a version that active consumers already trust.

06 / QuestionsMeasure startup, concurrent inputs and storage visibility

The cold-start documentation separates waiting for a ready container from initialization inside that container. These are different causes of a slow first result. Before paying to keep more capacity warm, measure whether time goes into importing libraries, downloading weights, loading the model or waiting for available execution capacity.

Concurrency also needs a model-specific test. Multiple inputs handled by one loaded model may improve utilization, but can increase memory pressure or change queueing behavior. Test representative large images and mixed request sizes rather than extrapolating from a single tiny example. Set explicit limits around the application’s response deadline and destination capacity.

A Volume is not a substitute for a transactional database. Its documented visibility behavior means file-based coordination needs deliberate commits and reloads. Keep catalog business state in the system that already owns it, and use artifact storage for the processing outputs. The proposed workflow’s stable IDs allow the final write step to be retried without treating storage visibility as proof that a business update completed.

Finally, verify feature maturity before adopting a newly advertised capability. The current documentation labels some platform features as alpha or beta. The workflow here uses the documented function, GPU and Volume routes; it does not assume every experimental execution option has the same support commitment.

07 / DecisionStart with one complete job and its real traffic pattern

Modal is a strong candidate when a team has useful AI code and wants managed execution with explicit resource choices. Begin with a complete batch or request path, including input access, artifact persistence and the final application write. Evaluate that path under the actual arrival pattern before tuning the number of containers.

The deciding evidence is a reproducible, correctly completed task with a known cost and understandable failure behavior. If the project needs only a ready-made model API, keep that simpler option in the comparison. If its value lies in custom processing logic, Modal’s code-centered interface becomes more relevant.

01

An intermittent batch workload

Package one complete job and measure cost per accepted item after retries and writes.

Evaluate Functions
02

An interactive model feature

Test first-request latency and the cost of keeping enough capacity warm.

Measure the latency tradeoff
03

A standard prediction need

Compare a hosted model API when custom execution logic offers little additional value.

Consider a simpler interface
What should we explore next?

A business worth understanding.

Suggest your business or one you find interesting. Tell us what you want to understand about its product, positioning, design or workflows.

Suggestions are free. Selection and publication stay with the desk.

Sources

Continue reading

All in this category