Skip to content

Intermittent HTTP 504 Gateway Timeout #7

@rempsyc

Description

@rempsyc

The error appears intermittent and not actually related to the number of tokens. I was able to capture it in a reprex:

library(ellmer)

chat <- chat_portkey(
  model = "@vertexai/gemini-3.1-pro-preview",
  base_url = "https://ai-gateway.apps.cloud.rt.nyu.edu/v1/"
)

prompt <- paste(
  "You are simulating an American adult who politically identifies as a Democrat.",
  "On a scale from 0 to 100, how warmly do you feel towards Democrats?",
  sep = "\n\n"
)

chat$chat_structured(
  prompt,
  type = type_object(rating = type_number())
)
#> Error in `req_perform()`:
#> ! HTTP 504 Gateway Timeout.

Created on 2026-03-20 with reprex v2.1.1

However, even with this reprex, sometimes it works, sometimes it generates the 504 error. I wonder whether that might be something local on my computer? How often should I be expected to run into this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions