Skip to content

Gemini: its own thresholds, 429 retries, real-service benchmark - #12

Merged
FMXExpress merged 4 commits into
mainfrom
gemini-tuning
Nov 15, 2026
Merged

FMXExpress merged 4 commits into
mainfrom
gemini-tuning

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

This finishes FMXExpress/JevBan#11, which was merged at its first commit. These are its four later commits, applied unchanged on top of main, which now also has the digest.

Changes

  • Rate limits are waited out instead of falling back to the rules.
    • On Gemini's free tier (50,000 input tokens a minute), the first real run sent 18–111 batches per split to the rules on HTTP 429.
    • Retries now wait as long as the provider says ("retry in 19s", or the retryDelay field; 10 s if neither), up to 6 times, in steps that shutdown interrupts. With retries there were 0 errors.
    • This applies to every provider. The mock can simulate it (MOCK_429=N).
  • Gemini's own thresholds. Its probabilities for some real attackers sit at 0.57–0.79, under the 0.80 jevban sets for OpenJev. The gemini preset now strikes at 0.50 and logs REVIEW from 0.30, unless the config sets threshold or review_threshold itself.
    • These values were chosen on the dev splits: no benign client scored above 0.26 there (80 judged). The test splits were then run once at these settings.
  • A latent config bug fixed: the flags for "url, model and thresholds were set in the config" weren't initialized when there was no config file.

Results on the real service (free tier)

These are held-out test splits plus the real LogarX log, all on the same build. Full notes are in bench/results/iter9-gemini/README.md.

Split Rules alone Gemini OpenJev Flash 9B (local) Benign banned (Gemini / Flash) Wall clock (Gemini / Flash)
WordPress 44/51 46/51 47/51 0 / 0 128 s / 26 min
Static site 48/52 49/52 49/52 0 / 1 18 s / 7.5 min
Web app 43/51 44/51 44/51 0 / 0 100 s / 12 min
LogarX (real) 126/126 126/126 — 0 / — 153 s / —

Flash's benign ban was an uptime monitor: GET / returning 200, with a Go-http-client agent, scored 0.80–0.84 on five separate verdicts. It's recorded in the notes; the guard against it is separate work.

Tests

202 checks, 0 failed, on a clean build. The new ones cover retry delays and the preset thresholds: that config values win, and that other presets keep jevban's.

One commit in this series (0a03996) on its own doesn't compile the tests; the next one (647a58f) fixes that. Squash-merge if you'd rather not have it in the history.


Generated by Claude Code

A rate limit is not an outage: retry after the delay the provider names
("retry in 19s" or retryDelay; 10 s if none), up to six times, in steps that
shutdown interrupts. On Gemini's free tier (50,000 input tokens a minute) the
first real benchmark sent 18-111 batches per split to the rules this way;
with the retries, 0. The mock can now answer 429 (MOCK_429=N) to test it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
…mark

Gemini's probabilities for some real attackers sit at 0.57-0.79, under the
0.80 set for OpenJev. On the dev splits no benign client scored above 0.26,
so the preset uses 0.50 / 0.30 unless the config sets threshold or
review_threshold. Held-out test splits, real service, free tier: 0 benign
bans; attackers 46/51, 49/52, 44/51 (rules alone 44, 48, 43); LogarX 126/126
with fewer requests through (536 -> 457).

Also: the config's url/model/threshold flags start False when there is no
config file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
… threshold tests

The previous commit changed ApplyProvider's parameters without updating the
tests, so the test program did not compile (a local run reported a stale
binary). The two new flags now default to False; tests check the gemini
preset's thresholds, that thresholds set in the config win, and that other
presets keep jevban's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
Flash: attackers 47/51, 49/52, 44/51 (Gemini at 0.50: 46, 49, 44), and one
benign uptime monitor banned on the static site (five separate verdicts at
0.80-0.84 on GET / 200 with a Go-http-client agent). Gemini banned no benign
client. Recorded; the guard against it is separate work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
@FMXExpress
FMXExpress merged commit be61319 into main Nov 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants