Skip to content

Providers

Luoshu supports multiple LLM providers through an OpenAI-compatible API interface. Each provider has a built-in preset that auto-fills endpoint and model defaults.

Built-in Presets

ProviderPreset NameLLM ModelEmbedding Model
OpenAIopenaigpt-4o-minitext-embedding-3-small
DeepSeekdeepseekdeepseek-chat
Moonshot (Kimi)moonshotmoonshot-v1-8k
Zhipu (GLM)zhipuglm-4-flashembedding-3
SiliconFlowsiliconflowQwen/Qwen2.5-7B-InstructBAAI/bge-m3
Volcengine (Doubao)volcenginedoubao-1-5-lite-32kdoubao-embedding-large
Customcustom(user-defined)(user-defined)

Use luoshu_provider_list to see the full details including endpoints and embedding dimensions.

Selecting a Provider

Set the provider preset to auto-fill defaults:

Tool: luoshu_config_set
Parameters:
  key: "llm.provider"
  value: "deepseek"

This automatically sets llm.endpoint and llm.model to the preset defaults. You can override individual fields afterward.

Setting API Keys

Tool: luoshu_config_set
Parameters:
  key: "llm.api_key"
  value: "sk-your-api-key"

A connection test runs automatically after setting an API key.

LLM vs Embedding

Luoshu uses two separate services:

ServicePurposeRequired For
LLMText generation (recall synthesis, memory extraction)luoshu_recall, memory_extract
EmbeddingVector embeddings (similarity search)memory_semantic_search, ov_search

You can use different providers for LLM and embedding. For example, use DeepSeek for LLM and OpenAI for embeddings.

Configuring Embedding Separately

Tool: luoshu_config_set
Parameters:
  key: "embedding.provider"
  value: "openai"
Tool: luoshu_config_set
Parameters:
  key: "embedding.api_key"
  value: "sk-your-openai-key"

Custom Provider

For providers not in the preset list, use the custom preset and set all fields manually:

Tool: luoshu_config_set
  key: "llm.provider", value: "custom"

Tool: luoshu_config_set
  key: "llm.endpoint", value: "https://your-api.example.com/v1"

Tool: luoshu_config_set
  key: "llm.model", value: "your-model-name"

Tool: luoshu_config_set
  key: "llm.api_key", value: "your-api-key"

Any OpenAI-compatible API endpoint works as a custom provider.

Environment Variables

Override config file values with environment variables:

VariableDescription
LUOSHU_LLM_API_KEYLLM service API key
LUOSHU_LLM_MODELLLM model name
LUOSHU_EMBEDDING_API_KEYEmbedding service API key
LUOSHU_EMBEDDING_MODELEmbedding model name

Environment variables take precedence over ~/.luoshu/config.json values.

Advanced Configuration

KeyTypeDefaultDescription
llm.max_tokensnumber(provider default)Maximum tokens for LLM responses
llm.temperaturenumber(provider default)LLM temperature setting
embedding.dimensionsnumber(provider default)Embedding vector dimensions
memory.auto_extractbooleantrueAuto-extract memories from conversations
memory.retention_daysnumber90Days to retain memories
memory.max_entriesnumber1000Maximum memory entries
memory.vector_search_top_knumber10Top-K results for vector search

Released under the MIT License.