Tag: Next.js

  • KJedi: a local, open-source contract review tool for California AI-focused SaaS attorneys

    KJedi: a local, open-source contract review tool for California AI-focused SaaS attorneys

    Solo and small-firm attorneys have five real ways to use AI for client work. Each trades off privilege, convenience, and cost differently.

    The five options

    OptionPrivilege-safe?EffortCost (typical)
    Consumer chat (ChatGPT free/Pro, Claude.ai Pro)No — Consumer Terms include training opt-out and weaker retentionLowest$0–$20/month
    Commercial API + your own wrapperYes — Commercial Terms, no training, includes DPAHighest (you build it)~$100–500/month depending on volume
    Managed legal-AI SaaSYesLowest~$500/month and up
    AI-in-a-box applianceYes — data never leaves the deviceMedium (setup + hardware)~$500–700/month equivalent
    On-prem frontier model on your own hardwareYesHighest$10K+ hardware, ongoing setup
    Top-spec Mac Studio running local LLMsYes — data never leaves the deviceHigh (RAG setup, model selection, ongoing tuning~$10K up front, plus your time

    Consumer plans are cheap because they’re subsidized. The subsidy comes with terms of service that make those tiers inappropriate for privileged content.

    Every option that’s honest about privilege costs real money, because frontier intelligence at attorney-workload volume costs real money to deliver. The legitimate options cluster in roughly the same price band.

    One caveat worth naming about the local-hardware options: they run open-weights models — GPT-OSS, Gemma, Llama, Qwen, DeepSeek — rather than proprietary frontier models. As of 2026, that’s much less of a capability gap than it used to be; OpenAI’s GPT-OSS-120B and others are genuinely strong on reasoning benchmarks and run on a maxed Mac Studio. But for legal work specifically, the gap is unknown in any rigorous sense — there’s no public benchmark for “which model spots the most issues in a SaaS MSA” — and proprietary models still hold edges on coding, long-context, and agentic tasks. The right way to evaluate this for your practice is to actually try the same contract through both and see.

    So that leaves two practical paths for solos:

    (1) pay for a managed platform;

    (2) Build a thin wrapper around the commercial API.

    KJedi is the second option.

    What KJedi is

    KJedi is a small open-source Next.js web app that runs only on your laptop. Upload a contract (PDF or DOCX), chat with Claude (Opus 4.7 as of this writing) about the terms, generate a red/yellow/green review memo.

    • Localhost only. No hosted service. Outbound traffic goes to the Anthropic API only.
    • Your API key, server-side. Lives in .env.local. Never touches the browser.
    • Nothing persists. No database, no logs, no analytics. Document and chat history live in memory only and clear on tab close.
    • System prompt is yours. Plain TypeScript file at lib/system-prompt.ts. Read, edit, fork.

    What it’s tuned for

    California AI/SaaS tech-transactions:

    • AI-specific clauses (training data rights, output ownership, IP indemnity for AI outputs, model substitution, accuracy disclaimers, prompt/output confidentiality, upstream-model-provider disclosure)
    • Vendor agreements with AI components (OpenAI, Anthropic, AWS Bedrock, Google Vertex)
    • Privacy: CCPA/CPRA, GDPR, DPAs
    • IP assignments, contractor and employee IP/confidentiality, NDAs
    • Open-source compliance and AI training-data provenance

    Not tuned for other practice areas or litigation. KJedi flags when a contract is outside its lane. Fork the system prompt for your own practice areas.

    What it costs to run

    A typical contract review session (upload, several follow-up questions, generate memo) should run just a few dollars in API costs. Steady client volume could therefore cost a few hundred dollars per month. Comparable to the managed platforms, with the wrapper logic and system prompt in your control.

    Before using it on client work

    1. Verify your Anthropic account is on Commercial Terms, not Consumer Terms. API access via the console defaults to Commercial Terms once you add a payment method. Claude.ai Pro/Max is governed by Consumer Terms. Confirm in your Anthropic console.
    2. This is open-source experimental software, not a vetted vendor product. Read the code, audit the dependencies, verify the system prompt is adequate for your needs, and verify your own machine’s configuration.
    3. Verify every citation before relying on it. Treat the output as a junior associate’s first pass, never the final word, including in the system prompt.

    Setup Instructions

    Visit: github.com/marchoag/kjedi

    git clone https://github.com/marchoag/kjedi.git
    cd kjedi
    npm install
    cp .env.example .env.local   # add your ANTHROPIC_API_KEY
    npm run dev

    Open http://localhost:XXXX (default is usually 3000).

    Questions? Feel free to reach out.