Skip to content

Repository files navigation

opencode-free-models

A project that provides two ways to resolve free models for OpenCode:

  1. OpenCode Plugin - Dynamically fetches free models within OpenCode
  2. GitHub Action - Resolves free models for CI/CD pipelines

Quick Start

For OpenCode Plugin

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
      "git@github.com:0xLLLLH/opencode-free-models.git"
  ]
}

For GitHub Action

- uses: 0xLLLLH/opencode-free-models@main

Choose Your Method

Key Difference: GitHub Actions cannot use OpenCode plugins.

Feature OpenCode Plugin GitHub Action
Environment OpenCode GitHub Actions
Configuration OpenCode config file YAML inputs
Dynamic resolution Yes Yes
Fallback support Yes Yes

When to Use Each Method

  • Use Plugin: When working within OpenCode environment
  • Use GitHub Action: When in CI/CD pipelines or need model resolution outside OpenCode

Installation

OpenCode Plugin

  1. Install via OpenCode plugin system
  2. Add to your OpenCode configuration

GitHub Action

  1. Add to your GitHub Actions workflow
  2. Configure input parameters

Configuration Options

OpenCode Plugin Options

  • alias: Custom alias for free models (default: "free-models")
  • providers: List of providers to check (default: ["opencode"])
  • fallbackModel: Fallback model when no free models available
  • pick: How to pick from free models — "first" (default) or "random"

GitHub Action Inputs

  • providers: Comma-separated provider list (default: "opencode")
  • fallback: Fallback model ID (default: "openrouter/free")
  • pick: How to pick from free models — "first" (default) or "random"

GitHub Action Outputs

  • model_id: Resolved model ID

Usage Examples

OpenCode Plugin Example

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "git@github.com:0xLLLLH/opencode-free-models.git",
      {
        "providers": ["opencode"],
        "alias": "free-models"
      }
    ]
  ]
}

GitHub Action Example

- uses: 0xLLLLH/opencode-free-models@main
  with:
    providers: "opencode"
    fallback: "openrouter/free"

Related Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages