Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

litellm-config-gen

Generate an OpenCode JSON config for connecting to a LiteLLM proxy (OpenAI-compatible endpoint). Queries the LiteLLM /models endpoint to define available models.

You can run the latest binary, or run the project with Go.

Installation

Download the latest binary from Releases:

# macOS (Apple Silicon)
curl -LO https://github.com/DiUS/opencode-litellm-config/releases/latest/download/litellm-config-gen-darwin-arm64
chmod +x litellm-config-gen-darwin-arm64

# macOS (Intel)
curl -LO https://github.com/DiUS/opencode-litellm-config/releases/latest/download/litellm-config-gen-darwin-amd64
chmod +x litellm-config-gen-darwin-amd64

# Linux
curl -LO https://github.com/DiUS/opencode-litellm-config/releases/latest/download/litellm-config-gen-linux-amd64
chmod +x litellm-config-gen-linux-amd64

Usage

export LITELLM_API_KEY="your-api-key"
./litellm-config-gen-darwin-arm64 output.json

Or run from source:

go run main.go output.json

Output

The output json file can be placed in an appropriate OpenCode config location such as ~/.config/opencode/opencode.json for global user config.

Flags

  • --base-url - LiteLLM base URL (default: http://localhost:4000/v1)
  • --provider-name - Provider display name (default: LiteLLM)
  • --provider-key - Provider key in config (default: litellm)
  • -v, --version - Print version

Contributing + Releases

Change for your needs and push to main, I don't mind -- then make a release

make release VERSION=1.0.0  # explicit version
make release-major          # bump major (1.0.0 → 2.0.0)
make release-minor          # bump minor (1.0.0 → 1.1.0)
make release-patch          # bump patch (1.0.0 → 1.0.1)

Builds binaries for linux/darwin/windows, generates checksums, tags, and creates GitHub Release.

License

Apache 2.0

About

Generate OpenCode config for Dius LiteLLM API

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages