LM Studio Embeddings
Generate embeddings using locally-hosted LM Studio
Overview
LM Studio provides a user-friendly interface for running embedding models locally.
Quick Start
from praisonaiagents import embedding
result = embedding(
input="Hello world",
model="lm_studio/nomic-embed-text",
api_base="http://localhost:1234/v1"
)
print(f"Dimensions: {len(result.embeddings[0])}")CLI Usage
praisonai embed "Hello world" --model lm_studio/nomic-embed-textSetup
- Download and install LM Studio from https://lmstudio.ai
- Load an embedding model
- Start the local server
export LM_STUDIO_API_BASE="http://localhost:1234/v1"