NodeLlamaCppConfig
Defined in: native-node-llamacpp/src/index.ts:55
Extends
Section titled “Extends”Partial<BackendAdapterConfig>
Properties
Section titled “Properties”apiKey?
Section titled “apiKey?”
readonlyoptionalapiKey:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:103
API key for authentication. Should be injected from environment or secure config.
Inherited from
Section titled “Inherited from”Partial.apiKey
baseURL?
Section titled “baseURL?”
readonlyoptionalbaseURL:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:108
Base URL for API endpoint. Useful for proxies or alternative endpoints.
Inherited from
Section titled “Inherited from”Partial.baseURL
batchSize?
Section titled “batchSize?”
optionalbatchSize:number
Defined in: native-node-llamacpp/src/index.ts:69
Batch size for prompt processing. Default: 512
browserMode?
Section titled “browserMode?”
readonlyoptionalbrowserMode:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:155
Enable browser-compatible mode.
⚠️ SECURITY WARNING: Enabling browser mode may expose API keys in client-side code. This option should ONLY be used for development and testing. Production applications should always use proxy servers to protect API keys.
Each provider implements browser compatibility differently:
- Anthropic: Adds
anthropic-dangerous-direct-browser-access: trueheader - Gemini: Already browser-compatible (API key in URL), this flag has no effect
- OpenAI: Already browser-compatible, this flag has no effect
- Other providers: May have provider-specific implementations
Default
Section titled “Default”falseExample
Section titled “Example”// Development only - DO NOT use in production!const backend = new AnthropicBackendAdapter({ apiKey: process.env.ANTHROPIC_API_KEY, browserMode: true // ⚠️ Exposes API key in browser});Inherited from
Section titled “Inherited from”Partial.browserMode
cacheModels?
Section titled “cacheModels?”
readonlyoptionalcacheModels:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:181
Enable model list caching.
Default
Section titled “Default”trueInherited from
Section titled “Inherited from”Partial.cacheModels
contextSize?
Section titled “contextSize?”
optionalcontextSize:number
Defined in: native-node-llamacpp/src/index.ts:59
Context window size. Default: 2048
custom?
Section titled “custom?”
readonlyoptionalcustom:Record<string,unknown>
Defined in: ai.matey.types/dist/types/adapters.d.ts:131
Provider-specific configuration options.
Inherited from
Section titled “Inherited from”Partial.custom
debug?
Section titled “debug?”
readonlyoptionaldebug:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:123
Enable debug logging.
Default
Section titled “Default”falseInherited from
Section titled “Inherited from”Partial.debug
defaultModel?
Section titled “defaultModel?”
readonlyoptionaldefaultModel:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:162
Default model to use when no model is specified in the request. This provides a fallback model for requests that don’t specify one.
Example
Section titled “Example”'gpt-4o' for OpenAI, 'claude-3-5-sonnet-20241022' for AnthropicInherited from
Section titled “Inherited from”Partial.defaultModel
gpuLayers?
Section titled “gpuLayers?”
optionalgpuLayers:number
Defined in: native-node-llamacpp/src/index.ts:61
Number of layers to offload to GPU. 0 = CPU only. Default: 0
headers?
Section titled “headers?”
readonlyoptionalheaders:Record<string,string>
Defined in: ai.matey.types/dist/types/adapters.d.ts:127
Custom HTTP headers to include in requests.
Inherited from
Section titled “Inherited from”Partial.headers
maxRetries?
Section titled “maxRetries?”
readonlyoptionalmaxRetries:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:118
Maximum number of retries for transient failures.
Default
Section titled “Default”0Inherited from
Section titled “Inherited from”Partial.maxRetries
modelPath
Section titled “modelPath”modelPath:
string
Defined in: native-node-llamacpp/src/index.ts:57
Path to the GGUF model file. Can be relative (resolved from cwd) or absolute.
models?
Section titled “models?”
readonlyoptionalmodels: readonly (string|AIModel)[]
Defined in: ai.matey.types/dist/types/adapters.d.ts:171
Static model list (used when provider doesn’t have listing endpoint or to override remote list).
Can be either:
- Array of model IDs (strings) - will be normalized to AIModel objects
- Array of full AIModel objects with capabilities
Inherited from
Section titled “Inherited from”Partial.models
modelsCacheScope?
Section titled “modelsCacheScope?”
readonlyoptionalmodelsCacheScope:"global"|"instance"
Defined in: ai.matey.types/dist/types/adapters.d.ts:193
Cache scope strategy.
- ‘global’: Share cache across all adapter instances (default)
- ‘instance’: Each adapter instance has its own cache
Default
Section titled “Default”'global'Inherited from
Section titled “Inherited from”Partial.modelsCacheScope
modelsCacheTTL?
Section titled “modelsCacheTTL?”
readonlyoptionalmodelsCacheTTL:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:186
Cache TTL in milliseconds.
Default
Section titled “Default”3600000 (1 hour)Inherited from
Section titled “Inherited from”Partial.modelsCacheTTL
modelsEndpoint?
Section titled “modelsEndpoint?”
readonlyoptionalmodelsEndpoint:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:176
URL endpoint for fetching models (overrides default). Used for custom model endpoints or proxies.
Inherited from
Section titled “Inherited from”Partial.modelsEndpoint
streaming?
Section titled “streaming?”
readonlyoptionalstreaming:StreamingConfig
Defined in: ai.matey.types/dist/types/adapters.d.ts:204
Streaming configuration for this backend.
Controls how streaming responses are delivered:
- mode: ‘delta’ (incremental only) or ‘accumulated’ (full text each chunk)
- includeBoth: Whether to provide both delta and accumulated in chunks
- bufferStrategy: How to buffer for accumulated mode
Default
Section titled “Default”{ mode: 'delta', includeBoth: false, bufferStrategy: 'memory' }Inherited from
Section titled “Inherited from”Partial.streaming
temperature?
Section titled “temperature?”
optionaltemperature:number
Defined in: native-node-llamacpp/src/index.ts:63
Sampling temperature. Default: 0.7
threads?
Section titled “threads?”
optionalthreads:number
Defined in: native-node-llamacpp/src/index.ts:71
Number of CPU threads to use. Defaults to optimal value.
timeout?
Section titled “timeout?”
readonlyoptionaltimeout:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:113
Request timeout in milliseconds.
Default
Section titled “Default”30000Inherited from
Section titled “Inherited from”Partial.timeout
optionaltopK:number
Defined in: native-node-llamacpp/src/index.ts:67
Top-k sampling. Default: 40
optionaltopP:number
Defined in: native-node-llamacpp/src/index.ts:65
Top-p sampling. Default: 0.9