Skip to content

feat: add kimi-k2:free model#81

Merged
fwang merged 1 commit into
anomalyco:devfrom
nick-galluzzo:feature/add-kimi-k2-free
Jul 27, 2025
Merged

feat: add kimi-k2:free model#81
fwang merged 1 commit into
anomalyco:devfrom
nick-galluzzo:feature/add-kimi-k2-free

Conversation

@nick-galluzzo

Copy link
Copy Markdown
Contributor

This PR adds the model definition for moonshotai/kimi-k2:free for OpenRouter. It was also mentioned in: anomalyco/opencode#1002.

@wienans

wienans commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

The problem with free models is that they not always support tool calls. Not all providers support them, see here: https://openrouter.ai/moonshotai/kimi-k2:free

additionally there are already pull requests for the free qwen coder and kimi k2.
I am not sure but I think they might not extend with more free models, as they are deprecated more often and updating the library is even more effort with all the free models.

@nick-galluzzo

Copy link
Copy Markdown
Contributor Author

@wienans Thanks for the feedback.

You mentioned tool use support. I might be looking in the wrong place, but the link you provided seems to indicate that tool use is supported for kimi-k2:free. I also confirmed this by filtering on the OpenRouter models page here: https://openrouter.ai/models?q=kimi%20k2&fmt=cards&supported_parameters=tools

I also tested this with the configuration in my PR and can confirm that tool calls are working as expected.

I understand the concern about maintenance overhead for free models. Do you know how frequently they tend to be deprecated? I believe adding the popular free-tier models is beneficial for the project as it lowers the barrier for new users (and users who stick to the free tiers) to start experimenting with the library.

Let me know your thoughts! Happy to close my PR due to the other kimi k2 PR.

@wienans

wienans commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

My concern was the provider specific options. The second provider (of 2) doesn’t have tool use enabled as far as I can see.

But at the end all our discussion doesn’t mean anything the decisions is on the maintainers. I am aligned with you that it would be beneficial with popular free models, and I don’t know how long providers provide them.

@fwang

fwang commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

Appreciate the discussion @nick-galluzzo @wienans!

Let's add the free models for now as it is beneficial the users. And with the help of the community, we'll keep it updated once they are deprecated.

@fwang
fwang merged commit ba5067a into anomalyco:dev Jul 27, 2025
1 check passed
@fwang

fwang commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Btw, in opencode, you can specify which provider for OpenRouter to route to. This is an example w/ Qwen3 coder

    "openrouter": {
      "models": {
        "qwen/qwen3-coder": {
          "name": "Qwen3 Coder (DeepInfra)",
          "options": {
            "provider": {
              "order": ["deepinfra/fp8"],
              "allow_fallbacks": false
            }
          }
        }
      }
    },

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.

3 participants