General import declarations: model connections for product questions

Review model connections for product questions in General import declarations. Check input mappings, source evidence and failure handling before use.

What the documents look like

General trade import declaration work centres on dutiable value, freight and insurance, and tax payment. Each shipment produces an import declaration form, a commercial invoice, a packing list, a bill of lading, and a contract. Product data and selection questions must be answered against this material: classification, specifications, and declared elements. The documents refresh per shipment, so configuration checks travel with each shipment's papers rather than relying on batch synchronization or transaction-triggered automation.

For model connections, the first requirement is that a language model and an index model are both available. The system needs at least one language model and one index model to operate. The language model handles text dialogue and, where the model supports it, image recognition. The index model indexes text chunks for retrieval. A rerank model is optional and only participates when one is configured and enabled; image retrieval requires an actual image input and a model with vision capability. The overall flow diagram lists optional paths that do not all execute on every request.

Retrieval is a recall process. It does not enforce permissions or entity isolation. Libraries built on different vector models cannot be associated with each other; the correct step is to check identifiers and record the gap, not to run cross-model retrieval to compare missed recalls.

Constraints at the model connections step

From V4.17.0, AI Proxy is a required dependency. Both the App and any Admin service that reuses App/Service configuration must set AIPROXY_API_ENDPOINT and a non-empty AIPROXY_API_TOKEN. Missing either one causes startup validation to fail. Legacy OpenAI environment variables or a single-model custom request address cannot replace these two settings.

Model ID is the value of the model field in the request body and is globally unique. A model channel determines the upstream protocol. Model mapping maps the model FastGPT requests to the actual upstream model; for example, gpt-4o-test maps to gpt-4o. The proxy address field takes a BaseUrl, not a full model request address, and whether /v1 is needed must be checked.

A model probe, when enabled, tests only currently enabled system models. A first failure triggers up to three retries, so a single round makes at most four attempts. One success marks the round valid; only four failed attempts mark the model abnormal. Status is green when the test succeeds with latency at or under 30s, yellow when it succeeds above 30s, and red after four consecutive errors. Probe interval accepts integers from 5 to 60 minutes. These are documented behaviours of the probe feature, not defaults for this page.

Hypothetical paper exercise. A customs manager at a customs broker reviews declaration material for a shipment of imported stainless steel plate on 2 March 2026. The commercial invoice reads: "Invoice No. INV-2026-0302, terms of trade CIF, total invoice value USD 48,000, price terms state freight and insurance are borne by the seller to Shanghai port." The packing list reads: "12 pallets total, gross weight 18,600 kg, net weight 18,200 kg." A draft sentence reads: "The terms of trade for this shipment are CIF, and freight and insurance are included in the invoice total." A handover request reads: "Please confirm whether the declared elements for this batch of plate can be quoted directly from the invoice and packing list." The parties, object, status, and date range above are used only for this paper check. No test, deployment, approval, or refund is claimed.

Configuration and implementation checks

Configuration itemHypothetical starting value for this exerciseCheck method
AIPROXY_API_ENDPOINTAI Proxy service root address, without /v1 appendedCompare character by character against the deployed address
AIPROXY_API_TOKENNon-empty admin token matching the server sideConfirm non-empty and consistent with AI Proxy configuration
Language modelOne model enabled that supports tool choiceSend one request on the model test page and read the response
Index modelOne index model enabled, with maxToken checkedCompare the maximum token field in the model configuration
Model mappingFastGPT model ID mapped to the upstream modelCheck the key-value correspondence in the mapping JSON
Model probeProbe interval set to an integer from 5 to 60 minutesSave on the model probe page, then view the status chart

The starting values above are assumptions for this page's exercise. They are not official defaults. Each was chosen so that a comparison target exists: the endpoint against the deployed address, the token against the server-side token, the interval against the documented 5-to-60-minute range.

Three common errors

  1. Writing AIPROXY_API_ENDPOINT as a full request address with /v1. Input: a configuration string containing the root address plus /v1. Comparison: the documented requirement of a service root address. Observable result: the two do not match, and the value needs correction.
  2. Filling an application API key into AIPROXY_API_TOKEN. Input: an application-side key. Comparison: the AI Proxy admin token. Observable result: the two have different sources, and startup validation may fail.
  3. Treating the price term stated on the invoice as a declared-element conclusion in the draft sentence. Input: the CIF statement on INV-2026-0302. Comparison: the draft sentence's claim that freight and insurance are included in the invoice total. Observable result: the invoice supports the price term; whether declared elements can be quoted directly from it remains to be verified.

How to verify the setup

  1. Take the text of INV-2026-0302 and the draft sentence. Input: both texts. Compare whether the invoice states the terms of trade and which party bears freight and insurance. Observable result: when the draft sentence matches the invoice wording, that sentence is supported; when it does not, the point remains to be verified.
  2. Take the packing list text and the handover request. Input: 12 pallets, gross weight 18,600 kg, net weight 18,200 kg. Compare whether the request asks to confirm that declared elements can be quoted. Observable result: the packing list supplies only piece and weight data; the quotation conclusion is not supported.
  3. Take the model ID on the model configuration page and the mapping JSON. Input: the FastGPT-side model ID and the upstream model name. Compare whether the two correspond through the mapping. Observable result: when the key and value match, a channel test can be initiated; when they do not match, the test request points to a model different from the expected one, and the identifier must be checked first and non-matching entries excluded.

Retrieval checks record only what is observed. If the paper input is an empty array, downstream design handles an empty result; no guarantee is made that the first hit appears or that unrelated queries return empty. Libraries on different vector models cannot be associated, so only identifiers are checked and gaps recorded.