# Pydantic AI: fix offline Web UI fetching CDN assets

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/pydantic-ai-offline-web-ui-cdn-references
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, serve the self-contained offline Web UI file. Select the offline artifact with `OFFLINE_HTML_URL`.

**Not for:** Pydantic AI web_fetch advisory and removed Groq models; see [pydantic-ai-2-59-0-web-fetch-advisory-groq-models-removed](https://whatworks.dev/t/pydantic-ai-2-59-0-web-fetch-advisory-groq-models-removed.md).

Subjects: testing

Do first: Use `OFFLINE_HTML_URL` from `pydantic_ai.ui`, download that file on a connected machine, transfer it to the offline environment, and pass its local file to `to_web(html_source=...)`.

## Symptom
johnthagen reported that a downloaded Web UI HTML file still references public CDN assets. This is an offline-hosting symptom, rather than an exception message. [madanlalit](https://github.com/pydantic/pydantic-ai/issues/5318#issuecomment-4418201463) and [gaby](https://github.com/pydantic/pydantic-ai/issues/5318#issuecomment-5240117189) commented on the issue.

## Cause
The downloaded `dist/index.html` is only an entry point. Its stylesheet and runtime chunk loader still reference the CDN. The fix exposes `OFFLINE_HTML_URL` for a single file with chunks, fonts and icons included.

## Fix
1. Use `OFFLINE_HTML_URL` from `pydantic_ai.ui`, download that file on a connected machine, transfer it to the offline environment, and pass its local file to `to_web(html_source=...)`.
2. The documented offline artifact is `https://cdn.jsdelivr.net/npm/@pydantic/ai-chat-ui@2.1.0/offline/index.html`; use the offline file rather than `dist/index.html`.

As of November 2026, the stable release named in the source is [v2.73.0](https://github.com/pydantic/pydantic-ai/releases/tag/v2.73.0) (released 2026-11-24). The [documentation at that tag](https://github.com/pydantic/pydantic-ai/blob/v2.73.0/docs/web.md) retains the offline build and `html_source` instructions.

## Fixed in
First stable release `v2.27.1` (released 2026-08-11). PR [#7349](https://github.com/pydantic/pydantic-ai/pull/7349), by dsfaccini, merged 2026-08-10.

## If it still fails
- Upgrading alone does not switch the default UI to the offline build: `DEFAULT_HTML_URL` still selects the split build. The docs describe a local development/debugging UI; an offline frontend does not make remote model calls available without a network.

Not for: Pydantic AI web_fetch advisory and removed Groq models; see pydantic-ai-2-59-0-web-fetch-advisory-groq-models-removed.

## Sources
- [Instructions for offline Web UI hosting don't include all source](https://github.com/pydantic/pydantic-ai/issues/5318), johnthagen, opened 2026-05-06; closed as completed on 2026-08-10: "a file that still has many CDN/public internet references"
- [Comment by madanlalit](https://github.com/pydantic/pydantic-ai/issues/5318#issuecomment-4418201463), madanlalit, 2026-05-11; parent issue closed as completed on 2026-08-10.
- [Comment by gaby](https://github.com/pydantic/pydantic-ai/issues/5318#issuecomment-5240117189), gaby, 2026-08-10; parent issue closed as completed on 2026-08-10.
- [Point offline web UI hosting at the self-contained chat UI build](https://github.com/pydantic/pydantic-ai/pull/7349), dsfaccini, merged 2026-08-10 (closed).
- [v2.27.1](https://github.com/pydantic/pydantic-ai/releases/tag/v2.27.1), published 2026-08-11.
- [v2.73.0](https://github.com/pydantic/pydantic-ai/releases/tag/v2.73.0), published 2026-11-24.
- [docs/web.md at v2.73.0](https://github.com/pydantic/pydantic-ai/blob/v2.73.0/docs/web.md).

## Checked
2026-11-24; read the issue and comment API records, merged PR, release records, and docs/web.md at v2.73.0; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.