Quality Problem Traceability and Defect Analysis for Petroleum Refining: Model Access and Configuration

Petroleum refining scenario data originates from multiple systems. These include unit operation parameters collected in real time by DCS/APC

This document was written for FastGPT v4.17.0.

What this category of data looks like

Petroleum refining scenario data originates from multiple systems. These include unit operation parameters collected in real time by DCS/APC, distillate quality reports generated by LIMS, material data measured by tank farms, crude oil evaluation reports, equipment management ledgers, and energy consumption data from energy systems. Daily documents include operating procedures, production plans, material balance sheets, interlock ledgers, shift handover records, and change management documents. Data update cycles cover real-time, shift-based, and daily frequencies. Fields include crude oil density, distillation range, product sulfur content, unit load, and corresponding engineering units.

What constraints these characteristics impose on model access and configuration

Real-time and batch updates of multi-source heterogeneous data require model access to support streaming data pulling and scheduled incremental synchronization. This avoids full data pulling that occupies excessive system resources. Diverse document types and fields require configuration of parsing rules adapted to different data structures. This ensures accurate identification of fields such as sulfur content in quality reports and unit interlock logs. Continuously coupled unit processes require model context to cover multi-link associated data. It is also necessary to limit the number of tokens processed per round to prevent request timeouts. In addition, defect analysis in refining scenarios requires association with historical interlock and material balance data. Configuration items must support associated recall of multi-source data.

How to set the configurations

Configuration ItemRecommended SettingRationale
maxContext8000–12000 tokenCovers multi-unit coupled process data and historical analysis documents, avoids truncation of critical context
maxTokens4000 tokenControls single-round response length, adapts to the detailed output requirements of refining analysis reports, prevents timeouts
quoteMaxToken1500 charactersLimits the single-segment length of recalled documents, matches the field length of single records in refining quality reports
Workflow/API tool selectionautoAllows the model to independently select tool calls, adapts to the associated query requirements of multi-source data
temperature0.3–0.5Reduces random generation probability, ensures consistency and traceability of defect analysis results
AIPROXY_API_TOKENKey matching the deployed modelCompletes identity verification for model access, prevents unauthorized requests from being blocked
AIPROXY_API_ENDPOINTFill in according to the deployment environmentAdapts to Ollama or other locally deployed model access addresses, ensures model call connectivity

Three common configuration mistakes

  • When toolChoice is set to none, the model cannot trigger tool calls. This manifests as an inability to return real-time unit data or historical interlock records. The cause is that tool call permissions are forcibly disabled, which does not adapt to the requirement of associating multi-system data in refining scenarios.
  • When maxContext exceeds 16000 token, model calls return a 504 timeout error. The cause is insufficient resources of the locally deployed Ollama, which cannot handle processing requests with overly long context.
  • When AIPROXY_API_TOKEN is not configured, model access requests return a 401 unauthorized error. The cause is that the identity verification token for model access is not correctly filled, resulting in request blocking.

How to confirm successful configuration

  • Initiate a test request that includes queries for multiple unit parameters. Check whether the model can recall real-time data from the corresponding DCS system to verify that the tool call function works properly.
  • Submit a quality report analysis request that includes long text. Check whether the response is within the preset maxTokens range, with no truncation or timeout.
  • View the model access logs. Confirm that requests correctly carry the AIPROXY_API_TOKEN and return a 200 status code to verify connectivity.
  • Adjust the temperature parameter and initiate repeated tests. Check the consistency of analysis results to confirm that the parameter takes effect.

The values provided here are common starting points. They should be evaluated against the reader's own samples.