7e6463ed22d565f217becb4b56cd0511748b9802
Restores the dbn-legal-agent-v3 fine-tune on ocelot (was silently aliased to plain qwen2.5:14b in LiteLLM since the viper retirement) and ships a new tool that uses it via a two-pass flow: Pass 1 (Azure 4o-mini) → extract up to 5 distinct legal issues Pass 2 (ocelot v3 only) → answer each issue, ≤350 tokens, with corpus Pass 3 (Azure 4o-mini) → synthesise overall assessment + next steps The 12GB-VRAM constraint motivates the split: dbn-legal-agent-v3 stays hot in VRAM through the 5 sequential per-issue calls because issue extraction and synthesis run on Azure, not on ocelot. New surface: - includes/LegalAnalysisAgent.php - api/legal-analysis.php (NDJSON streaming endpoint) - legal-analysis.php (dedicated tool page) - assets/js/legal-analysis.js (streamed UI with per-issue cards) - Save-result + case-result.php rendering for legal-analysis output - Nav registration in all four UI languages Add-on integration: a "⚖️🇳🇴 Run deep legal analysis on this text" button now appears on Summarize, Ask, and Redact result pages and streams the same pipeline inline below the existing result. Existing tools relabelled: the misleading "🇳🇴 Norwegian specialist v3 ⭐" option on advocate/deep-research/discrepancy/barnevernet is now honestly "DBN Legal Agent" — now that the real fine-tune is actually deployed, the label finally matches reality. The advocate.php v2 option was removed since the v2 GGUF is retired. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Do Better Norge Legal Tools Hub
MVP docroot for tools.dobetternorge.no.
Required environment
- CaveauAI client access for
DBN_CAVEAU_CLIENT_SLUGandDBN_CAVEAU_PACKAGE_SLUG DBN_AZURE_OPENAI_ENDPOINTDBN_AZURE_OPENAI_API_KEYDBN_AZURE_OPENAI_API_VERSIONDBN_AZURE_OPENAI_CHAT_DEPLOYMENTDBN_AZURE_OPENAI_EMBEDDING_DEPLOYMENT
Optional:
DBN_AI_PORTAL_ROOT(defaults to siblingai-portal)DBN_CAVEAU_CLIENT_SLUG(defaults todobetter)DBN_CAVEAU_PACKAGE_SLUG(defaults tofamily-legal)DBN_TOOLS_SUPPORT_DIRDBN_TOOLS_METADATA_LOG
Authentication
The login form authenticates against Caveau client_users for the configured
client slug. The client must be active, the user must be active, and the client
must have an active subscription to the configured corpus package.
Use scripts/setup-caveau-access.php for repeatable local/production setup of
the Do Better Norge Caveau owner account, family-legal subscription, and
white-label domain mappings. Pass the account password through
DBN_SETUP_PASSWORD at runtime only; do not commit it.
The APIs process pasted text in memory and write only metadata such as tool name, latency, language, source count, chunk count, deployment, and anonymous session id.
Description
Languages
PHP
77.3%
JavaScript
13.6%
CSS
9.1%