Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions blockrun_llm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
# Load environment variables
load_dotenv()

# Default chat HTTP timeout (seconds). Was 120; reasoning models (opus-4.8,
# deepseek-v4-pro) routinely take 200–300s, so 120 timed out non-streaming
# calls. Override via the BLOCKRUN_CHAT_TIMEOUT env var.
DEFAULT_CHAT_TIMEOUT = float(os.environ.get("BLOCKRUN_CHAT_TIMEOUT", "600"))


# User-Agent for client identification in server logs
# Version read lazily to avoid circular import with __init__.py
Expand Down Expand Up @@ -219,7 +224,7 @@ def __init__(
self,
private_key: Optional[str] = None,
api_url: Optional[str] = None,
timeout: float = 120.0,
timeout: float = DEFAULT_CHAT_TIMEOUT,
search_timeout: float = 300.0,
transaction_log: Union[bool, str, "os.PathLike[str]", None] = None,
):
Expand Down Expand Up @@ -2166,7 +2171,7 @@ def __init__(
self,
private_key: Optional[str] = None,
api_url: Optional[str] = None,
timeout: float = 120.0,
timeout: float = DEFAULT_CHAT_TIMEOUT,
search_timeout: float = 300.0,
transaction_log: Union[bool, str, "os.PathLike[str]", None] = None,
):
Expand Down
2 changes: 1 addition & 1 deletion blockrun_llm/solana_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _create_signer(private_key: str) -> KeypairSigner:
#
# Public callers can also override per-call via ``timeout=`` on
# ``chat_completion`` / ``image`` / ``image_edit`` / ``search``.
DEFAULT_CHAT_TIMEOUT = 120.0
DEFAULT_CHAT_TIMEOUT = float(os.environ.get("BLOCKRUN_CHAT_TIMEOUT", "600")) # was 120; reasoning models need 200–300s+
DEFAULT_IMAGE_TIMEOUT = 200.0
DEFAULT_SEARCH_TIMEOUT = 300.0
DEFAULT_FAST_TIMEOUT = 30.0 # pyth / x_user_info / quick lookups
Expand Down
Loading