pydantic-ai-web-models¶
Educational project — read before using
This project was created for personal learning and educational purposes only. It is not intended for production use, nor does it encourage or endorse circumventing any terms of service. The author makes no warranties and accepts no liability for any misuse. Users are solely responsible for ensuring their usage complies with the terms of service of OpenAI, Google, and any other third-party services they interact with.
A lightweight Pydantic AI model provider that routes requests to web-based LLMs through Temporal workflows. The Temporal worker handles browser-based LLM access on your behalf — no LLM API keys are required in your application.
This package does not include Temporal workflows
pydantic-ai-web-models provides only the Pydantic AI model provider — the client that
sends requests to Temporal. It does not ship the Temporal workflows needed to execute LLM
requests against web-based models. You must build and deploy your own Temporal worker that
implements the LLMInvokeWorkflow workflow type. Without a running worker, this package
cannot work on its own.
Features¶
- Drop-in provider strings — use
"google-web:gemini-3-flash"or"openai-web:gpt-5-3"directly inAgent(model=...) - No LLM API keys needed in your application code
- Pydantic structured output — pass
output_type=MyModeland get validated, typed responses - Multi-turn conversations via
message_history=result.all_messages() - Temporal Cloud and mTLS authentication supported
- Fully environment-driven configuration via
.envfile or env vars - Python 3.11+
Quick Example¶
from pydantic_ai import Agent
import pydantic_ai_web_models # (1)!
agent = Agent(model="google-web:gemini-3-flash") # (2)!
result = agent.run_sync("What is the capital of France?") # (3)!
print(result.data)
# Paris is the capital of France...
- Importing the package automatically registers
google-webandopenai-webproviders with Pydantic AI. No explicit setup call is needed. - Pass a provider-prefixed model string directly to
Agent. Both"google-web:..."and"openai-web:..."are supported. - Use
run_syncfor synchronous code orawait agent.run(...)in async contexts.
Ready to dive in?
Head over to Getting Started for installation instructions, environment setup, and your first working agent in under five minutes.
Available Models¶
| Provider | Model String | Description |
|---|---|---|
google-web |
google-web:gemini-3-flash |
Gemini 3 Flash — fast, general-purpose |
google-web |
google-web:gemini-3-flash-thinking |
Gemini 3 Flash with extended reasoning |
google-web |
google-web:gemini-3.1-pro |
Gemini 3.1 Pro — highest capability Google model |
openai-web |
openai-web:gpt-5-3 |
GPT-5-3 — fast OpenAI model |
openai-web |
openai-web:gpt-5-5 |
GPT-5-5 — latest OpenAI model |