banks
A prompt programming language
What it is and what it does
Banks is a template-based prompt programming language built on Jinja2 that transforms generic prompt blueprints into structured LLM inputs. Rather than manually formatting prompts with f-strings or string concatenation, you write templates using custom tags like `{% chat %}` to define message roles and content, then render them with context variables. The system handles conversion to chat message objects, image embedding for vision models, and metadata attachment for prompt versioning and management.
The package integrates with LLM providers through optional dependencies: it can invoke LLMs during template rendering to generate few-shot examples or perform function calling, supports prompt caching directives from providers like Anthropic, and stores prompts on disk with version tracking. Core templating requires only the base dependencies (Jinja2, Pydantic, Griffe for documentation), while advanced features like in-prompt LLM completion or Redis-backed caching require optional packages.
Use it for:
- Build reusable chat prompt templates with system/user/assistant roles and render them as structured message objects for API calls.
- Include images in prompts for vision models and have Banks handle URL encoding or local file upload during rendering.
- Generate few-shot examples by invoking an LLM during template rendering to populate example sections dynamically.
- Define and version prompts with metadata, storing them on disk for team reuse and tracking changes across iterations.
- Attach function definitions to prompts and let Banks orchestrate LLM tool-calling roundtrips automatically.
- Mark sections of prompts for provider-specific caching (e.g., Anthropic's ephemeral cache) to reduce latency and cost.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Banks is a template language and prompt management system for generating LLM prompts from blueprints, supporting chat message formatting, image inclusion, dynamic text generation via LLM calls, function calling, and prompt caching.
Yes. Banks is actively maintained, has low install friction, carries a permissive MIT license, and solves a real problem—moving beyond ad-hoc string formatting for LLM prompts. The Beta status and recent release (6 days old) suggest active development. Install it if you're building LLM applications and want structured, versioned, reusable prompts; skip it if you're only calling LLMs with simple one-off strings.
Install
banks on PyPI
pip
pip install banksuv
uv add bankspoetry
poetry add banksInstalling banks
Before you install
Low friction install with a pure-Python wheel. Maintenance is active with a recent release (6 days old) and steady repository activity. Seven runtime dependencies are all well-established packages, though optional dependencies (litellm, redis) add capability for advanced features.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install banks
from banks import Prompt
prompt_template = """
{% chat role="system" %}
You are a {{ persona }}.
{% endchat %}
"""
p = Prompt(prompt_template)
messages = p.chat_messages({"persona": "helpful assistant"})
Verify before relying
- Whether optional dependencies (litellm, redis) are required for core templating or only for specific advanced features like LLM-based text generation and caching.
- Performance characteristics when rendering complex templates with many dynamic LLM calls or large image payloads.
- Stability guarantees given Beta development status (Development Status :: 4).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — deprecated, eval-type-backport, filetype, griffe, jinja2, platformdirs, pydantic |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,360,654/month — #1,631 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: banks-2.5.0-py3-none-any.whl
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
llmLLM is a CLI tool and Python library for…
permissive · top 15,000 on PyPI
pomlPOML is a markup language and Python SDK for…
unclear · top 15,000 on PyPI
pdd-cliPDD is a CLI tool that treats natural-language…
permissive · top 15,000 on PyPI
promptflowPrompt flow is a development suite for…
permissive · top 15,000 on PyPI
renderersConverts chat messages to token IDs for LLM…
permissive · top 15,000 on PyPI
promptyPrompty is a Python runtime for executing LLM…
permissive · top 15,000 on PyPI
pydantic-handlebarsRenders Handlebars templates for composing LLM…
permissive · top 5,000 on PyPI
ell-aiell-ai is a functional prompt engineering…
permissive · top 15,000 on PyPI
dynamicpromptsGenerates varied text prompts for image…
permissive · top 15,000 on PyPI
toon-formatEncodes and decodes data structures using TOON…
permissive · top 15,000 on PyPI