unsloth/studio/backend/models
Daniel Han 887e7a31c4 studio: don't cap max_tokens for GGUF inference
Remove the hard max_tokens=2048 default and le=4096 cap for GGUF
chat completions. When max_tokens is not set (None), the field is
omitted from the llama-server payload entirely, letting the model
generate until it produces an EOS token or hits the context limit.

This is critical for thinking/reasoning models (Qwen3.5, DeepSeek-R1,
etc.) where the thinking phase alone can consume 1000+ tokens before
the actual answer. With the previous 2048 default, simple questions
like "What is 2+2?" used all tokens on thinking and produced empty
visible responses.

Changes:
- llama_cpp.py: max_tokens default None, only include in payload
  when explicitly set
- models/inference.py: default None, remove le=4096 cap
- routes/inference.py: pass max_tokens directly, no "or 2048" fallback

llama-server handles omitted max_tokens gracefully (generates until
EOS or context limit). The context size (-c flag, default 4096) acts
as the hard upper bound.
2026-03-15 05:24:06 -07:00
..
.gitkeep fix: restore models directory files deleted during restructure 2026-02-02 19:36:30 +00:00
__init__.py fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
auth.py fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
data_recipe.py miscallenous studio (#4293) 2026-03-15 14:42:11 +04:00
datasets.py Final cleanup 2026-03-12 18:28:04 +00:00
export.py Final cleanup 2026-03-12 18:28:04 +00:00
inference.py studio: don't cap max_tokens for GGUF inference 2026-03-15 05:24:06 -07:00
models.py Final cleanup 2026-03-12 18:28:04 +00:00
responses.py Final cleanup 2026-03-12 18:28:04 +00:00
training.py Final cleanup 2026-03-12 18:28:04 +00:00
users.py fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00