UNPKG

socraticode

Version:

SocratiCode — MCP server for local codebase indexing, semantic search, and code dependency graphs. All private, all local via Docker.

34 lines • 1.76 kB
/** * LM Studio embedding provider. * * LM Studio's Local Server exposes an OpenAI-compatible /v1/embeddings endpoint, * so we reuse the OpenAI SDK with a custom baseURL. This provider is intentionally * separate from `provider-openai.ts` because: * - LM Studio runs locally with no auth by default; OpenAI is cloud-only and requires a key. * - LM Studio models have no Matryoshka support, so we never send a `dimensions` parameter. * - Health check messaging, defaults, and error guidance differ meaningfully. * * Required env when using this provider: * EMBEDDING_PROVIDER=lmstudio * EMBEDDING_MODEL=<model-id-from-LM-Studio-Local-Server-tab> * EMBEDDING_DIMENSIONS=<dim-of-loaded-model> * * Optional env: * LMSTUDIO_URL=http://localhost:1234/v1 (default) * LMSTUDIO_API_KEY=<key> (only if you've enabled API key auth in LM Studio) * EMBEDDING_CONTEXT_LENGTH=<tokens> (defaults to 2048 if model unknown) * LMSTUDIO_ALLOW_MISSING_MODEL_LISTING=true (accept servers without /v1/models, e.g. TEI; * resolved in embedding-config.ts) */ import type { EmbeddingHealthStatus, EmbeddingProvider, EmbeddingReadinessResult } from "./embedding-types.js"; /** Reset client (for testing or LMSTUDIO_URL hot-swap). */ export declare function resetLMStudioClient(): void; export declare class LMStudioEmbeddingProvider implements EmbeddingProvider { readonly name = "lmstudio"; ensureReady(): Promise<EmbeddingReadinessResult>; embed(texts: string[]): Promise<number[][]>; embedSingle(text: string): Promise<number[]>; healthCheck(): Promise<EmbeddingHealthStatus>; private _embedBatch; } //# sourceMappingURL=provider-lmstudio.d.ts.map