This commit is contained in:
John W 2026-08-09 08:32:11 +00:00 committed by GitHub
commit 3d37825bc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -20,7 +20,7 @@ from src.upload_limits import (
GALLERY_UPLOAD_MAX_BYTES,
GALLERY_TRANSFORM_UPLOAD_MAX_BYTES,
)
from src.constants import GENERATED_IMAGES_DIR
from src.constants import GENERATED_IMAGES_DIR, VISION_MAX_TOKENS
from src.optional_deps import patch_realesrgan_torchvision_compat
from routes.gallery.gallery_helpers import (
@ -2285,7 +2285,7 @@ def setup_gallery_routes() -> APIRouter:
{"type": "image_url", "image_url": {"url": f"data:{mime};base64,{b64}"}},
],
}],
_tok_key: 200,
_tok_key: VISION_MAX_TOKENS,
"temperature": 0.3,
}
# Reasoning models (o1/o3/o4/gpt-5) reject an explicit temperature.

View file

@ -107,7 +107,10 @@ PASSWORD_MIN_LENGTH = 8
# Default parameters
DEFAULT_TEMPERATURE = 1.0
DEFAULT_MAX_TOKENS = 0
# Vision/OCR calls need more headroom than a plain caption would suggest:
# thinking-capable models (Gemma 4, Qwen3-VL Thinking) spend the budget in
# `reasoning` and return empty `content` if capped too low.
VISION_MAX_TOKENS = 1200
def internal_api_base() -> str:
"""Base URL for in-process loopback calls to Odysseus's own API.