Prompt Chain

Generate code using Moonshot AI provider integration

Integrate Moonshot AI provider into promptfoo for testing and evaluating code generation prompts.

Works with moonshotpromptfoo

54
Spark score
out of 100
Updated yesterday
Version code-scan-action-0.1

Add to Favorites

Why it matters

Test and validate AI code generation capabilities by integrating the Moonshot AI provider into your promptfoo evaluation workflow.

Outcomes

What it gets done

01

Configure Moonshot AI provider connection in promptfoo

02

Run code generation prompts through Moonshot models

03

Evaluate Moonshot provider responses against test cases

04

Compare Moonshot output quality with other AI providers

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-provider-moonshot | bash

Capabilities

What this chain does

Generate code

Writes source code or scripts from a description.

Overview

Provider Moonshot

What it does

This is a working example from the promptfoo repository that shows how to configure the Moonshot AI provider within promptfoo's testing framework. It provides the necessary setup files and configuration to run prompt evaluations using Moonshot's API.

How it connects

Use this example when you want to integrate Moonshot AI as a provider in your promptfoo testing workflow, or when you need a reference implementation for configuring provider-specific prompt evaluations.

Source README

provider-moonshot (Moonshot AI / Kimi)

You can run this example with:

npx promptfoo@latest init --example provider-moonshot
cd provider-moonshot

Usage

Set your MOONSHOT_API_KEY environment variable. You can get a key from the Kimi (Moonshot) platform.

Then run:

promptfoo eval

View the results with promptfoo view.

What this shows

  • Two Moonshot model families compared on a short summarisation task, both on a single MOONSHOT_API_KEY:
    • kimi-k2.6 - Moonshot's flagship Kimi K2 thinking model. It reasons before answering; showThinking: false keeps that reasoning out of the graded output.
    • moonshot-v1-8k - a generation model with a configurable temperature.
  • Plain icontains / icontains-any assertions, so the example runs with nothing but a MOONSHOT_API_KEY (Moonshot does not expose an embeddings endpoint).

Kimi K2 (kimi-k2.x) models pin temperature and the other sampling params to fixed values, so leave them unset - the provider handles that for you. Model names rotate over time; if one 404s, pick a current id from the Kimi model list.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.