Overview
Dinja is a Flutter/Dart package that implements the Jinja templating engine for Hugging Face and GGUF large language model (LLM) chat templates, supporting messages, tools, and generation prompts. It ensures parity with llama.cpp and Jinja2, enabling consistent template rendering across platforms. Designed for cross-platform use, it runs seamlessly on Android, iOS, Linux, macOS, Web, and Windows, including WebAssembly. Ideal for developers building AI-powered applications requiring precise prompt formatting.
Use cases
- LLM chat interface development
- AI assistant prompt templating
- Cross-platform LLM integration
- Web and mobile AI applications
- Tool calling in LLM workflows
Key features
- Jinja2 compatibility
- Parity with llama.cpp
- Support for GGUF and Hugging Face models
- Web and Wasm support
- Platform-agnostic rendering
Suitable for
- Flutter developers building AI apps
- Teams needing consistent prompt handling
- Applications using LLM tool calls
- Web-based AI assistants
- Multi-platform AI clients
Considerations
- Requires familiarity with Jinja syntax
- Best suited for LLM-specific templating
- Limited to prompt generation use cases
- Not a general-purpose templating engine
- Dependent on underlying LLM framework