finds.dev← search

// the find

mitsuhiko/minijinja

★ 2,665 · Rust · Apache-2.0 · updated Jun 2026

MiniJinja is a powerful but minimal dependency template engine for Rust compatible with Jinja/Jinja2

MiniJinja brings Jinja2-compatible templating to Rust with a single dependency (serde). It's aimed at Rust developers who want familiar Python-ecosystem template syntax without pulling in a heavy crate graph — and increasingly at the ML tooling space, where HuggingFace, mistral.rs, and others use it to render LLM chat templates.

The dependency story is genuinely impressive: one required dep (serde), and the cargo tree in the README proves it. Jinja2 compatibility is taken seriously — there's a COMPATIBILITY.md that documents divergences honestly rather than claiming full parity. The error messages are descriptive with line/column context, which matters a lot when templates are user-authored. The cross-language reach (Go native impl, WASM for JS/browser, Python extension, C bindings) means you can standardize on one template syntax across a polyglot stack.

No compile-time template verification — unlike Askama, errors surface at runtime, which is a real tradeoff if you're building something where template correctness is a deploy-time concern. The async story is bolted on: there's an `object-using-async` example but the core rendering loop is sync, so async functions in templates require workarounds rather than first-class support. The multi-crate layout (autoreload, embed, contrib, cli as separate crates) is reasonable but means you're juggling version compatibility across several packages when you want the full feature set. The Go implementation is a separate native port, not a WASM wrapper — so behavior drift between the Rust and Go versions is possible and the Go impl's test coverage relative to the Rust core isn't obvious from the repo.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →