pr-agent icon indicating copy to clipboard operation
pr-agent copied to clipboard

need a model of KIMI k2 also

Open manku211 opened this issue 5 months ago • 4 comments

Feature request

add feature for KIMIK2 https://github.com/MoonshotAI/Kimi-K2

Motivation

Need to use for the personal project

manku211 avatar Jul 17 '25 08:07 manku211

:bulb: Auto-generated documentation-based answer:

The feature request is asking for support of the KIMI K2 model from MoonshotAI. Currently, this specific model is not mentioned in the documentation as a supported model.

However, PR-Agent/Qodo Merge supports a wide variety of models through LiteLLM. To add support for a new model like KIMI K2, you would need to:

  1. Check if the model is supported by LiteLLM (the underlying library used by PR-Agent)
  2. If supported, configure it as a custom model using the custom model configuration options
  3. Set the appropriate environment variables as required by LiteLLM for that specific model

For custom models, you can configure them by:

  • Setting model="custom_model_name" in your configuration
  • Setting custom_model_max_tokens for the model's token limit
  • Adding the required environment variables as specified in the LiteLLM documentation

You should check the LiteLLM documentation at https://litellm.vercel.app/docs/proxy/quick_start#supported-llms to see if KIMI K2 is supported and what environment variables are needed.

Relevant Sources:

  • https://qodo-merge-docs.qodo.ai//usage-guide/changing_a_model#custom-models
  • https://qodo-merge-docs.qodo.ai//usage-guide/changing_a_model#changing-a-model-in-pr-agent

@manku211 I find a solution set env

OPENAI__API_BASE=<moonshot-api>
OPENAI__KEY=sk-...  

update config in configuration.toml

model = "openai/kimi-k2-0711-preview"
custom_model_max_tokens=128000  

All right !

lqd1434 avatar Jul 18 '25 03:07 lqd1434

hey @lqd1434 @mrT23 I want to use with docker command for model also with env something like this

docker run --rm -it \
  -e OPENAI__KEY=sk-XXXX \
  -e OPENAI__API_BASE=<moonshot-api> \
  -e CONFIG__MODEL=openai/kimi-k2-0711-preview \
  -e GITHUB__USER_TOKEN=XXXX \
  codiumai/pr-agent:latest \
  --pr_url XXXXX

or do I need to run manually with python command for changing configuration.toml file for changing any model

manku211 avatar Jul 18 '25 04:07 manku211

As far as I see, Qodo CLI has added Kimi-k2 support in latest update.

  • gpt-4.1
  • gpt-4o
  • o3
  • o4-mini
  • claude-4-sonnet
  • claude-4-opus
  • gemini-2.5-pro
  • grok-4
  • kimi-k2

gs14n avatar Jul 20 '25 12:07 gs14n