AgentSkillsCN

sparkgen-config

切换LLM提供商、部署模式,并管理环境配置。

SKILL.md
--- frontmatter
name: sparkgen-config
description: Switch LLM providers, deployment modes, and manage environment configuration
user_invokable: true
auto_invokable: true
auto_invoke_hint: Invoke when the user discusses providers, models, deployment modes, or environment variables
arguments: "<switch-provider|switch-mode|show|env> [args]"

SparkGen Config

Manage project configuration — providers, deployment modes, and environment files.

Dynamic Context

Before any action:

  1. Read current .env (if exists) for DEPLOYMENT_MODE, LLM_PROVIDER, MODEL_ID
  2. List available env files: ls .env.*
  3. Read config/ai_workflow.yaml for current LLM and embedding config

Actions

Show Config (/sparkgen-config show)

Display current configuration:

code
=== Current Configuration ===
Deployment Mode:    <from .env or 'not set'>
LLM Provider:      <provider>
LLM Model:         <model_id>
Embed Provider:    <embed_provider>
Embed Model:       <embed_model>
RAG Enabled:       <yes/no>
Guardrails:        <yes/no>
API Key:           <masked>
Server Port:       <port>

Switch Provider (/sparkgen-config switch-provider <bedrock|ollama|openai>)

To Ollama:

  1. Update .env: LLM_PROVIDER=ollama, OLLAMA_MODEL=llama3.2:3b, OLLAMA_BASE_URL=http://localhost:11434
  2. Check Ollama is running: curl -sf http://localhost:11434/api/tags
  3. Check model is pulled: ollama list | grep <model>
  4. Update EMBEDDING_PROVIDER=sentence-transformer

To Bedrock:

  1. Update .env: LLM_PROVIDER=bedrock, AWS_MODEL_ID=eu.amazon.nova-lite-v1:0
  2. Check AWS credentials: aws sts get-caller-identity
  3. Update EMBEDDING_PROVIDER=bedrock, AWS_EMBED_MODEL_ID=amazon.titan-embed-text-v2:0

To OpenAI:

  1. Update .env: LLM_PROVIDER=openai, OPENAI_MODEL=gpt-4o-mini
  2. Check OPENAI_API_KEY is set
  3. Update EMBEDDING_PROVIDER=openai

After switch: remind user to restart the server.

Switch Mode (/sparkgen-config switch-mode <local|docker|aws>)

  1. Copy the appropriate env file: cp .env.<mode> .env
  2. Show what changed (diff the key variables)
  3. Remind user of prerequisites for the mode:
    • local: Ollama running + model pulled
    • docker: Docker running
    • aws: AWS credentials configured

Environment (/sparkgen-config env)

Show all environment variables from current .env with descriptions, grouped by section:

  • Deployment settings
  • LLM provider settings
  • Embedding settings
  • Storage settings
  • RAG settings
  • Security settings