Skip to content

OpenRouter support with Google models #146

@empz

Description

@empz

It's already possible to set OpenRouter as an endpoint, but it's not possible to select the model.

Doing ai config and selecting Model throws an error:

✖ Cannot read properties of undefined (reading 'value')
    at LD.changeValue (file:///home/empz/.bun/install/global/node_modules/@clack/core/dist/index.mjs:14:4846)
    at new LD (file:///home/empz/.bun/install/global/node_modules/@clack/core/dist/index.mjs:14:4514)
    at Module.ve (file:///home/empz/.bun/install/global/node_modules/@clack/prompts/dist/index.mjs:22:294)
    at showConfigUI (file:///home/empz/.bun/install/global/node_modules/@builder.io/ai-shell/dist/cli.mjs:1470:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///home/empz/.bun/install/global/node_modules/@builder.io/ai-shell/dist/cli.mjs:1512:9

    ai-shell v1.0.12

I then tried

ai config set MODEL=google/gemini-2.0-flash-001

And it seemed to work, but the responses seems incomplete.

Running ai -s list all files in cwd in bash returns:

┌  AI Shell
│
◇  Your script:

 -l

•
│
◆  Run this script?
│  ● ✅ Yes (Lets go!)
│  ○ 📝 Edit
│  ○ 🔁 Revise
│  ○ 📋 Copy
│  ○ ❌ Cancel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions