Skip to content
Merged
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
4 changes: 2 additions & 2 deletions modelfiles/qwen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mlx-community/Qwen3.5-0.8B-8bit
FROM mlx-community/Qwen3.5-4B-MLX-4bit
#FROM mlx-community/Qwen3.5-0.8B-8bit
# FROM mlx-community/Qwen3.5-0.8B-MLX-8bit
# FROM mlx-community/Qwen3.5-4B-MLX-4bit
# FROM mlx-community/Qwen3-0.6B-4bit
6 changes: 6 additions & 0 deletions pkg/scripts/preinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# So that we don't have multiple copies of python libs lying around
# from previous installs

rm -rf /usr/local/share/tiles/server
7 changes: 0 additions & 7 deletions server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pydantic import BaseModel, Field

from . import runtime
from .hf_downloader import pull_model
from .mem_agent.engine import execute_sandboxed_code
from .mem_agent.utils import (
create_memory_if_not_exists,
Expand Down Expand Up @@ -37,12 +36,6 @@ async def ping():
return {"message": "Badda-Bing Badda-Bang"}


@app.post("/download")
async def download(request: downloadRequest):
"""Download the model"""
runtime.backend.download_model(request.model)


@app.post("/start")
async def start_model(request: StartRequest):
"""Load the model and start the agent"""
Expand Down
10 changes: 0 additions & 10 deletions server/backend/mlx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
from ..reasoning_utils import ReasoningExtractor

from ..cache_utils import get_model_path
from ..hf_downloader import pull_model
from ..schemas import (
ChatCompletionRequest,
ChatMessage,
GenerationMetrics,
ResponsesRequest,
ResponsesResponse,
downloadRequest,
)
from .mlx_runner import MLXRunner

Expand All @@ -46,14 +44,6 @@
_responses: Dict[str, ResponsesResponse] = {}


def download_model(model_name: str):
"""Download the model"""
if pull_model(model_name):
return {"message": "Model downloaded"}
else:
raise HTTPException(status_code=400, detail="Downloading model failed")


def get_or_load_model(
model_spec: str, model_cache_path: str | None = None, verbose: bool = True
) -> MLXRunner:
Expand Down
145 changes: 0 additions & 145 deletions server/hf_downloader.py

This file was deleted.

12 changes: 7 additions & 5 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ version = "0.1.0"
description = "Local MLX inference server for the Tiles CLI"
requires-python = "==3.13.*"
dependencies = [
"fastapi",
"uvicorn",
"mlx-lm",
"black",
"huggingface-hub>=0.34.0",
"fastapi==0.119.0",
"uvicorn==0.38.0",
"mlx-lm==0.31.0",
"black==25.9.0",
"openai-harmony==0.0.8",
"openresponses-types"
]
Expand All @@ -19,3 +18,6 @@ build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
exclude = ["backend", "backend.*"]

[tool.uv]
exclude-newer="10 days"
31 changes: 19 additions & 12 deletions server/stack/requirements/app-server/packages-app-server.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Package summary for app-server
# Auto-generated by venvstacks (DO NOT EDIT)
annotated-doc==0.0.4
annotated-types==0.7.0
anyio==4.12.1
anyio==4.13.0
black==25.9.0
certifi==2026.2.25
charset-normalizer==3.4.6
click==8.3.1
fastapi==0.119.0
filelock==3.25.2
fsspec==2026.2.0
fsspec==2026.3.0
h11==0.16.0
hf-xet==1.4.2
huggingface-hub==0.35.0
httpcore==1.0.9
httpx==0.28.1
huggingface-hub==1.8.0
Comment on lines +14 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C2 'import requests|requests\.exceptions|requests\.(get|post)\s*=|snapshot_download\s*\(|HfHubHttpError|set_(async_)?client_factory' server/hf_downloader.py server/throttled_download_worker.py

Repository: tilesprivacy/tiles

Length of output: 2917


🏁 Script executed:

cat -n server/stack/requirements/app-server/packages-app-server.txt

Repository: tilesprivacy/tiles

Length of output: 1515


🏁 Script executed:

# Check if requests appears anywhere in the requirements file
rg -n "requests" server/stack/requirements/app-server/packages-app-server.txt

Repository: tilesprivacy/tiles

Length of output: 44


🌐 Web query:

huggingface-hub 1.8.0 dependencies requests httpx

💡 Result:

huggingface-hub 1.8.0 requires httpx as a core dependency (>=0.23.0, <1), but does not require requests. Since v1.0, the library has migrated from requests to httpx as its HTTP backend, dropping requests as a dependency. httpx is listed under core dependencies on PyPI, while requests is absent. It also appears as an optional dependency in some extras (e.g., oauth), but not required for base installation.

Citations:


Update downloader code to use huggingface-hub v1's httpx-based HTTP backend instead of relying on requests.

requests is no longer in the requirements, but server/throttled_download_worker.py imports it (line 29), monkeypatches requests.get/post (lines 99–100), and catches requests.exceptions.* (lines 117, 132). Similarly, server/hf_downloader.py imports requests in its fallback path (line 116) and catches requests.exceptions.* (lines 122, 125, 128). Hub v1.8.0 migrated from requests to httpx and no longer includes requests as a dependency. The current monkeypatching approach will fail, and the custom throttling will not affect Hub traffic. Use set_client_factory() or set_async_client_factory() to hook into Hub's HTTP client instead.

idna==3.11
jinja2==3.1.6
markdown-it-py==4.0.0
markupsafe==3.0.3
mlx-lm==0.28.3
mdurl==0.1.2
mlx-lm==0.31.0
mypy-extensions==1.1.0
numpy==2.4.3
numpy==2.4.4
openai-harmony==0.0.8
openresponses-types==2.3.0.post1
packaging==26.0
Expand All @@ -26,20 +30,23 @@ platformdirs==4.9.4
protobuf==7.34.1
pydantic==2.12.5
pydantic-core==2.41.5
pygments==2.20.0
pytokens==0.4.1
pyyaml==6.0.3
regex==2026.2.28
requests==2.32.5
regex==2026.3.32
rich==14.3.3
safetensors==0.7.0
sentencepiece==0.2.1
shellingham==1.5.4
starlette==0.48.0
tokenizers==0.22.2
tqdm==4.67.3
transformers==4.57.6
transformers==5.4.0
typer==0.24.1
typing-extensions==4.15.0
typing-inspection==0.4.2
urllib3==2.6.3
uvicorn==0.38.0

# Shared packages inherited from other layers
mlx-metal==0.29.3 ; platform_machine == 'arm64' and sys_platform == 'darwin'
mlx==0.29.3 ; platform_machine == 'arm64' and sys_platform == 'darwin'
mlx-metal==0.31.1 ; platform_machine == 'arm64' and sys_platform == 'darwin'
mlx==0.31.1 ; platform_machine == 'arm64' and sys_platform == 'darwin'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"lock_input_hash": "sha256:c836d5cfb697330a57241b2b8f275a804178488ec906b19866809ef33c95ba81",
"lock_input_hash": "sha256:d7a2f2a68301eb65d01fc121715ef8b96a6af48a315d580340d976fde6e1dc47",
"lock_version": 1,
"locked_at": "2026-03-22T21:45:51.270370+00:00",
"locked_at": "2026-03-29T17:39:54.163496+00:00",
"other_inputs_hash": "sha256:63b3c2cfe2ec414938e81dace7aac779c7b902bae681618cd8827e9f16880985",
"requirements_hash": "sha256:167a9044a762af6b1b0b26589b77a245bf351a3b74860bc9f1bc6a07053a48a7",
"requirements_hash": "sha256:d848ff36972adee8df190ab839a11cd766fcdd9577ae2e24ebbe1f25f9074da3",
"version_inputs_hash": "sha256:58db986b7cd72eeded675f7c9afd8138fe024fb51451131b5562922bbde3cf43"
}
Loading
Loading