-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (74 loc) · 4.22 KB
/
Copy pathMakefile
File metadata and controls
95 lines (74 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Prefix for venv binaries. Override with `make BIN= test` in CI
# where tools are installed globally (no .venv).
BIN = .venv/bin/
.PHONY: run lint format check typecheck client-check workshop-dev audit-deps check-install-constraints module-sizes test setup config install install-status runtime-access tts-model refresh-models
run:
$(BIN)python -m kai
lint:
$(BIN)ruff check .
format:
$(BIN)ruff format .
check: lint
$(BIN)ruff format --check .
typecheck:
$(BIN)pyright --pythonpath "$$($(BIN)python -c 'import sys; print(sys.executable)')"
client-check:
cd workshop-client && npm run check
workshop-dev:
cd workshop-client && npm run dev -- --host 0.0.0.0 --port 5173
audit-deps:
$(BIN)pip-audit --local --skip-editable
check-install-constraints:
$(BIN)python -m pip install --dry-run --upgrade \
--constraint requirements/constraints.txt pip setuptools
$(BIN)python -m pip install --dry-run --constraint requirements/constraints.txt -e '.[memory,totp,tts]'
$(BIN)python -m pip install --dry-run --constraint requirements/constraints.txt -e '.[memory,telegram,totp,tts]'
module-sizes:
$(BIN)python scripts/module-sizes.py
test:
$(BIN)python -m pytest tests/ -v
# Development environment setup (editable install with dev tools)
setup:
$(BIN)python -m pip install --upgrade \
--constraint requirements/constraints.txt pip setuptools
$(BIN)python -m pip install --upgrade \
--constraint requirements/constraints.txt -e '.[dev,telegram]'
# Protected installation targets
config:
$(BIN)python -m kai install config
# Any non-empty DRY_RUN becomes an explicit CLI flag inside the root
# process. Do not rely on sudo environment propagation for this safety gate.
install:
sudo $(BIN)python -m kai install apply $(if $(strip $(DRY_RUN)),--dry-run,)
install-status:
sudo $(BIN)python -m kai install status
runtime-access:
sudo $(BIN)python -m kai install runtime-access
# Refresh helper for PROVIDER_MODELS. Queries each curated provider's
# /v1/models endpoint and prints a diff against the in-tree list;
# operator hand-edits src/kai/config.py after review. Pass
# `ARGS=--write-snippet` to emit a paste-able Python fragment.
refresh-models:
$(BIN)python -m kai.refresh_models $(ARGS)
models/ggml-base.en.bin:
mkdir -p models
curl -L -o $@ https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin
PIPER_URL = https://huggingface.co/rhasspy/piper-voices/resolve/main
tts-model:
mkdir -p models/piper
curl -L -o models/piper/en_GB-cori-medium.onnx $(PIPER_URL)/en/en_GB/cori/medium/en_GB-cori-medium.onnx
curl -L -o models/piper/en_GB-cori-medium.onnx.json $(PIPER_URL)/en/en_GB/cori/medium/en_GB-cori-medium.onnx.json
curl -L -o models/piper/en_GB-alba-medium.onnx $(PIPER_URL)/en/en_GB/alba/medium/en_GB-alba-medium.onnx
curl -L -o models/piper/en_GB-alba-medium.onnx.json $(PIPER_URL)/en/en_GB/alba/medium/en_GB-alba-medium.onnx.json
curl -L -o models/piper/en_GB-jenny_dioco-medium.onnx $(PIPER_URL)/en/en_GB/jenny_dioco/medium/en_GB-jenny_dioco-medium.onnx
curl -L -o models/piper/en_GB-jenny_dioco-medium.onnx.json $(PIPER_URL)/en/en_GB/jenny_dioco/medium/en_GB-jenny_dioco-medium.onnx.json
curl -L -o models/piper/en_GB-alan-medium.onnx $(PIPER_URL)/en/en_GB/alan/medium/en_GB-alan-medium.onnx
curl -L -o models/piper/en_GB-alan-medium.onnx.json $(PIPER_URL)/en/en_GB/alan/medium/en_GB-alan-medium.onnx.json
curl -L -o models/piper/en_US-amy-medium.onnx $(PIPER_URL)/en/en_US/amy/medium/en_US-amy-medium.onnx
curl -L -o models/piper/en_US-amy-medium.onnx.json $(PIPER_URL)/en/en_US/amy/medium/en_US-amy-medium.onnx.json
curl -L -o models/piper/en_US-lessac-medium.onnx $(PIPER_URL)/en/en_US/lessac/medium/en_US-lessac-medium.onnx
curl -L -o models/piper/en_US-lessac-medium.onnx.json $(PIPER_URL)/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json
curl -L -o models/piper/en_US-ryan-medium.onnx $(PIPER_URL)/en/en_US/ryan/medium/en_US-ryan-medium.onnx
curl -L -o models/piper/en_US-ryan-medium.onnx.json $(PIPER_URL)/en/en_US/ryan/medium/en_US-ryan-medium.onnx.json
curl -L -o models/piper/en_US-joe-medium.onnx $(PIPER_URL)/en/en_US/joe/medium/en_US-joe-medium.onnx
curl -L -o models/piper/en_US-joe-medium.onnx.json $(PIPER_URL)/en/en_US/joe/medium/en_US-joe-medium.onnx.json