--- id: banks version: "2.5.0" license: MIT license_treatment: permissive maintenance: active --- # banks — A prompt programming language License: permissive · Maintenance: active · Downloads: 8.4M/mo ## 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 above — 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 pip install banks uv add banks poetry add banks ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 8.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags llm prompt templating, chat message generation, prompt versioning management, dynamic prompt rendering, jinja2 prompt language, multimodal prompt builder, function calling in prompts, llm-prompting, template-engine, prompt-management [View on SkillFed](https://skillfed.io/packages/banks) · [View on PyPI](https://pypi.org/project/banks/)