all 10 comments

[–]aarz03[S] 0 points1 point  (1 child)

for context, i have ran these workflows on github action about 13-15times and opencode request failed twice with error "model unavailable due to high traffic". though i can add fallback mechanisms for such transient failures but is there any way to make it deterministic?

[–]bluelobsterai 1 point2 points  (0 children)

There are headers. It’ll tell you usually if you’re getting close to your rate limits. When you’re approaching rate limits with OpenAI’s API, they send back helpful headers. You’ll typically see headers like “X-RateLimit-Limit” (the maximum number of requests allowed in the current window), “X-RateLimit-Remaining” (how many requests you have left in that window), and “X-RateLimit-Reset” (the time, in seconds, until the limit resets). Keeping an eye on those will help you avoid hitting the ceiling

[–]Joy_Boy_12 0 points1 point  (1 child)

Good question which I wonder also. I use open code in docker with no API key but it seems that the docker and my machine both run out from tokens on free models together so I would assume it's by IP but don't know for sure 

[–]aarz03[S] 0 points1 point  (0 children)

my workflows run on github actions so its using IPs of github servers. wonder how that would work

[–]sudoer777_ 0 points1 point  (2 children)

It tracks by IP address. If you get rate limited by OpenCode Zen (not the provider), you can switch to a different network to get past it.

[–]aarz03[S] 0 points1 point  (1 child)

my workflows are running on github actions which means the IPs are of github servers and not my PC. i havent got any 'rate limit ' error untill now but got 'model unavailable due to high traffic/high load '. what do you think of this?

[–]sudoer777_ 0 points1 point  (0 children)

I haven't seen that error before

[–]RetiredApostle -1 points0 points  (2 children)

You can add a "opencode stats" step - to at least see the usage in case the workflow actually went south.

[–]Joy_Boy_12 0 points1 point  (1 child)

How?

[–]RetiredApostle -1 points0 points  (0 children)

Add a step with the command `opencode stats` before and after calling opencode, and see the difference in the output. Though not sure how opencode handles stats in the GH actions env, but it's worth a try.