一键导入
add-model
Add a new AI model to a provider (anthropic, openai, groq, cerebras). Use when a new model is announced and needs to be supported in aico.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new AI model to a provider (anthropic, openai, groq, cerebras). Use when a new model is announced and needs to be supported in aico.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | add-model |
| description | Add a new AI model to a provider (anthropic, openai, groq, cerebras). Use when a new model is announced and needs to be supported in aico. |
| argument-hint | [provider:model-id] |
Add a new AI model to the aico codebase.
$ARGUMENTS should be in the format provider:model-id (e.g. anthropic:claude-opus-4-6).
If only a model ID is given, infer the provider from the model name prefix:
claude-* → anthropicgpt-*, o1*, o3*, o4* → openaillama*, mixtral* → groqqwen* → cerebrasBefore writing any code, gather the following from the user or from provided reference URLs:
claude-opus-4-6, gpt-4.1)If the user provides a reference URL, fetch it to extract this information. Otherwise, search the web for the latest model information from the provider's official documentation.
Before creating any file, read at least one existing model file in the same provider directory to understand the exact current pattern. The patterns described below are guidelines — always match the actual code.
Provider directories:
internal/providers/anthropic/internal/providers/openai/internal/providers/groq/internal/providers/cerebras/Create a new file at internal/providers/<provider>/<model_file_name>.go.
File naming convention — replace hyphens and dots with underscores, drop suffixes like -versatile or -instant for brevity:
claude-opus-4-6 → claude_opus_4_6.gogpt-4.1 → gpt4_1.gogpt-4.1-mini → gpt4_1_mini.goo3 → o3.gollama-3.3-70b-versatile → llama3_3_70b.goAll models must:
var _ assistant.GenerativeModel = (*TypeName)(nil)assistant.GenerativeModel:
Provider() stringName() stringDescription() stringSetSystemInstruction(...*assistant.TextContent)GenerateContent(ctx, ...Message) (*GenerateContentResponse, error)GenerateContentStream(ctx, ...Message) (iter.Seq2[*GenerateContentResponse, error], error)Provider-specific patterns:
internal/providers/anthropic/)- Import: anthropic "github.com/anthropics/anthropic-sdk-go", anthropicopt "github.com/anthropics/anthropic-sdk-go/option"
- Define: const ModelNameXxx = "model-id"
- Struct fields: client *anthropic.Client, opts []anthropicopt.RequestOption
- Constructor: takes *anthropic.Client (NOT apiKey)
- GenerateContent: buildRequestBody() → m.client.Messages.New()
- GenerateContentStream: buildRequestBody() → m.client.Messages.NewStreaming()
Template: claude_opus_4_6.go
internal/providers/openai/)- Struct fields: systemInstruction []*assistant.TextContent, client *APIClient
- Constructor: takes apiKey string → NewAPIClient(apiKey)
- GenerateContent: BuildChatRequest() → m.client.DoPost(ctx, endpoint, req, resp)
- GenerateContentStream: BuildChatRequest() → m.client.DoStream(ctx, endpoint, req)
- Also implements SetHttpClient(c *http.Client) (not part of interface, but required for this provider)
Template: gpt4_1.go
- Import: "micheam.com/aico/internal/providers/openai"
- Struct fields: systemInstruction []*assistant.TextContent, client *openai.APIClient
- Constructor: takes apiKey string → openai.NewAPIClient(apiKey)
- GenerateContent: delegates to openai.GenerateContent(ctx, m.client, Endpoint, m.Name(), ...)
- GenerateContentStream: delegates to openai.GenerateContentStream(ctx, m.client, Endpoint, m.Name(), ...)
- Uses the provider's Endpoint constant (defined in the provider main file)
Template: llama3_3_70b.go (groq) or gpt_oss_120b.go (cerebras)
Edit the provider's main file (e.g. anthropic.go, chat.go for openai, groq.go, cerebras.go).
Update all three registration points:
AvailableModels() — add the new model struct to the returned sliceselectModel() — add a case for the model ID stringNewGenerativeModel() — add a case for the model ID with the constructor callPlace the new model at the top of each list/switch (latest model first).
Note:
cmd/aico/models.godoes NOT need changes. It aggregates models from all providers automatically via each provider'sAvailableModels()function.
Update the documentation comment block at the top of the provider file to include the new model's description, capabilities, and pricing.
If the user requests deprecating an older model:
Description() return with [Deprecated] <Model Name> - superseded by <New Model>.(Deprecated) suffixmake test
This runs go vet ./... and go test -tags e2e ./....
Run and show the user the output of:
go run ./cmd/aico models
go run ./cmd/aico models describe <new-model-id>
If a predecessor was deprecated, also show:
go run ./cmd/aico models describe <deprecated-model-id>
Follow the Conventional Commits format:
feat(api): add <Model Name> support
If a predecessor was deprecated:
feat(api): add <Model Name> support and deprecate <Old Model>