claude-code-router icon indicating copy to clipboard operation
claude-code-router copied to clipboard

Gemini models ?

Open johann-taberlet opened this issue 8 months ago • 7 comments

First thanks for this project!

As I understand the models used needs to be openAI compatible, correct ?

Is there a way to use Gemini models like flash/flash-lite ?

I tried several things without any success so far.

johann-taberlet avatar Mar 10 '25 10:03 johann-taberlet

I previously integrated Gemini into Claude Code using this documentation: https://ai.google.dev/gemini-api/docs/openai. However, I found that the Gemini model isn’t capable of driving Claude Code effectively—it’s just too dumb.

musistudio avatar Mar 11 '25 00:03 musistudio

maybe this isn't true anymore with 2.5 released?

EDIT: When running with Gemini 2.5 I get the following error

    message: 'Provider returned error',
    code: 400,
    metadata: {
      raw: '{\n' +
        '  "error": {\n' +
        '    "code": 400,\n' +
        `    "message": "* GenerateContentRequest.tools[0].function_declarations[2].parameters.properties[invocations].items.properties[input].properties: should be non-empty for OBJECT type\\n* GenerateContentRequest.tools[0].function_declarations[11].parameters.properties[url].format: only 'enum' and 'date-time' are supported for STRING type\\n",\n` +
        '    "status": "INVALID_ARGUMENT"\n' +
        '  }\n' +
        '}\n',
      provider_name: 'Google AI Studio'
    }
  },

mattbucci avatar Mar 30 '25 00:03 mattbucci

maybe this isn't true anymore with 2.5 released?

EDIT: When running with Gemini 2.5 I get the following error

    message: 'Provider returned error',
    code: 400,
    metadata: {
      raw: '{\n' +
        '  "error": {\n' +
        '    "code": 400,\n' +
        `    "message": "* GenerateContentRequest.tools[0].function_declarations[2].parameters.properties[invocations].items.properties[input].properties: should be non-empty for OBJECT type\\n* GenerateContentRequest.tools[0].function_declarations[11].parameters.properties[url].format: only 'enum' and 'date-time' are supported for STRING type\\n",\n` +
        '    "status": "INVALID_ARGUMENT"\n' +
        '  }\n' +
        '}\n',
      provider_name: 'Google AI Studio'
    }
  },

I'm testing the next version: it will allow users to rewrite the Claude Code prompt to better adapt to other LLMs, and enable users to customize the router for more granular task splitting based on different needs. The next version is expected to be released later next week.

musistudio avatar Mar 30 '25 06:03 musistudio

Thanks for your work, and please let us know if it's possible to help you with anything.

paskal avatar Mar 31 '25 13:03 paskal

Thanks for your work, and please let us know if it's possible to help you with anything.

I just released the test code on the dev/custom-prompt branch. This is still in the testing phase and does not yet have good compatibility with Gemini.

musistudio avatar Mar 31 '25 14:03 musistudio

Does gemini 2.5 pro now work properly on Claude-code?

dnslin avatar Jun 20 '25 02:06 dnslin

Does gemini 2.5 pro now work properly on Claude-code?

Yes, though I’ve only tried using it by OpenRouter.

musistudio avatar Jun 20 '25 04:06 musistudio