LLM integration
Calling a language model from application code with the tenant, destination and credential handling already solved instead using an SDK call with a hand-rolled key.
Showing artifacts, examples and content with confirmed Node.js applicability. View All CAP
Overview
@cap-js/ai@cap-js/aiOut-of-the-box value-help recommendations powered by SAP RPT-1, SAP AI Core as a standard CAP service, and an experimental local embedding model behind SQLite's vector functions.sap official, cap is the plugin: it embeds SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp as a standard CAP service with automatic service-binding resolution and tenant-aware resource groups and deployments, and detects @Common.ValueList and @cds.odata.valuelist fields to put SAP RPT-1 recommendations into draft-enabled Fiori UIs without a handler. The call itself is the SAP Cloud SDK for AI's JavaScript packages, @sap-ai-sdk/foundation-models@sap-ai-sdk/foundation-modelsThe package of SAP's AI SDK that calls foundation models through SAP AI Core and the Generative AI Hub, and the one an application actually reaches for.sap official, cap and @sap-ai-sdk/orchestration@sap-ai-sdk/orchestrationThe Orchestration Service client of SAP's AI SDK, which applies templating, grounding, filtering and masking around a model call rather than in the application.sap official, cap, each of which streams a chat completion over server-sent events, and which model a CAP-level agent talks to is cds.requires.llm, whose aicore kind is the default for production and hybrid.
Not covered: At the binding, and at what the local kinds answer with. A production deployment of the recommendations needs an SAP AI Core service binding, and without one local development answers from a mock implementation for UI smoke tests; the auto kind reads a local Claude or OpenCode configuration and mock returns dummy responses, so neither is a model an application ships against. The plugin's own local vector embeddings and the tooling around them are experimental, with breaking changes expected.
A backend SAP's clients do not reach: @saptarishi/cds-plugin-llm@saptarishi/cds-plugin-llmA CAP service kind that puts eleven model providers behind one chat, stream, embed and batch interface, so which backend a service calls is a profile in package.json rather than a change to the handler.independent, cap registers many provider kinds under the same cds.requires.llm the agent plugin uses, so a development profile on a local Ollama model and a production profile on the Generative AI Hub differ by configuration alone. cap-llm-plugincap-llm-pluginGenerative AI in a CAP application with the sensitive fields anonymised through SAP HANA before the prompt leaves, so the model never sees the confidential half.independent, cap and @geertjanklaps/cds-toon-ai-protocol-adapter@geertjanklaps/cds-toon-ai-protocol-adapterA protocol adapter that serves CAP data as TOON — Token-Oriented Object Notation — instead of JSON, so a payload bound for a language model costs fewer tokens to send.independent, cap stay on SAP AI Core and change what is sent to it, the first anonymising sensitive fields in SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp and the second the wire format.
Licence
LicenceSAP Developer License Agreement 3.2 CAP§ 3AlwaysCovered SAP materials or a covered CAP customer application are used as training data or to develop or refine an AI model or system.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
Calling a model for inference is not automatically AI training. Section 3 matters when the covered material or application participates in training, model development, refinement or the text-and-data-mining uses it names.
SAP Developer License Agreement 3.2 CAP →Artifacts
Content
Show 7 more
Seen working
Neither the package manifest nor the repository tree declares a licence.
Neither the package manifest nor the repository tree declares a licence.
It calls the OpenAI API directly with a key in the environment. It was written in early 2023 and last touched in May 2023, which is before SAP AI Core and the CAP LLM plugins existed — so read it for the shape of the application, not for how a CAP service should reach a model today.
Neither the package manifest nor the repository tree declares a licence.
Every CDS service in both samples is marked `@requires: 'any'` and left publicly accessible, which the README says simplifies the deployment process, and it asks for proper authentication mechanisms to be applied in their place.
Neither the package manifest nor the repository tree declares a licence.
Details
Coverage
Comparison properties
These are the questions used to compare what the artifacts do. Values come from their documentation and may apply to a particular ecosystem or runtime. Each recorded value in the comparison opens its statement and sources.
For your agent
- Ref
capability:llm-integration- JSON
- /capabilities/llm-integration.json
- MCP
- Connecting an agent