Skip to content

Commit 872302b

Browse files
authored
Merge pull request #730 from doringeman/rm-models-path-makefile
refactor: remove models-store in favor of default ~/.docker/models
2 parents d494aec + 3731f27 commit 872302b

5 files changed

Lines changed: 8 additions & 18 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
model-runner
33
model-runner.sock
44
docker-model
5-
# Default MODELS_PATH in Makefile
6-
models-store/
75
# Directory where we store the updated llama.cpp
86
updated-inference/
97
vendor/

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ DOCKER_IMAGE_SGLANG := docker/model-runner:latest-sglang
1212
DOCKER_IMAGE_DIFFUSERS := docker/model-runner:latest-diffusers
1313
DOCKER_TARGET ?= final-llamacpp
1414
PORT := 8080
15-
MODELS_PATH := $(shell pwd)/models-store
1615
LLAMA_ARGS ?=
1716
DOCKER_BUILD_ARGS := \
1817
--load \
@@ -65,7 +64,6 @@ run: build
6564
clean:
6665
rm -f $(APP_NAME)
6766
rm -f model-runner.sock
68-
rm -rf $(MODELS_PATH)
6967

7068
# Run tests
7169
test:
@@ -166,12 +164,11 @@ docker-run-diffusers: docker-build-diffusers
166164
# Common implementation for running Docker container
167165
docker-run-impl:
168166
@echo ""
169-
@echo "Starting service on port $(PORT) with model storage at $(MODELS_PATH)..."
167+
@echo "Starting service on port $(PORT)..."
170168
@echo "Service will be available at: http://localhost:$(PORT)"
171169
@echo "Example usage: curl http://localhost:$(PORT)/models"
172170
@echo ""
173171
PORT="$(PORT)" \
174-
MODELS_PATH="$(MODELS_PATH)" \
175172
DOCKER_IMAGE="$(DOCKER_IMAGE)" \
176173
LLAMA_ARGS="$(LLAMA_ARGS)" \
177174
DMR_ORIGINS="$(DMR_ORIGINS)" \

cmd/cli/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ARG DOCS_FORMATS
2222
RUN --mount=target=/context \
2323
--mount=target=.,type=tmpfs <<EOT
2424
set -e
25-
rsync -a --exclude='models-store' /context/. .
25+
rsync -a /context/. .
2626
docsgen --formats "$DOCS_FORMATS" --source "cmd/cli/docs/reference"
2727
mkdir /out
2828
cp -r cmd/cli/docs/reference/* /out/
@@ -35,7 +35,7 @@ FROM docs-build AS docs-validate
3535
RUN --mount=target=/context \
3636
--mount=target=.,type=tmpfs <<EOT
3737
set -e
38-
rsync -a --exclude='models-store' /context/. .
38+
rsync -a /context/. .
3939
git add -A
4040
rm -rf cmd/cli/docs/reference/*
4141
cp -rf /out/* ./cmd/cli/docs/reference/

demos/embeddings/indexer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CodebaseIndexer {
2929
const ig = ignore().add(content);
3030

3131
// Always ignore these
32-
ig.add(['node_modules', '.git', 'embeddings-index.json', 'models-store', 'model-store']);
32+
ig.add(['node_modules', '.git', 'embeddings-index.json']);
3333

3434
return ig;
3535
} catch (error) {

scripts/docker-run.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ add_optional_args() {
3333
args+=(-p "$PORT:$PORT" -e "MODEL_RUNNER_PORT=$PORT")
3434
fi
3535

36-
if [ -n "${MODELS_PATH-}" ]; then
37-
args+=(-v "$MODELS_PATH:/models" -e MODELS_PATH=/models)
38-
fi
36+
args+=(-v "$models_path:/models" -e MODELS_PATH=/models)
3937

4038
for i in /usr/local/dcmi /usr/local/bin/npu-smi /usr/local/Ascend/driver/lib64/ /usr/local/Ascend/driver/version.info /etc/ascend_install.info; do
4139
if [ -e "$i" ]; then
@@ -65,14 +63,11 @@ add_optional_args() {
6563
main() {
6664
set -eux -o pipefail
6765

66+
local models_path="${MODELS_PATH:-$HOME/.docker/models}"
6867
local args=(docker run --rm -e LLAMA_SERVER_PATH=/app/bin)
6968
add_optional_args
70-
71-
# Ensure model path exists only if provided
72-
if [ -n "${MODELS_PATH-}" ]; then
73-
mkdir -p "$MODELS_PATH"
74-
chmod a+rwx "$MODELS_PATH"
75-
fi
69+
mkdir -p "$models_path"
70+
chmod a+rwx "$models_path"
7671

7772
if [ -z "${DOCKER_IMAGE-}" ]; then
7873
echo "DOCKER_IMAGE is required" >&2

0 commit comments

Comments
 (0)