thetaserve 0.1.0__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 (68) hide show
  1. thetaserve-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +39 -0
  2. thetaserve-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. thetaserve-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
  4. thetaserve-0.1.0/.github/dependabot.yml +10 -0
  5. thetaserve-0.1.0/.github/pull_request_template.md +14 -0
  6. thetaserve-0.1.0/.github/workflows/ci.yml +42 -0
  7. thetaserve-0.1.0/.github/workflows/release.yml +43 -0
  8. thetaserve-0.1.0/.gitignore +29 -0
  9. thetaserve-0.1.0/AGENTS.md +23 -0
  10. thetaserve-0.1.0/CHANGELOG.md +46 -0
  11. thetaserve-0.1.0/CODE_OF_CONDUCT.md +83 -0
  12. thetaserve-0.1.0/CONTRIBUTING.md +37 -0
  13. thetaserve-0.1.0/LICENSE +202 -0
  14. thetaserve-0.1.0/NOTICE +7 -0
  15. thetaserve-0.1.0/PKG-INFO +95 -0
  16. thetaserve-0.1.0/README.md +64 -0
  17. thetaserve-0.1.0/SECURITY.md +13 -0
  18. thetaserve-0.1.0/docs/DESIGN.md +758 -0
  19. thetaserve-0.1.0/docs/README.md +22 -0
  20. thetaserve-0.1.0/docs/explanation/launch-settings.md +97 -0
  21. thetaserve-0.1.0/docs/explanation/weights-cache.md +41 -0
  22. thetaserve-0.1.0/docs/how-to/connect-a-client.md +42 -0
  23. thetaserve-0.1.0/docs/how-to/override-catalogue.md +63 -0
  24. thetaserve-0.1.0/docs/how-to/run-without-cache-volume.md +31 -0
  25. thetaserve-0.1.0/docs/how-to/store-credentials.md +48 -0
  26. thetaserve-0.1.0/docs/reference/benchmark-plan.md +55 -0
  27. thetaserve-0.1.0/docs/reference/cli.md +118 -0
  28. thetaserve-0.1.0/docs/reference/configuration.md +97 -0
  29. thetaserve-0.1.0/docs/tutorials/first-deployment.md +103 -0
  30. thetaserve-0.1.0/justfile +34 -0
  31. thetaserve-0.1.0/pyproject.toml +70 -0
  32. thetaserve-0.1.0/src/thetaserve/__init__.py +5 -0
  33. thetaserve-0.1.0/src/thetaserve/_files.py +25 -0
  34. thetaserve-0.1.0/src/thetaserve/bench.py +244 -0
  35. thetaserve-0.1.0/src/thetaserve/catalog/bandwidth.yaml +49 -0
  36. thetaserve-0.1.0/src/thetaserve/catalog/models.yaml +21 -0
  37. thetaserve-0.1.0/src/thetaserve/catalog/presets.yaml +6 -0
  38. thetaserve-0.1.0/src/thetaserve/catalog/providers.yaml +14 -0
  39. thetaserve-0.1.0/src/thetaserve/catalog/publishers.yaml +5 -0
  40. thetaserve-0.1.0/src/thetaserve/catalog/samples.json +619 -0
  41. thetaserve-0.1.0/src/thetaserve/cli.py +848 -0
  42. thetaserve-0.1.0/src/thetaserve/config.py +151 -0
  43. thetaserve-0.1.0/src/thetaserve/guard.py +29 -0
  44. thetaserve-0.1.0/src/thetaserve/health.py +76 -0
  45. thetaserve-0.1.0/src/thetaserve/options.py +332 -0
  46. thetaserve-0.1.0/src/thetaserve/providers/__init__.py +22 -0
  47. thetaserve-0.1.0/src/thetaserve/providers/base.py +60 -0
  48. thetaserve-0.1.0/src/thetaserve/providers/runpod.py +343 -0
  49. thetaserve-0.1.0/src/thetaserve/py.typed +0 -0
  50. thetaserve-0.1.0/src/thetaserve/samples.py +73 -0
  51. thetaserve-0.1.0/src/thetaserve/secrets.py +96 -0
  52. thetaserve-0.1.0/src/thetaserve/spec.py +121 -0
  53. thetaserve-0.1.0/src/thetaserve/state.py +92 -0
  54. thetaserve-0.1.0/src/thetaserve/watchdog.py +85 -0
  55. thetaserve-0.1.0/tests/__init__.py +0 -0
  56. thetaserve-0.1.0/tests/conftest.py +140 -0
  57. thetaserve-0.1.0/tests/test_bench.py +98 -0
  58. thetaserve-0.1.0/tests/test_cli_lifecycle.py +203 -0
  59. thetaserve-0.1.0/tests/test_config.py +50 -0
  60. thetaserve-0.1.0/tests/test_guard.py +81 -0
  61. thetaserve-0.1.0/tests/test_health.py +61 -0
  62. thetaserve-0.1.0/tests/test_options.py +260 -0
  63. thetaserve-0.1.0/tests/test_runpod.py +262 -0
  64. thetaserve-0.1.0/tests/test_secrets.py +57 -0
  65. thetaserve-0.1.0/tests/test_spec.py +51 -0
  66. thetaserve-0.1.0/tests/test_state.py +55 -0
  67. thetaserve-0.1.0/tests/test_watchdog.py +61 -0
  68. thetaserve-0.1.0/uv.lock +881 -0
@@ -0,0 +1,39 @@
1
+ name: Bug report
2
+ description: Something does not work as documented.
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: Do not paste API keys or tokens. Security issues go through SECURITY.md, not here.
8
+ - type: textarea
9
+ id: what
10
+ attributes:
11
+ label: What happened
12
+ description: Command you ran, what you expected, and what you got.
13
+ validations:
14
+ required: true
15
+ - type: textarea
16
+ id: output
17
+ attributes:
18
+ label: Output
19
+ description: Full output, with secrets removed.
20
+ render: text
21
+ - type: input
22
+ id: version
23
+ attributes:
24
+ label: thetaserve version
25
+ description: Output of `thetaserve --version`, or the commit hash.
26
+ validations:
27
+ required: true
28
+ - type: input
29
+ id: platform
30
+ attributes:
31
+ label: Platform
32
+ description: OS and Python version, e.g. Ubuntu 24.04, Python 3.13.
33
+ validations:
34
+ required: true
35
+ - type: input
36
+ id: target
37
+ attributes:
38
+ label: Provider, device and model
39
+ placeholder: runpod / NVIDIA A40 / qwen3.8-27b
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Report a security vulnerability
4
+ url: https://github.com/thetaplex/thetaserve/security/advisories/new
5
+ about: Report privately; see SECURITY.md.
@@ -0,0 +1,20 @@
1
+ name: Feature request
2
+ description: Suggest a change or a new device, model or provider.
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: Problem
9
+ description: What are you trying to do, and what gets in the way?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: proposal
14
+ attributes:
15
+ label: Proposal
16
+ description: What you would like to happen. For a new profile, include measured results if you have them.
17
+ - type: textarea
18
+ id: alternatives
19
+ attributes:
20
+ label: Alternatives considered
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ - package-ecosystem: uv
8
+ directory: /
9
+ schedule:
10
+ interval: monthly
@@ -0,0 +1,14 @@
1
+ ## What and why
2
+
3
+ <!-- What this changes and the problem it solves. Link the issue: Fixes #123 -->
4
+
5
+ ## How it was tested
6
+
7
+ <!-- Commands run, and for profile changes the recorded results file. -->
8
+
9
+ ## Checklist
10
+
11
+ - [ ] `just check` passes
12
+ - [ ] Tests added or updated
13
+ - [ ] CHANGELOG.md updated under `Unreleased` (user-visible changes)
14
+ - [ ] No secrets in code, output, logs or test fixtures
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ check:
17
+ name: ${{ matrix.os }} / Python ${{ matrix.python }}
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest, macos-latest, windows-latest]
23
+ python: ["3.13"]
24
+ include:
25
+ - os: ubuntu-latest
26
+ python: "3.14"
27
+ env:
28
+ UV_PYTHON: ${{ matrix.python }}
29
+ steps:
30
+ # pinned to commits, as in thetaplex/thetaterm: a tag can be moved
31
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
32
+ with:
33
+ persist-credentials: false
34
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
35
+ with:
36
+ enable-cache: true
37
+ - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
38
+ - run: just setup
39
+ - run: just check
40
+ # Keyless dry run, as in the README quickstart; runs offline from catalog/samples.json.
41
+ - name: Dry run smoke test
42
+ run: just run up --provider runpod --model qwen3.8-27b --dry-run
@@ -0,0 +1,43 @@
1
+ name: Release
2
+
3
+ # A pushed tag vX.Y.Z publishes to PyPI through trusted publishing; no token is stored.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
+ with:
17
+ persist-credentials: false
18
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
19
+ - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
20
+ - run: just setup
21
+ - run: just check
22
+ - name: Tag matches the package version
23
+ run: test "${GITHUB_REF_NAME#v}" = "$(uv version --short)"
24
+ - run: uv build
25
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
26
+ with:
27
+ name: dist
28
+ path: dist/
29
+
30
+ publish:
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ environment:
34
+ name: pypi
35
+ url: https://pypi.org/p/thetaserve
36
+ permissions:
37
+ id-token: write
38
+ steps:
39
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
@@ -0,0 +1,29 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+
9
+ # Tool caches
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .mypy_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ # Local secrets and env
17
+ .env
18
+ .env.*
19
+
20
+ # Editors and OS
21
+ .idea/
22
+ .vscode/
23
+ .DS_Store
24
+ Thumbs.db
25
+
26
+ # Personal AI-agent state
27
+ .serena/
28
+ .claude/settings.local.json
29
+ graphify-out/
@@ -0,0 +1,23 @@
1
+ # thetaserve
2
+
3
+ Open-source CLI (PyPI) that launches open-weight models with vLLM on rented GPUs (RunPod core, AWS extra) and returns a secured OpenAI-compatible endpoint. Part of the ThetaPlex organisation.
4
+
5
+ Read `docs/DESIGN.md` before making changes; it is the source of truth. Build in the milestone order in its section 12, starting with M0.
6
+
7
+ ## Stack
8
+ Python 3.13+, uv, hatchling, typer + rich, pydantic v2, pyyaml, httpx, keyring, platformdirs. Must run on Linux (including headless), macOS and Windows. Extra: `aws` (boto3). Dev tools live in the `dev` dependency group. Apache-2.0.
9
+
10
+ ## Commands
11
+ - `just setup` - install from the lockfile
12
+ - `just check` - lint, format check, mypy, tests (what CI runs)
13
+ - `just fmt` - format and apply safe lint fixes
14
+ - `just run up --provider runpod --model qwen3.8-27b --dry-run` - options and the launch command; offline from packaged samples without a Runpod key
15
+ - `just samples` - refresh `catalog/samples.json` (needs the Runpod key)
16
+
17
+ ## Rules
18
+ - Tests never hit real provider APIs; mock with respx and moto.
19
+ - Never print or log secrets; mask them in output. Persist them only to keyring or, when no keyring backend exists, the mode-600 secrets file (see DESIGN.md section 4).
20
+ - No hard-coded POSIX paths; use platformdirs.
21
+ - Do not add SkyPilot or other heavy dependencies to core.
22
+ - Hand-written values (overhead, family flags, vLLM image) marked TODO stay TODO until measured on real hardware.
23
+ - Before writing the RunPod adapter, check RunPod's current REST API reference for exact endpoints and fields.
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-10-23
10
+
11
+ First beta release, Runpod only.
12
+
13
+ ### Added
14
+
15
+ - Built-in presets, models and providers, overridable from the user config directory.
16
+ - `thetaserve list models|providers`.
17
+ - `thetaserve up --dry-run`, printing the options, the `vllm serve` command and the provider request. Without a Runpod key it uses a packaged, dated sample of Runpod's GPU catalogue and the built-in models' Hugging Face data, so it works offline; `just samples` refreshes it.
18
+ - Runpod adapter (REST API v2): pods on a shared network volume for the weights cache, placed where the GPU is in stock.
19
+ - `thetaserve setup`, `up`, `status`, `env`, `logs`, `stop`, `start` and `down`.
20
+ - A fresh API key for every launch; secrets from environment variables, the system keyring, or a mode-600 file when no keyring exists.
21
+ - Local deployment state in the platform's state directory, without secrets.
22
+ - `network_volume: null` in `providers.yaml` launches Runpod pods without a weights cache volume.
23
+ - Documentation in `docs/`: tutorial, how-to guides, reference and explanation.
24
+ - Design decisions D1 (accepted, derive launch options from live data), D2 (accepted, offer every precision) and D3 (accepted, trusted weight publishers) and D4 (accepted, remove device and tier files), in the decision log of `docs/DESIGN.md`.
25
+ - `up` pins the chosen variant to the commit its sizes were read from (`vllm serve --revision`).
26
+ - `up` offers weights only from the base model's organisation and the publishers in `publishers.yaml` (`RedHatAI`, `nvidia`); `--any-publisher` lists the rest, marked.
27
+ - `up` lists the cheapest GPU in stock for every weight precision (16, 8, 4 bits) and KV-cache precision (16-bit, FP8) that fits the model, cheapest first, from Hugging Face metadata and the Runpod GPU catalogue, and asks which to launch. `--use coding|chat|research` (presets in `presets.yaml`) sets the context and the precision floor for the default; `--min-precision` hides lower precisions; each row shows estimated tokens per second from GPU memory bandwidth (`bandwidth.yaml`); `--model` also takes a Hugging Face repo; `--device` takes a Runpod GPU ID and limits the options to it.
28
+ - `env` also shows the model, the model name for requests, the context, the device and the endpoint URLs, on stderr.
29
+ - Gemma 4 31B launches text-only with `--max-num-seqs 32`; its tool-call and reasoning parsers are verified on an RTX 6000 Ada (`docs/DESIGN.md` section 13.2).
30
+ - `kv_scale` in `models.yaml`: a measured factor on the KV cache per token; 1.5 for Gemma 4 31B.
31
+
32
+ - Runpod pods stop themselves after `--idle` (default 30 min) without requests or after `--max-life` (default 10 h): a watchdog on the host reads vLLM's `/metrics` and stops the pod with the key Runpod gives every pod.
33
+ - With a cache volume, vLLM's compile cache is kept on it too (`VLLM_CACHE_ROOT`), so a warm start skips most compilation.
34
+ - `thetaserve bench`: launches the recommended option on one GPU, measures decode speed at 1 and 4 requests, time to first token at 8K-128K, start-up memory against the estimate, time to ready, cost per million output tokens and tool-call reliability, writes one JSON result and removes the deployment.
35
+ - `up` keeps a crashed server's log, key masked, in the state directory's `logs/`.
36
+ - `up` stops waiting and reports the error when the vLLM log shows a crash, instead of waiting 40 minutes.
37
+ - The built-in vLLM image is `vllm/vllm-openai:v0.32.0`, and Qwen3.8-27B launches with `--max-num-seqs 32`, as run in the M1 pilot on an A40 (`docs/DESIGN.md` section 13.1).
38
+ - Install from PyPI with `uv tool install thetaserve`; tagged releases publish through PyPI trusted publishing.
39
+ - Launched servers require the API key on every path except `/health`, including `/metrics`, which vLLM's `--api-key` leaves open.
40
+
41
+ ### Changed
42
+
43
+ - The memory overhead in the fit check is 3.2 GiB, measured, instead of an estimated 2 GiB.
44
+
45
+ [Unreleased]: https://github.com/thetaplex/thetaserve/compare/v0.1.0...HEAD
46
+ [0.1.0]: https://github.com/thetaplex/thetaserve/releases/tag/v0.1.0
@@ -0,0 +1,83 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@thetaplex.com. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76
+
77
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78
+
79
+ [homepage]: https://www.contributor-covenant.org
80
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81
+ [Mozilla CoC]: https://github.com/mozilla/diversity
82
+ [FAQ]: https://www.contributor-covenant.org/faq
83
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,37 @@
1
+ # Contributing
2
+
3
+ Thanks for helping. By taking part you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
4
+
5
+ ## Before you start
6
+
7
+ Read [docs/DESIGN.md](docs/DESIGN.md); it is the source of truth for scope and decisions. For anything larger than a bug fix, open an issue first so we can agree on the approach.
8
+
9
+ ## Development
10
+
11
+ Prerequisites: [uv](https://docs.astral.sh/uv/getting-started/installation/) and [just](https://just.systems/man/en/packages.html).
12
+
13
+ ```sh
14
+ git clone https://github.com/thetaplex/thetaserve.git
15
+ cd thetaserve
16
+ just setup # install from the lockfile
17
+ just check # lint, format check, type check, tests (what CI runs)
18
+ just fmt # format and apply safe lint fixes
19
+ just run list models
20
+ just samples # refresh the dry-run sample data; needs the Runpod key
21
+ ```
22
+
23
+ Add dependencies with `uv add` (or `uv add --dev`) and commit the updated `uv.lock`.
24
+
25
+ ## Rules
26
+
27
+ - Tests never call real provider APIs; mock HTTP with respx and AWS with moto.
28
+ - Never print or log a secret. Persist secrets only to keyring or the mode-600 secrets file.
29
+ - No hard-coded POSIX paths; use platformdirs. Code must work on Linux, macOS and Windows.
30
+ - Every hand-written number (overhead, family flags) comes from a recorded run. Unmeasured values stay marked `TODO`.
31
+
32
+ ## Pull requests
33
+
34
+ - Keep each PR to one change, with tests.
35
+ - Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages.
36
+ - Add a line under `Unreleased` in [CHANGELOG.md](CHANGELOG.md) for user-visible changes.
37
+ - `just check` must pass.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ Copyright 2026 ThetaPlex
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4
+
5
+ http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.