Show HN: Clockwork – Intelligent, Composable Infrastructure Primitives in Python
github.comI've been working on Clockwork, a Python library for composable infrastructure blocks that lets you dial the AI involvement up or down per resource.
The core idea: Allows you to build complex infra components from basic building blocks with a knob on how much "intelligence" you want in it.
``` # Specify everything yourself nginx = DockerResource( image="nginx:1.25-alpine", ports=["8080:80"], volumes=["/configs:/etc/nginx"] )
# Just set constraints, AI fills the rest nginx = DockerResource( description="web server with caching", ports=["8080:80"] )
# Or just describe it
nginx = DockerResource(
description="web server for static files",
assertions=[HealthcheckAssert(url="http://localhost:8080")]
)
```Same resource type, you pick the level of control. What I find tedious (picking nginx vs caddy vs httpd) you might care deeply about. So every resource lets you specify what matters to you and skip what doesn't.
It's built on Pulumi for deployment, uses Pydantic for declarative specifications, and works with local LLMs (LM Studio) and cloud-based such as OpenRouter.
Also has composable resources - group related things together:
``` BlankResource(name="dev-stack", description="Local dev environment").add( DockerResource(description="postgres", ports=["5432:5432"]), DockerResource(description="redis", ports=["6379:6379"]), DockerResource(description="api server", ports=["8000:8000"]) ) ```
The AI sees the whole group and configures things to work together. Or you can .connect() independent resources for dependency ordering and auto-generated connection strings (this is still WIP as is the whole project but I'm currently thinking of a mechanism of "connecting" things together appropriately).
Repo: https://github.com/kessler-frost/clockwork
It's early (v0.3.0) and I'm still figuring out what works. Main questions:
1. The "adjustable AI" concept - is this useful or confusing? 2. Which resources/features would be most valuable next?
Would love to hear if this resonates with anyone or if I'm solving a problem nobody has.