localdeploy 0.6.1__tar.gz → 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. {localdeploy-0.6.1 → localdeploy-0.6.3}/CHANGELOG.md +43 -0
  2. localdeploy-0.6.3/PKG-INFO +146 -0
  3. localdeploy-0.6.3/README.md +98 -0
  4. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/__init__.py +1 -1
  5. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/cli.py +41 -1
  6. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/monitor.py +18 -1
  7. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/index.html +5 -5
  8. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/app.js +5 -5
  9. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/benchmark-views.js +3 -3
  10. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/benchmark.js +5 -5
  11. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/chat.js +20 -6
  12. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/models.js +26 -3
  13. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/system.js +1 -1
  14. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/styles.css +10 -12
  15. localdeploy-0.6.3/localdeploy.egg-info/PKG-INFO +146 -0
  16. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy.egg-info/requires.txt +8 -8
  17. {localdeploy-0.6.1 → localdeploy-0.6.3}/pyproject.toml +2 -2
  18. localdeploy-0.6.3/requirements.txt +9 -0
  19. localdeploy-0.6.1/PKG-INFO +0 -220
  20. localdeploy-0.6.1/README.md +0 -172
  21. localdeploy-0.6.1/localdeploy.egg-info/PKG-INFO +0 -220
  22. localdeploy-0.6.1/requirements.txt +0 -9
  23. {localdeploy-0.6.1 → localdeploy-0.6.3}/.env.example +0 -0
  24. {localdeploy-0.6.1 → localdeploy-0.6.3}/LICENSE +0 -0
  25. {localdeploy-0.6.1 → localdeploy-0.6.3}/MANIFEST.in +0 -0
  26. {localdeploy-0.6.1 → localdeploy-0.6.3}/SECURITY.md +0 -0
  27. {localdeploy-0.6.1 → localdeploy-0.6.3}/api_server.py +0 -0
  28. {localdeploy-0.6.1 → localdeploy-0.6.3}/benchmark.py +0 -0
  29. {localdeploy-0.6.1 → localdeploy-0.6.3}/chat_cli.py +0 -0
  30. {localdeploy-0.6.1 → localdeploy-0.6.3}/compare_models.py +0 -0
  31. {localdeploy-0.6.1 → localdeploy-0.6.3}/config.example.json +0 -0
  32. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/backends/__init__.py +0 -0
  33. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/backends/llamacpp.py +0 -0
  34. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/backends/ollama.py +0 -0
  35. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/backends/openai_compatible.py +0 -0
  36. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/benchmark.py +0 -0
  37. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/chat_cli.py +0 -0
  38. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/compare_models.py +0 -0
  39. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/__init__.py +0 -0
  40. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/_config.py +0 -0
  41. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/_ollama.py +0 -0
  42. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/bakeoff.py +0 -0
  43. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/bench.py +0 -0
  44. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/calibration.py +0 -0
  45. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/community.py +0 -0
  46. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/fit.py +0 -0
  47. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/hardware.py +0 -0
  48. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/history.py +0 -0
  49. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/manifest.py +0 -0
  50. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/models.py +0 -0
  51. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/profiles.py +0 -0
  52. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/recommend.py +0 -0
  53. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/registry.py +0 -0
  54. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/report.py +0 -0
  55. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/starter.py +0 -0
  56. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/control/updates.py +0 -0
  57. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/grader_sandbox.py +0 -0
  58. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/server.py +0 -0
  59. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/utils.py +0 -0
  60. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/favicon.png +0 -0
  61. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/js/shared.js +0 -0
  62. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy/web/logo.svg +0 -0
  63. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy.egg-info/SOURCES.txt +0 -0
  64. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy.egg-info/dependency_links.txt +0 -0
  65. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy.egg-info/entry_points.txt +0 -0
  66. {localdeploy-0.6.1 → localdeploy-0.6.3}/localdeploy.egg-info/top_level.txt +0 -0
  67. {localdeploy-0.6.1 → localdeploy-0.6.3}/setup.cfg +0 -0
@@ -2,6 +2,49 @@
2
2
 
3
3
  All notable changes to this project should be documented here.
4
4
 
5
+ ## 0.6.3 - 2026-10-22
6
+
7
+ - `localdeploy` (the pip and uvx entry point) on a taken port 8000 printed that port's UI address, opened the
8
+ browser on the other program, and ended with one bind error and exit code 0. It now checks the port first:
9
+ without a port given it uses the next free one and says so; with `--port` or `API_PORT` it stops with a clear
10
+ message and exit code 2.
11
+ - Model fit badges could disagree for the same hardware. A check that started with the early "live free VRAM" number
12
+ (for example 5.6 GB) could finish after the corrected 8 GB budget had been applied and overwrite it, so one row said
13
+ "cpu only" while its neighbour said "comfortable". Answers for an earlier budget are now discarded.
14
+ - Deploying a model from "Your models" now enables chat for it. Models pulled outside LocalDeploy had no chat profile,
15
+ so Chat stayed locked behind a second "Enable chat" step. Chat also follows the model you just loaded instead of
16
+ staying on the first one in the list, and its messages no longer say "Load an installed model" for a loaded model.
17
+ - Monitor showed 8.5 GB of VRAM on a laptop where every other screen said 8.0 GB, because it added the integrated
18
+ GPU's 512 MB to the discrete card. It now uses the same GPU pool as the fit checks.
19
+ - The UI's cache-busting token had not changed since July, so a browser that already had the page could keep
20
+ showing old styles and scripts after an upgrade. The token is bumped.
21
+ - Updated runtime dependencies: FastAPI 0.143.1, uvicorn 0.54.0, pydantic 2.14.1, python-dotenv 1.2.4, and
22
+ huggingface-hub 2.2.0 (a new major version, used for Hugging Face model search and GGUF import).
23
+ - Benchmark leaderboard: the first chip rendered as "90/90 comple..." in 0.6.2, because the longer word
24
+ "completed" did not fit its fixed-width column. The chips now size to their text and wrap onto another row on
25
+ narrow screens, so no label is cut off.
26
+
27
+ ## 0.6.2 - 2026-10-03
28
+
29
+ - Benchmark screen: the leaderboard and comparison tables said "N/N passed" even for a model with low
30
+ accuracy, because the number counts requests that finished without an error. They now say "completed".
31
+ The `passed` field in saved runs and exports is unchanged.
32
+ - "Contribute anonymized benchmark" is now "Save anonymized benchmark", and its dialog says that the
33
+ snapshot is saved to a file on this computer and nothing is sent anywhere. That was already how it
34
+ worked; the old wording suggested an upload.
35
+ - The category heatmap and the pass/fail matrix used pale text colours made for the dark theme, so the
36
+ category names were nearly invisible in the light theme. They now use the theme's text colour.
37
+ - Launchers: the root launchers (`run.bat`, `run.ps1`, `run.command`, `run.sh`) share one lifecycle,
38
+ report install failures more clearly, and `run.sh` and `run.command` are executable in the repository.
39
+ Install and run documentation was aligned with them.
40
+ - README: opens with the demo and a short quick start, the Docker example uses the `latest` tag, and the
41
+ images use absolute URLs so they render on the PyPI project page.
42
+ - The PyPI summary now matches the repository description.
43
+ - Refreshed the animated product walkthrough.
44
+ - Updated runtime dependencies, including FastAPI 0.141.1, huggingface-hub 1.31.0 and python-dotenv
45
+ 1.2.3, and the GitHub Actions used by CI and the publish workflows. CI now caches pip, and Dependabot
46
+ is configured with grouped updates.
47
+
5
48
  ## 0.6.1 - 2026-08-24
6
49
 
7
50
  - Published the Python package to PyPI and added a GHCR container publishing workflow with a
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: localdeploy
3
+ Version: 0.6.3
4
+ Summary: Find, deploy, manage, and benchmark local AI models for your hardware across Ollama, llama.cpp, and compatible runtimes.
5
+ Author: oney-erge
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/oney-erge/LocalDeploy
8
+ Project-URL: Documentation, https://github.com/oney-erge/LocalDeploy#readme
9
+ Project-URL: Changelog, https://github.com/oney-erge/LocalDeploy/blob/main/CHANGELOG.md
10
+ Project-URL: Issues, https://github.com/oney-erge/LocalDeploy/issues
11
+ Keywords: ollama,llm,local-ai,benchmark,vram,self-hosted
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Web Environment
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: fastapi==0.143.1
27
+ Requires-Dist: uvicorn==0.54.0
28
+ Requires-Dist: requests==2.34.2
29
+ Requires-Dist: python-dotenv==1.2.4
30
+ Requires-Dist: pydantic==2.14.1
31
+ Requires-Dist: python-multipart==0.0.32
32
+ Requires-Dist: huggingface_hub==2.2.0
33
+ Requires-Dist: psutil==7.2.2
34
+ Requires-Dist: pyyaml==6.0.3
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.0; extra == "dev"
37
+ Requires-Dist: httpx>=0.27; extra == "dev"
38
+ Requires-Dist: ruff==0.17.0; extra == "dev"
39
+ Requires-Dist: build>=1.2; extra == "dev"
40
+ Requires-Dist: twine>=5.0; extra == "dev"
41
+ Requires-Dist: playwright>=1.40; extra == "dev"
42
+ Requires-Dist: pillow>=10.0; extra == "dev"
43
+ Provides-Extra: packaging
44
+ Requires-Dist: pyinstaller>=6.0; extra == "packaging"
45
+ Requires-Dist: pystray>=0.19; extra == "packaging"
46
+ Requires-Dist: pillow>=10.0; extra == "packaging"
47
+ Dynamic: license-file
48
+
49
+ <p align="center">
50
+ <img src="https://raw.githubusercontent.com/oney-erge/LocalDeploy/main/localdeploy/web/logo.svg" width="96" height="96" alt="LocalDeploy logo" />
51
+ </p>
52
+
53
+ <h1 align="center">LocalDeploy</h1>
54
+
55
+ <p align="center"><strong>Choose, run, and compare local AI models on your own hardware.</strong></p>
56
+
57
+ <p align="center">
58
+ <a href="https://github.com/oney-erge/LocalDeploy/actions/workflows/ci.yml"><img src="https://github.com/oney-erge/LocalDeploy/actions/workflows/ci.yml/badge.svg" alt="CI status" /></a>
59
+ <a href="https://pypi.org/project/localdeploy/"><img src="https://img.shields.io/pypi/v/localdeploy.svg" alt="PyPI version" /></a>
60
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license" /></a>
61
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="Python 3.10+" />
62
+ </p>
63
+
64
+ <p align="center">
65
+ <img src="https://raw.githubusercontent.com/oney-erge/LocalDeploy/main/docs/assets/demo.gif" alt="LocalDeploy walkthrough showing hardware-aware model recommendations, deployment, local chat, benchmark comparisons, and live monitoring" width="820" />
66
+ </p>
67
+
68
+ LocalDeploy helps you answer a practical question before you download a model:
69
+ will it fit and run well on this machine? It detects hardware, estimates memory
70
+ use, manages local models, records benchmarks, and serves the deployed model
71
+ through an OpenAI-compatible API. It runs locally, has no telemetry, and does
72
+ not provide cloud inference.
73
+
74
+ ## Quick start
75
+
76
+ With Python 3.10+ and [Ollama](https://ollama.com) installed:
77
+
78
+ ```bash
79
+ pip install localdeploy
80
+ localdeploy # opens http://localhost:8000/ui
81
+ ```
82
+
83
+ The UI guides you through hardware detection, model search, a fit estimate,
84
+ deployment, chat, and benchmarking. If you use `uv`, `uvx localdeploy` runs it
85
+ without a permanent install.
86
+
87
+ Need help setting up Python or Ollama? Clone the repository and run its launcher:
88
+
89
+ ```bash
90
+ git clone https://github.com/oney-erge/LocalDeploy.git
91
+ cd LocalDeploy
92
+ ./run.sh # Linux; macOS: ./run.command
93
+ ```
94
+
95
+ On Windows, use `run.bat`. The launchers can prepare the environment and open
96
+ the UI; [Installation](docs/INSTALL.md) covers prerequisites, Docker, and the
97
+ Windows setup script. Desktop builds are experimental and unsigned; see
98
+ [Packaging](docs/PACKAGING.md).
99
+
100
+ ## What it helps with
101
+
102
+ - Find models from Ollama, Hugging Face, ModelScope GGUF repositories, local
103
+ GGUF files, or direct URLs.
104
+ - Estimate model fit before download, including likely CPU offload.
105
+ - Pull, deploy, switch, unload, and remove local models.
106
+ - Chat with text, images, and documents, then compare installed models using
107
+ measured latency, throughput, memory, and accuracy results.
108
+ - Monitor CPU, RAM, VRAM, model placement, and request timing while a model runs.
109
+ - Connect compatible tools through `/v1/chat/completions`, `/v1/responses`,
110
+ `/v1/embeddings`, and `/v1/models`.
111
+
112
+ If you already know which Ollama model you want and only need terminal chat,
113
+ Ollama may be enough. LocalDeploy is for selecting and evaluating models on a
114
+ particular machine.
115
+
116
+ ## What to expect
117
+
118
+ Fit estimates are guidance, not guarantees. Driver versions, context length,
119
+ quantization, desktop GPU use, and the runtime all affect actual memory use.
120
+ LocalDeploy records what happened after deployment so later estimates can be
121
+ adjusted for that machine.
122
+
123
+ It works with Ollama, llama.cpp, LM Studio, vLLM, and other loopback
124
+ OpenAI-compatible runtimes. Runtime URLs must remain local. An `API_TOKEN`
125
+ is an optional shared token, not full authentication. Keep the service on
126
+ localhost; it has no TLS, user isolation, or rate limiting. Tool calls are
127
+ returned to clients and are never executed by LocalDeploy.
128
+
129
+ Model search and the UI's release check can contact external services.
130
+ Set `OFFLINE=true` to disable those requests. Separately installed runtimes
131
+ have their own network settings; see [Security](SECURITY.md).
132
+
133
+ ## Documentation
134
+
135
+ | Guide | Use it for |
136
+ |---|---|
137
+ | [Installation](docs/INSTALL.md) | Launcher commands, Docker, and setup alternatives |
138
+ | [UI guide](docs/UI.md) | Choosing, deploying, chatting with, and benchmarking models |
139
+ | [API options](docs/API_OPTIONS.md) | OpenAI-compatible API and local integrations |
140
+ | [CLI](docs/CLI.md) | Commands and automation |
141
+ | [Models](docs/MODELS.md) | Runtimes, model discovery, and fit estimates |
142
+ | [Screenshots](docs/SCREENSHOTS.md) | The complete UI tour |
143
+ | [Packaging](docs/PACKAGING.md) | Experimental desktop builds and signing limitations |
144
+ | [Contributing](CONTRIBUTING.md) | Development setup and verification |
145
+
146
+ MIT licensed. Built by [Oney Erge](https://oneyerge.com).
@@ -0,0 +1,98 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/oney-erge/LocalDeploy/main/localdeploy/web/logo.svg" width="96" height="96" alt="LocalDeploy logo" />
3
+ </p>
4
+
5
+ <h1 align="center">LocalDeploy</h1>
6
+
7
+ <p align="center"><strong>Choose, run, and compare local AI models on your own hardware.</strong></p>
8
+
9
+ <p align="center">
10
+ <a href="https://github.com/oney-erge/LocalDeploy/actions/workflows/ci.yml"><img src="https://github.com/oney-erge/LocalDeploy/actions/workflows/ci.yml/badge.svg" alt="CI status" /></a>
11
+ <a href="https://pypi.org/project/localdeploy/"><img src="https://img.shields.io/pypi/v/localdeploy.svg" alt="PyPI version" /></a>
12
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license" /></a>
13
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="Python 3.10+" />
14
+ </p>
15
+
16
+ <p align="center">
17
+ <img src="https://raw.githubusercontent.com/oney-erge/LocalDeploy/main/docs/assets/demo.gif" alt="LocalDeploy walkthrough showing hardware-aware model recommendations, deployment, local chat, benchmark comparisons, and live monitoring" width="820" />
18
+ </p>
19
+
20
+ LocalDeploy helps you answer a practical question before you download a model:
21
+ will it fit and run well on this machine? It detects hardware, estimates memory
22
+ use, manages local models, records benchmarks, and serves the deployed model
23
+ through an OpenAI-compatible API. It runs locally, has no telemetry, and does
24
+ not provide cloud inference.
25
+
26
+ ## Quick start
27
+
28
+ With Python 3.10+ and [Ollama](https://ollama.com) installed:
29
+
30
+ ```bash
31
+ pip install localdeploy
32
+ localdeploy # opens http://localhost:8000/ui
33
+ ```
34
+
35
+ The UI guides you through hardware detection, model search, a fit estimate,
36
+ deployment, chat, and benchmarking. If you use `uv`, `uvx localdeploy` runs it
37
+ without a permanent install.
38
+
39
+ Need help setting up Python or Ollama? Clone the repository and run its launcher:
40
+
41
+ ```bash
42
+ git clone https://github.com/oney-erge/LocalDeploy.git
43
+ cd LocalDeploy
44
+ ./run.sh # Linux; macOS: ./run.command
45
+ ```
46
+
47
+ On Windows, use `run.bat`. The launchers can prepare the environment and open
48
+ the UI; [Installation](docs/INSTALL.md) covers prerequisites, Docker, and the
49
+ Windows setup script. Desktop builds are experimental and unsigned; see
50
+ [Packaging](docs/PACKAGING.md).
51
+
52
+ ## What it helps with
53
+
54
+ - Find models from Ollama, Hugging Face, ModelScope GGUF repositories, local
55
+ GGUF files, or direct URLs.
56
+ - Estimate model fit before download, including likely CPU offload.
57
+ - Pull, deploy, switch, unload, and remove local models.
58
+ - Chat with text, images, and documents, then compare installed models using
59
+ measured latency, throughput, memory, and accuracy results.
60
+ - Monitor CPU, RAM, VRAM, model placement, and request timing while a model runs.
61
+ - Connect compatible tools through `/v1/chat/completions`, `/v1/responses`,
62
+ `/v1/embeddings`, and `/v1/models`.
63
+
64
+ If you already know which Ollama model you want and only need terminal chat,
65
+ Ollama may be enough. LocalDeploy is for selecting and evaluating models on a
66
+ particular machine.
67
+
68
+ ## What to expect
69
+
70
+ Fit estimates are guidance, not guarantees. Driver versions, context length,
71
+ quantization, desktop GPU use, and the runtime all affect actual memory use.
72
+ LocalDeploy records what happened after deployment so later estimates can be
73
+ adjusted for that machine.
74
+
75
+ It works with Ollama, llama.cpp, LM Studio, vLLM, and other loopback
76
+ OpenAI-compatible runtimes. Runtime URLs must remain local. An `API_TOKEN`
77
+ is an optional shared token, not full authentication. Keep the service on
78
+ localhost; it has no TLS, user isolation, or rate limiting. Tool calls are
79
+ returned to clients and are never executed by LocalDeploy.
80
+
81
+ Model search and the UI's release check can contact external services.
82
+ Set `OFFLINE=true` to disable those requests. Separately installed runtimes
83
+ have their own network settings; see [Security](SECURITY.md).
84
+
85
+ ## Documentation
86
+
87
+ | Guide | Use it for |
88
+ |---|---|
89
+ | [Installation](docs/INSTALL.md) | Launcher commands, Docker, and setup alternatives |
90
+ | [UI guide](docs/UI.md) | Choosing, deploying, chatting with, and benchmarking models |
91
+ | [API options](docs/API_OPTIONS.md) | OpenAI-compatible API and local integrations |
92
+ | [CLI](docs/CLI.md) | Commands and automation |
93
+ | [Models](docs/MODELS.md) | Runtimes, model discovery, and fit estimates |
94
+ | [Screenshots](docs/SCREENSHOTS.md) | The complete UI tour |
95
+ | [Packaging](docs/PACKAGING.md) | Experimental desktop builds and signing limitations |
96
+ | [Contributing](CONTRIBUTING.md) | Development setup and verification |
97
+
98
+ MIT licensed. Built by [Oney Erge](https://oneyerge.com).
@@ -1,3 +1,3 @@
1
1
  """LocalDeploy manages and benchmarks AI models on local runtimes."""
2
2
 
3
- __version__ = "0.6.1"
3
+ __version__ = "0.6.3"
@@ -10,6 +10,8 @@ from __future__ import annotations
10
10
 
11
11
  import argparse
12
12
  import os
13
+ import socket
14
+ import sys
13
15
  import threading
14
16
  import webbrowser
15
17
 
@@ -17,6 +19,40 @@ from . import __version__
17
19
  from .utils import api_client_base_url, app_home
18
20
 
19
21
 
22
+ def port_in_use(host: str, port: int) -> bool:
23
+ """True when something already accepts connections on host:port."""
24
+ probe_host = "127.0.0.1" if host in {"", "0.0.0.0"} else "::1" if host == "::" else host
25
+ try:
26
+ with socket.create_connection((probe_host, port), timeout=0.3):
27
+ return True
28
+ except OSError:
29
+ return False
30
+
31
+
32
+ def choose_port(host: str, port: int, *, explicit: bool, attempts: int = 10) -> int | None:
33
+ """Return the port to serve on, or None (after saying why) when none can be used.
34
+
35
+ Port 8000 is a popular default, so another local tool often holds it. Without this check
36
+ LocalDeploy printed that port's URL, opened the browser on the other program, and ended with
37
+ a single bind error and exit code 0. An explicitly requested port is never changed silently.
38
+ """
39
+ if not port_in_use(host, port):
40
+ return port
41
+ if explicit:
42
+ print(
43
+ f"Port {port} is already in use by another program. Pick a different one, "
44
+ f"for example: localdeploy --port {port + 1}",
45
+ file=sys.stderr,
46
+ )
47
+ return None
48
+ for candidate in range(port + 1, port + attempts + 1):
49
+ if not port_in_use(host, candidate):
50
+ print(f"Port {port} is already in use; using {candidate} instead.")
51
+ return candidate
52
+ print(f"Ports {port}-{port + attempts} are all in use. Pick one with --port.", file=sys.stderr)
53
+ return None
54
+
55
+
20
56
  def main(argv: list[str] | None = None) -> int:
21
57
  parser = argparse.ArgumentParser(
22
58
  prog="localdeploy",
@@ -42,7 +78,11 @@ def main(argv: list[str] | None = None) -> int:
42
78
  from localdeploy.server import app # noqa: PLC0415 - import after env is settled
43
79
 
44
80
  host = os.getenv("API_HOST", "127.0.0.1")
45
- port = int(os.getenv("API_PORT", "8000"))
81
+ chosen = choose_port(host, int(os.getenv("API_PORT", "8000")), explicit=bool(args.port) or "API_PORT" in os.environ)
82
+ if chosen is None:
83
+ return 2
84
+ port = chosen
85
+ os.environ["API_PORT"] = str(port) # client scripts started from here read the port from the environment
46
86
  client_base = api_client_base_url(host, port)
47
87
  url = f"{client_base}/ui"
48
88
  print(f"LocalDeploy {__version__}")
@@ -155,8 +155,25 @@ def record_request(
155
155
  })
156
156
 
157
157
 
158
- def _sample_hardware(hw: Dict[str, Any]) -> Dict[str, Any]:
158
+ def _primary_gpus(hw: Dict[str, Any]) -> List[Dict[str, Any]]:
159
+ """GPUs in the largest compatible pool, the same pool the fit checks use.
160
+
161
+ Adding an integrated GPU's small memory to a discrete card's would make the
162
+ Monitor disagree with the System card (8.5 GB against 8.0 GB on a laptop
163
+ with an RTX 3080 and a Radeon iGPU).
164
+ """
159
165
  gpus = hw.get("gpus") or []
166
+ groups = (hw.get("gpu_summary") or {}).get("compatible_groups") or []
167
+ if groups:
168
+ indexes = set(groups[0].get("gpu_indexes") or [])
169
+ picked = [gpu for index, gpu in enumerate(gpus) if index in indexes]
170
+ if picked:
171
+ return picked
172
+ return gpus
173
+
174
+
175
+ def _sample_hardware(hw: Dict[str, Any]) -> Dict[str, Any]:
176
+ gpus = _primary_gpus(hw)
160
177
  vram_total = sum(g.get("vram_total_mb") or 0 for g in gpus) or None
161
178
  vram_used = sum(g.get("vram_used_mb") or 0 for g in gpus) or None
162
179
  utils = [g.get("utilization_pct") for g in gpus if g.get("utilization_pct") is not None]
@@ -4,8 +4,8 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>LocalDeploy</title>
7
- <link rel="icon" type="image/png" href="favicon.png?v=20260719-ui32" />
8
- <link rel="stylesheet" href="styles.css?v=20260719-ui32" />
7
+ <link rel="icon" type="image/png" href="favicon.png?v=20261020-ui33" />
8
+ <link rel="stylesheet" href="styles.css?v=20261020-ui33" />
9
9
  <script>
10
10
  // Applied synchronously, before CSS renders, so a saved preference never flashes the other theme.
11
11
  try {
@@ -19,7 +19,7 @@
19
19
  <body>
20
20
  <header class="topbar">
21
21
  <button class="brand brand-button" id="brand-home" type="button" title="Go to setup">
22
- <img class="brand-icon" src="logo.svg?v=20260719-ui32" alt="" />
22
+ <img class="brand-icon" src="logo.svg?v=20261020-ui33" alt="" />
23
23
  <span>LocalDeploy</span>
24
24
  </button>
25
25
  <nav class="tabs" role="tablist">
@@ -646,7 +646,7 @@
646
646
  <div class="row gap">
647
647
  <button class="btn danger" id="btn-run-cancel" hidden>Cancel</button>
648
648
  <button class="btn" id="btn-export" disabled title="Select a completed run">Export run</button>
649
- <button class="btn" id="btn-contribute" disabled title="Select a completed run">Contribute anonymized benchmark</button>
649
+ <button class="btn" id="btn-contribute" disabled title="Select a completed run">Save anonymized benchmark</button>
650
650
  </div>
651
651
  </div>
652
652
  <div class="bench-summary-grid">
@@ -886,6 +886,6 @@
886
886
 
887
887
  <div id="ui-tooltip" class="ui-tooltip" role="tooltip" aria-hidden="true"></div>
888
888
  <div id="toasts" class="toasts" aria-live="polite"></div>
889
- <script type="module" src="js/app.js?v=20260719-ui32"></script>
889
+ <script type="module" src="js/app.js?v=20261020-ui33"></script>
890
890
  </body>
891
891
  </html>
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import { $, $$, initSharedUI, toast } from "./shared.js?v=20260719-ui32";
4
- import { getSystemSnapshot, initSystem, refreshOllamaStatus, refreshSystem, setMonitorActive, subscribeToSystemChanges, updateModelContext as updateSystemModelContext } from "./system.js?v=20260719-ui32";
5
- import { getModelSnapshot, initModels, refreshModels, setDefaultProfile, subscribeToModelChanges, updateSystemContext as updateModelsSystemContext } from "./models.js?v=20260719-ui32";
6
- import { initChat, updateModelContext as updateChatModelContext } from "./chat.js?v=20260719-ui32";
7
- import { initBenchmark, refreshBenchmarkMetadata, updateModelContext as updateBenchmarkModelContext, updateSystemContext as updateBenchmarkSystemContext } from "./benchmark.js?v=20260719-ui32";
3
+ import { $, $$, initSharedUI, toast } from "./shared.js?v=20261020-ui33";
4
+ import { getSystemSnapshot, initSystem, refreshOllamaStatus, refreshSystem, setMonitorActive, subscribeToSystemChanges, updateModelContext as updateSystemModelContext } from "./system.js?v=20261020-ui33";
5
+ import { getModelSnapshot, initModels, refreshModels, setDefaultProfile, subscribeToModelChanges, updateSystemContext as updateModelsSystemContext } from "./models.js?v=20261020-ui33";
6
+ import { initChat, updateModelContext as updateChatModelContext } from "./chat.js?v=20261020-ui33";
7
+ import { initBenchmark, refreshBenchmarkMetadata, updateModelContext as updateBenchmarkModelContext, updateSystemContext as updateBenchmarkSystemContext } from "./benchmark.js?v=20261020-ui33";
8
8
 
9
9
  function propagateSystem(snapshot = getSystemSnapshot()) {
10
10
  updateModelsSystemContext(snapshot);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { esc } from "./shared.js?v=20260719-ui32";
3
+ import { esc } from "./shared.js?v=20261020-ui33";
4
4
 
5
5
  function runLabel(run) { return [run.profile || run.modelId || "run", run.actualDevice || run.requestedDevice].filter(Boolean).join(" · "); }
6
6
  function categorySummary(tests = []) {
@@ -18,7 +18,7 @@ export function renderWinners(runs) {
18
18
  const bestTps = [...runs].filter((run) => run.summary.avg_tokens_per_second != null).sort((a, b) => b.summary.avg_tokens_per_second - a.summary.avg_tokens_per_second)[0];
19
19
  const categories = new Set(runs.flatMap((run) => (run.category_summary || categorySummary(run.tests)).map((row) => row.category)));
20
20
  return [
21
- `<div class="metric-tile"><span>Top run</span><strong>${esc(runLabel(top))}</strong><small>${esc(top.summary.passed)}/${esc(top.summary.tests)} passed</small></div>`,
21
+ `<div class="metric-tile"><span>Top run</span><strong>${esc(runLabel(top))}</strong><small>${esc(top.summary.passed)}/${esc(top.summary.tests)} completed</small></div>`,
22
22
  `<div class="metric-tile"><span>Accuracy</span><strong>${esc(top.summary.avg_accuracy)}</strong><small>${esc(top.questionSetName || "benchmark")}</small></div>`,
23
23
  fastest ? `<div class="metric-tile"><span>Fastest</span><strong>${esc(fastest.summary.avg_latency_s)}s</strong><small>${esc(runLabel(fastest))}</small></div>` : "",
24
24
  bestTps ? `<div class="metric-tile"><span>Best tok/s</span><strong>${esc(bestTps.summary.avg_tokens_per_second)}</strong><small>${esc(runLabel(bestTps))}</small></div>` : "",
@@ -28,7 +28,7 @@ export function renderWinners(runs) {
28
28
 
29
29
  export function renderLeaderboard(runs) {
30
30
  if (!runs.length) return "Benchmark results appear here after the first streamed test result.";
31
- const rows = [...runs].sort((a, b) => (b.summary.passed || 0) - (a.summary.passed || 0) || (b.summary.avg_accuracy || 0) - (a.summary.avg_accuracy || 0) || (a.summary.avg_latency_s || 999999) - (b.summary.avg_latency_s || 999999)).map((run, index) => `<div class="leaderboard-row"><span class="rank">${index + 1}</span><div class="leaderboard-name"><b>${esc(runLabel(run))}</b><span>${esc(run.questionSetName || "")}</span></div><div class="leaderboard-metrics"><span><b>${esc(run.summary.passed)}/${esc(run.summary.tests)}</b> passed</span><span><b>${esc(run.summary.avg_accuracy)}</b> acc</span><span><b>${esc(run.summary.avg_latency_s)}s</b> latency</span><span><b>${esc(run.summary.avg_tokens_per_second ?? "-")}</b> tok/s</span></div></div>`).join("");
31
+ const rows = [...runs].sort((a, b) => (b.summary.passed || 0) - (a.summary.passed || 0) || (b.summary.avg_accuracy || 0) - (a.summary.avg_accuracy || 0) || (a.summary.avg_latency_s || 999999) - (b.summary.avg_latency_s || 999999)).map((run, index) => `<div class="leaderboard-row"><span class="rank">${index + 1}</span><div class="leaderboard-name"><b>${esc(runLabel(run))}</b><span>${esc(run.questionSetName || "")}</span></div><div class="leaderboard-metrics"><span><b>${esc(run.summary.passed)}/${esc(run.summary.tests)}</b> completed</span><span><b>${esc(run.summary.avg_accuracy)}</b> acc</span><span><b>${esc(run.summary.avg_latency_s)}s</b> latency</span><span><b>${esc(run.summary.avg_tokens_per_second ?? "-")}</b> tok/s</span></div></div>`).join("");
32
32
  return `<div class="leaderboard-list">${rows}</div>`;
33
33
  }
34
34
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import { $, $$, busy, downloadFile, esc, fmtMb, getJSON, postJSON, postMaybeStream, simpleModal, toast } from "./shared.js?v=20260719-ui32";
4
- import { renderHeatmap, renderLeaderboard, renderMatrix, renderResponseComparison, renderScatter, renderWinners } from "./benchmark-views.js?v=20260719-ui32";
3
+ import { $, $$, busy, downloadFile, esc, fmtMb, getJSON, postJSON, postMaybeStream, simpleModal, toast } from "./shared.js?v=20261020-ui33";
4
+ import { renderHeatmap, renderLeaderboard, renderMatrix, renderResponseComparison, renderScatter, renderWinners } from "./benchmark-views.js?v=20261020-ui33";
5
5
 
6
6
  const state = {
7
7
  profiles: [], profileData: {}, profileModels: {}, defaultProfile: null,
@@ -1213,7 +1213,7 @@ async function renderComparison(runs, baseline) {
1213
1213
  .map((name) => `<button class="btn compact response-compare-btn" data-test="${esc(name)}">${esc(name)}</button>`)
1214
1214
  .join("");
1215
1215
  $("#compare-body").innerHTML = `<div class="table-wrap"><table class="results">
1216
- <thead><tr><th>Run</th><th class="num">Passed</th><th class="num">Accuracy Δ</th><th class="num">Latency Δ</th><th class="num">tok/s Δ</th></tr></thead>
1216
+ <thead><tr><th>Run</th><th class="num">Completed</th><th class="num">Accuracy Δ</th><th class="num">Latency Δ</th><th class="num">tok/s Δ</th></tr></thead>
1217
1217
  <tbody>${rows}</tbody></table></div>
1218
1218
  <h3 class="sub">Response detail</h3><div class="response-test-list">${testButtons}</div>
1219
1219
  <div id="regression-diffs"></div>`;
@@ -1329,8 +1329,8 @@ async function contributeRun() {
1329
1329
  const out = await postJSON("/system/community/preview", { card: runToCardPayload(run) });
1330
1330
  if (!out.success) throw new Error(out.error || "Preview failed.");
1331
1331
  const overlay = simpleModal(
1332
- "Contribute this benchmark",
1333
- `Exactly what would be shared - review before saving. ${esc(out.note)}`,
1332
+ "Save an anonymized benchmark",
1333
+ `This anonymized snapshot is saved to a file on this computer. Nothing is sent anywhere. ${esc(out.note)}`,
1334
1334
  `<pre class="log manifest-yaml">${esc(JSON.stringify(out.would_share, null, 2))}</pre>
1335
1335
  <details style="margin-top:0.5rem"><summary class="muted small">Never included</summary>
1336
1336
  <div class="muted small">${out.excluded_fields.map(esc).join(", ")}</div>
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
 
3
- import { $, $$, downloadFile, esc, fmtBytes, formatExpires, postJSON, postMaybeStream, toast } from "./shared.js?v=20260719-ui32";
3
+ import { $, $$, downloadFile, esc, fmtBytes, formatExpires, postJSON, postMaybeStream, toast } from "./shared.js?v=20261020-ui33";
4
4
 
5
5
  const state = {
6
6
  profiles: [], profileData: {}, profileModels: {}, defaultProfile: null,
7
7
  installedLoaded: false, installedList: [],
8
8
  chatMessages: [], chatImages: [], chatFiles: [], chatController: null,
9
9
  chatSessionBusy: false, chatSessionOperation: null,
10
+ // True once the user picks a model in the Chat picker; until then Chat follows the loaded model.
11
+ chatModelChosen: false,
10
12
  };
11
13
  let initialized = false;
12
14
  let onModelStateInvalidated = async () => {};
@@ -101,9 +103,11 @@ function renderChatModelOptions() {
101
103
  const names = models.map((item) => item.name).filter(Boolean);
102
104
  const byName = Object.fromEntries(models.map((item) => [item.name, item]));
103
105
  const defaultModel = state.profileModels[state.defaultProfile];
106
+ const currentIsLoaded = names.includes(current) && !!byName[current]?.is_loaded;
104
107
  const preferred =
105
- (names.includes(current) && current) ||
108
+ (names.includes(current) && (state.chatModelChosen || currentIsLoaded) && current) ||
106
109
  names.find((name) => byName[name]?.is_loaded) ||
110
+ (names.includes(current) && current) ||
107
111
  (names.includes(defaultModel) && defaultModel) ||
108
112
  names[0];
109
113
  select.innerHTML = names
@@ -146,7 +150,14 @@ function updateChatModelState() {
146
150
  }
147
151
  input.disabled = !ready || !!operation;
148
152
  send.disabled = (!ready || !!operation) && !state.chatController;
149
- input.placeholder = operation ? `${operation === "unloading" ? "Unloading" : "Loading"} ${model}…` : ready ? "Message this local model" : "Load an installed model to start chatting";
153
+ const loadedWithoutProfile = !!(model && running && !profile);
154
+ input.placeholder = operation
155
+ ? `${operation === "unloading" ? "Unloading" : "Loading"} ${model}…`
156
+ : ready
157
+ ? "Message this local model"
158
+ : loadedWithoutProfile
159
+ ? "Select Enable chat above to start chatting"
160
+ : "Load an installed model to start chatting";
150
161
  duration.disabled = ready || !!operation;
151
162
  action.disabled = !model || !!operation || !!state.chatController;
152
163
  session.className = `chat-session-state${ready && !operation ? " ready" : operation ? " loading" : ""}`;
@@ -725,9 +736,12 @@ function renderChatWelcome() {
725
736
  return;
726
737
  }
727
738
  if (!ready) {
739
+ const loaded = !!runningChatModel(model);
728
740
  welcome.innerHTML = `<div class="chat-welcome-mark">${esc(model.slice(0, 1).toUpperCase())}</div>
729
- <h3>${esc(model)} is installed</h3>
730
- <p class="muted small">Use Load model above to warm it for the displayed keep-loaded duration.</p>`;
741
+ <h3>${esc(model)} is ${loaded ? "loaded" : "installed"}</h3>
742
+ <p class="muted small">${loaded
743
+ ? "Select Enable chat above to start a conversation with it."
744
+ : "Use Load model above to warm it for the displayed keep-loaded duration."}</p>`;
731
745
  list.appendChild(welcome);
732
746
  return;
733
747
  }
@@ -764,7 +778,7 @@ export function initChat(options = {}) {
764
778
  onNavigate = options.onNavigate || onNavigate;
765
779
  $("#btn-chat-send")?.addEventListener("click", sendChatMessage);
766
780
  $("#btn-chat-clear")?.addEventListener("click", clearChat);
767
- $("#chat-model")?.addEventListener("change", updateChatModelState);
781
+ $("#chat-model")?.addEventListener("change", () => { state.chatModelChosen = true; updateChatModelState(); });
768
782
  $("#chat-keep-alive")?.addEventListener("change", updateChatModelState);
769
783
  $("#btn-chat-session")?.addEventListener("click", toggleChatSession);
770
784
  $("#btn-chat-system-toggle")?.addEventListener("click", () => { const panel = $("#chat-system-panel"); panel.classList.toggle("hidden"); if (!panel.classList.contains("hidden")) $("#chat-system").focus(); });
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { $, $$, busy, currentTheme, downloadFile, esc, fmtBytes, fmtDuration, fmtMb, formatExpires, getJSON, postJSON, postMaybeStream, simpleModal, skeletonHtml, startElapsed, toast, vramBarHtml } from "./shared.js?v=20260719-ui32";
3
+ import { $, $$, busy, currentTheme, downloadFile, esc, fmtBytes, fmtDuration, fmtMb, formatExpires, getJSON, postJSON, postMaybeStream, simpleModal, skeletonHtml, startElapsed, toast, vramBarHtml } from "./shared.js?v=20261020-ui33";
4
4
 
5
5
  const state = {
6
6
  profiles: [], profileData: {}, profileModels: {}, defaultProfile: null,
@@ -27,6 +27,11 @@ function readonly(value) {
27
27
  }
28
28
  function targetVram() { return state.systemContext.vramBudgetMb ?? state.systemContext.vramTotalMb ?? state.systemContext.vramFreeMb; }
29
29
  export function fitCacheKey(model, budgetMb) { return `${model}|${budgetMb ?? "auto"}`; }
30
+ // A fit answer is only current while the budget it was computed for is still the
31
+ // budget on screen. Without this check a slow answer for an earlier budget (such as
32
+ // the live free VRAM seen before the total arrives) lands after the corrected one
33
+ // and overwrites it, so neighbouring rows disagree about the same hardware.
34
+ export function fitResultIsCurrent(requestKey, model, budgetMb) { return requestKey === fitCacheKey(model, budgetMb); }
30
35
  function normalizedProfiles() {
31
36
  return state.profiles.map((name) => {
32
37
  const raw = clone(state.profileData[name] || {});
@@ -740,7 +745,7 @@ async function fitCheckRow(row, force = false) {
740
745
  try {
741
746
  const res = await postJSON("/system/fit-check", fitRequestForModel(model, details, installed.size));
742
747
  state.fitCache[cacheKey] = res;
743
- render(res);
748
+ if (fitResultIsCurrent(cacheKey, model, targetVram())) render(res);
744
749
  } catch (err) {
745
750
  slot.innerHTML = `<span class="muted">error</span>`;
746
751
  toast(`Fit check failed: ${err.message}`, "error");
@@ -749,6 +754,23 @@ async function fitCheckRow(row, force = false) {
749
754
  }
750
755
  }
751
756
 
757
+ // A deployed model should be ready to chat with. Models pulled outside LocalDeploy
758
+ // have no enabled profile, which left Chat locked behind a second "Enable chat" step.
759
+ // Best effort: if the profile cannot be saved, Chat still offers that step.
760
+ async function ensureChatProfile(model) {
761
+ const enabled = state.profiles.some((name) => {
762
+ const profile = state.profileData[name] || {};
763
+ return (profile.backend || "ollama") === "ollama" && profile.model_id === model && profile.enabled === true;
764
+ });
765
+ if (enabled) return;
766
+ try {
767
+ const saved = await postJSON("/profiles/upsert", { model_id: model, backend: "ollama", fields: { enabled: true } });
768
+ if (saved.success) await loadProfiles();
769
+ } catch (err) {
770
+ console.warn("Could not enable chat for", model, err);
771
+ }
772
+ }
773
+
752
774
  async function startInstalledModel(name, btn) {
753
775
  if (!name) return;
754
776
  busy(btn, true);
@@ -763,6 +785,7 @@ async function startInstalledModel(name, btn) {
763
785
  });
764
786
  stop();
765
787
  showServeResult(res);
788
+ if (res.success) await ensureChatProfile(name);
766
789
  await refreshLiveModelState(true);
767
790
  } catch (err) {
768
791
  stop();
@@ -1375,7 +1398,7 @@ function renderBakeoffResult(evt) {
1375
1398
  <h3 class="sub">${esc(evt.winner)}</h3>
1376
1399
  </div>
1377
1400
  <div class="table-wrap"><table class="results">
1378
- <thead><tr><th>Model</th><th class="num">Passed</th><th class="num">Accuracy</th><th class="num">Avg latency</th><th class="num">Headroom</th></tr></thead>
1401
+ <thead><tr><th>Model</th><th class="num">Completed</th><th class="num">Accuracy</th><th class="num">Avg latency</th><th class="num">Headroom</th></tr></thead>
1379
1402
  <tbody>${rows}</tbody>
1380
1403
  </table></div>
1381
1404
  <div class="row gap wrap" style="margin-top:0.5rem">