The invention provides an
artificial intelligence dialogue compliance
examination method and
system based on a local small model, and the method comprises the steps: obtaining a
user input request and related contents, sending the
user input request and related contents to the local small model (LSM), and carrying out the examination before sending according to a preset rule; if the content is compliant, sending the content to an external large
language model (LLM) to obtain a response; external LLM response content is returned in a streaming mode or a complete mode, the LSM performs real-time examination on each
data fragment returned in the streaming mode, if illegal fragments exist, the illegal fragments are processed according to risk levels, and if no illegal fragments exist, the illegal fragments are displayed; and the
complete response is directly displayed. The
system also performs overall post-review on all contents, and if problems are found, the problems are processed according to risk levels, otherwise, the problems are displayed to users. According to the invention, on one hand, the local small model is deployed to carry out multi-stage compliance examination on the whole process of
user input and LLM output, and
data privacy protection and
content security control are realized; and on the other hand, real-time interruption and
cross validation can be performed on high-risk contents, mechanisms such as log recording, objection feedback, service degradation and the like are supported, and the reliability, stability and
traceability of
system review are ensured.