Skip to content

add timeout arg to server method#456

Open
grossjct wants to merge 1 commit intoallenai:mainfrom
grossjct:fix/issue-455
Open

add timeout arg to server method#456
grossjct wants to merge 1 commit intoallenai:mainfrom
grossjct:fix/issue-455

Conversation

@grossjct
Copy link
Copy Markdown

@grossjct grossjct commented Apr 8, 2026

Closes #455

Changes proposed in this pull request:

  • Use configurable timeout for HTTP client in run_server function

Copilot AI review requested due to automatic review settings April 8, 2026 15:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable HTTP client timeout to the olmocr bench “server” runner, addressing issue #455 where the previous fixed 300s timeout was insufficient for some use cases.

Changes:

  • Add a timeout parameter (default 300) to run_server(...).
  • Use the new timeout value when constructing httpx.AsyncClient.
Comments suppressed due to low confidence (1)

olmocr/bench/runners/run_server.py:41

  • Now that timeout is configurable, it would help to document its units/behavior in the docstring (e.g., seconds, passed through to httpx.AsyncClient(timeout=...)). Also consider typing it as float (vs int) since httpx accepts floats and callers via parse_method_arg may supply non-integer values.
    timeout: int = 300,
) -> str:
    """
    Convert page of a PDF file to markdown by calling a request
    running against an openai compatible server.

    You can use this for running against vllm, sglang, servers
    as well as mixing and matching different model's.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

configurable timeout for HTTP client in server method

2 participants