A model configuration method and system for multi-agent workflow scenarios

By constructing a "task-model-resource" collaborative configuration mechanism for multi-agent workflows and utilizing iterative local search algorithms to optimize model deployment and execution, the problems of local optimum model configuration and resource waste in existing technologies are solved, and efficient execution of workflows is achieved.

CN123114585APending Publication Date: 2026-11-17SHANHU INTELLIGENT COMPUTING TECHNOLOGY (HUNAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611600416.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing multi-agent workflow scenarios, model configuration methods rely on human experience or simple rules, failing to take a global perspective on the dependencies between tasks, model loading and reuse, and competition for cluster resources. This results in local optima in model deployment, resource waste, and low execution efficiency.

Method used

By acquiring the task types, candidate model performance, and resource consumption in the multi-agent workflow, and combining cluster resources, a model deployment and scheduling algorithm based on iterative local search is adopted to coordinate the joint optimization of tasks, models, and computing nodes, construct a collaborative configuration mechanism of "task-model-resource", and optimize the model deployment and execution scheme.

Benefits of technology

While ensuring service quality, the overall workflow execution time is significantly shortened, model duplication and resource waste are reduced, and execution efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114585A_ABST
    Figure CN123114585A_ABST
Patent Text Reader

Abstract

A model configuration method and system for multi-agent workflow scenarios is disclosed. The method involves acquiring task types and execution flows, candidate model performance test results and runtime resource consumption, and available cluster hardware resources. Under the combined influence of service quality constraints and hardware resource constraints at the per-compute-node and per-resource dimensions, a model deployment and scheduling algorithm based on iterative local search is used to jointly optimize tasks, models, and compute nodes, coordinating the loading and reuse of model instances to find the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path. Based on this scheme, the model instances configured for each task are deployed to the corresponding compute nodes, and model configuration and scheduling are performed for each task to obtain the configuration result. This invention coordinates hardware resource constraints and model loading and reuse while ensuring service quality, shortening the total workflow completion time and improving the automation and global optimization capabilities of model configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, large model applications and multi-agent systems, and in particular to a model configuration method and system for multi-agent workflow scenarios. Background Technology

[0002] With the rapid development of large-scale model technology, intelligent agents based on large-scale models have demonstrated powerful capabilities in tasks such as natural language processing, question answering, code generation, and intelligent decision-making. To accomplish complex business tasks, multiple agents are typically arranged into multi-agent workflows according to certain logic. Different agents undertake different tasks within the workflow, and collaborate to achieve the overall goal through information flow between tasks. In multi-agent workflows, different tasks have varying requirements for model size, capabilities, response speed, and resource consumption. Therefore, selecting the appropriate model for each task in the workflow and deploying it to suitable computing nodes has become a key issue affecting the overall execution time and service quality of the workflow.

[0003] Currently, model configuration in multi-agent workflows typically employs methods based on human experience or simple rules. Engineers pre-specify fixed models for each task according to task type, or select the best-performing or lowest-cost model for each task locally using a greedy strategy, and then deploy the selected models uniformly to the computing nodes in the cluster for execution.

[0004] However, the above-mentioned model configuration methods based on human experience or greedy strategies have some drawbacks: First, this method selects a model independently for a single task during configuration, without taking into account the dependencies between tasks, model loading and reuse, and competition for cluster resources from a global perspective of multi-agent workflow. This results in the final model deployment scheme being limited to local optima, failing to minimize the overall time cost, and making it difficult to meet the overall execution efficiency requirements in multi-agent workflow scenarios. Second, this method does not incorporate service quality constraints and cluster resource constraints into a unified optimization framework. When a larger-scale model is chosen in pursuit of low latency, it can easily lead to cluster resource overload or substandard service quality, failing to balance resource constraints and time costs while ensuring service quality. Third, the model deployment scheme and workflow execution scheme of this method are separated, and the impact of factors such as model loading time and multiple tasks sharing the same model instance on the overall execution time is not considered, resulting in repeated model loading and resource waste, which further increases the execution delay of the multi-agent workflow.

[0005] Therefore, a model configuration scheme is needed for multi-agent workflow scenarios. This scheme should take a global perspective on multi-agent workflows, reduce model loading overhead and improve model reuse efficiency while meeting service quality requirements and considering the resource capacity limitations of cluster computing nodes. This would shorten the total workflow completion time and overcome the problems of local optima, resource waste, and low execution efficiency caused by existing technologies, such as independent task configuration, disconnect between model deployment and workflow execution, failure to consider model loading overhead and cluster resource limitations.

[0006] It should be noted that the information disclosed in the background section above is only for understanding the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0007] The main objective of this invention is to overcome the deficiencies in the aforementioned background technology and provide a model configuration method and system for multi-agent workflow scenarios.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: A model configuration method for multi-agent workflow scenarios includes the following steps: S1. Obtain the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks and the resource consumption of the models during runtime, as well as the available hardware resources of each computing node in the cluster, and perform standardization processing to form unified multi-agent workflow model configuration input information. S2. Under the combined effect of service quality constraints and hardware resource constraints per compute node and per resource dimension, a model deployment and scheduling algorithm based on iterative local search is used to jointly optimize tasks, models and compute nodes, coordinate the loading and reuse of model instances on compute nodes, and solve the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path of the workflow. S3. Based on the model deployment scheme and workflow execution scheme, deploy the model instances configured for each task to the corresponding computing nodes, and perform model configuration and scheduling for each task in the workflow to obtain the configuration results.

[0009] A model configuration system for multi-agent workflow scenarios includes: The information collection and standardization module is used to acquire the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks and the resource consumption of the models during runtime, as well as the available hardware resources of each computing node in the cluster, and to perform standardization processing to form unified multi-agent workflow model configuration input information. The model deployment and scheduling module is used to jointly optimize tasks, models, and computing nodes under the combined effect of service quality constraints and hardware resource constraints per computing node and per resource dimension. It uses an iterative local search-based model deployment and scheduling algorithm to coordinate the loading and reuse of model instances on computing nodes and solve the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path of the workflow. The configuration and scheduling execution module is used to deploy the model instances configured for each task to the corresponding computing nodes according to the model deployment scheme and workflow execution scheme, and to perform model configuration and scheduling for each task in the workflow to obtain the configuration results.

[0010] This invention provides a model configuration method and system for multi-agent workflow scenarios. To address the problems of existing multi-agent workflow models, such as reliance on manual experience or simple rules for configuration, independent model selection for individual tasks, separation of model deployment and workflow execution schemes, and failure to integrate service quality constraints and cluster resource constraints into a unified optimization framework, this invention constructs a collaborative configuration mechanism for "task-model-resource" in multi-agent workflows. Unlike existing technologies that focus on independent configuration of local tasks or the separation of deployment and execution, this invention takes a global perspective on multi-agent workflows, incorporating task dependencies, model loading and reuse, cluster resource competition, and service quality requirements into a single configuration process. This provides a holistic solution to overcome problems such as local optima, resource waste, and low execution efficiency.

[0011] At the information input level, this invention uniformly acquires the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks, the resource consumption of the models during runtime, and the available hardware resources of each computing node in the cluster, and performs standardized processing. This processing eliminates the tediousness of manually sorting out multi-agent workflow information, providing complete, unified, and accurate input information for subsequent global optimization. It also eliminates reliance on manual experience or simple greedy rules in the model configuration process, effectively improving the automation and reliability of the configuration.

[0012] At the optimization level, this invention, under the combined influence of service quality constraints and hardware resource constraints at the per-compute-node and per-resource dimensions, uses an iterative local search-based model deployment and scheduling algorithm to jointly optimize tasks, models, and compute nodes. It coordinates the loading and reuse of model instances on compute nodes to find the model deployment scheme and workflow execution scheme that minimizes the total workflow completion time. Compared to existing technologies that independently select models for individual tasks without coordinating task dependencies and resource contention, this invention breaks through the limitations of independent task configuration. It incorporates service quality constraints and cluster resource constraints into a unified optimization framework, enabling global coordination of task dependencies, model loading and reuse, and resource contention. This avoids cluster resource overload or substandard service quality caused by selecting excessively large models in pursuit of local low latency, thereby significantly shortening the overall workflow execution time while ensuring service quality.

[0013] Furthermore, this invention comprehensively considers key factors such as model loading time, task execution time, and data transmission time during model deployment and scheduling. It introduces a loading time amortization mechanism based on model reuse and an iterative optimization mechanism based on perturbation to continuously improve the model deployment scheme. Specifically, the model reuse loading time amortization mechanism, in conjunction with the overall planning of model instance loading and reuse on computing nodes, helps reduce redundant model loading; the iterative optimization mechanism based on perturbation, in conjunction with the iterative local search process, helps to escape local optima while satisfying resource constraints; and the hardware resource constraints per computing node and per resource dimension, in conjunction with model deployment and execution scheduling, ensure the physical feasibility of the solved solution. These mechanisms work together to enable the model deployment scheme to better adapt to multi-agent workflow scenarios, improving practical application effectiveness.

[0014] Ultimately, this invention achieves model configuration and scheduling for each task in a multi-agent workflow through the coordinated efforts of information collection and standardization, joint optimization, and configuration and scheduling execution. It minimizes the overall time cost of the workflow while ensuring service quality, and overcomes the problems of local optima, resource waste, and low execution efficiency caused by independent task configuration, disconnect between model deployment and workflow execution, failure to consider model loading overhead and cluster resource limitations in existing technologies.

[0015] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description

[0016] Figure 1 This is a simplified flowchart of the model configuration method for multi-agent workflow scenarios of the present invention; Figure 2 This is the core process and overall framework diagram of the model configuration scheme for multi-agent workflow scenarios in this embodiment of the invention. Detailed Implementation

[0017] The embodiments of the present invention will be described in detail below. It should be emphasized that the following description is merely exemplary and not intended to limit the scope and application of the present invention.

[0018] Traditional multi-agent workflows typically rely on manual experience or simple rules for model configuration, selecting models independently for individual tasks without considering the global perspective of task dependencies, model loading and reuse, and cluster resource competition. Furthermore, they fail to integrate service quality constraints and cluster resource constraints into a unified optimization framework. This invention aims to provide a model configuration method for multi-agent workflow scenarios, with its core advantage lying in constructing a collaborative "task-model-resource" configuration mechanism for multi-agent workflows. To this end, this invention proposes: first, uniformly reading the workflow's task types and execution flow, performance test results and runtime resource consumption of different models, and available cluster resources; then, under the combined effect of service quality constraints and node-by-node and dimension-by-dimensional resource constraints, solving for the time-cost-optimal model deployment scheme through an iterative local search-based model deployment and scheduling algorithm, and generating a workflow execution scheme accordingly; finally, achieving model configuration and scheduling for each task in the multi-agent workflow, thereby minimizing the overall time cost of the workflow while ensuring service quality. This solves the technical problems in existing multi-agent workflows where model configuration relies on human experience, lacks global optimization, and fails to coordinate service quality constraints and cluster resource constraints, making it difficult to simultaneously achieve optimal time cost and service quality.

[0019] See Figure 1 This invention provides a model configuration method for multi-agent workflow scenarios, comprising the following steps: Step S1: Obtain the task types and execution flow in the multi-agent workflow, the performance test results of candidate models for different tasks, the resource consumption of the models during runtime, and the available hardware resources of each computing node in the cluster. Then, standardize these information to form unified multi-agent workflow model configuration input information. For example... Figure 2 As shown, the standardized input information obtained in step S1 can be output to the subsequent iterative global joint optimization process.

[0020] In some embodiments, step S1 includes: reading and parsing the definition information of all workflows from the configuration file to obtain the task types contained in each workflow and the execution flow between tasks, wherein the execution flow includes the order, dependencies, and parallel branches between tasks; reading the performance test results of each model in the candidate model set for different task types and the resource consumption of the model during runtime from the model performance test results, wherein the performance test results include at least one of accuracy, response latency, and throughput, and the resource consumption includes at least one of video memory, computing power, and memory occupied by the model during runtime; and reading the performance test results of each computing unit in the cluster for different task types from the model performance test results. The available computing power, GPU memory, RAM, and network bandwidth of each node are used to obtain the available hardware resources of the cluster. This information is then standardized to form unified multi-agent workflow model configuration input information. The standardization process includes: normalizing performance metrics that are better when larger and those that are better when smaller, and unifying the dimensions of each resource metric to obtain the service quality scalar and resource consumption vector for each candidate model under each task. The service quality scalar is obtained by weighted summation of the normalized values ​​of each performance metric. The weights of each performance metric are specified in the configuration file or preset according to the task type, and the sum of the weights of each performance metric satisfies the normalization condition.

[0021] In some embodiments, when there is only a single performance indicator, the weight of the indicator is a preset weight; when there are multiple performance indicators, they are allocated according to a preset ratio. The aggregated service quality scalar value is located within the normalized interval, and the minimum service quality requirement and the service quality scalar use the same dimension.

[0022] Step S2: Under the combined influence of service quality constraints and hardware resource constraints at the per-compute-node and per-resource dimensions, a model deployment and scheduling algorithm based on iterative local search is used to jointly optimize tasks, models, and compute nodes. This coordinates the loading and reuse of model instances on compute nodes, solving for the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path in the workflow. For example... Figure 2 As shown, the joint optimization process in step S2 may include constructing a task dependency graph, generating candidate mappings and performing service quality filtering, solving for the model deployment scheme with the optimal time cost, generating a workflow execution scheme, and performing verification, evaluation, convergence judgment, perturbation, and iteration.

[0023] In some embodiments, in step S2, a task dependency graph corresponding to all workflows is constructed based on the execution flow obtained in step S1. The task dependency graph uses tasks as nodes and data dependencies between tasks as directed edges, and represents the order, dependencies and parallel branches between tasks in the form of a directed acyclic graph. Based on the performance test results and resource consumption obtained in step S1, candidate mapping relationships between tasks and candidate models are generated, and candidate mappings that do not meet the service quality constraints are eliminated.

[0024] In some embodiments, in step S2, the optimal model deployment scheme in terms of time cost aims to minimize the total completion time of the critical path of the workflow; the completion time of a task in the workflow is recursively determined based on the completion time of its direct predecessor task, the data transfer time between tasks, the model execution time, and the model loading time; the model loading time is only counted when the model is loaded for the first time on its deployment node, and when multiple tasks reuse the same model instance, the loading time is only counted once or the loading time corresponding to the reuse of the model is not counted; the total completion time of the workflow is the maximum value of the completion times of each task.

[0025] In some embodiments, in step S2, the service quality constraint is: for each task, the service quality scalar of its configured candidate model after standardization is not lower than the minimum service quality requirement of the task; the hardware resource constraint per compute node and per resource dimension is: for any compute node and any resource dimension, the sum of the resource consumption of all task-model pairs deployed on the compute node in that resource dimension does not exceed the available amount of the compute node in that resource dimension; the hardware resource constraint adopts a conservative estimation model, that is, it is assumed that each task-model pair deployed on the same compute node corresponds to an independent model instance or inference container, the saving effect brought by different tasks reusing the same model instance is not considered when calculating the storage resource consumption, and the constraint is based on the sum of the peak demand of all task-model pairs on the compute node when calculating the compute resource consumption, so as to ensure that the solved model deployment scheme is physically feasible.

[0026] In some embodiments, the joint optimization using the model deployment scheduling algorithm based on iterative local search in step S2 includes: constructing a task dependency graph according to the execution flow, and generating candidate mapping relationships between tasks and candidate models based on performance test results and resource consumption, eliminating candidate mappings that do not meet service quality constraints; determining whether it is the first iteration: if it is the first iteration, generating an initial model deployment scheme using a greedy approach; otherwise, using the candidate solution generated by perturbation as the current candidate solution; under the premise of meeting service quality constraints and hardware resource constraints, solving for the model deployment scheme with the optimal time cost, and generating a workflow execution scheme based on the model deployment scheme and the task dependency graph; verifying whether the generated workflow execution scheme meets service quality constraints and hardware resource constraints, and if not, adjusting the model... The deployment plan is adjusted and a new workflow execution plan is generated. The total time cost of the current workflow execution plan and its improvement rate relative to the previous iteration result are calculated. The improvement rate is determined based on the total time cost of the current optimal solution in the previous round and the total time cost of the workflow execution plan in this round. When the total time cost in this round is not less than the total time cost in the previous round, the improvement rate is non-positive, the current optimal solution is not updated in this round, and the process enters the termination judgment. When the improvement rate meets the preset minimum optimization threshold and the current iteration number is less than the preset maximum iteration number, a perturbation is applied to the current candidate solution to generate a new candidate solution. If the time cost of the new candidate solution is better than the current optimal solution, the current optimal solution is updated, and the process returns to execute the solution steps. Otherwise, the current optimal model deployment plan and workflow execution plan are output.

[0027] In some embodiments, the process of finding the optimal model deployment scheme in terms of time cost includes: if it is the first iteration, for each task, sorting its candidate models according to the task completion time in ascending order, and selecting the candidate model with the smallest task completion time that satisfies the service quality constraints to form an initial model deployment scheme; otherwise, using the candidate solution generated by the perturbation as the current candidate solution, and proceeding to subsequent resource verification and adjustment; judging whether the current candidate solution satisfies the hardware resource constraints per compute node and per resource dimension based on the available hardware resources of the cluster, if it does, then using it as the current optimal model deployment scheme and calculating the corresponding time cost; otherwise, replacing and adjusting the model for tasks that exceed the resource constraints until the hardware resource constraints are met; and outputting the current optimal model deployment scheme that satisfies the hardware resource constraints as the model deployment scheme with the optimal time cost.

[0028] In some embodiments, the model replacement adjustment employs a local search algorithm: for tasks exceeding resource constraints, the next candidate model is selected from the candidate model list sorted by task completion time in ascending order for replacement, and the replacement operation that minimizes the increase in time cost is selected from multiple feasible replacement operations. This process is repeated until all resource dimensions of all computing nodes satisfy the resource constraints. Specifically, for model execution tasks configured on computing nodes, the task completion time is determined based on the model reuse indicator variable, model loading time, model execution time, and task input data transmission time. The model reuse indicator variable takes a value that excludes loading time when the model has been loaded and reused by other tasks on the computing node; otherwise, it takes a value that includes loading time. The task input data transmission time is determined based on the smaller of the task input data volume and the network bandwidth at both ends of the input data node and the model deployment node. When the input data node and the model deployment node are the same node, data transmission occurs through local memory, and the transmission time is not included. When a task has multiple predecessor tasks, the transmission time is calculated for each input path, and the maximum value is included in the task completion time.

[0029] In some embodiments, applying perturbation to the current candidate solution includes: randomly selecting several tasks with a preset perturbation strength and replacing their configured models, or swapping the configured models of two tasks, generating a new candidate solution based on the current candidate solution to escape local optima; adopting a flexible unloading strategy when replacing the configured model of a task: when the resources of the target computing node are insufficient to meet the deployment requirements of the new model, prioritizing the unloading of models already deployed on the target computing node but no longer used by current and subsequent tasks, releasing resources before deploying the new model; considering model unloading, the task execution time is increased by the model unloading time item based on the model loading time, model execution time, and data transmission time; among multiple feasible replacement operations, selecting the replacement operation that minimizes the increase in overall time cost, wherein the increase in overall time cost includes the task execution time increment and the model unloading time increment.

[0030] Step S3: Based on the model deployment scheme and workflow execution scheme, deploy the model instances configured for each task to the corresponding computing nodes, and perform model configuration and scheduling for each task in the workflow to obtain the configuration results. For example... Figure 2 As shown, step S3 may include a configuration phase and an execution phase, which are used for model deployment and unloading, as well as task scheduling and data flow, respectively.

[0031] In some embodiments, in step S3, according to the model deployment scheme and workflow execution scheme, the model instances configured for each task are deployed to the corresponding computing nodes, and the execution order and data flow of each task are determined according to the workflow execution scheme. In the configuration phase, the current task, target computing node, and configured model are obtained, and it is determined whether the model instance already exists on the target computing node and whether the resources of the target computing node meet the deployment requirements. If the resources are insufficient, the set of unloadable models on the target computing node is obtained, and unloadable models are selected in the order of unused, no longer needed, and low priority for unloading until the resources of the target computing node meet the deployment requirements of the new model. Then, the model instance is deployed on the target computing node. In the execution phase, each task is executed in sequence, and data is transmitted between tasks. Data transmission between tasks on the same node is carried out through local memory, and data transmission between tasks across nodes is carried out through the network until all tasks are completed. The final configuration result is output, which satisfies the quality of service constraints and does not exceed the hardware resource constraints of the computing node, and minimizes the total workflow completion time.

[0032] This invention also provides a model configuration system for multi-agent workflow scenarios, see [link to relevant documentation]. Figure 2 As shown, the system includes an information acquisition and standardization module, a model deployment and scheduling module, and a configuration and scheduling execution module. Among them: The information collection and standardization module is used to acquire the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks and the resource consumption of the models during runtime, as well as the available hardware resources of each computing node in the cluster, and to perform standardization processing to form unified multi-agent workflow model configuration input information. The model deployment and scheduling module is used to jointly optimize tasks, models, and computing nodes under the combined effect of service quality constraints and hardware resource constraints per computing node and per resource dimension. It uses an iterative local search-based model deployment and scheduling algorithm to coordinate the loading and reuse of model instances on computing nodes and solve the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path of the workflow. The configuration and scheduling execution module is used to deploy the model instances configured for each task to the corresponding computing nodes according to the model deployment scheme and workflow execution scheme, and to perform model configuration and scheduling for each task in the workflow to obtain the configuration results.

[0033] It should be noted that the specific processing procedures of each module in the above system embodiments can be found in the corresponding steps in the aforementioned method embodiments, and will not be repeated here.

[0034] This invention provides a model configuration method and system for multi-agent workflow scenarios. It constructs a collaborative configuration mechanism of "task-model-resource" for multi-agent workflows, and jointly optimizes tasks, models, and computing nodes from a global perspective. Under service quality constraints and hardware resource constraints per computing node and per resource dimension, it coordinates the loading and reuse of model instances through a model deployment and scheduling algorithm based on iterative local search. It solves the model deployment scheme and workflow execution scheme that minimizes the total workflow completion time, thereby avoiding local optima caused by independent task configuration, reducing repeated model loading and resource waste, and improving the overall execution efficiency of the workflow while ensuring service quality.

[0035] The following further describes specific embodiments of the present invention and examples of its algorithm implementation.

[0036] A model configuration method for multi-agent workflow scenarios mainly includes: reading the task types and execution processes of all workflows from the configuration file; reading the performance test results of different models for different tasks in different workflows and the resource consumption of the models during runtime from the model performance test results; and reading the available resources in the cluster. After normalizing and standardizing the above information, under the combined effect of service quality constraints and cluster resource constraints at the node-by-node and resource-by-resource dimensions, an iterative local search model deployment and scheduling algorithm is used to jointly optimize tasks, models, and resources, coordinate model loading and reuse, and solve for the optimal model deployment scheme and workflow execution scheme in terms of time cost (total completion time of the critical path in the workflow). Based on the model deployment scheme and workflow execution scheme, model configuration and scheduling are performed on each task in the workflow to obtain the configuration result. Correspondingly, a model configuration system for multi-agent workflow scenarios includes an information collection and standardization module, a model deployment and scheduling module, and a configuration and scheduling execution module, each module being used to perform the corresponding processing in the above method. The method and system of this invention can solve the technical problems in existing multi-agent workflows, such as model configuration relying on human experience, lack of global optimization, and failure to coordinate service quality constraints and cluster resource constraints, which makes it difficult to simultaneously achieve optimal time cost and service quality.

[0037] like Figure 1 As shown, the model configuration method for multi-agent workflow scenarios specifically includes the following steps: (1) Read the task types and execution flow of all workflows from the configuration file, read the performance test results of different models for tasks in different workflows and the resource consumption of the model during runtime from the model performance test results, and read the available resources in the cluster. Standardize the above information to form a unified multi-agent workflow model configuration input information.

[0038] Specifically, this step includes the following sub-steps: (1-1) Read the definition information of all workflows from the configuration file and parse the definition information to obtain the task types contained in each workflow and the execution flow between tasks, where the execution flow includes the order of tasks, dependencies and parallel branches.

[0039] (1-2) Read the performance test results of each model in the candidate model set for different task types and the resource consumption of the model during runtime from the model performance test results. The performance test results include at least one of accuracy, response latency and throughput, and the resource consumption includes the video memory resources, computing power resources and memory resources occupied by the model during runtime.

[0040] (1-3) Read the available computing power resources, video memory resources, memory resources and network bandwidth resources of each computing node in the cluster to obtain the available resources of the cluster.

[0041] (1-4) Standardize the task types, execution processes, performance test results, resource consumption, and available cluster resources obtained in steps (1-1) to (1-3). Specifically, standardization involves: assigning higher-than-optimal performance metrics (accuracy, throughput) to... Normalized to [0,1], smaller values ​​are preferred for performance metrics (response latency). Normalized to [0,1], and resource indicators such as video memory and system memory are unified to the same dimension. The service quality scalar q(i,k) is obtained by weighted summation of the normalized values ​​of each performance indicator, i.e. The weights of each indicator satisfy , where x m (i,k) represents the value of index m after Min-Max normalization; weight w m The weights are specified in the configuration file or preset according to the task type. By default, if only a single metric is included, the weight of that metric is 1. If accuracy, throughput, and response latency are included simultaneously, they can be weighted equally (1 / 3 each) or by a preset ratio (e.g., 0.4 / 0.3 / 0.3). The aggregated q(i,k) value is located in the range [0,1]. The minimum service quality requirement uses the same dimension as q(i,k). This yields the service quality scalar q(i,k) and the resource consumption vector r(i,k), forming a unified multi-agent workflow model configuration input information.

[0042] For the first in the workflow i For each task, the performance test results and resource consumption of each model in the candidate model set on that task constitute the candidate model configuration parameters for that task, which are as follows: in,i Indicates the task sequence number. , N This indicates the total number of tasks in the workflow. K This represents the total number of models in the candidate model set. Indicates the first k One candidate model, Indicates the first k The candidate model at the th i Standardized service quality metrics for each task Indicates the first k The candidate model executes the first... i Resource consumption vector for each task.

[0043] (2) Based on the service quality constraints and resource constraints, the input information obtained in step (1) is jointly optimized by the model deployment scheduling algorithm to obtain the model deployment scheme and workflow execution scheme with the best time cost.

[0044] Specifically, such as Figure 2 As shown, this step employs a model deployment and scheduling algorithm for multi-agent workflows as the decision-making strategy for model configuration. Under the combined effect of service quality constraints and node-by-node and dimension-by-dimensional resource constraints, this algorithm selects the optimal model for each task from a global workflow perspective and coordinates model loading and reuse, thereby obtaining the model deployment scheme and workflow execution scheme with optimal time cost.

[0045] This step (2) includes the following sub-steps: (2-1) Construct a task dependency graph corresponding to all workflows based on the execution flow obtained in step (1). The task dependency graph uses tasks as nodes and data dependencies between tasks as directed edges. The order of tasks, dependencies, and parallel branches are represented in the task dependency graph as a directed acyclic graph (DAG).

[0046] (2-2) Based on the performance test results and resource consumption obtained in step (1), generate candidate mapping relationships between tasks and candidate models, and eliminate candidate mappings that do not meet the service quality constraints, that is, eliminate candidate mappings that do not meet the service quality constraints for each task. Candidate models. Among them, Indicates the first i The minimum service quality requirements for each task. The service quality constraints are... .

[0047] (2-3) Based on the available cluster resources obtained in step (1), the candidate mapping relationship obtained in step (2-2) is used to solve the optimal model deployment scheme in terms of time cost under the premise of satisfying service quality constraints and resource constraints.

[0048] The objective function of the time-cost-optimal model deployment scheme is: in, P This represents the set of all execution paths in the workflow execution plan. Indicates the execution path p Total completion time; the first in the workflow i The completion time of each task is recursively defined as: in, Indicates the first i The set of direct predecessor tasks of each task Indicates the first i The model configured for each task. Indicates task i' To the mission i Data transmission time between Representation Model Execute the i The execution time of each task Representation Model The loading time, and only if the model The loading time is counted on the first load on the deployment node. When multiple tasks reuse the same model instance, this loading time is counted only once, and is counted as 0 when the model is reused; Total workflow completion time .

[0049] This step (2-3) includes the following sub-steps: (2-3-0) Determine if it is the first iteration: If it is the first iteration, execute step (2-3-1) to generate an initial solution in a greedy manner; otherwise, take the perturbation candidate solution returned in step (2-8) as the current solution and directly enter step (2-3-2) to perform resource verification and local adjustment.

[0050] (2-3-1) For each task, rank its candidate models according to task completion time. Sort the candidate models from smallest to largest, and select those with the shortest task completion time that also meet the service quality constraints to form the initial model deployment plan. For models configured at... j On the _th computing node k The model executes the first... i For each task, the task completion time is: in, δ For model reuse indicator variables, if the first k The model in the first j If a compute node has already been loaded and reused by other tasks, then δ =0, otherwise δ =1; Indicates the first k The model in the first j Loading time per compute node Indicates the first k The model in the first j Execute the first on the computing node i The execution time of each task Indicates the first i The transmission time of input data for each task.

[0051] The first i Transmission time of task input data for: in, Indicates the first i The amount of input data for each task Indicates the first i The node where the task input data is located or the first k The network bandwidth of each model deployment node. Specifically, when the input data node and the model deployment node are different nodes, the network bandwidth... Take the smaller value of the network bandwidth at both ends, that is: When the node containing the input data and the node where the model is deployed are the same node, data transmission occurs via local memory, and the transmission time is 0. The transmission time... It can also be recorded as , where j is the kth model deployment node; when task i has multiple predecessor tasks, the transmission time is calculated for each input and the maximum value is included in the task completion time.

[0052] (2-3-2) Determine whether the current candidate solution meets the resource constraints per node and per dimension based on the available resources of the cluster. If it does, use it as the current optimal model deployment scheme and calculate the corresponding time cost. Otherwise, replace and adjust the model for tasks that exceed the resource constraints until the resource constraints are met.

[0053] The resource constraints are node-by-node, resource-by-resource dimension constraints: in This represents the set of (task, model) pairs deployed on the j-th compute node. This represents the resource usage of type d when the k-th model executes the i-th task. This represents the available quantity of resource type d on the j-th computing node, where d traverses resource dimensions such as video memory, computing power, memory resources, and network bandwidth resources.

[0054] It should be noted that the above resource constraint formula is a conservative estimate of the resource constraint model, which is modeled based on the following reasonable assumptions: (1) Constraints on storage resources (such as video memory and main memory): The formula imposes constraints on the set When performing the summation, it is assumed that each (task i, model k) pair deployed on the j-th computing node corresponds to an independent model instance or inference container. That is, when calculating the total occupancy of the d-th type of storage resources, the memory saving effect brought about by different tasks reusing (sharing) the same model instance is not considered. This conservative assumption ensures that even if each task loads the model independently in actual deployment, the storage resources on the node are still sufficient, thereby ensuring the physical feasibility of the scheduling scheme. (2) Constraints on computing resources (such as computing power and network bandwidth): The formula applies to all Summing this up is equivalent to considering the peak demand of all tasks on the j-th computing node for the d-th type of resource. This constraint ensures that even if tasks on a node execute simultaneously at the highest concurrency, the total resources can still meet the demand. In actual operation, if some tasks are executed serially or during off-peak periods, the actual resource consumption will be lower than the calculated value, and the constraint still holds. In summary, the above resource constraint formula provides a sufficient condition: a scheduling scheme that satisfies this formula is definitely feasible in actual deployment; schemes that do not satisfy this formula can attempt to satisfy the actual resource constraints through further resource sharing optimizations (such as model reuse, task off-peak periods, etc.).

[0055] The model replacement adjustment adopts a local search algorithm: for tasks that exceed resource constraints, the next candidate model is selected from the candidate model list after the task is sorted by task completion time from smallest to largest for replacement, and the replacement operation that minimizes the increase in time cost is selected from multiple feasible replacement operations. This process is repeated until the resource constraints are met.

[0056] The candidate model list is constructed as follows: for the first... i For each task, all its available models are sorted in ascending order of execution time on that task, denoted as an ordered set. ,satisfy: The mathematical expression of the resource constraint is: for any deployment node j and any resource type d The total resource requirements of all tasks deployed on this node must not exceed the node's capacity. The method for calculating the increase in time cost is as follows: [The task...]i The model from Replace with candidate model Then, the increment in the overall workflow completion time: The specific strategy for selecting the next candidate model is as follows: under the premise of satisfying resource constraints, select the candidate model that minimizes the increase in time cost. : The termination condition for repeated execution is that all resource types on all deployed nodes satisfy the resource constraints.

[0057] (2-3-3) Output the current optimal model deployment scheme obtained in step (2-3-2) as the model deployment scheme with the best time cost, and output it together with the workflow execution scheme as the basis for subsequent model configuration and scheduling.

[0058] (2-4) Based on the time-cost optimal model deployment scheme obtained in step (2-3) and the task dependency graph obtained in step (2-1), generate a workflow execution scheme in topological order, wherein tasks on parallel branches can be executed concurrently.

[0059] (2-5) Verify whether the workflow execution plan obtained in step (2-4) meets the service quality constraints and resource constraints. If yes, proceed to step (2-6); otherwise, adjust the model deployment plan and return to step (2-4).

[0060] (2-6) Calculate the total time cost of the workflow execution plan obtained in step (2-4). And calculate its improvement rate relative to the result of the previous iteration. The improvement rate is defined as: in, T old The total time cost of the current optimal solution in the previous round. T new The total time cost of executing the workflow plan in this round; when T new ≥ T old At that time, the improvement rate η If the value is ≤0, the current optimal solution will not be updated in this round, and the process will proceed to the termination judgment in step (2-7).

[0061] (2-7) Determine whether the improvement rate is greater than or equal to the preset minimum optimization threshold and the current iteration number is less than the preset maximum iteration number. If so, proceed to step (2-8); otherwise, the process ends. The minimum optimization threshold ranges from 0.01 to 0.5, preferably 0.1; the maximum iteration number ranges from 2 to 100, preferably 10.

[0062] (2-8) Apply a perturbation to the current candidate solution to generate a new candidate solution, increment the iteration counter cnt by 1, and return to step (2-3). If the time cost of the new candidate solution is better than the current optimal solution, then update the current optimal solution. The perturbation is specifically as follows: randomly select several tasks with a preset perturbation strength and replace their configured models, or swap the configured models of two tasks, and generate a new candidate solution based on the current candidate solution to escape local optima.

[0063] Among them, when replacing the model configured in the task, a flexible unloading strategy is adopted: when the resources of the target deployment node are insufficient to meet the deployment requirements of the new model, the model that has been deployed on the node but is no longer used by the current and subsequent tasks is unloaded first, and the new model is deployed after the resources are released. In the flexible unloading strategy, the determination condition for model unloading is: if deployed on a node... j On the model k' If a model is no longer used in the current moment and in all subsequent pending tasks, it can be unloaded. in, This represents the set of remaining tasks to be executed starting from the current moment. Indicates task h The configured model; Unloading Model k' The amount of resources released is: After model unloading, the calculation of task execution time needs to include a model unloading time term: in, U Indicates the deployment model k Previously, it was necessary to start from the node. j The set of models to be unloaded. Indicates from node j Unloading Model k' Time required; The selection criterion for the flexible unloading strategy among multiple feasible alternative operations remains minimizing the increase in overall time cost, i.e.: in, This is the increment for the unloading time.

[0064] (3) Based on the optimal time cost model deployment scheme and workflow execution scheme obtained in step (2), configure and schedule each task in the workflow obtained in step (1) to obtain the configuration result. Specifically, deploy the configured model of each task to the corresponding computing node, determine the execution order and data flow of each task according to the workflow execution scheme, and output the final configuration result.

[0065] This invention also provides a model configuration system for multi-agent workflow scenarios, comprising the following modules: The first module is used to read the task types and execution flow of all workflows from the configuration file, read the performance test results of different models for tasks in different workflows and the resource consumption of the model during runtime from the model performance test results, read the available resources in the cluster, and standardize the above information to form a unified multi-agent workflow model configuration input information. The second module is used to perform joint optimization processing on the input information obtained from the first module based on service quality constraints and resource constraints, through a model deployment scheduling algorithm, in order to obtain the model deployment scheme and workflow execution scheme with the best time cost. The third module is used to configure and schedule the tasks in the workflow obtained by the first module based on the optimal time cost model deployment scheme and workflow execution scheme obtained by the second module, so as to obtain the configuration result.

[0066] Preferably, the second module includes: a dependency graph construction submodule, used to construct a task dependency graph corresponding to all workflows according to the execution flow; a candidate mapping submodule, used to generate candidate mapping relationships between tasks and candidate models, and eliminate candidate mappings that do not meet service quality constraints; a solution submodule, used to solve for the time-cost optimal model deployment scheme through a model deployment scheduling algorithm under the premise of meeting service quality constraints and resource constraints, and generate a workflow execution scheme according to the model deployment scheme and the task dependency graph; a verification submodule, used to verify whether the workflow execution scheme meets service quality constraints and resource constraints; and an iterative control submodule, used to calculate the overall time cost and improvement rate, determine the convergence condition, and apply perturbation to the current optimal solution for iterative optimization. In summary, this invention proposes a model configuration method and system for multi-agent workflow scenarios. It reads the task types and execution flows of all workflows from configuration files, the performance test results of different models for different tasks in different workflows and the resource consumption of the models during runtime from model performance test results, and the available resources in the cluster. After normalizing and standardizing the above information, under the combined effect of service quality constraints and cluster resource constraints at the node and resource dimensions, a model deployment and scheduling algorithm based on iterative local search is used to jointly optimize tasks, models, and resources, coordinating model loading and reuse, and solving for the optimal model deployment scheme and workflow execution scheme in terms of time cost (total completion time of the critical path in the workflow). Based on this model deployment scheme and workflow execution scheme, model configuration and scheduling are performed on each task in the workflow to obtain the configuration result. This overcomes the technical defects of existing multi-agent workflows, such as reliance on manual experience in model configuration, lack of global optimization, and failure to coordinate service quality constraints and cluster resource constraints, which makes it difficult to simultaneously achieve optimal time cost and service quality.

[0067] Compared with the prior art, the significant technical advantages of the present invention are at least reflected in the following aspects: (1) By adopting step (1), the present invention collects and standardizes the task types, execution processes, performance test results of candidate models for different tasks, resource consumption during model operation, and available resources of the cluster in a unified manner in the multi-agent workflow, eliminating the tediousness of manually sorting out the multi-agent workflow information, providing complete, unified, and accurate input information for subsequent global optimization, and effectively improving the automation and reliability of model configuration. (2) By adopting step (2), this invention breaks the limitation of selecting a model independently for a single task, and incorporates service quality constraints and cluster resource constraints of per-node and per-resource dimensions into a unified optimization framework. Through the model deployment and scheduling algorithm based on iterative local search, it coordinates task dependencies, model loading and reuse, and resource competition from the global perspective of multi-agent workflow, and can obtain the model deployment scheme and workflow execution scheme with the best time cost, and significantly shorten the overall execution time of the workflow while ensuring service quality. (3) By adopting steps (2-3) and (2-8), this invention comprehensively considers key factors such as model loading time, task execution time and data transmission time, and introduces a loading time amortization mechanism based on model reuse and an iterative optimization mechanism based on disturbance to continuously improve the model deployment scheme, which significantly improves the adaptability and practical application effect of the model deployment scheme to multi-agent workflow scenarios.

[0068] This invention also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.

[0069] This invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein the processor executes the computer program by performing at least the method described above.

[0070] This invention also provides a processor that executes a computer program, at least performing the methods described above.

[0071] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc or CD-ROM; magnetic surface memory can be disk storage or magnetic tape storage. The storage media described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0072] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0073] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0074] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0075] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0076] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0077] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0078] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0079] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0080] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.

Claims

1. A model configuration method for multi-agent workflow scenarios, characterized in that, Includes the following steps: S1. Obtain the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks and the resource consumption of the models during runtime, as well as the available hardware resources of each computing node in the cluster, and perform standardization processing to form unified multi-agent workflow model configuration input information. S2. Under the combined effect of service quality constraints and hardware resource constraints per compute node and per resource dimension, a model deployment and scheduling algorithm based on iterative local search is used to jointly optimize tasks, models and compute nodes, coordinate the loading and reuse of model instances on compute nodes, and solve the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path of the workflow. S3. Based on the model deployment scheme and workflow execution scheme, deploy the model instances configured for each task to the corresponding computing nodes, and perform model configuration and scheduling for each task in the workflow to obtain the configuration results.

2. The model configuration method for multi-agent workflow scenarios according to claim 1, characterized in that, Step S1 includes: Read and parse the definition information of all workflows from the configuration file to obtain the task types contained in each workflow and the execution flow between tasks. The execution flow includes the order of tasks, dependencies, and parallel branches. Read the performance test results of each model in the candidate model set for different task types and the resource consumption of the model during runtime from the model performance test results. The performance test results include at least one of accuracy, response latency and throughput, and the resource consumption includes at least one of video memory, computing power and memory occupied by the model during runtime. Read the available computing power, video memory, RAM, and network bandwidth of each computing node in the cluster to obtain the available hardware resources of the cluster; The above information is standardized to form unified multi-agent workflow model configuration input information. The standardization process includes: normalizing the performance indicators that are better when they are larger and those that are better when they are smaller, and unifying the dimensions of each resource indicator to obtain the service quality scalar and resource consumption vector of each candidate model under each task. The service quality scalar is obtained by weighted summation of the normalized values ​​of each performance indicator. The weights of each performance indicator are specified by the configuration file or preset according to the task type, and the sum of the weights of each performance indicator satisfies the normalization condition.

3. The model configuration method for multi-agent workflow scenarios according to claim 1, characterized in that, In step S2, a task dependency graph corresponding to all workflows is constructed based on the execution flow obtained in step S1. The task dependency graph uses tasks as nodes and data dependencies between tasks as directed edges, and represents the order, dependencies and parallel branches between tasks in the form of a directed acyclic graph. Based on the performance test results and resource consumption obtained in step S1, candidate mapping relationships between tasks and candidate models are generated, and candidate mappings that do not meet the service quality constraints are eliminated.

4. The model configuration method for multi-agent workflow scenarios according to claim 1, characterized in that, In step S2, the model deployment scheme aims to minimize the total completion time of the critical path in the workflow. The completion time of a task in the workflow is determined recursively based on the completion time of its direct predecessor task, the data transfer time between tasks, the model execution time, and the model loading time. The model loading time is only counted when the model is loaded for the first time on its deployment node. When multiple tasks reuse the same model instance, the loading time is counted only once or the loading time corresponding to the reuse of the model is not counted. The total completion time of the workflow is the maximum value of the completion times of each task.

5. The model configuration method for multi-agent workflow scenarios according to claim 1, characterized in that, In step S2, the service quality constraint is: for each task, the service quality scalar of its configured candidate model after standardization is not lower than the minimum service quality requirement of the task; the hardware resource constraint per compute node and per resource dimension is: for any compute node and any resource dimension, the sum of the resource consumption of all task-model pairs deployed on that compute node in that resource dimension does not exceed the available amount of that compute node in that resource dimension; the hardware resource constraint adopts a conservative estimation model, that is, it is assumed that each task-model pair deployed on the same compute node corresponds to an independent model instance or inference container. When calculating the storage resource consumption, the saving effect brought by different tasks reusing the same model instance is not considered. When calculating the compute resource consumption, the constraint is based on the sum of the peak demand of all task-model pairs on that compute node, so as to ensure that the solved model deployment scheme is physically feasible.

6. The model configuration method for multi-agent workflow scenarios according to claim 1, characterized in that, In step S2, joint optimization using a model deployment scheduling algorithm based on iterative local search includes: A task dependency graph is constructed based on the execution process, and candidate mapping relationships between tasks and candidate models are generated based on performance test results and resource consumption, eliminating candidate mappings that do not meet service quality constraints. Determine if it is the first iteration: If it is the first iteration, generate an initial model deployment scheme using a greedy approach; otherwise, use the candidate solution generated by the perturbation as the current candidate solution. Under the premise of satisfying service quality constraints and hardware resource constraints, solve for the model deployment scheme with optimal time cost, and generate a workflow execution scheme based on the model deployment scheme and task dependency graph; Verify whether the generated workflow execution plan meets the service quality constraints and hardware resource constraints. If it does not meet the constraints, adjust the model deployment plan and regenerate the workflow execution plan. Calculate the total time cost of the current workflow execution plan and its improvement rate relative to the previous iteration result; the improvement rate is determined based on the total time cost of the current optimal solution in the previous round and the total time cost of the workflow execution plan in this round. When the total time cost in this round is not less than the total time cost in the previous round, the improvement rate is non-positive, the current optimal solution is not updated in this round and the process enters the termination judgment. When the improvement rate meets the preset minimum optimization threshold and the current iteration number is less than the preset maximum iteration number, a perturbation is applied to the current candidate solution to generate a new candidate solution. If the time cost of the new candidate solution is better than the current optimal solution, the current optimal solution is updated and the execution of the solution step is returned; otherwise, the current optimal model deployment scheme and workflow execution scheme are output.

7. The model configuration method for multi-agent workflow scenarios according to claim 6, characterized in that, The optimal model deployment scheme for solving time cost includes: If it is the first iteration, for each task, its candidate models are sorted in ascending order of task completion time, and the candidate models with the smallest task completion time that meet the service quality constraints are selected in turn to form the initial model deployment plan; otherwise, the candidate solution generated by the perturbation is used as the current candidate solution, and it enters the subsequent resource verification and adjustment. Based on the available hardware resources of the cluster, determine whether the current candidate solution meets the hardware resource constraints per compute node and per resource dimension. If it does, it is taken as the current optimal model deployment scheme and the corresponding time cost is calculated; otherwise, the model is replaced and adjusted for tasks that exceed the resource constraints until the hardware resource constraints are met. The output is the current optimal model deployment scheme that satisfies hardware resource constraints, which is the model deployment scheme with the best time cost.

8. The model configuration method for multi-agent workflow scenarios according to claim 7, characterized in that, The model replacement and adjustment employs a local search algorithm: For tasks exceeding resource constraints, the next candidate model is selected from the candidate model list sorted by task completion time in ascending order for replacement. The replacement operation that minimizes the increase in time cost is chosen from multiple feasible replacement operations, and this process is repeated until all resource dimensions of all computing nodes meet the resource constraints. Specifically, for model execution tasks configured on computing nodes, the task completion time is determined based on the model reuse indicator variable, model loading time, model execution time, and task input data transmission time. The model reuse indicator variable takes a value that excludes loading time if the model has been loaded and reused by other tasks on the same computing node; otherwise, it takes a value that includes loading time. The task input data transmission time is determined based on the smaller of the task input data volume and the network bandwidth at both ends of the input data node and the model deployment node. When the input data node and the model deployment node are the same node, data transmission occurs through local memory, and the transmission time is not included. When a task has multiple predecessor tasks, the transmission time is calculated for each input path, and the maximum value is included in the task completion time.

9. The model configuration method for multi-agent workflow scenarios according to claim 6, characterized in that, The perturbation of the current candidate solution includes: randomly selecting several tasks with a preset perturbation strength and replacing their configured models, or swapping the configured models of two tasks, and generating a new candidate solution based on the current candidate solution to escape local optima; when replacing the configured model of a task, a flexible unloading strategy is adopted: when the resources of the target computing node are insufficient to meet the deployment requirements of the new model, the model already deployed on the target computing node but no longer used by the current and subsequent pending tasks is unloaded first, and the new model is deployed after the resources are released; after considering the model unloading, the task execution time is increased by the model unloading time in addition to the model loading time, model execution time and data transmission time; among multiple feasible replacement operations, the replacement operation that minimizes the increase in overall time cost is selected, and the increase in overall time cost includes the increment of task execution time and the increment of model unloading time.

10. A model configuration system for multi-agent workflow scenarios, characterized in that, include: The information collection and standardization module is used to acquire the task types and execution processes in the multi-agent workflow, the performance test results of candidate models for different tasks and the resource consumption of the models during runtime, as well as the available hardware resources of each computing node in the cluster, and to perform standardization processing to form unified multi-agent workflow model configuration input information. The model deployment and scheduling module is used to jointly optimize tasks, models, and computing nodes under the combined effect of service quality constraints and hardware resource constraints per computing node and per resource dimension. It uses an iterative local search-based model deployment and scheduling algorithm to coordinate the loading and reuse of model instances on computing nodes and solve the model deployment scheme and workflow execution scheme that minimizes the total completion time of the critical path of the workflow. The configuration and scheduling execution module is used to deploy the model instances configured for each task to the corresponding computing nodes according to the model deployment scheme and workflow execution scheme, and to perform model configuration and scheduling for each task in the workflow to obtain the configuration results.