# US 2025/0147820 A1 · Hybrid language model architecture for api orchestration including chain of thought

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0147820 A1
- Document ID: US20250147820A1
- Status: Published application
- Kind: A1
- Application number: 19/015,513
- Filed: 2025-01-09
- Published: 2025-05-08
- Earliest claimed: 2023-10-26
- Assignees: Goldman, Sachs & Co.
- Applicants: Goldman Sachs & Co. LLC
- Inventors: Giovanni Faonte; Shreya Chandrashekar Srinarasi; Mithun Azhagappan; Dinesh Gupta; Christopher M. Churchman; Cheska Adrianne Mauban
- Web page: https://patentgrep.com/patent/US20250147820A1

## CPC

- G06F 9/54: Interprogram communication
- G06F 9/541: {via adapters, e.g. between incompatible applications}
- G06F 9/547: {Remote procedure calls [RPC]; Web services}
- G06F 40/30: Semantic analysis
- G06N 20/00: Machine learning
- G06F 2209/541: Client-server
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A hybrid architecture that combines the efficiency of small language models with the accuracy of large language models for enhanced selection of requested functionality and identification of data visualizations using a network system is described. For instance, an orchestration module employs a hybrid architecture using both small language models and large language models to generate API payloads for clients in a way that harnesses the benefits of both models.

## Claims

### Claim 1

A method for generating a payload response for a requested functionality in a system environment, the method comprising:
receiving, at a network system, a payload request from a client device, the payload request comprising a natural language request for the requested functionality;
applying, at the network system, a small language model to the payload request to determine a set of candidate APIs from a catalog based on embeddings generated by the small language model that map the natural language in the payload request to the functionality of the APIs in the catalog;
applying, at the network system, a large language model to the payload request and the candidate APIs to determine a selected API that performs the requested functionality, the large language model interpreting context and intent of the payload request to select a candidate API from the set of candidate APIs as the selected API based on the context and intent;
executing the selected API to generate a payload response including the requested functionality; and
transmitting the payload response to the client device.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
generating the catalog for the network system by:
accessing a plurality of APIs within a system environment comprising the network system;
determining metadata associated with a functionality of each of the APIs in the plurality of APIs; and
wherein the set of candidate APIs are selected from the plurality of APIs.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
training the small language model to identify candidate APIs by mapping metadata describing the functionality of each API to language samples representing a plurality of payload requests.

### Claim 4 (depends on 2)

The method of claim 2, wherein accessing a plurality of APIs within the system environment comprises accessing APIs from one or more additional network systems.

### Claim 5 (depends on 1)

The method of claim 1, wherein applying the large language model to the payload request and the set candidate APIs further comprises:
providing metadata associated with each candidate API to the large language model, and
wherein selecting the candidate API as the selected API is further based on the metadata.

### Claim 6 (depends on 1)

The method of claim 1, wherein selecting candidate APIs further comprises:
determining, for each API of a plurality of APIs in the catalog, a score quantifying a likelihood the API is semantically or syntactically relevant to language in the payload request;
selecting a number of APIs having a highest score as the candidate APIs.

### Claim 7 (depends on 1)

The method of claim 1, wherein selecting candidate APIs further comprises:
determining, for each API of a plurality of APIs in the catalog, a score quantifying a likelihood the API is semantically or syntactically relevant to language in the payload request;
selecting the APIs having scores above a threshold score as the candidate APIs.

### Claim 8 (depends on 1)

The method of claim 1, wherein the network system executes the selected API and transmits the payload response to the client device.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
providing a location of the selected API to the client device; and
wherein a system hosting the location executes the selected API and the system transmits the payload response to the client device.

### Claim 10 (depends on 1)

The method of claim 1, wherein applying the large language model to the payload request and the candidate APIs to determine the selected API that performs the requested functionality comprises:
selecting one or more additional APIs for an API chain, and wherein:
each of the one or more additional APIs provide a partial functionality related to the requested functionality, and
the API chain, in aggregate, provides the requested functionality.

### Claim 11

A non-transitory computer-readable storage medium comprising computer program instructions for a payload response for a requested functionality in a system environment, the computer program instructions, when executed, causing the one or more processors to:
receive, at a network system, a payload request from a client device, the payload request comprising a natural language request for the requested functionality;
apply, at the network system, a small language model to the payload request to determine a set of candidate APIs from a catalog based on embeddings generated by the small language model that map the natural language in the payload request to the functionality of the APIs in the catalog;
apply, at the network system, a large language model to the payload request and the candidate APIs to determine a selected API that performs the requested functionality, the large language model interpreting context and intent of the payload request to select a candidate API from the set of candidate APIs as the selected API based on the context and intent;
execute the selected API to generate a payload response including the requested functionality; and
transmit the payload response to the client device.

### Claim 12 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the computer program instructions, when executed, cause the one or more processors to:
generate the catalog for the network system by:
accessing a plurality of APIs within a system environment comprising the network system;
determining metadata associated with a functionality of each of the APIs in the plurality of APIs; and
wherein the set of candidate APIs are selected from the plurality of APIs.

### Claim 13 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, further comprising:
train the small language model to identify candidate APIs by mapping metadata describing the functionality of each API to language samples representing a plurality of payload requests.

### Claim 14 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein accessing a plurality of APIs within the system environment causes the one or more processors to:
access APIs from one or more additional network systems.

### Claim 15 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein applying the large language model to the payload request and the set candidate APIs causes the one or more processors to:
provide metadata associated with each candidate API to the large language model, and
wherein selecting the candidate API as the selected API is further based on the metadata.

### Claim 16 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein selecting candidate APIs causes the one or more processors to:
determine, for each API of a plurality of APIs in the catalog, a score quantifying a likelihood the API is semantically or syntactically relevant to language in the payload request;
select a number of APIs having a highest score as the candidate APIs.

### Claim 17 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein selecting candidate APIs causes the one or more processors to:
determine, for each API of a plurality of APIs in the catalog, a score quantifying a likelihood the API is semantically or syntactically relevant to language in the payload request;
select the APIs having scores above a threshold score as the candidate APIs.

### Claim 18 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the network system executes the selected API and transmits the payload response to the client device.

### Claim 19 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein the computer program instructions, when executed, cause the one or more processors to:
provide a location of the selected API to the client device; and
wherein a system hosting the location executes the selected API and the system transmits the payload response to the client device.

### Claim 20 (depends on 11)

The non-transitory computer-readable storage medium of claim 11, wherein applying the large language model to the payload request and the candidate APIs to determine the selected API that performs the requested functionality comprises:
select one or more additional APIs for an API chain, and wherein:
each of the one or more additional APIs provide a partial functionality related to the requested functionality, and
the API chain, in aggregate, provides the requested functionality.
