Skip to content
Merged
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
6 changes: 5 additions & 1 deletion gitpilot/llm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ def build_llm() -> Any:
if not model.startswith("anthropic/"):
model = f"anthropic/{model}"

# Anthropic requires an explicit max_tokens; without it litellm falls
# back to a low default that truncates large single-file generations
# (e.g. a full self-contained game). Allow override via env.
return _wrap_llm(
LLM(
model=model,
api_key=api_key,
base_url=base_url if base_url else None,
max_tokens=int(os.getenv("GITPILOT_MAX_TOKENS", "32000")),
),
model,
)
Expand Down Expand Up @@ -161,7 +165,7 @@ def build_llm() -> Any:
base_url=base_url,
project_id=project_id, # \u2190 CRITICAL: This was missing!
temperature=0.3, # Default temperature
max_tokens=1024, # Default max tokens
max_tokens=int(os.getenv("GITPILOT_MAX_TOKENS", "4096")),
),
model,
)
Expand Down
Loading