Mosaic CLI Docs 中文

Configure

Provider, model, and profile setup

Mosaic uses an OpenAI-compatible provider contract. Use profiles to separate environments.

Default profile setup

export OPENAI_API_KEY=your_key
mosaic --project-state --profile default setup \
  --base-url https://api.openai.com \
  --api-key-env OPENAI_API_KEY \
  --model gpt-4o-mini

mosaic --project-state --profile default models list

Azure OpenAI profile setup

export AZURE_OPENAI_BASE_URL="https://.openai.azure.com/openai/v1"
export AZURE_OPENAI_API_KEY=""

mosaic --project-state --profile az-openai setup \
  --base-url "$AZURE_OPENAI_BASE_URL" \
  --api-key-env AZURE_OPENAI_API_KEY \
  --model gpt-4o-mini

mosaic --project-state --profile az-openai models list
Important: ensure Azure base URL ends with /openai/v1. Do not duplicate /v1.

Run commands with profile

mosaic --project-state --profile az-openai ask "hello"
mosaic --project-state --profile az-openai chat