<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eusebio Simango</title>
    <description>The latest articles on DEV Community by Eusebio Simango (@eusebiosimango).</description>
    <link>https://dev.to/eusebiosimango</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4191998%2F891f6c6a-41e4-477d-b605-5897bebfa429.png</url>
      <title>DEV Community: Eusebio Simango</title>
      <link>https://dev.to/eusebiosimango</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eusebiosimango"/>
    <language>en</language>
    <item>
      <title>ClauseClear: Gemma 3 1B flags the risky clauses in your client contract, privately</title>
      <dc:creator>Eusebio Simango</dc:creator>
      <pubDate>Sun, 18 Oct 2026 15:08:28 +0000</pubDate>
      <link>https://dev.to/eusebiosimango/clauseclear-gemma-3-1b-flags-the-risky-clauses-in-your-client-contract-privately-1507</link>
      <guid>https://dev.to/eusebiosimango/clauseclear-gemma-3-1b-flags-the-risky-clauses-in-your-client-contract-privately-1507</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ClauseClear&lt;/strong&gt; is a local contract checklist for freelancers.&lt;/p&gt;

&lt;p&gt;You drop in a client agreement (PDF or paste). A &lt;strong&gt;Gemma 3 1B&lt;/strong&gt; model running in &lt;strong&gt;Ollama on this laptop&lt;/strong&gt; returns the clauses worth negotiating: payment, IP, exclusivity, termination, late fees, scope, liability. Each finding has to carry a &lt;strong&gt;verbatim quote&lt;/strong&gt;. If Gemma paraphrases, ClauseClear snaps the claim back to the nearest real sentence — or marks it &lt;code&gt;review&lt;/code&gt; and retries. Then it drafts the email you send the client.&lt;/p&gt;

&lt;p&gt;The PDF never leaves the machine. There is no account. There is no cloud LLM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who would pay:&lt;/strong&gt; a solo designer, developer, or illustrator staring at a five-page "standard" contractor agreement the night before kickoff. A lawyer skim is often more expensive than the first invoice. Cloud legal-AI wants the whole NDA uploaded. ClauseClear is the product in between: cheap enough to sell as a one-time license, private enough to use on a real client paper.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not legal advice&lt;/strong&gt;. It is a flag list. A human still has to read the paper. The disclaimer is in the UI, the CLI, and the report.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;No login. From a cold Ollama on CPU (no GPU, 16 GB RAM):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ollama ps
&lt;span class="go"&gt;NAME         SIZE     PROCESSOR    CONTEXT
gemma3:1b    880 MB   100% CPU     4096

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; clauseclear samples/abusive_client_agreement.txt &lt;span class="nt"&gt;--trace&lt;/span&gt; samples/trace.json
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;6 validated, 0 need review, 2 attempt&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;, 58.2s, model gemma3:1b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The bundled abusive agreement is the shape of paper freelancers actually get: 90-day payment, IP assigned whether or not you have been paid, 12-month worldwide exclusivity, terminate-anytime-without-paying, uncapped late fees, unlimited revisions.&lt;/p&gt;

&lt;p&gt;First pass with Gemma 1B &lt;strong&gt;paraphrased every quote&lt;/strong&gt;. The validator rejected all six (87s, 3 attempts). After grounding:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Risk&lt;/th&gt;
&lt;th&gt;Quote in the paper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Payment&lt;/td&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;td&gt;Payment is due ninety (90) days after Client's written acceptance of the final deliverables.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP&lt;/td&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;td&gt;Contractor hereby irrevocably assigns to Client all right, title, and interest in and to all work product… in perpetuity.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exclusivity&lt;/td&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;td&gt;For twelve (12) months after the last delivery, Contractor shall not perform similar services for any company that competes with Client in any market, worldwide.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Termination&lt;/td&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;td&gt;Client may terminate this Agreement at any time… without payment for work in progress.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Late fees&lt;/td&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;td&gt;Client may reduce the fee by ten percent (10%) per day of delay, without a cap.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scope&lt;/td&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;td&gt;unlimited rounds of revisions until Client is satisfied&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Browser UI: &lt;code&gt;streamlit run app.py&lt;/code&gt; — paste, review on this laptop, copy the negotiation email, download markdown. Redacted span dump from the same run is in &lt;code&gt;samples/trace.json&lt;/code&gt; (infer 30.6s + 27.6s, validate 19ms, no contract text).&lt;/p&gt;

&lt;p&gt;There is no live inference URL on purpose. Gemma stays on the laptop. A sample-only front end lives in &lt;code&gt;public/&lt;/code&gt; for a later Render/.tech host; that host is not live yet, so it is not listed below.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/EusebioSimango" rel="noopener noreferrer"&gt;
        EusebioSimango
      &lt;/a&gt; / &lt;a href="https://github.com/EusebioSimango/clauseclear" rel="noopener noreferrer"&gt;
        clauseclear
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;ClauseClear&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Local contract review for freelancers. Paste a client agreement; a &lt;strong&gt;Gemma&lt;/strong&gt; open-weight model running in &lt;strong&gt;Ollama&lt;/strong&gt; on your laptop returns a plain-English checklist of clauses to negotiate. The PDF never leaves the machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not legal advice.&lt;/strong&gt; ClauseClear is a flag list, not a lawyer. A human still has to read the paper.&lt;/p&gt;

&lt;p&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12" rel="nofollow"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why this exists&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;A 15-minute lawyer skim of a freelance agreement is often more expensive than the first invoice. Cloud legal-AI tools want the full contract uploaded. ClauseClear is the side hustle in between: cheap enough to sell, private enough to use on a real NDA.&lt;/p&gt;

&lt;p&gt;The product is the &lt;strong&gt;validator&lt;/strong&gt;, not the chatbot. Every quote the model cites has to appear in the contract. Small local models paraphrase; ClauseClear snaps those paraphrases back to the nearest real sentence, or marks…&lt;/p&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/EusebioSimango/clauseclear" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama serve
ollama pull gemma3:1b
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
python &lt;span class="nt"&gt;-m&lt;/span&gt; clauseclear samples/abusive_client_agreement.txt
streamlit run app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap the model with &lt;code&gt;export OLLAMA_MODEL=gemma3:4b&lt;/code&gt; (or any OpenAI-compatible tag). The product does not care who served the weights. MIT license. Tests do not need a GPU (&lt;code&gt;pytest -q&lt;/code&gt;, 13 passed).&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;ClauseClear is built around &lt;strong&gt;local inference of an open-weight Gemma model&lt;/strong&gt;, not a chat wrapper around a closed API.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
  pdf[PDF_or_paste] --&amp;gt; extract[pypdf_text]
  extract --&amp;gt; gemma[Gemma_local_Ollama]
  gemma --&amp;gt; json[structured_clauses]
  json --&amp;gt; validate[quote_must_be_in_paper]
  validate --&amp;gt;|paraphrase| snap[snap_to_nearest_sentence]
  snap --&amp;gt;|still missing| retry[retry_with_the_miss]
  validate --&amp;gt;|ok| report[checklist_and_email]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Three design bets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Do not OCR with the LLM.&lt;/strong&gt; &lt;code&gt;pypdf&lt;/code&gt; extracts text. Gemma only classifies. A 1B model that also has to read pixels would miss the 90-day clause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not trust the JSON.&lt;/strong&gt; Pydantic checks the shape. Then every &lt;code&gt;quote&lt;/code&gt; has to survive whitespace-folded substring matching. Small local models invent fluent nonsense; the fix is a checker, not a bigger prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure RAM, not the download size.&lt;/strong&gt; &lt;code&gt;gemma3:1b&lt;/code&gt; is an 806 MB pull. &lt;code&gt;ollama ps&lt;/code&gt; showed &lt;strong&gt;880 MB&lt;/strong&gt; resident at a 4096-token context, 100% CPU. That is the side-hustle math: it fits a laptop that is already running a browser.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Dead end that became the product.&lt;/strong&gt; First run: 0 validated quotes. Gemma restated every clause in nicer English. A closed legal API would have shipped those paraphrases as citations. The snap step (token overlap + &lt;code&gt;SequenceMatcher&lt;/code&gt; against numbered clauses) is what made a 1B model usable. Retry only fires for quotes that still cannot be bound to the paper.&lt;/p&gt;

&lt;p&gt;The pipeline records redacted spans (model, attempt, duration). Infer dominates: ~30s then ~28s on CPU. Validate is 19ms. Contract text is never in the trace — only a source hash and character count. Sentry is wired the same way (&lt;code&gt;SENTRY_DSN&lt;/code&gt; optional, &lt;code&gt;before_send&lt;/code&gt; strips quotes) so I am &lt;strong&gt;not&lt;/strong&gt; entering Best Use of Sentry until a real dashboard screenshot exists. I will not fake a partner category.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;For this product, an open-weight model is a requirement.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The paper cannot go to someone else's server.&lt;/strong&gt; Freelance agreements name clients, rates, unreleased products, and sometimes home addresses. "We do not train on your data" is not something you can put in front of a client who just sent an NDA. Local Gemma means the leak surface is the freelancer's own disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The unit economics work.&lt;/strong&gt; A closed legal API that charges per document kills the side hustle: you cannot sell a $15 checklist if inference costs $4 and you still eat the retries. Here the marginal cost of a rerun is electricity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can swap the model.&lt;/strong&gt; Today's default is Gemma 3 1B because this laptop has 16 GB and no GPU. Tomorrow it is Gemma 4B, or a fine-tune on contracts you have already negotiated. Nobody can deprecate the weights under a freelancer mid-tax-season.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline is not a gimmick.&lt;/strong&gt; Contracts get signed on trains and in cafes with captive-portal Wi-Fi.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The trade-off is honesty: a 1B local model paraphrases. That is why the validator exists. I would rather ship a small model that can be checked than a fluent API that cannot.&lt;/p&gt;

&lt;h2&gt;
  
  
  My First User
&lt;/h2&gt;

&lt;p&gt;I have not taken money yet, and I will not invent a testimonial. I ran ClauseClear on a realistic abusive agreement (the bundled sample) and on a fairer one. The abusive paper is the one a friend would actually forward at 11pm. What I would ask them next: &lt;em&gt;would you pay €12 once to keep this on your laptop, or do you want it to compare two versions of the same contract?&lt;/em&gt; That second request is the obvious v2 — a redline, not just a flag list.&lt;/p&gt;

&lt;p&gt;If you are a freelancer and you have a contract you can share with the names stripped, I want that test more than I want another sample file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Best Use of Gemma&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
