Off the cloud: Local artificial intelligence for maritime contract intelligence

Supply Chain Management Review

Source published: Site published:

Original article · فارسی

Stephen Day III and Wathila Ekanayake · October 15, 2026 ·

Editor's Note: The SCM thesis From Unstructured PDF Files to Contract Intelligence: A Local LLM RAG Pipeline for Extracting Demurrage Terms and Conditions, was authored by Stephen Day III and Wathila Ekanayake and supervised by Dr. Elena Dugundji ([email protected]). For more information on this research, please contact the thesis supervisor.

Our project tackled a critical bottleneck in maritime shipping: the inability to rapidly evaluate and negotiate incoming shipping contracts. We focused our proof of concept on the largest cost driver in these agreements: demurrage. In the oil, gas, and chemicals industry, profit lives in the margin between commodity prices and operational efficiency. Few costs erode that margin faster than demurrage, which is the penalty charged when loading or unloading a vessel runs past the allowed time. The terms governing these penalties, including laytime rules and exceptions, are buried in dense maritime charter agreements that routinely run 40 to 60 pages in length.

Our sponsor, a large energy company, signs thousands of these shipping agreements annually. Reconciling a single proposed voyage to understand demurrage exposure often takes an analyst up to six hours of reading redlined legal language and cross-referencing conflicting terms. Our tool revolutionizes this deal desk workflow. It uses semantic AI to let analysts instantly audit incoming, unsigned agreements against baseline templates. Because these maritime contracts are highly confidential, we had one hard constraint: the entire system had to run locally.

The cost of slow evaluations

A single voyage is governed by a hierarchy of documents. The Charter Party is the foundational template of standardized terms. The Recap is the authoritative record of what was negotiated and overrides any conflicting language elsewhere. Riders and addendums layer in further amendments.

When it takes hours to manually reconcile this complex legal hierarchy, discrepancies are usually caught only after the vessel has sailed. This delay completely neutralizes any leverage to negotiate or enforce a contractual amendment.

The core technical problem, then, was not simply using local AI to read PDFs. It was instantly converting an incoming, unstructured agreement into a structured data asset that faithfully respects this legal hierarchy. This speed allows traders to catch risks before the ink dries, all in an environment where confidentiality is non-negotiable.

A data center in a lunchbox

The instinct in enterprise AI is to assume that serious generative reasoning demands expensive third-party cloud infrastructure or data-center GPUs. Our project demonstrates that this assumption is overstated, and we are not the only ones making the point. At CES 2026, AMD CEO Lisa Su held up a lunchbox-sized mini PC and ran a 235-billion-parameter model on it live. This demo did not rely on a data center, the cloud, or a rented GPU. That machine was built on the same AMD Ryzen AI Max+ 395 “Strix Halo” processor that powers our system.

The contract intelligence system runs on a single compact Minisforum MS-S1 Max workstation built around that Strix Halo processor with 128 GB of unified memory. By permanently dedicating 96 GB of that memory to AI workloads at the firmware level, our machine holds a 26-billion-parameter language model and an 8-billion-parameter embedding model in fast local memory at the same time. The result is performance comparable to an enterprise server, sitting quietly in a standard office, requiring no climate-controlled server room and no external network connection.

That last point is the strategic one. For a firm handling sensitive commodity contracts, keeping the entire intelligence-gathering process on-premises is not a nice-to-have; it is what makes the technology viable at all. The economics reinforce the case. Because the entire AI stack is open source, there is no vendor lock-in and no per-token billing. Once the hardware is purchased, the marginal cost of analyzing one more contract is simply the electricity to run it.

From raw PDFs to a structured asset

Turning a contract into intelligence happens in a single on-device ingestion pass. Text is extracted with precise character coordinates, and, critically, strikethrough redlines left over from negotiation are detected and stripped out. Deleted clauses that remain visually present in a final PDF would otherwise be embedded into the knowledge base and silently bias the tool toward obsolete terms. Detecting where vector lines cross the midline of a character, and dropping that text, proved to be a mandatory step rather than a refinement.

The cleaned text is then semantically chunked, tagged with metadata that encodes document type and hierarchy level, and indexed for both keyword and semantic search. In parallel, the system runs a “map-reduce” pass in which the language model reads the full agreement and distills every clause, obligation, liability cap, and financial threshold into a structured “clause inventory” of typically 80 to 250 lines per contract. This information is stored in a local database. Decoupling this structured inventory from raw text retrieval was one of our biggest breakthroughs: it lets the system audit an entire contract directly and completely, rather than hoping a keyword search surfaces the right needle in a 60-page haystack.

Three tools, one secure dashboard

Users reach everything through a single web interface that hides the underlying infrastructure. Behind it sit three tools:

  • Fact Retrieval answers natural-language questions about contract terms, combining keyword and semantic search to return precise results to questions about a given contract. Each factual claim the AI returns is based on the source text, and a clickable in-text citation is generated. It resolves hierarchy automatically: when a Recap and Charter Party conflict, the Recap wins.
  • Contract Compare audits a proposed agreement against an approved baseline. This produces a structured report of missing protections, weakened obligations, newly added risks, altered financial thresholds, and an overall risk verdict.
  • Executive Summarize condenses an entire agreement into a standardized seven-section brief covering parties, freight rates, laytime and demurrage, key obligations, liability caps, notable amendments, and a risk assessment, so leadership can triage the business logic of a deal without reading 50 pages of legal language.

Trust through verification

Accurate insight is useless if an analyst cannot confirm it. Commercial traders and legal experts, reasonably, will not stake a counterparty dispute on an answer they cannot trace to a source. So every claim the system makes carries a citation, and every citation is clickable. Selecting one opens a locally hosted document viewer, and the user’s attention is called directly to the exact paragraph the answer came from. Bridging the gap physically, back to the original text in its original context, was the decisive factor in moving the system from an experiment to a tool people trusted.

From reactive to proactive

The payoff is a shift in posture. A review that once took an analyst up to six hours now runs in moments, which is fast enough to apply to every proposed agreement as it arrives, not just the ones someone has time to scrutinize. Instead of discovering an unfavorable term after a vessel has sailed, traders can audit each incoming contract against an approved template before signing. They enter negotiations armed with evidence rather than institutional memory, keeping unfavorable clauses out of the active fleet entirely. The value compounds with every contract reviewed: faster, more consistent commercial scrutiny that protects voyage economics … all without a single byte of data ever leaving company-controlled hardware.

SC
MR