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 .github/skills/thunder-forge/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ uv run thunder-forge runtime setup-daemon --node infer-01 --admin-user <admin> -
uv run thunder-forge runtime restart --node infer-01 --manager daemon --apply
uv run thunder-forge service restart --service omlx --node infer-01 --manager daemon --apply
uv run thunder-forge runtime smoke --node infer-01 --model <model>
make olla-install
make olla-restart
make bootstrap
make restart
make bootstrap infer-01
make restart infer-01
make smoke infer-01
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
pull_request:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: uv sync --frozen

- name: Check formatting hazards
run: git diff --check

- name: Lint
run: uv run ruff check .

- name: Test
run: uv run pytest --tb=short -q
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
UV ?= uv run

_TARGETS := help cli-help dev-sync dev-test dev-lint dev-check bootstrap restart smoke status sync prune config usage-report usage-report-json usage-trim usage-duckdb opencode hermes
_TARGETS := help cli-help dev-sync dev-test dev-lint dev-check bootstrap restart smoke status sync prune config usage-report usage-report-json usage-trim usage-duckdb edge-keys edge-usage opencode hermes
ARG ?= $(word 2,$(MAKECMDGOALS))
EDGE_CLIENTS ?=

ifneq ($(ARG),)
$(ARG):
Expand All @@ -26,6 +27,8 @@ help:
@printf " %-24s %s\n" "usage-report-json [day]" "print usage summary as JSON"
@printf " %-24s %s\n" "usage-trim [days]" "trim local TF logs (default 3 days)"
@printf " %-24s %s\n" "usage-duckdb [day]" "run DuckDB daily usage SQL over JSONL logs"
@printf " %-24s %s\n" "edge-keys [clients]" "create missing TF edge client keys"
@printf " %-24s %s\n" "edge-usage" "summarize TF edge access logs"
@printf " %-24s %s\n" "opencode [id]" "create client key and print/copy OpenCode config"
@printf " %-24s %s\n" "hermes [id]" "create client key and print/copy Hermes config"
@echo ""
Expand Down Expand Up @@ -96,6 +99,16 @@ usage-duckdb:
fi
duckdb -readonly -cmd ".mode table" -cmd ".headers on" -cmd ".param set period $(if $(strip $(ARG)),$(ARG),$(shell date -u +%F))" -f docs/operations/daily-usage-duckdb.sql

edge-keys:
@clients="$(if $(strip $(EDGE_CLIENTS)),$(EDGE_CLIENTS),$(ARG))"; \
if [ -z "$$clients" ]; then echo 'usage: make edge-keys EDGE_CLIENTS="client-a client-b"'; exit 2; fi; \
args=""; \
for client in $$clients; do args="$$args --client $$client"; done; \
$(UV) thunder-forge edge keys $$args

edge-usage:
$(UV) thunder-forge edge usage

opencode:
@$(UV) thunder-forge edge client-config opencode --copy $(if $(strip $(ARG)),--inject-api-key --create-missing-key "$(ARG)")

Expand Down
20 changes: 6 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,26 @@ version = "0.2.0"
description = "CLI for managing a local MLX inference cluster"
requires-python = ">=3.12"
dependencies = [
"httpx>=0.27",
"python-dotenv>=1.0",
"httpx>=0.28",
"python-dotenv>=1.2",
"pyyaml>=6.0",
"typer>=0.15",
"typer>=0.26",
]

[project.scripts]
thunder-forge = "thunder_forge.cli:app"

[build-system]
requires = ["hatchling"]
requires = ["hatchling>=1.30"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/thunder_forge"]

[dependency-groups]
dev = [
"bcrypt>=4.2",
"httpx>=0.27",
"paramiko>=5.0.0",
"psycopg[binary]>=3.2",
"pytest>=8.0",
"ruff>=0.11",
"pytest>=9.0",
"ruff>=0.15",
]

[tool.ruff]
Expand All @@ -37,9 +33,5 @@ line-length = 120
[tool.ruff.lint]
select = ["E", "F", "I", "UP"]

[tool.ruff.lint.per-file-ignores]
"v1/**/*.py" = ["ALL"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--ignore=v1"
Loading
Loading