feat(providers): add Moonshot AI (Kimi) hosted provider - #18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
moonshotas the first hosted, OpenAI-compatible provider adapter behind the existingProviderinterface, following the Ollama/LM Studio pattern exactly (per-provider chat shapes duplicated; no shared base class, no dynamic registry, no Zod enum centralization).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 viaMOONSHOT_HOST(defaulthttps://api.moonshot.ai/v1).completeandlistModels/modelInfo/healthonly. Lifecycle (pull/remove/load/unload) andembedthrow as unsupported for the hosted API..env.example(placeholders only); CHANGELOG entry; version bumped 0.1.2 -> 0.2.0 (minor, perfeat:convention). STANDARDS_VERSION untouched.Proven by live run
npm test), plusnpm run buildandnpm run typecheckclean.completesuccess assertion insrc/__tests__/moonshot.test.ts, rannpm 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).vi.stubGlobal("fetch", ...), matching the existing adapter test pattern.Established by inspection only (not live-tested)
https://api.moonshot.ai/v1and Bearer auth: https://platform.moonshot.ai/docs/api/chatkimi-k3(the default in Moonshot's own API examples): same pageGET /v1/modelslist shape: https://platform.moonshot.ai/docs/api/list-modelsRelease note
This PR does not publish to npm. Tagging/release is a separate, explicit decision after merge.