Skip to content
Closed
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ We have an `acontext-cli` to help you do a quick proof-of-concept. Download it f
curl -fsSL https://install.acontext.io | sh
```

You should have [docker](https://www.docker.com/get-started/) installed and an OpenAI API Key to start an Acontext backend on your computer:
You should have [docker](https://www.docker.com/get-started/) installed and a MiniMax API Key to start an Acontext backend on your computer:

```bash
mkdir acontext_server && cd acontext_server
acontext server up
```

> Make sure your LLM has the ability to [call tools](https://platform.openai.com/docs/guides/function-calling). By default, Acontext will use `gpt-4.1`.
> Make sure your LLM has the ability to [call tools](https://platform.openai.com/docs/guides/function-calling). By default, Acontext will use MiniMax `MiniMax-M3` via `https://api.minimax.io/v1`.

`acontext server up` will create/use `.env` and `config.yaml` for Acontext, and create a `db` folder to persist data.

Expand Down
6 changes: 3 additions & 3 deletions charts/acontext/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ core:

env:
# LLM Configuration
LLM_BASE_URL: "" # Optional: Custom LLM base URL
LLM_SIMPLE_MODEL: "gpt-4.1" # Default LLM model
LLM_SDK: "openai" # LLM SDK: "openai" or "anthropic"
LLM_BASE_URL: "https://api.minimax.io/v1" # MiniMax OpenAI-compatible base URL
LLM_SIMPLE_MODEL: "MiniMax-M3" # Default LLM model
LLM_SDK: "minimax" # LLM SDK: "openai", "anthropic", or "minimax"

# S3 Configuration (AWS S3)
S3_ENDPOINT: "" # AWS S3 endpoint, e.g., https://s3.amazonaws.com or https://s3.us-east-1.amazonaws.com
Expand Down
19 changes: 9 additions & 10 deletions docs/content/docs/(guides)/settings/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Configure your acontext core services using these essential environment variable
### LLM Configuration

<ParamField path="LLM_API_KEY" type="string" required>
API key for your LLM provider (OpenAI or Anthropic). This is the primary authentication credential for AI model access.
API key for your LLM provider (OpenAI, Anthropic, or MiniMax). This is the primary authentication credential for AI model access.
</ParamField>

<ParamField path="LLM_BASE_URL" type="string" default="null">
Custom base URL for LLM API endpoints. Leave unset to use the provider's default endpoint.
</ParamField>

<ParamField path="LLM_SDK" type="string" default="openai">
LLM provider to use. Supported values: `openai`, `anthropic`
LLM provider to use. Supported values: `openai`, `anthropic`, `minimax`
</ParamField>

<ParamField path="LLM_SIMPLE_MODEL" type="string" default="gpt-4.1">
Default model identifier for LLM operations. Examples: `gpt-4`, `gpt-3.5-turbo`, `claude-3-sonnet`
Default model identifier for LLM operations. Examples: `MiniMax-M3`, `gpt-4`, `gpt-3.5-turbo`, `claude-3-sonnet`
</ParamField>

<ParamField path="LLM_RESPONSE_TIMEOUT" type="float" default="60">
Expand Down Expand Up @@ -62,13 +62,12 @@ Be careful when choosing your embedding model. Changing the embedding model afte
## `.env` Examples

<CodeGroup>
```bash title=".env"
# Required LLM Configuration
LLM_API_KEY=sk-your-openai-api-key-here

# Optional LLM Settings
LLM_SDK=openai
LLM_SIMPLE_MODEL=gpt-4
```bash title="MiniMax Setup"
# Using MiniMax-M3 through the OpenAI-compatible endpoint
LLM_API_KEY=your-minimax-api-key
LLM_BASE_URL=https://api.minimax.io/v1
LLM_SDK=minimax
LLM_SIMPLE_MODEL=MiniMax-M3
LLM_RESPONSE_TIMEOUT=60

# Embedding Configuration
Expand Down
7 changes: 4 additions & 3 deletions src/client/acontext-cli/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,10 @@ func runServerUp(cmd *cobra.Command, args []string) error {
if _, err := os.Stat(envFile); os.IsNotExist(err) {
envConfig := &docker.EnvConfig{
LLMConfig: &docker.LLMConfig{
APIKey: "your-api-key",
BaseURL: "https://api.openai.com/v1",
SDK: "openai",
APIKey: "your-minimax-api-key",
BaseURL: "https://api.minimax.io/v1",
SimpleModel: "MiniMax-M3",
SDK: "minimax",
},
RootAPIBearerToken: "your-root-api-bearer-token",
CoreConfigYAMLFile: "./config.yaml",
Expand Down
10 changes: 7 additions & 3 deletions src/client/acontext-cli/internal/docker/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func GenerateEnvFile(filePath string, config *EnvConfig) error {
# LLM Configuration
LLM_API_KEY={{.LLMAPIKey}}
LLM_BASE_URL={{.LLMBaseURL}}
LLM_SIMPLE_MODEL={{.LLMSimpleModel}}
LLM_SDK={{.LLMSDK}}

# API Bearer Token (for root API access)
Expand All @@ -36,12 +37,14 @@ CORE_CONFIG_YAML_FILE={{.CoreConfigYAMLFile}}
vars := struct {
LLMAPIKey string
LLMBaseURL string
LLMSimpleModel string
LLMSDK string
RootAPIBearerToken string
CoreConfigYAMLFile string
}{
LLMAPIKey: config.LLMConfig.APIKey,
LLMBaseURL: config.LLMConfig.BaseURL,
LLMSimpleModel: config.LLMConfig.SimpleModel,
LLMSDK: config.LLMConfig.SDK,
RootAPIBearerToken: config.RootAPIBearerToken,
CoreConfigYAMLFile: config.CoreConfigYAMLFile,
Expand Down Expand Up @@ -69,9 +72,10 @@ CORE_CONFIG_YAML_FILE={{.CoreConfigYAMLFile}}

// LLMConfig contains LLM configuration
type LLMConfig struct {
APIKey string
BaseURL string
SDK string
APIKey string
BaseURL string
SimpleModel string
SDK string
}

// EnvConfig contains all environment configuration
Expand Down
17 changes: 12 additions & 5 deletions src/client/acontext-cli/internal/docker/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ func TestGenerateEnvFile(t *testing.T) {
// Create mock env config for testing
envConfig := &EnvConfig{
LLMConfig: &LLMConfig{
APIKey: "test-api-key",
BaseURL: "https://api.example.com",
SDK: "openai",
APIKey: "test-api-key",
BaseURL: "https://api.example.com",
SimpleModel: "MiniMax-M3",
SDK: "minimax",
},
RootAPIBearerToken: "test-root-token",
}
Expand All @@ -63,19 +64,23 @@ func TestGenerateEnvFile(t *testing.T) {
// Check for required environment variables
assert.Contains(t, contentStr, "LLM_API_KEY=")
assert.Contains(t, contentStr, "LLM_BASE_URL=")
assert.Contains(t, contentStr, "LLM_SIMPLE_MODEL=")
assert.Contains(t, contentStr, "LLM_SDK=")
assert.Contains(t, contentStr, "ROOT_API_BEARER_TOKEN=")

// Verify config values are not empty
lines := strings.Split(contentStr, "\n")
var llmAPIKey, llmBaseURL, llmSDK, rootToken string
var llmAPIKey, llmBaseURL, llmSimpleModel, llmSDK, rootToken string
for _, line := range lines {
if strings.HasPrefix(line, "LLM_API_KEY=") {
llmAPIKey = strings.TrimPrefix(line, "LLM_API_KEY=")
}
if strings.HasPrefix(line, "LLM_BASE_URL=") {
llmBaseURL = strings.TrimPrefix(line, "LLM_BASE_URL=")
}
if strings.HasPrefix(line, "LLM_SIMPLE_MODEL=") {
llmSimpleModel = strings.TrimPrefix(line, "LLM_SIMPLE_MODEL=")
}
if strings.HasPrefix(line, "LLM_SDK=") {
llmSDK = strings.TrimPrefix(line, "LLM_SDK=")
}
Expand All @@ -85,11 +90,13 @@ func TestGenerateEnvFile(t *testing.T) {
}
assert.NotEmpty(t, llmAPIKey)
assert.NotEmpty(t, llmBaseURL)
assert.NotEmpty(t, llmSimpleModel)
assert.NotEmpty(t, llmSDK)
assert.NotEmpty(t, rootToken)
assert.Equal(t, "test-api-key", llmAPIKey)
assert.Equal(t, "https://api.example.com", llmBaseURL)
assert.Equal(t, "openai", llmSDK)
assert.Equal(t, "MiniMax-M3", llmSimpleModel)
assert.Equal(t, "minimax", llmSDK)
assert.Equal(t, "test-root-token", rootToken)
}
})
Expand Down
8 changes: 4 additions & 4 deletions src/server/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LLM_API_KEY="YOUR OPENAI API KEY"
LLM_BASE_URL=""
LLM_SIMPLE_MODEL="gpt-4.1"
LLM_SDK="openai"
LLM_API_KEY="YOUR-MINIMAX-KEY"
LLM_BASE_URL="https://api.minimax.io/v1"
LLM_SIMPLE_MODEL="MiniMax-M3"
LLM_SDK="minimax"
5 changes: 4 additions & 1 deletion src/server/core/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
LLM_API_KEY="YOUR-OPENAI-KEY"
LLM_API_KEY="YOUR MINIMAX API KEY"
LLM_BASE_URL="https://api.minimax.io/v1"
LLM_SIMPLE_MODEL="MiniMax-M3"
LLM_SDK="minimax"
3 changes: 2 additions & 1 deletion src/server/core/acontext_core/llm/complete/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
FACTORIES: Mapping[str, COMPLETE_FUNC] = {
"openai": openai_complete,
"anthropic": anthropic_complete,
"minimax": openai_complete,
"mock": mock_complete,
}

Expand Down Expand Up @@ -61,7 +62,7 @@ async def llm_sanity_check():


def response_to_sendable_message(message: LLMResponse) -> dict:
if DEFAULT_CORE_CONFIG.llm_sdk == "openai":
if DEFAULT_CORE_CONFIG.llm_sdk in ("openai", "minimax"):
return message.raw_response.choices[0].message.model_dump()
elif DEFAULT_CORE_CONFIG.llm_sdk == "anthropic":
dp = {"role": message.role, "content": []}
Expand Down
2 changes: 1 addition & 1 deletion src/server/core/acontext_core/schema/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CoreConfig(BaseModel):
llm_openai_default_header: Optional[Mapping[str, Any]] = None
llm_openai_completion_kwargs: Mapping[str, Any] = {}
llm_response_timeout: float = 60
llm_sdk: Literal["openai", "anthropic", "mock"] = "openai"
llm_sdk: Literal["openai", "anthropic", "minimax", "mock"] = "openai"

llm_simple_model: str = "gpt-4.1"

Expand Down
5 changes: 4 additions & 1 deletion src/server/core/config.yaml.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
llm_api_key: YOUR-OPENAI-KEY
llm_api_key: YOUR-MINIMAX-KEY
llm_base_url: https://api.minimax.io/v1
llm_simple_model: MiniMax-M3
llm_sdk: minimax