Skip to content

feat(providers): add Moonshot AI (Kimi) hosted provider - #18

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/kimi-provider
Jul 17, 2026
Merged

feat(providers): add Moonshot AI (Kimi) hosted provider#18
TMHSDigital merged 1 commit into
mainfrom
feat/kimi-provider

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

  • Adds moonshot as the first hosted, OpenAI-compatible provider adapter behind the existing Provider interface, following the Ollama/LM Studio pattern exactly (per-provider chat shapes duplicated; no shared base class, no dynamic registry, no Zod enum centralization).
  • Auth: Authorization: Bearer $MOONSHOT_API_KEY, resolved from the environment with a clear error when absent. The provider is not detected without a key. Host override via MOONSHOT_HOST (default https://api.moonshot.ai/v1).
  • Capabilities: complete and listModels/modelInfo/health only. Lifecycle (pull/remove/load/unload) and embed throw as unsupported for the hosted API.
  • Docs: README repositioned as local-first with optional hosted providers; Moonshot adapter row + env table entries; new .env.example (placeholders only); CHANGELOG entry; version bumped 0.1.2 -> 0.2.0 (minor, per feat: convention). STANDARDS_VERSION untouched.

Proven by live run

  • Full offline vitest suite green: 44 tests, 8 files, exit 0 (npm test), plus npm run build and npm run typecheck clean.
  • Failure gate demonstrated: intentionally broke the complete success assertion in src/__tests__/moonshot.test.ts, ran npm test, confirmed the suite failed (1 failed / 43 passed, exit 1), restored the assertion, and confirmed the suite returned to green (44 passed, exit 0).
  • No live network calls in tests: all HTTP is mocked via vi.stubGlobal("fetch", ...), matching the existing adapter test pattern.

Established by inspection only (not live-tested)

Release note

This PR does not publish to npm. Tagging/release is a separate, explicit decision after merge.

First hosted, OpenAI-compatible provider behind the existing Provider
interface, validating the abstraction beyond local runtimes. Bearer auth
via MOONSHOT_API_KEY with a clear error when absent; MOONSHOT_HOST
override (default https://api.moonshot.ai/v1). Lifecycle ops and embed
are intentionally unsupported for the hosted API.

Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@TMHSDigital
TMHSDigital merged commit 2b32417 into main Jul 17, 2026
6 checks passed
@TMHSDigital
TMHSDigital deleted the feat/kimi-provider branch July 17, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant