Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const (
ProviderOpenAI = "openai"
ProviderOllama = "ollama"
ProviderAnthropic = "anthropic"
ProviderKimi = "kimi"
)

// Observability Providers
Expand Down Expand Up @@ -289,6 +290,14 @@ func (c *Config) applyLLMDefaults() {
Temperature: 0.7,
}
}

if _, exists := c.LLM.Providers[ProviderKimi]; !exists {
c.LLM.Providers[ProviderKimi] = LLMProviderConfig{
Model: "kimi-k2.5",
BaseURL: "https://api.moonshot.cn/v1",
Temperature: 1,
}
}
}

// applyRAGDefaults sets default RAG provider and configurations
Expand Down Expand Up @@ -490,6 +499,20 @@ func (c *Config) ApplyEnvironmentVariables() {
}
c.LLM.Providers[ProviderOllama] = ollamaConfig
}

// Kimi (Moonshot AI) configuration
if kimiConfig, exists := c.LLM.Providers[ProviderKimi]; exists {
if apiKey := os.Getenv("KIMI_API_KEY"); apiKey != "" {
kimiConfig.APIKey = apiKey
}
if model := os.Getenv("KIMI_MODEL"); model != "" {
kimiConfig.Model = model
}
if baseURL := os.Getenv("KIMI_BASE_URL"); baseURL != "" {
kimiConfig.BaseURL = baseURL
}
c.LLM.Providers[ProviderKimi] = kimiConfig
}
// Observability overrides
if enabled := os.Getenv("OBSERVABILITY_ENABLED"); enabled != "" {
if val, err := strconv.ParseBool(enabled); err == nil {
Expand Down
4 changes: 4 additions & 0 deletions internal/config/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func (c *Config) ValidateAfterDefaults() error {
if providerConfig.APIKey == "" || strings.HasPrefix(providerConfig.APIKey, "${") {
return fmt.Errorf("ANTHROPIC_API_KEY environment variable not set")
}
case ProviderKimi:
if providerConfig.APIKey == "" || strings.HasPrefix(providerConfig.APIKey, "${") {
return fmt.Errorf("KIMI_API_KEY environment variable not set")
}
}

// Validate observability configuration
Expand Down
1 change: 1 addition & 0 deletions internal/llm/langchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
RegisterLangChainModelFactory(ProviderTypeOpenAI, &OpenAIModelFactory{})
RegisterLangChainModelFactory(ProviderTypeOllama, &OllamaModelFactory{})
RegisterLangChainModelFactory(ProviderTypeAnthropic, &AnthropicModelFactory{})
RegisterLangChainModelFactory(ProviderTypeKimi, &OpenAIModelFactory{})
}

// RegisterLangChainModelFactory registers a new model factory for the given provider type
Expand Down
1 change: 1 addition & 0 deletions internal/llm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
ProviderTypeOpenAI = "openai"
ProviderTypeOllama = "ollama"
ProviderTypeAnthropic = "anthropic"
ProviderTypeKimi = "kimi"
ProviderNameLangChain = "langchain"
DefaultLLMGatewayProvider = ProviderNameLangChain
)
Expand Down
5 changes: 4 additions & 1 deletion schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"properties": {
"provider": {
"type": "string",
"enum": ["openai", "anthropic", "ollama"],
"enum": ["openai", "anthropic", "ollama", "kimi"],
"default": "openai",
"description": "Primary LLM provider to use"
},
Expand Down Expand Up @@ -71,6 +71,9 @@
},
"ollama": {
"$ref": "#/$defs/llm_provider"
},
"kimi": {
"$ref": "#/$defs/llm_provider"
}
},
"additionalProperties": false
Expand Down
Loading