# Moonshot/Kimi provider template for dsh's generic adapter (llm-pi-ai).
# Paste into $DSH_HOME/settings.yaml (top level). Verified live 2026-08-16:
# kimi-k2.7-code accepted an image and answered a content question about it
# when declared input: [text, image].
#
# The API key: `apiKeyEnv` is a CREDENTIAL REFERENCE, resolved through dsh's
# credential layers — inherited environment > $DSH_HOME/.credentials.yaml >
# <cwd>/.env > $DSH_HOME/.env. dsh does NOT read arbitrary file paths, so
# export MOONSHOT_API_KEY in the environment dsh launches from (a shell
# profile read by non-interactive shells, e.g. ~/.zshenv), or store it via
# the web UI's Models page.
#
# CAUTION: hand-editing settings.yaml while a `dsh web` instance is running
# loses races against its settings flushes — edit via the web UI, or stop
# the instance first.

llm-pi-ai:
  providers:
    moonshot:
      displayName: Moonshot Kimi
      api: openai-completions
      baseURL: https://api.moonshot.cn/v1
      apiKeyEnv: MOONSHOT_API_KEY
      models:
        - id: kimi-k2.7-code
          name: Kimi K2.7 Code
          contextWindow: 131072
          maxTokens: 8192
          # [text] → mp_screenshot degrades honestly (geometry table + note).
          # [text, image] → mp_screenshot attaches the real PNG.
          input: [text, image]
