Skip to content
Open
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
2 changes: 2 additions & 0 deletions omlx/admin/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@ async def list_models(is_admin: bool = Depends(require_admin)):
"force_sampling": settings.force_sampling,
"max_tool_result_tokens": settings.max_tool_result_tokens,
"enable_thinking": settings.enable_thinking,
"preserve_thinking": settings.preserve_thinking,
"thinking_budget_enabled": settings.thinking_budget_enabled,
"thinking_budget_tokens": settings.thinking_budget_tokens,
"reasoning_parser": settings.reasoning_parser,
Expand All @@ -1421,6 +1422,7 @@ async def list_models(is_admin: bool = Depends(require_admin)):
"index_cache_freq": settings.index_cache_freq,
"turboquant_kv_enabled": settings.turboquant_kv_enabled,
"turboquant_kv_bits": settings.turboquant_kv_bits,
"turboquant_skip_last": settings.turboquant_skip_last,
"specprefill_enabled": settings.specprefill_enabled,
"specprefill_draft_model": settings.specprefill_draft_model,
"specprefill_keep_pct": settings.specprefill_keep_pct,
Expand Down
14 changes: 11 additions & 3 deletions omlx/cache/boundary_snapshot_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,22 @@ def cleanup_request(self, request_id: str) -> None:

def cleanup_all(self) -> None:
"""Delete all snapshot files (for reset/startup)."""
# Drain write queue so the writer thread doesn't process stale
# items after the directory is deleted.
# Drain queued writes, then wait for any item the writer already
# dequeued. Without the join, an in-flight write can recreate a
# request directory after the cleanup has removed it.
saw_sentinel = False
while True:
try:
item = self._write_queue.get_nowait()
self._write_queue.task_done()
if item is None: # Sentinel — put it back for shutdown.
self._write_queue.put(item)
saw_sentinel = True
break
except queue.Empty:
break
if not saw_sentinel:
self._write_queue.join()

with self._pending_lock:
self._pending_writes.clear()
Expand Down Expand Up @@ -320,6 +326,7 @@ def _writer_loop(self) -> None:
continue

if item is None: # Sentinel
self._write_queue.task_done()
break

pw_key, tensors_raw, metadata, file_path = item
Expand All @@ -335,6 +342,7 @@ def _writer_loop(self) -> None:
except Exception:
pass
self._dec_cancelled(pw_key[0])
self._write_queue.task_done()
continue

temp_path = None
Expand Down Expand Up @@ -392,7 +400,7 @@ def _writer_loop(self) -> None:
# If file was written successfully, remove entirely.
if file_path.exists():
self._pending_writes.pop(pw_key, None)

self._write_queue.task_done()

def _serialize_extracted(
self,
Expand Down
1 change: 1 addition & 0 deletions omlx/model_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"presence_penalty",
"force_sampling",
"enable_thinking",
"preserve_thinking",
"thinking_budget_enabled",
"thinking_budget_tokens",
"reasoning_parser",
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ audio = [
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"python-multipart>=0.0.5",
"black>=23.0.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
Expand All @@ -101,6 +102,7 @@ dev = [
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"python-multipart>=0.0.5",
"black>=23.0.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/test_e2e_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json
import pytest
from dataclasses import dataclass, field
from types import SimpleNamespace
from typing import Any, AsyncIterator, Dict, List, Optional
from unittest.mock import AsyncMock, MagicMock, patch

Expand Down Expand Up @@ -174,6 +175,14 @@ def get_model_ids(self) -> List[str]:
def get_status(self) -> Dict[str, Any]:
return {"models": self._models}

def get_entry(self, model_id: str):
if model_id in self.get_model_ids():
return SimpleNamespace(
config_model_type="",
preserve_thinking_default=None,
)
return None

async def get_engine(self, model_id: str):
return self._engine

Expand Down
2 changes: 1 addition & 1 deletion tests/test_accuracy_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_all_valid_benchmarks(self):
model_id="test-model",
benchmarks={b: 100 for b in VALID_BENCHMARKS},
)
assert len(req.benchmarks) == 12
assert len(req.benchmarks) == len(VALID_BENCHMARKS)

def test_enable_thinking_default_false(self):
req = AccuracyBenchmarkRequest(
Expand Down
Loading