mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 17:18:49 -04:00
test: cover config-level disable for xhigh/max and the effort-only load warning
- ApplyReasoningEffort keeps an operator's reasoning.disable for high, xhigh and max - sglang: _configured_budget() feeds the strict-thinking warning; tested with effort_budgets alone Signed-off-by: pos-ei-don <1822533+pos-ei-don@users.noreply.github.com>
This commit is contained in:
1 parent
0bd723a652
commit
45a960ca1f
3 files changed
+22
-8
No files matched your search
@@ -207,6 +207,10 @@ class BackendServicer(backend_pb2_grpc.BackendServicer):
|
||||
return self.effort_budgets[effort]
|
||||
return self.thinking_budget
|
||||
|
||||
def _configured_budget(self) -> Optional[int]:
|
||||
"""Any budget configured for this model (fixed or per effort), for the load-time warning."""
|
||||
return self.thinking_budget or max((self.effort_budgets or {}).values(), default=None)
|
||||
|
||||
@staticmethod
|
||||
def _strict_thinking_warning(thinking_budget: Optional[int], engine_kwargs: dict) -> Optional[str]:
|
||||
"""sglang only enforces the budget with enable_strict_thinking on; without
|
||||
@@ -389,9 +393,7 @@ class BackendServicer(backend_pb2_grpc.BackendServicer):
|
||||
print(f"engine_args error: {err}", file=sys.stderr)
|
||||
return backend_pb2.Result(success=False, message=str(err))
|
||||
|
||||
warning = self._strict_thinking_warning(
|
||||
self.thinking_budget or max((self.effort_budgets or {}).values(), default=None), engine_kwargs
|
||||
)
|
||||
warning = self._strict_thinking_warning(self._configured_budget(), engine_kwargs)
|
||||
if warning:
|
||||
print(warning, file=sys.stderr)
|
||||
|
||||
|
||||
Reference in new issue
Block a user