Gallant is a customizable linter built to utilize Decision Models (i.e. Jev, Clef, and other system one models) to lint your code, documents, and any other text-based files.
Some rules that would be great to express as lints in a codebase are very hard to perform in traditional deterministic systems -- "Does the comments in this file repeat what the code already says". As such, these type of checks are left either to human reviewers in PRs or to expensive and slow LLM models.
Decision Models are fast, cheap(er), and can work on more fuzzy rules that traditional software has not been able to. Gallant is a solution to provide a simple to use cli program with no runtime requirements and minimal dependencies.
I looked at the other available tools doing this type of work, and I was not left impressed. All the tools I saw were immense slop dumps, required runtimes like python/npm, servers you had to continually run, terrible CLIs, or had many many dependencies (aka supply chain attack vectors!)
I build Gallant to (try) and avoid all of those things. Gallant requires no runtime as it is in go. The CLI adheres to standard unix utility principles such as working off files/filepaths, minimizing configuration needed, and doing one thing well.
Please, if you find it useful give it a share in your favorite tech community!
Releases are available to install on the Releases page.
Install the latest release with Go:
go install github.com/madxmike/gallant/cmd/gallant@latestTo install a specific release, pin its version:
go install github.com/madxmike/gallant/cmd/[email protected]To use gallant you will need a set of files and rules. By default gallant will look in the relative .agents/gallant for rules. You can then run gallant . to apply the rules to all files in the relative path. For more information see gallant --help
Examples holds runnable rules, sample files, and terminal recordings, from comment classification to JSON output.
Set GALLANT_PROVIDER, GALLANT_MODEL, and GALLANT_RULES to choose defaults for the provider, model, and rules directory. The matching flags override them.
For information on making Rules see gallant --help rules
For information on available providers see gallant --help providers
Strands Decider serves the same protocol whether it runs on your machine or in
your AWS account, so --provider strands-decider reaches either. Point it at a
deployment with STRANDS_DECIDER_HOST, written as a URI:
STRANDS_DECIDER_HOST=sagemaker://strands-decider-e4b gallant . # SageMaker endpoint
STRANDS_DECIDER_HOST=lambda://strands-decider gallant . # direct invocation
STRANDS_DECIDER_HOST=aws://abc.lambda-url.eu-west-1.on.aws gallant . # IAM Function URLCredentials and region come from the AWS SDK's own chain, so no secret is stored
in gallant: a laptop uses AWS_PROFILE or SSO, and CI uses the task or instance
role it already has. The example has the policy
each target needs and the commands that check a deployment before gallant
reaches it.
Decision models as of writing (10/10/2026) have relatively small input context windows (orders of a couple hundred to a couple thousand tokens). Some hosted models have larger contexts, but you should expect rejections if the file you are linting is too large.
Strands Decider v2 is trained at a 4,096-token window. The Gemma 4 checkpoints
serve 32,768 with --max-batch 4 --max-batch-tokens 34000, which is wider than
the other decision models gallant speaks to.
If you are facing this you may chunk the file yourself into relevant, smaller, pieces. Gallant does not do this itself, but you can pass arbitrary input from stdin (See Usage above).
These models are only now becoming mainstream, but are seeing rapid development. The hope is that new models will allow bigger inputs soon enough (as we saw with LLMs).
Well thought out and made contributions are welcome.
Gallant is not intended to encompass every possible decision model provider. If the provider is large, widely used, or a popular local servers then they will be considered.
The examples ship terminal recordings generated with
VHS. Re-recording one requires VHS, an
OPENCODE_API_KEY, and a model that is not rate limited:
OPENCODE_API_KEY=... vhs examples/ste100/.vhs/demo.tapeTo re-record every example and commit the GIFs:
OPENCODE_API_KEY=... examples/rerecord.shThe hand-rolled parsers (rule frontmatter, diff splitting, and the error-body snippet) have fuzz targets. Fuzzing is not run automatically; run one directly:
go test ./rules -fuzz FuzzParse -fuzztime 30s
go test ./rules -fuzz FuzzSplitFrontmatter -fuzztime 30s
go test ./cmd/gallant -fuzz FuzzDiffInputs -fuzztime 30sA failing input is written under testdata/fuzz and can be committed as a
regression seed.
Gallant does not emit telemetry, log, or attempt to obtain any additional information than what you provide as input. As gallant interfaces with hosted providers of your chosing it will pass information you give to these providers in order to perform lint evalautations. See your chosen provider's privacy policy.
MIT. See LICENSE.
The gopher logo used in this project is from egonelbre/gophers.
The Go gopher was designed by Renee French. Read http://blog.golang.org/gopher for more details.