# @lssm-tech/integration.provider-llm

LLM provider implementations for ContractSpec.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.1.4`
- Package path: `packages/integrations/provider-llm`
- Manifest path: `packages/integrations/provider-llm/package.json`
- Manifest Git blob: `aaef1e63a1fcf37841bc137d0dcf225cfcac96f8`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/integration.provider-llm](https://lssm.co/docs/packages/integration.provider-llm/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.provider-llm.txt)

## Package metadata

```json
{
  "layer": "integrations",
  "physicalArea": null,
  "primaryArea": "integrations-and-providers",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "integrations",
    "catalogKind": "integration",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Integrations and provider selection](https://lssm.co/docs/areas/integrations-and-providers/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/integrations/provider-llm/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/README.md",
  "blobSha": "bd073cb8b4b1e7363080951c2f5b3ad34efdb133",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/integration.provider-llm

Website: https://contractspec.io

LLM provider implementations for ContractSpec.

Mistral chat requests forward the declared `LLMChatOptions.signal` and
`timeoutMs` to the underlying SDK, so bounded meeting generation can cancel its
actual HTTP request.

## Usage

Import the root entrypoint for the domain surface, or import a concrete implementation from the `./impls/*` subpaths.

## Compatibility

This package owns the llm implementation slice split out of `@lssm-tech/integration.providers-impls`. The legacy package continues to re-export these subpaths for existing consumers.

Mistral accepts an optional `fetchImpl` for host-owned HTTP policy via the installed
SDK's `HTTPClient`. `serverURL` is the server origin (the SDK adds `/v1` paths).
Existing callers retain their default transport. Regional consumers must select
and verify their own approved endpoint and block redirects or global fallback.

## Vercel AI Gateway

`GatewayLLMProvider` is available from `./impls/gateway-llm`. It implements the
existing `LLMProvider` chat/stream interface with a required pinned `defaultModel`,
`modelAuthor` (`openai`, `anthropic`, or `gemini`) and non-empty `only` inference
provider allowlist. Models use Gateway-qualified identifiers; Gemini models use
the `google/` namespace. Direct Mistral models/providers are excluded from this
adapter. Existing Mistral exports remain compatible and are not silently rerouted.

The native Gateway SDK preserves request-level `inferenceRegion` EU-zone,
`zeroDataRetention: true`, `disallowPromptTraining: true`, and the provider
allowlist. No per-call model change, direct-provider fallback, tool execution or
application retry is performed. Calls reject invalid origins and redirects;
abort/deadline protection covers chat and streaming. Missing token counts remain
unknown. Unsupported preflight token counting throws explicitly.

Use `apiKey` only for a Gateway credential, or omit it for the SDK's
`AI_GATEWAY_API_KEY` / Vercel OIDC authentication. No direct provider credential
is read. The only endpoint is `https://ai-gateway.vercel.sh/v4/ai` for the installed
SDK protocol. Model/provider availability and processing approval remain host
responsibilities; an adapter instance is not a successful qualification receipt.

**Residency boundary:** EU inference does not mean EU-only gateway transit.
[Vercel regional inference documentation](https://vercel.com/docs/ai-gateway/security-and-compliance/regional-inference)
states that the Gateway may process requests globally before forwarding to the
regional provider. Hosts must explicitly approve that boundary before sending
private content. Request controls follow Vercel's
[ZDR](https://vercel.com/docs/ai-gateway/security-and-compliance/zdr) and
[no-training](https://vercel.com/docs/ai-gateway/security-and-compliance/disallow-prompt-training)
documentation. Tests use synthetic content and mocked HTTP; they do not prove
live residency, commercial terms, model quality or provider availability.

Chat and final stream responses expose only a bounded routing projection at
`raw.providerMetadata.gateway.routing`: finalProvider, modelAttempts,
providerAttempts, and inferenceEndpoint slug/scope/geoRegion. Transport headers,
response bodies and unrelated provider metadata are discarded. Missing or malformed
metadata stays absent; global/non-EU endpoints are never rewritten as EU.
`readVercelGatewayRoutingMetadata` and its return type are re-exported from
`./impls/gateway-llm` for hosts to reuse. Hosts must verify the served provider and
resolved region against their pinned binding before accepting or persisting
intelligence; request options alone are insufficient. Streaming deltas are
provisional until final routing evidence has passed the host's acceptance check.


## Declared capabilities

### Integration Provider Llm

Capability ID: `package.lssm.tech.integration.provider.llm`

LLM provider implementations for ContractSpec.

Use cases:

- Adopt llm provider implementations for contractspec

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/integration.provider-llm package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "integration",
    "provider",
    "llm"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/integration.provider-llm",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.provider-llm/impls",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.provider-llm/impls/mistral-llm",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.provider-llm/llm",
    "symbols": []
  },
  {
    "from": "@lssm-tech/integration.provider-llm/impls/gateway-llm",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "integrations",
  "kind": "integration",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./impls",
    "./impls/mistral-llm",
    "./llm",
    "./impls/gateway-llm"
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.integration.provider.llm",
    "from": "@lssm-tech/integration.provider-llm",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.provider.llm",
    "from": "@lssm-tech/integration.provider-llm/impls",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.provider.llm",
    "from": "@lssm-tech/integration.provider-llm/impls/mistral-llm",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.provider.llm",
    "from": "@lssm-tech/integration.provider-llm/llm",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.integration.provider.llm",
    "from": "@lssm-tech/integration.provider-llm/impls/gateway-llm",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/integration.provider-llm` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/index.ts); verified source file.

- `@lssm-tech/integration.provider-llm/impls` — subpath `./impls`
  - `unconditional`: `./src/impls/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/impls/index.ts); verified source file.

- `@lssm-tech/integration.provider-llm/impls/gateway-llm` — subpath `./impls/gateway-llm`
  - `unconditional`: `./src/impls/gateway-llm.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/impls/gateway-llm.ts); verified source file.

- `@lssm-tech/integration.provider-llm/impls/gateway-llm-deadline` — subpath `./impls/gateway-llm-deadline`
  - `unconditional`: `./src/impls/gateway-llm-deadline.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/impls/gateway-llm-deadline.ts); verified source file.

- `@lssm-tech/integration.provider-llm/impls/gateway-llm-messages` — subpath `./impls/gateway-llm-messages`
  - `unconditional`: `./src/impls/gateway-llm-messages.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/impls/gateway-llm-messages.ts); verified source file.

- `@lssm-tech/integration.provider-llm/impls/mistral-llm` — subpath `./impls/mistral-llm`
  - `unconditional`: `./src/impls/mistral-llm.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/impls/mistral-llm.ts); verified source file.

- `@lssm-tech/integration.provider-llm/llm` — subpath `./llm`
  - `unconditional`: `./src/llm.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/provider-llm/src/llm.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "browser": "./dist/browser/index.js",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./impls": {
      "types": "./dist/impls/index.d.ts",
      "browser": "./dist/browser/impls/index.js",
      "bun": "./dist/impls/index.js",
      "node": "./dist/node/impls/index.js",
      "default": "./dist/impls/index.js"
    },
    "./impls/gateway-llm": {
      "types": "./dist/impls/gateway-llm.d.ts",
      "browser": "./dist/browser/impls/gateway-llm.js",
      "bun": "./dist/impls/gateway-llm.js",
      "node": "./dist/node/impls/gateway-llm.js",
      "default": "./dist/impls/gateway-llm.js"
    },
    "./impls/gateway-llm-deadline": {
      "types": "./dist/impls/gateway-llm-deadline.d.ts",
      "browser": "./dist/browser/impls/gateway-llm-deadline.js",
      "bun": "./dist/impls/gateway-llm-deadline.js",
      "node": "./dist/node/impls/gateway-llm-deadline.js",
      "default": "./dist/impls/gateway-llm-deadline.js"
    },
    "./impls/gateway-llm-messages": {
      "types": "./dist/impls/gateway-llm-messages.d.ts",
      "browser": "./dist/browser/impls/gateway-llm-messages.js",
      "bun": "./dist/impls/gateway-llm-messages.js",
      "node": "./dist/node/impls/gateway-llm-messages.js",
      "default": "./dist/impls/gateway-llm-messages.js"
    },
    "./impls/mistral-llm": {
      "types": "./dist/impls/mistral-llm.d.ts",
      "browser": "./dist/browser/impls/mistral-llm.js",
      "bun": "./dist/impls/mistral-llm.js",
      "node": "./dist/node/impls/mistral-llm.js",
      "default": "./dist/impls/mistral-llm.js"
    },
    "./llm": {
      "types": "./dist/llm.d.ts",
      "browser": "./dist/browser/llm.js",
      "bun": "./dist/llm.js",
      "node": "./dist/node/llm.js",
      "default": "./dist/llm.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/integration.runtime](https://lssm.co/docs/packages/integration.runtime/): `workspace:^`
- [@lssm-tech/lib.ai-providers](https://lssm.co/docs/packages/lib.ai-providers/): `workspace:^`
- [@lssm-tech/lib.contracts-integrations](https://lssm.co/docs/packages/lib.contracts-integrations/): `workspace:^`
- `@mistralai/mistralai`: `^2.7.0`
- `ai`: `catalog:ai`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@types/bun`: `catalog:types`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "dev": "contractspec-bun-build dev",
  "clean": "rimraf dist .turbo",
  "lint:check": "node ../../../scripts/biome.cjs check .",
  "lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
  "test": "bun test",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Integration Provider Llm documentation](https://www.npmjs.com/package/%40lssm-tech%2Fintegration.provider-llm) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fintegration.provider-llm",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/integration.provider-llm.txt",
  "route": "/llms/integration.provider-llm",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.provider-llm.txt",
  "blobSha": "bd073cb8b4b1e7363080951c2f5b3ad34efdb133",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
