HTML Prompt Response Construction
HPRC Documentation
An AI-native server-side templating engine that integrates with any web framework — FastAPI, Flask, Django — or runs standalone. Embed LLM prompts directly inside your HTML and have them executed during rendering — like JSP or PHP, but for prompts.
v0.1.0
Python 3.9+
Provider-independent
Async
pip install hprc-framework # then: import hprc
README
Start here — the project explained in plain language: what HPRC is, why it exists, how it works, and how your data flows into prompts and the page.
Read firstUser Guide
Install, quick start, the full template syntax reference, rules, tools, request parameters, dependency graphs, async, caching, and a runnable FastAPI example.
Start hereArchitecture & Design
The big picture, the render pipeline, tools, the LLM adapters, the module layout, a worked example — and the roadmap.
Deep diveSPREP Spec
The formal SPREP template-language specification — elements, attributes, execution semantics, and conformance. HPRC is the reference implementation.
SpecificationSource on GitHub
Clone, star, file issues, or download a release. git clone the repo,
or pip install hprc-framework to use it in your app.
What HPRC does
You write a normal HTML page and drop <prompt> blocks into it. At
render time, HPRC resolves each prompt's text (filling in data, request parameters
and the responses of other prompts), figures out the execution order
automatically, runs prompts concurrently where it can, caches results, and stitches
each <response> back into the final HTML. Prompts themselves are
tacit — they never appear in the output.
Tacit prompts
Prompt blocks execute but never render. Only <response> placeholders emit text.
Auto dependencies
One prompt can <include> another's response. HPRC builds the graph and orders execution for you.
Concurrent
Independent prompts in the same level run together with asyncio.
Pluggable
Swap the LLM provider, rules, tools and cache through one HPRCConfig.
Declarative
Named rules & tools — no expression language in templates; business logic stays in Python.
Cached
Per-prompt TTL caching keyed on everything that determines the output.
Thirty-second taste
<h1>Hello <fill>customer.name</fill></h1>
<prompt id="summary" model="gpt-5" condition="is_premium" cache="24h">
Summarize the account for <fill>customer.name</fill>
who is interested in <param>product</param>.
</prompt>
<section><response id="summary"/></section>
import hprc
from hprc import HPRCConfig, MockLLMClient
config = HPRCConfig(
llm_client=MockLLMClient(),
rules={"is_premium": lambda ctx: ctx["customer"]["tier"] == "premium"},
)
html = await hprc.render_template(
template_path="customer.sprep.html",
request={"query": {"product": "WidgetPro"}, "path": {}, "method": "GET"},
bindings={"customer": {"name": "Ada", "tier": "premium"}},
config=config,
)
The application developer writes no prompt-orchestration logic. See the User Guide for the full walkthrough.
Status
Open source (Apache-2.0). Version 0.1.0 (Alpha). Created by Rajesh Ramani. Early release — contributions and feedback welcome.