Deploy Python AI Agents Without Docker or Terraform¶
If you're a Python developer shipping AI agents, you've probably spent more time on infrastructure than on your agent's logic. Dockerfiles. IAM roles. Container registries. Cron schedulers. Secrets management.
None of that is Python. None of it is AI. And none of it differentiates your agent.
Here's how to deploy Python AI agents to production without touching any of it.
The Python developer's infrastructure trap¶
A typical Python AI agent is 200 lines of logic and 400 lines of YAML, bash, and Terraform to get it running. The ratio is backwards.
What you actually want to write:
# main.py — your agent logic
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
def handler(event, context):
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Analyze the latest data..."}]
)
return {"ok": True, "result": response.choices[0].message.content}
What you end up writing to get it running:
Dockerfile(20 lines)docker-compose.yml(15 lines)terraform/main.tf(80 lines)terraform/iam.tf(40 lines)terraform/variables.tf(30 lines)deploy.sh(25 lines)crontabentry (1 line, but you'll mess it up twice).env.example(10 lines, hope nobody commits the real one)
That's over 200 lines of infrastructure — for a 15-line agent.
The alternative: one command¶
HollowHost inverts the model. Instead of specifying how to deploy, you specify what to deploy — and let the platform handle the rest.
That's it. No Dockerfile. No Terraform. No IAM console.
What you get by default¶
When you deploy a Python agent through HollowHost, the platform provisions:
Containerization (no Dockerfile)¶
Your Python project is containerized automatically. HollowHost detects your
dependency file (requirements.txt or pyproject.toml), installs dependencies
in an isolated build environment, and produces a container image — without you
writing a single line of Dockerfile.
If you want to customize the build, you can provide a Dockerfile — but
you never have to.
IAM roles (no Terraform)¶
Every AI Job gets a dedicated, least-privilege IAM execution role, provisioned automatically. The role is scoped to:
- Read its own secrets only
- Write its own logs only
- Access only the AWS resources you explicitly grant
No shared roles. No AdministratorAccess. No "just make it work" policies
that survive into production.
Secrets management (no .env files)¶
The CLI auto-detects sensitive keys and offers to promote them to secrets.
Secrets are encrypted at rest, injected at runtime as environment variables,
and never appear in logs, build output, or image layers. No .env file to
accidentally commit.
For CI pipelines:
Cron scheduling (no crontab)¶
Standard cron expressions. Toggle on and off with --enable-schedule /
--disable-schedule without losing config. Every run is logged with status,
duration, and token usage.
Logs (no grep through /var/log)¶
Full execution logs from your terminal. Complete run history in the dashboard. Logs are isolated per agent — agent A never sees agent B's output.
Example: a LangChain agent in production¶
Here's a complete example: a LangChain agent that researches a topic daily and emails the results.
main.py — the code you write:
import os, smtplib
from email.mime.text import MIMEText
from langchain_openai import ChatOpenAI
from langchain_community.tools import TavilySearchResults
from langgraph.prebuilt import create_react_agent
llm = ChatOpenAI(model="gpt-4o")
tools = [TavilySearchResults(max_results=3)]
agent = create_react_agent(llm, tools)
def handler(event, context):
result = agent.invoke({
"messages": [("user", "Research the latest in AI agent deployment")]
})
summary = result["messages"][-1].content
msg = MIMEText(summary)
msg["Subject"] = "Daily AI Research Briefing"
msg["From"] = os.environ["SMTP_FROM"]
msg["To"] = os.environ["SMTP_TO"]
with smtplib.SMTP(os.environ["SMTP_HOST"], int(os.environ["SMTP_PORT"])) as s:
s.starttls()
s.login(os.environ["SMTP_USER"], os.environ["SMTP_PASS"])
s.send_message(msg)
return {"ok": True, "message": "Briefing sent"}
requirements.txt:
Deployment — four commands:
# 1. Create the AI Job
hollowhost ai-jobs create --repo you/research-agent --lang python --pm pip --entry-point main.py
# 2. Import secrets from an .env file
hollowhost ai-jobs env import <ai-job-id> --file .env
# 3. Set a daily 9 AM UTC schedule
hollowhost ai-jobs update <ai-job-id> --schedule "0 9 * * *"
# 4. Deploy
hollowhost ai-jobs deploy <ai-job-id> --follow
Total infrastructure code written: zero lines.
What about TypeScript?¶
HollowHost supports TypeScript AI agents the same way. Same CLI, same isolation guarantees, same zero-infra experience:
hollowhost ai-jobs create \
--repo you/ts-agent \
--lang typescript \
--pm npm \
--entry-point src/index.ts
Your package.json handles dependencies; HollowHost handles the rest.
The bottom line¶
Python developers should spend their time on agent logic, not deployment infrastructure. If your agent works locally, it should be five minutes from production — not five days of Terraform and IAM debugging.
Ready to deploy your Python agent? Start with the Getting Started guide or browse the full CLI reference.