Our sandbox installed llm-legislativo in 53 seconds and built it successfully, then the test command failed with three named failures. Use it if you want to study a Brazilian legislative corpus and a small Transformer implemented in PyTorch. Skip it if you need a factual legal adviser or a ready-to-deploy document assistant. The project's own README tells you to keep it in the research and education category.
The useful question is how much of the research you can reproduce. Downloading published weights, checking the Python code and rebuilding the historical corpus are different commitments. llm-legislativo puts them under one repository name, but you should choose which one you need before allocating a machine.
What people use llm-legislativo for
The documented uses are an author-released research pipeline and a published inference package, with concrete artifacts you can inspect.
- Build a Brazilian legislative training corpus. In the author's X announcement, baruqrodrigues reports releasing the code, data and weights, describing collection of nearly one million historical congressional documents and pretraining a causal Transformer. That is the author's account of completed work. It gives researchers a particular document collection and modeling pipeline to examine, rather than an unspecified promise of a future legal model.
- Distribute the model separately from the corpus pipeline. The Hugging Face account BaruqRodrigues published an inference package whose listing includes model.safetensors, tokenizer.json, modeling and evaluation directories. The listing totals 70.7 MB. This is useful for someone who wants to inspect the delivered model files without first collecting the parliamentary archive. A directory named evaluation is an artifact, not an independent assessment of its results.
The README describes a causal language model: it continues text from a prompt. Its inference example starts with a Portuguese bill heading and the phrase “Dispõe sobre”. For a student learning how legislative prose is modeled, that is an intelligible first experiment. For someone trying to find what a current law actually says, generated continuation answers a different question from retrieving the official document.
What happened when we ran it
Our source-checkout run installed successfully in 53 seconds, built in 1 second and failed its test command after 247 seconds at commit 6951114 on November 15, 2026.
| Lab observation | Recorded result | What it means for your decision |
|---|---|---|
| Install | Succeeded in 53 seconds | The recorded source environment could be installed |
| Build | Succeeded in 1 second | The build step completed |
| Tests | Exit 1 after 247 seconds | Read the failures before relying on this checkout |
| Pytest log | 163 passed, 3 failed, 4 skipped | Substantial passing coverage, with specific failures left to address |
| Dependencies and disk | 76 recorded dependencies, 5,545 MB on disk | Leave room beyond the small Git checkout |
| pip-audit | 0 known vulnerabilities | A dependency-advisory result within this run |
| Repository scan | 258 files, about 20,052 source lines, 2.4 MB checked out | The checkout is much smaller than the installed environment |
| Automation and packaging scan | 0 CI workflow files, no Dockerfile, a tests directory | The scan found local tests without those automation files |
The sandbox configuration allocated 3 CPUs and 8 GB of RAM and recorded the image label ghcr.io/astral-sh/uv:python3.12-bookworm. That label identifies the configured image, not independently observed interpreter or operating-system versions. The raw toolchain logs would be needed to make those version claims.
The most consequential failure for a reader trying the generation example is test_early_stopping_on_eos. The assertion says generation should have stopped at the end-of-sequence token, but reports torch.Size([1, 6]) against an expected shape of (1, 3). It is a specific failed stopping check. It is not evidence that every generated response ignores its stopping token, and it gives no basis for blaming a particular dependency version.
Another failure, test_byte_nll_manual_sum_and_tokenizer_independent_segment_identity, reports a missing tokenizer file with the path “data”. The common-contracts test reports that /work/repo/configs/data/history.yaml should exist. Those messages are useful because they identify what the tests looked for. Neither message explains why the expected file was absent.
There is also an accounting wrinkle worth preserving: the supplied headline summary says “of 166”, while the raw tail lists 163 passed, 3 failed, 4 skipped and 2 passed subtests. We report the categories directly rather than turn that mixed summary into a clean pass percentage. The test process failed, regardless of how the parser summarized its total.
Where people get stuck: package names and missing local inputs
The research pack's separate quickstart-lib attempt stopped because the package registry could not find legislm, while the README documents installation from a checkout.
The package-resolution error says “Because legislm was not found in the package registry”. Its finding record reports unsatisfiable requirements. Treat that as a failed registry lookup. The recorded command asks a registry for a distribution by name, whereas the README's pip install -e . uses the repository in the current directory. These are different requests. The supplied source-run measurements above remain the authority for our installation and test results.
The quickstart record also contains contradictory metadata: its run summary says the package was installed from PyPI, while the step and finding records say it was not found. The clone record records the quickstart-lib recipe, and teardown reports success. There is no reason to turn that inconsistent run summary into a working inference claim.
For the failures in our source run, this is the practical investigation map. These are next checks, not fixes demonstrated by the logs.
| Symptom | First thing to inspect | What a satisfactory resolution would show |
|---|---|---|
| Tokenizer path reported as data | The path supplied to the failing byte-NLL test | The intended tokenizer artifact is located and that test passes |
| EOS check produces shape [1, 6] | Generation stopping behavior and the test's expected EOS sequence | The specific stopping assertion passes on the same checkout |
| history.yaml contract fails | The checkout's configs/data contents and required configuration contract | The expected configuration exists or the contract is deliberately corrected |
| Registry cannot find legislm | Whether you are following the documented editable-checkout route | A resolved source environment, kept separate from a registry package claim |
Keep the original errors when investigating. Installing an arbitrary newer package or manufacturing an empty YAML file could hide a symptom without reproducing the intended experiment. A useful bug report should name the commit and the exact failing test, then show what changed.
The corpus pipeline needs more than the Python environment
The README assigns collection and curation to R, document extraction to Swift on macOS, and tokenization and modeling to Python.
That division changes the setup decision. If your aim is to examine the published weights, start with the model and tokenizer artifacts. If your aim is to reproduce extraction from historical documents, the documented route includes PDFKit and Apple Vision OCR. A successful Python environment on Linux answers only the Python-environment question. The README's platform-specific extraction stage deserves a separate machine and procedure in a reproduction plan.
Volume also belongs in that plan. Upstream describes more than 360 GiB of official raw data and says the raw files and token shards live outside Git. That explains why the repository can be small while the research data is large. Decide whether you need the raw archive, extracted text, curated Parquet release or only inference files before downloading. These are upstream descriptions of artifacts, not storage or throughput measurements from our sandbox.
For a first examination, I would use the published curated data and keep a manifest of the chosen files. Rebuilding collection and OCR first adds moving parts before you have checked whether the delivered corpus suits your research question. Someone auditing the collection process should take the opposite route and preserve the original documents alongside extraction outputs.
Family-based splits are the research feature to inspect
The README says related bills, amendments, opinions and substitutes share a family_id, and that train/test assignment is calculated from that family identifier.
This matters more to my decision than the phrase “trained from scratch”. The design tries to keep related versions together when dividing documents between training and evaluation. If you are researching legislative text, that is a concrete methodological choice to examine and potentially reuse. The same README says the byte-level BPE tokenizer is fitted exclusively on the training split. Both choices give a reviewer a defined audit target.
On X, vintcessun singles out those family splits and training-only BPE fitting as the part worth learning from. The commentator recommends taking the project apart for study and cautions against treating it as a legal adviser. That is a reading of the project's design, not a report of an independently repeated training run.
For your own audit, ask for the assignment manifest, inspect families spanning several document types, and trace the inputs used to fit the tokenizer. A README promise of zero leakage should lead to a check of those artifacts. The byte-NLL test failure also makes the evaluation path a sensible place to begin your code investigation, without assuming that this one missing-file error disproves the published research.
Security checks do not make generated legislation trustworthy
Our pip-audit result reported zero known vulnerabilities, and the README separately warns that the model can invent law numbers and legislative content.
Those findings answer different operational questions. The audit is about known dependency advisories in the recorded environment. The warning is about relying on generated text as factual law. A researcher can reasonably proceed with an isolated experiment while refusing to use its output to make a legal decision. Keep prompts and generated continuations labeled as research output, especially when an example resembles the formal heading of a real bill.
The README describes SHA-256 checks for artifacts and checkpoints. Use the supplied manifests when handling the data and weights: identifying the exact files is part of a reproducible experiment. A matching checksum tells you that you have the expected file. It does not tell you whether a generated provision exists in enacted law or whether an evaluation set is free of related training documents. Those need their own evidence.
Portuguese is part of the work
The project's README and legislative examples are in Portuguese, and it does not link an English companion README.
An English-speaking PyTorch developer can recognize model classes and configuration values, but the document categories and ethical-use warning need careful reading. The difference between an amendment, an opinion and a final text matters when the dataset groups related documents. Translation helps you enter the codebase; it should not silently redefine the categories you are analyzing. Have a Portuguese-speaking collaborator review corpus assumptions if those distinctions are central to your study.
The same point applies to the model's role. The example is continuation of Brazilian legislative prose, not an English conversation with a general assistant. Choose prompts that match the experiment you are investigating. English fluency, translation quality and cross-jurisdiction legal usefulness would each require separate evidence.
llm-legislativo vs nanochat and llm-fragments-us-legislation
nanochat addresses general LLM experimentation, while llm-fragments-us-legislation loads US bills into an existing LLM workflow.
| Project | Documented job | Choose it when |
|---|---|---|
| llm-legislativo | Brazilian legislative corpus and from-scratch causal model | Your research question concerns this corpus, its family splits or its PyTorch implementation |
| nanochat | Experimental harness covering tokenization, pretraining, finetuning, evaluation and inference | You want a general LLM training experiment rather than this Brazilian document pipeline |
| llm-fragments-us-legislation | Load bills from Congress.gov as LLM fragments | You need US bill text in the LLM command-line tool |
The nanochat README describes a harness designed for a single GPU node. That makes it a relevant alternative for learning or changing a general training workflow. It does not supply the Brazilian corpus work that makes llm-legislativo interesting. Choose based on the experiment you want to own, rather than assume all repositories mentioning Transformers are interchangeable.
The US legislation plugin's README asks for CONGRESS_API_KEY and shows loading a full bill, its table of contents or selected sections. Its narrower job is useful if your real need is to put official bill text into a model's context. It is a different jurisdiction and a different workflow from pretraining a Brazilian model. Neither alternative receives a speed, cost or answer-quality ranking here.
What the other reviews get wrong
Midorreal's supplied comparison pages show editorial verdicts and popularity figures, rather than a shared legislative task run on competing tools.
The comparison with dust, for example, labels the projects TOO EARLY and MID. The comparison with scam-with-your-friends-web explicitly calls its verdict an opinion. These pages can tell you what their editors think. Their score tables cannot decide whether you should reproduce a tokenizer, audit Brazilian document families or retrieve a US bill. The table above separates those jobs before suggesting a repository.
The README also presents its CPU test suite as fully passing. Our source checkout did not match that claim: the test command failed. Keep the commit and the named failures attached to that finding rather than infer that another checkout would produce the same result.
The “without spending” framing also needs attribution. baruqrodrigues says on X that the project was done without spending one real. The current README names Google Colab Pro / Compute Engine and an NVIDIA A100 environment. That gives the resource discussion more substance than the announcement alone, but it is not an itemized account of who paid for access. Treat free code, the author's reported personal spending and your own reproduction budget as separate questions.
Questions people ask
The author's claim of spending no money describes the author's experience, not a zero-cost reproduction guarantee.
Can a Brazilian LLM be trained from scratch without spending any money?
baruqrodrigues reports doing so in the X announcement. The README identifies GPU-backed cloud resources, so budget your own access to compute and storage before repeating the project. Published code and data make it possible to examine the work without assuming that every reader has the same access arrangements as its author.
How does the README tell you to install llm-legislativo?
The README tells you to clone the repository, create a virtual environment and run pip install -e . from the checkout. Follow that route when investigating the Python source. The delivered model files are on Hugging Face, and reproducing the R and macOS extraction stages is a separate undertaking.
Does llm-legislativo permit use as a legal adviser?
The README's ethical-use note says it should not be used as a factual legal adviser or a tool for normative decisions. It warns of invented law numbers, summaries and content attributed to existing provisions. That is a direct reason for a lawyer seeking factual assistance to choose a different, independently evaluated workflow.
What we have not tested yet
Our evidence covers a source installation, a build, automated tests and a failed package-registry attempt, not an independently reproduced model inference session.
We have not tested generation from the published weights, legal accuracy, English output, GPU training, the R collectors, macOS OCR, a full corpus download, or behavior under sustained use. We have not independently audited the family assignments, deduplication or tokenizer training inputs. Published evaluation figures remain upstream reports. No inference latency, training-cost comparison or application-quality benchmark follows from the source-build timings.
The supplied video and Bilibili results do not document an attributable llm-legislativo task with a checked outcome. They add no usable reproduction evidence. The sampled author announcement and package listing also provide no named downstream deployment to assess. Stars and forks measure attention rather than active use or support capacity.
The three test failures still need resolutions supported by matching logs. The mixed test totals need reconciliation against the complete output, and exact runtime versions require toolchain logs. Our next useful experiment would load the published weights and tokenizer, record the artifact revisions, and check a short Portuguese continuation including EOS behavior. Until that produces a result, this is a research project I would inspect for its data decisions, with application deployment left for a separate evaluation.


