google-gemini / google-gemini/gemini-cli
Gemma 4 31B API returns no output in Gemini CLI while REST API works
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
When using `gemma-4-31b-it` through Gemini CLI, the request never returns any output.
The same API key and the same model work correctly through the REST API.
Gemini CLI version:
Gemini CLI v0.52.0
The request is cancelled after several seconds.
Session summary shows:
Model Usage
gemma-4-31b-it
Reqs: 1
Input Tokens: 0
Output Tokens: 0
No response is ever produced.
The REST API works correctly with the same API key and model, returning a valid response from `generateContent`.
This issue appears to affect only Gemini CLI when using `gemma-4-31b-it`.
### What did you expect to happen?
Gemini CLI should generate a response from `gemma-4-31b-it`.
The model should behave the same way as it does when called through the REST API with the same API key.
### Client information
Client Information
Run `gemini` to enter the interactive CLI, then run the `/about` command.
```console
> /about
# paste output here
```
### Login information
Using a Gemini API key.
Authentication method:
gemini-api-key
The API key works correctly with the REST API using the same `gemma-4-31b-it` model.
### Anything else we need to know?
Environment:
- OS: Kali Linux
- Node.js: v22.23.1
- Installed via npm
Additional information:
- Other Gemini CLI features work normally.
- Authentication is successful.
- The model is available through the API.
- No useful error message is displayed in the terminal.
- The REST API consistently succeeds with the same credentials.
This may be related to Gemma model compatibility or Gemini CLI handling of this model.
Contributor guide
Research direction
Start by reproducing the request in Gemini CLI v0.52.0 with gemma-4-31b-it and the same API key, then compare it with the REST generateContent call. Trace the CLI request path for the zero-token, no-output cancellation and identify where handling diverges; done means the CLI returns the model response or displays an actionable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- ai, api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100