Skip to content

Commit 5c6a000

Browse files
committed
merge: incorporate current main
2 parents fd19514 + a8ceeb1 commit 5c6a000

2 files changed

Lines changed: 102 additions & 0 deletions

File tree

docs/inference/use-google-gemini.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,36 @@ NemoClaw validates the selected provider and model before creating the sandbox.
4444
NemoClaw validates Gemini inference through its OpenAI-compatible Chat Completions path.
4545
When you enter a custom Gemini model ID, NemoClaw checks Google's native model catalog and accepts IDs with or without the `models/` prefix.
4646
It skips the Responses API probe because Gemini does not support `/v1/responses`.
47+
When NemoClaw reads the native Google model catalog, it keeps only models that support `generateContent`.
48+
Embedding-only models are filtered out of the catalog, so they do not appear as onboarding choices.
49+
50+
## Troubleshooting
51+
52+
Model validation can fail with these messages:
53+
54+
- `Could not validate model against https://generativelanguage.googleapis.com/v1beta/models: <reason>`
55+
NemoClaw could not read the Google model catalog.
56+
The `<reason>` value identifies an authentication, network, response, or pagination failure.
57+
Verify `GEMINI_API_KEY`, host access to `generativelanguage.googleapis.com`, and the reported response.
58+
- `Model '<model>' is not available from Google Gemini. Checked https://generativelanguage.googleapis.com/v1beta/models.`
59+
The catalog did not contain the model ID.
60+
This message also appears when the catalog omits `models`, because NemoClaw treats the response as an empty catalog.
61+
Check the ID for typing errors.
62+
Custom IDs can include or omit the `models/` prefix.
63+
Embedding-only models do not appear because they do not support `generateContent`.
64+
- `Unexpected Gemini model catalog response: expected a top-level models array`
65+
The Google model catalog returned a non-null `models` value that is not an array.
66+
Retry the request, then inspect the Google service or proxy response if the error continues.
67+
- `Gemini model catalog pagination repeated page token '<token>'`
68+
The catalog repeated a `nextPageToken`, so NemoClaw stopped reading pages.
69+
Retry the request, then inspect the Google service or proxy response if the error continues.
70+
- `Gemini model catalog pagination exceeded <count> pages`
71+
The catalog exhausted the 25-page `GEMINI_MODEL_CATALOG_MAX_PAGES` limit.
72+
Retry the request, then inspect the Google service or proxy response if the error continues.
73+
- `Onboard inference smoke check failed.`
74+
The validation request failed.
75+
The output shows the provider, model, and API base URL.
76+
Compare these values with your configuration.
4777

4878
## Related Topics
4979

src/lib/inference/provider-models.test.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,78 @@ describe("provider model helpers", () => {
266266
});
267267
});
268268

269+
it("reports an unavailable Gemini model when the catalog omits models (#8971)", () => {
270+
const result = validateOpenAiLikeModel(
271+
"Google Gemini",
272+
"https://generativelanguage.googleapis.com/v1beta/openai/",
273+
"gemini-2.5-flash",
274+
"AIzaFakeKey123",
275+
{
276+
runCurlProbeImpl: () => ({
277+
ok: true,
278+
httpStatus: 200,
279+
curlStatus: 0,
280+
body: JSON.stringify({}),
281+
stderr: "",
282+
message: "",
283+
}),
284+
},
285+
);
286+
287+
expect(result).toEqual({
288+
ok: false,
289+
httpStatus: 200,
290+
curlStatus: 0,
291+
message: `Model 'gemini-2.5-flash' is not available from Google Gemini. Checked ${GEMINI_NATIVE_MODELS_ENDPOINT_URL}.`,
292+
});
293+
});
294+
295+
it("reports an unavailable Gemini model when the catalog models value is null (#8971)", () => {
296+
const result = validateOpenAiLikeModel(
297+
"Google Gemini",
298+
"https://generativelanguage.googleapis.com/v1beta/openai/",
299+
"gemini-2.5-flash",
300+
"AIzaFakeKey123",
301+
{
302+
runCurlProbeImpl: () => ({
303+
ok: true,
304+
httpStatus: 200,
305+
curlStatus: 0,
306+
body: JSON.stringify({ models: null }),
307+
stderr: "",
308+
message: "",
309+
}),
310+
},
311+
);
312+
313+
expect(result).toEqual({
314+
ok: false,
315+
httpStatus: 200,
316+
curlStatus: 0,
317+
message: `Model 'gemini-2.5-flash' is not available from Google Gemini. Checked ${GEMINI_NATIVE_MODELS_ENDPOINT_URL}.`,
318+
});
319+
});
320+
321+
it("rejects a Gemini catalog whose models value is not an array (#8971)", () => {
322+
const result = fetchGeminiModels("AIzaFakeKey123", {
323+
runCurlProbeImpl: () => ({
324+
ok: true,
325+
httpStatus: 200,
326+
curlStatus: 0,
327+
body: JSON.stringify({ models: {} }),
328+
stderr: "",
329+
message: "",
330+
}),
331+
});
332+
333+
expect(result).toEqual({
334+
ok: false,
335+
httpStatus: 200,
336+
curlStatus: 0,
337+
message: "Unexpected Gemini model catalog response: expected a top-level models array",
338+
});
339+
});
340+
269341
it("fails Gemini native catalog pagination after the bounded page budget (#6975)", () => {
270342
const requestedUrls: string[] = [];
271343

0 commit comments

Comments
 (0)