For developers & operators
Bloqr Core: the open-source engine behind Bloqr AI
A multi-language toolkit for compiling, validating, and shipping ad-blocking and DNS-protection rule sets — six compiler implementations, one shared configuration schema, and a Dashboard that ties the whole pipeline together.
What Bloqr Core actually does
Every rule set that powers Bloqr AI — the same protection enforced by the product you signed up for — is produced by pulling in upstream sources (EasyList, hosts files, curated lists), running them through a transformation pipeline (dedupe, validate, compress, invert allow-rules, optimize), and emitting a single compiled output. Bloqr Core is that pipeline, and it's also what powers Bloqr AI, our commercial compiler for teams that want the managed, vendor-integrated version of this same engine — implemented independently in six languages so it can run wherever your stack already lives: a CI job, a desktop tool, or a serverless edge function.
Six runtimes, one schema
Pick the compiler that fits your stack
TypeScript
Deno 2.0+ · Bun-compatible
Published to JSR as @bloqr/compiler-core. Powers the reference CLI and interactive console.
.NET 10
Library + Spectre.Console CLI
Dependency-injection friendly, with a shared Bloqr.Compiler.Core library also consumed by the Dashboard.
Python
3.9+ · pip install -e .
A pip-installable package exposing both a CLI (bloqr-compiler) and a plain Python API.
Rust
Zero runtime deps
A single high-performance binary with LTO optimization, split into a bloqr-compiler-core library and thin CLI crate.
Swift
macOS-native Swift Package
Library plus a bloqr-compiler CLI, sharing the same compilation engine as the other wrappers.
PowerShell
7+ · Windows / Linux / macOS
A class-based, Pester-tested module — the sole cross-platform scripting-language compiler in the toolkit.
Same config. Any runtime.
A single config.json compiles identically whether you invoke it from Deno, .NET, Python, Rust, Swift, or PowerShell.
# pip install bloqr-compiler
bloqr-compiler -c config.json -r
# Same config file, six different runtimes:
# deno task compile (TypeScript)
# dotnet run -- --config (.NET)
# bloqr-compiler -c config.json (Python, shown above)
# cargo run -- -c config.json (Rust)
# swift run bloqr-compiler compile (Swift)
# Invoke-BloqrCompiler -ConfigPath config.json (PowerShell)The transformation pipeline
Thirteen transformations, chained per source or globally
Every rule that reaches a compiled list has passed through a configurable chain — comment stripping and deduplication through conflict detection and rule optimization. Not every transformation is valid for every engine: Compress,Validate/ValidateAllowIp, and InvertAllow assume DNS/hosts-style grammar and are rejected on a browser-engine source; the rest are browser-safe. Bloqr Core exposes the full set of 13; Bloqr AI's default pipeline currently surfaces 11 of them in its managed configuration, with the rest available to anyone compiling with Bloqr Core directly.
RemoveCommentsStrips comment lines before further processingCompressDNS-only — collapses hosts-style rulesRemoveModifiersDrops AdGuard rule modifiersValidateDNS-only syntax validationValidateAllowIpDNS-only, allows IP-literal rulesDeduplicateRemoves duplicate rules across sourcesInvertAllowDNS-only — flips allow-rulesRemoveEmptyLinesHousekeeping passTrimLinesTrims stray whitespaceInsertFinalNewlinePOSIX-friendly output filesConvertToAsciiNormalizes non-ASCII domainsConflictDetectionFlags contradictory allow/block rulesRuleOptimizerCollapses redundant rule patternsBuilt for scale
Parallel chunking for the commercial compiler at scale
When a list spans hundreds of sources and millions of rules, the compiler splits sources into chunks, compiles them in parallel across CPU cores, and merges the results with deduplication. Natively supported in the TypeScript, .NET, Python, and Rust compilers.
| Scale | Sources | Rules | Sequential | Chunked (4 cores) | Speedup |
|---|---|---|---|---|---|
| Small | 10 | ~50k | 15s | 12s | 1.25x |
| Medium | 50 | ~250k | 75s | 25s | 3x |
| Large | 200 | ~1M | 300s | 85s | 3.5x |
Non-negotiable
The validation library: integrity end to end
bloqr-validator-core (crates.io) is a single Rust validation layer shared by every language wrapper — via a Cargo path dependency in Rust, anextern "C" FFI surface for .NET P/Invoke, or the standalonebloqr-validate CLI shelled out to by TypeScript, Python, and PowerShell. It's the layer that keeps a compromised or tampered upstream source from ever reaching a compiled list:
- SHA-384 hashing, in-flight — every downloaded source is streamed through SHA-384 as it arrives, paired with the HTTPS/SSRF-hardened transport below so a tampered response is verifiable rather than trusted blindly; hashing alone identifies a changed payload, it's the combination with a trusted transport that closes the MITM window.
- SHA-384 hashing, at rest — a local hash database tracks every file's hash, size, and last-verified timestamp, so a later compile detects silent on-disk corruption or tampering.
- URL security validation — HTTPS enforcement plus SSRF-hardened redirect checking, so a malicious redirect chain can't be used to reach internal infrastructure.
- Syntax validation — AdGuard
HostlistCompiler-compatible linting for both adblock and hosts-file grammars, catching malformed rules before they ship. - Archiving & conflict handling — timestamped archives with manifest tracking and retention policies, plus automatic rename/overwrite/error strategies on file conflicts.
One shared schema
A configuration file, in full
JSON (with JSONC comments), validated against a first-party, IDE-autocompletable JSON Schema. YAML and TOML are also read for backward compatibility. This same file compiles identically across all six runtimes.
{
"name": "Bloqr AI Default Ruleset",
"description": "Ads, trackers, and malware — merged and deduped",
"homepage": "https://example.com",
"license": "MIT",
"version": "1.0.0",
"defaultEngine": "dns",
"sources": [
{
"name": "EasyList",
"source": "https://easylist.to/easylist/easylist.txt",
"type": "adblock",
"engine": "browser",
"transformations": ["RemoveComments", "Deduplicate"]
},
{
"name": "Curated hosts",
"source": "./local/hosts.txt",
"type": "hosts",
"engine": "dns"
}
],
"transformations": [
"RemoveComments",
"RemoveModifiers",
"Validate",
"Deduplicate",
"ConflictDetection",
"RuleOptimizer",
"RemoveEmptyLines",
"TrimLines",
"InsertFinalNewLine"
],
"exclusions": ["*.internal.example.com"],
"chunking": {
"enabled": true,
"chunkSize": 100000,
"maxParallel": 4,
"strategy": "source"
}
}The flagship app
The Dashboard: a guided wizard for the whole pipeline
The Bloqr Dashboard is a .NET console app that turns config authoring, compilation, and validation into a single guided workflow — menu-driven for interactive use, or fully scriptable via CLI switches or as an embedded IDashboardService library.
- Configuration wizard — generates a compiler config interactively: add sources, infer or choose an engine per source (local files are auto-detected; remote URLs prompt directly), pick transformations, and review the resulting JSON/JSONC before saving — no hand-editing required.
- Config editor — round-trips an existing configuration, preserving fields like
engine/defaultEnginethat a naive re-serialize would drop. - Profile management — named profiles (e.g.
production,staging) each carry their own config, log settings, and independent backup/recovery state, switchable via--activate-profile. - Automatic backups & recovery — backs up configs on every change, quarantines corrupt files instead of failing hard, and recovers from the newest valid backup automatically in interactive mode.
- Rich compilation UI — live progress bars and structured JSON logging with rollover, whether you're compiling one profile or running the full fleet in CI.
Coming soon: direct vendor uploads. Third-party vendor APIs are on the roadmap so a compiled rule set can be pushed straight from the Dashboard into Bloqr AI or your own DNS/ad-blocking provider — compile, validate, and publish without leaving the wizard.
Same engine, two ways to run it
Bloqr Core vs. Bloqr AI
Bloqr Core is the open-source pipeline itself — compile and validate rule sets yourself, on your own infrastructure. Bloqr AI is Bloqr's commercial, fully managed edition of that same pipeline, with the license layer built on top: AI-curated threat intelligence that watches for emerging malware and phishing domains, a natural language rule builder, AST-based custom pipelines, REST/streaming/async APIs behind an entitlement-checked gateway, bring-your-own-vendor delivery to NextDNS, AdGuard Home, Pi-hole, or Cloudflare Gateway, and support you can put an SLA on.
| Feature | Bloqr Core | Bloqr AI |
|---|---|---|
| Compiler engine | Six independent runtimes, self-hosted | Same engine, fully managed — no install |
| Deployment | Self-hosted: CLI, CI job, or embedded library | Hosted Web API/SaaS, licensed SDK, CLI, or Cloudflare edge |
| Transformations | All 13, including DNS-only ones | 11 of 13 in the default managed pipeline, plus custom pipelines |
| Parallel chunking | Yes — TS, .NET, Python, Rust | Yes, plus managed autoscaling across cores |
| AI-curated threat intelligence | AI continuously monitors emerging malware & phishing domains and folds them into your list | |
| Natural language rule builder | Describe what to block in plain English — Bloqr AI translates it into compiler rules | |
| Abstract syntax tree (AST) | Rules are parsed to an AST and stored, enabling custom pipelines and programmatic rule edits (Dev Pro and above) | |
| API access | Not applicable — library/CLI only | REST, streaming, and async/batch APIs, entitlement-checked at the gateway |
| Bring your own vendor | Ships to NextDNS, AdGuard Home, Pi-hole, Cloudflare Gateway, or a custom DNS provider — no lock-in | |
| Validation & integrity | bloqr-validator-core, self-run | Same validator, run automatically per compile |
| Dashboard | Local .NET console app | Hosted dashboard + direct vendor uploads |
| Multi-instance management | Manage multiple compiler instances from one account (Vendor and above) | |
| Vendor / marketplace listing | API marketplace listings (RapidAPI and others, when live) | |
| Support & SLA | Community — issues & discussions on GitHub | Tiered support up to a custom, dedicated 99.9%-uptime SLA (Enterprise) |
| Updates & maintenance | You track releases per package yourself | Continuously updated by Bloqr, zero-touch |
| Cost | Free, open source (MIT-licensed pipeline) | Subscription — Starter, Dev Pro, Vendor, Enterprise |
Both editions compile from the same compiler-config.schema.json and the same six-runtime engine. Bloqr AI runs it for you and adds the license-only layer on top — AI-curated threat intelligence, natural language rules, AST-based custom pipelines, and delivery straight to the DNS vendor you already run.
One config, six languages
Every compiler reads the same JSON/JSONC configuration schema, documented and IDE-autocompletable via first-party JSON Schemas. Write a config once; compile it with whichever runtime fits your pipeline.
Validation, built in — and it matters
A dedicated Rust validation library (bloqr-validator-core, on crates.io) SHA-384-hashes every source both in-flight and at rest, enforces HTTPS with SSRF-hardened redirect checks, and lints syntax against AdGuard’s HostlistCompiler grammar — independent of which compiler produced the output.
Parallel chunking for scale
Large lists (hundreds of sources, millions of rules) split across CPU cores and merge back with deduplication — up to 3.5x faster than sequential compilation, supported natively in the TypeScript, .NET, Python, and Rust compilers.
A Dashboard for the whole workflow
The flagship .NET console app generates, edits, and round-trips compiler configs via a guided wizard, runs compilations with a rich progress UI, and surfaces validation diagnostics — menu-driven, or automatable via CLI switches or as an embedded library.
Open, documented, and versioned per package
Each independently-published package (starting with @bloqr/compiler-core) gets its own semver, its own changelog, and its own release workflow — not one repo-wide version number.
Bloqr Core is open source and welcomes issues, discussions, and contributions.