basemode 0.1.2__tar.gz → 0.1.4__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 (102) hide show
  1. basemode-0.1.4/.github/workflows/ci.yml +34 -0
  2. basemode-0.1.4/.github/workflows/docs-deploy.yml +48 -0
  3. basemode-0.1.4/.github/workflows/integration-provider-health.yml +84 -0
  4. basemode-0.1.4/.github/workflows/verified-models.yml +41 -0
  5. {basemode-0.1.2 → basemode-0.1.4}/.gitignore +5 -1
  6. basemode-0.1.4/LICENSE +190 -0
  7. basemode-0.1.4/Makefile +28 -0
  8. basemode-0.1.4/PKG-INFO +137 -0
  9. basemode-0.1.4/README.md +122 -0
  10. basemode-0.1.4/data/verified_models_details.json +303 -0
  11. basemode-0.1.4/data/verified_models_registry.json +106 -0
  12. basemode-0.1.4/docs/concepts/How It Works.md +37 -0
  13. basemode-0.1.4/docs/concepts/Model Normalization.md +18 -0
  14. basemode-0.1.4/docs/concepts/Strategies.md +29 -0
  15. basemode-0.1.4/docs/getting-started/Installation.md +42 -0
  16. basemode-0.1.4/docs/getting-started/Quickstart.md +42 -0
  17. basemode-0.1.4/docs/index.md +37 -0
  18. basemode-0.1.4/docs/reference/GenerationParams.md +25 -0
  19. basemode-0.1.4/docs/reference/branch_text.md +27 -0
  20. basemode-0.1.4/docs/reference/continue_text.md +26 -0
  21. basemode-0.1.4/docs/reference/detect_strategy.md +19 -0
  22. basemode-0.1.4/docs/usage/CLI Reference.md +87 -0
  23. basemode-0.1.4/docs/usage/Keys and Defaults.md +51 -0
  24. basemode-0.1.4/docs/usage/Python API.md +88 -0
  25. basemode-0.1.4/docs/usage/Verified Models.md +28 -0
  26. {basemode-0.1.2 → basemode-0.1.4}/features.md +26 -1
  27. basemode-0.1.4/mkdocs.yml +55 -0
  28. {basemode-0.1.2 → basemode-0.1.4}/pyproject.toml +5 -1
  29. basemode-0.1.4/scripts/generate_verified_models_table.py +276 -0
  30. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/__init__.py +9 -0
  31. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/cli.py +31 -1
  32. basemode-0.1.4/src/basemode/models.py +169 -0
  33. {basemode-0.1.2 → basemode-0.1.4}/tests/test_integration.py +88 -5
  34. basemode-0.1.4/tests/test_models.py +79 -0
  35. {basemode-0.1.2 → basemode-0.1.4}/uv.lock +230 -1
  36. basemode-0.1.2/Makefile +0 -34
  37. basemode-0.1.2/PKG-INFO +0 -11
  38. basemode-0.1.2/README.md +0 -315
  39. basemode-0.1.2/caliban-ball.md +0 -27
  40. basemode-0.1.2/example.txt +0 -11
  41. basemode-0.1.2/new.txt +0 -1
  42. basemode-0.1.2/packages/basemode-loom/pyproject.toml +0 -59
  43. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/__init__.py +0 -24
  44. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/cli.py +0 -990
  45. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/display.py +0 -326
  46. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/loom_formats.py +0 -239
  47. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/naming.py +0 -80
  48. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/session.py +0 -494
  49. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/stats.py +0 -343
  50. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/store.py +0 -506
  51. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/__init__.py +0 -0
  52. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/app.py +0 -21
  53. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/app.tcss +0 -125
  54. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/__init__.py +0 -0
  55. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/confirm.py +0 -36
  56. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/int_input.py +0 -35
  57. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/loom.py +0 -288
  58. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/model_picker.py +0 -57
  59. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/stats.py +0 -99
  60. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/screens/tree_picker.py +0 -93
  61. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/widgets/__init__.py +0 -0
  62. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/widgets/loom_view.py +0 -88
  63. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/widgets/stream_view.py +0 -78
  64. basemode-0.1.2/packages/basemode-loom/src/basemode_loom/tui/widgets/tree_picker.py +0 -146
  65. basemode-0.1.2/packages/basemode-loom/tests/test_cli.py +0 -220
  66. basemode-0.1.2/packages/basemode-loom/tests/test_display.py +0 -407
  67. basemode-0.1.2/packages/basemode-loom/tests/test_loom_formats.py +0 -150
  68. basemode-0.1.2/packages/basemode-loom/tests/test_naming.py +0 -70
  69. basemode-0.1.2/packages/basemode-loom/tests/test_session.py +0 -494
  70. basemode-0.1.2/packages/basemode-loom/tests/test_stats.py +0 -123
  71. basemode-0.1.2/packages/basemode-loom/tests/test_store.py +0 -242
  72. basemode-0.1.2/packages/basemode-loom/tests/test_tree_picker.py +0 -451
  73. basemode-0.1.2/packages/basemode-loom/tests/test_tui.py +0 -561
  74. basemode-0.1.2/packages/basemode-loom/uv.lock +0 -2166
  75. basemode-0.1.2/src/basemode/models.py +0 -43
  76. basemode-0.1.2/temp.json +0 -1326
  77. basemode-0.1.2/test.json +0 -1326
  78. basemode-0.1.2/tests/test_models.py +0 -38
  79. {basemode-0.1.2 → basemode-0.1.4}/.env.example +0 -0
  80. {basemode-0.1.2 → basemode-0.1.4}/.pre-commit-config.yaml +0 -0
  81. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/continue_.py +0 -0
  82. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/detect.py +0 -0
  83. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/healing.py +0 -0
  84. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/keys.py +0 -0
  85. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/params.py +0 -0
  86. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/settings.py +0 -0
  87. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/__init__.py +0 -0
  88. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/base.py +0 -0
  89. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/compat.py +0 -0
  90. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/completion.py +0 -0
  91. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/few_shot.py +0 -0
  92. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/fim.py +0 -0
  93. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/prefill.py +0 -0
  94. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/strategies/system.py +0 -0
  95. {basemode-0.1.2 → basemode-0.1.4}/src/basemode/usage.py +0 -0
  96. {basemode-0.1.2 → basemode-0.1.4}/tests/conftest.py +0 -0
  97. {basemode-0.1.2 → basemode-0.1.4}/tests/test_cli.py +0 -0
  98. {basemode-0.1.2 → basemode-0.1.4}/tests/test_compat.py +0 -0
  99. {basemode-0.1.2 → basemode-0.1.4}/tests/test_detect.py +0 -0
  100. {basemode-0.1.2 → basemode-0.1.4}/tests/test_strategies.py +0 -0
  101. {basemode-0.1.2 → basemode-0.1.4}/tests/test_usage.py +0 -0
  102. {basemode-0.1.2 → basemode-0.1.4}/tests/test_utils.py +0 -0
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint-test-docs:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: '3.11'
20
+
21
+ - name: Set up uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Install dependencies
25
+ run: uv sync --group dev
26
+
27
+ - name: Lint
28
+ run: make lint-core
29
+
30
+ - name: Test
31
+ run: make test-core
32
+
33
+ - name: Build docs
34
+ run: uv run mkdocs build --strict
@@ -0,0 +1,48 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ environment:
21
+ name: github-pages
22
+ url: ${{ steps.deployment.outputs.page_url }}
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.11"
31
+
32
+ - name: Set up uv
33
+ uses: astral-sh/setup-uv@v5
34
+
35
+ - name: Install dependencies
36
+ run: uv sync --group dev
37
+
38
+ - name: Build docs
39
+ run: uv run mkdocs build --strict
40
+
41
+ - name: Upload Pages artifact
42
+ uses: actions/upload-pages-artifact@v3
43
+ with:
44
+ path: site
45
+
46
+ - id: deployment
47
+ name: Deploy to GitHub Pages
48
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,84 @@
1
+ name: Integration provider health
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: "35 6 * * 3"
7
+
8
+ jobs:
9
+ integration-health:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v4
21
+
22
+ - name: Sync deps
23
+ run: uv sync --all-groups
24
+
25
+ - name: Run integration tests
26
+ env:
27
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
28
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
29
+ OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
30
+ GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
31
+ GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
32
+ TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
33
+ MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
34
+ XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
35
+ ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
36
+ run: uv run pytest -m integration tests/test_integration.py -q
37
+
38
+ - name: Append health summary
39
+ if: always()
40
+ run: |
41
+ if [ -f dist/integration/provider_health.json ]; then
42
+ echo "## Provider health" >> "$GITHUB_STEP_SUMMARY"
43
+ uv run python - <<'PY' >> "$GITHUB_STEP_SUMMARY"
44
+ import json
45
+ from collections import defaultdict
46
+ from pathlib import Path
47
+
48
+ p = Path("dist/integration/provider_health.json")
49
+ rows = json.loads(p.read_text()).get("rows", [])
50
+ agg = defaultdict(lambda: {"ok": 0, "error": 0, "xfail": 0, "cost": 0.0})
51
+ total_cost = 0.0
52
+ for r in rows:
53
+ provider = r["provider"]
54
+ status = r.get("status", "error")
55
+ if status == "ok":
56
+ agg[provider]["ok"] += 1
57
+ elif status == "xfail_retired_model":
58
+ agg[provider]["xfail"] += 1
59
+ else:
60
+ agg[provider]["error"] += 1
61
+ cost = r.get("estimated_cost_usd")
62
+ if isinstance(cost, (int, float)):
63
+ agg[provider]["cost"] += float(cost)
64
+ total_cost += float(cost)
65
+
66
+ print("| Provider | OK | Error | XFail | Est. cost |")
67
+ print("|---|---:|---:|---:|---:|")
68
+ for provider in sorted(agg):
69
+ v = agg[provider]
70
+ print(f"| {provider} | {v['ok']} | {v['error']} | {v['xfail']} | ${v['cost']:.6f} |")
71
+ print()
72
+ print(f"Estimated total test cost: ${total_cost:.6f}")
73
+ PY
74
+ else
75
+ echo "No health report generated." >> "$GITHUB_STEP_SUMMARY"
76
+ fi
77
+
78
+ - name: Upload provider health artifact
79
+ if: always()
80
+ uses: actions/upload-artifact@v4
81
+ with:
82
+ name: provider-health-report
83
+ path: dist/integration/provider_health.json
84
+ if-no-files-found: warn
@@ -0,0 +1,41 @@
1
+ name: Refresh verified models table
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: "17 6 * * 1"
7
+
8
+ jobs:
9
+ refresh:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ pull-requests: write
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.11"
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v4
24
+
25
+ - name: Sync deps
26
+ run: uv sync --all-groups
27
+
28
+ - name: Regenerate verified model table
29
+ run: uv run python scripts/generate_verified_models_table.py
30
+
31
+ - name: Create pull request
32
+ uses: peter-evans/create-pull-request@v6
33
+ with:
34
+ commit-message: "chore(models): refresh verified models table"
35
+ branch: "chore/refresh-verified-models"
36
+ title: "chore(models): refresh verified models table"
37
+ body: |
38
+ Automated refresh of:
39
+ - README verified model table
40
+ - data/verified_models_details.json
41
+ labels: documentation
@@ -8,4 +8,8 @@ htmlcov/
8
8
  .pytest_cache/
9
9
  *.egg-info/
10
10
 
11
- data/
11
+ data/*
12
+ !data/verified_models_registry.json
13
+ !data/verified_models_details.json
14
+
15
+ site/
basemode-0.1.4/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Fergus Fettes
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,28 @@
1
+ .PHONY: publish test test-core test-integration lint lint-core models-table docs-serve
2
+
3
+ publish:
4
+ rm -rf dist/
5
+ uv build
6
+ @export $$(grep UV_PUBLISH_TOKEN .env | xargs) && uv publish
7
+
8
+ test:
9
+ uv run pytest tests
10
+
11
+ test-core:
12
+ uv run pytest tests
13
+
14
+ test-integration:
15
+ uv run pytest -m integration
16
+
17
+ lint:
18
+ uv run ruff check src tests
19
+ uv run ruff format --check src tests
20
+
21
+ lint-core:
22
+ uv run ruff check src tests && uv run ruff format --check src tests
23
+
24
+ models-table:
25
+ uv run python scripts/generate_verified_models_table.py
26
+
27
+ docs-serve:
28
+ uv run mkdocs serve -a localhost:8001
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: basemode
3
+ Version: 0.1.4
4
+ Summary: Make any LLM do raw text continuation
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: anyio>=4.0.0
9
+ Requires-Dist: litellm>=1.63.0
10
+ Requires-Dist: pydantic-settings>=2.0.0
11
+ Requires-Dist: python-dotenv>=1.0.0
12
+ Requires-Dist: rich>=13.0.0
13
+ Requires-Dist: typer>=0.12.0
14
+ Description-Content-Type: text/markdown
15
+
16
+ # basemode
17
+
18
+ Make any LLM do raw text continuation.
19
+
20
+ `basemode` coerces chat-tuned models into clean next-token continuation mode (instead of assistant-style replies), with strategy selection handled per model/provider.
21
+
22
+ ## Install
23
+
24
+ ```bash
25
+ pip install basemode
26
+ ```
27
+
28
+ Set provider keys via environment variables or `.env` (for example `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY`, `TOGETHER_API_KEY`).
29
+
30
+ ## Quickstart
31
+
32
+ ```bash
33
+ # Single continuation (default model if configured, else fallback)
34
+ basemode "The ship rounded the headland and"
35
+
36
+ # Parallel continuations
37
+ basemode "The ship rounded the headland and" -n 3
38
+
39
+ # Inspect selected strategy and pricing metadata
40
+ basemode info claude-sonnet-4-6
41
+
42
+ # Show only key-configured models
43
+ basemode models --available
44
+ ```
45
+
46
+ ## CLI
47
+
48
+ ```bash
49
+ basemode --help
50
+ basemode run --help
51
+ basemode models --help
52
+ basemode info --help
53
+ basemode strategies --help
54
+ ```
55
+
56
+ Useful commands:
57
+
58
+ - `basemode run` (default): stream continuation text
59
+ - `basemode models`: list models (supports `--verified` and `--json` for picker UIs)
60
+ - `basemode providers`: list provider IDs
61
+ - `basemode info`: show normalized model + prompt strategy + pricing metadata
62
+ - `basemode default`: get/set your default model
63
+ - `basemode keys`: manage stored API keys
64
+
65
+ ## Python API
66
+
67
+ ```python
68
+ from basemode import continue_text, branch_text
69
+
70
+ async for token in continue_text(
71
+ "The ship rounded the headland and",
72
+ model="gpt-4o-mini",
73
+ max_tokens=120,
74
+ ):
75
+ print(token, end="", flush=True)
76
+
77
+ async for idx, token in branch_text(
78
+ "The ship rounded the headland and",
79
+ model="gpt-4o-mini",
80
+ n=3,
81
+ max_tokens=80,
82
+ ):
83
+ print(idx, token, end="", flush=True)
84
+ ```
85
+
86
+ ## Docs
87
+
88
+ Full docs are in `docs/` and can be served with MkDocs:
89
+
90
+ ```bash
91
+ make docs-serve
92
+ ```
93
+
94
+ Then open `http://localhost:8001`.
95
+
96
+ ## Integration Health Checks
97
+
98
+ Run live provider checks (real APIs, key-aware skips):
99
+
100
+ ```bash
101
+ uv run pytest -m integration tests/test_integration.py -q
102
+ ```
103
+
104
+ This writes a machine-readable report to `dist/integration/provider_health.json` with per-model status, latency, token estimates, and estimated USD cost.
105
+
106
+ <!-- verified-models:start -->
107
+
108
+ ## Verified Models
109
+
110
+ Single generated table, refreshed by CI.
111
+
112
+ | Model | Input cost (/1M) | Output cost (/1M) | Release date | Prompt method | Reliability |
113
+ |---|---:|---:|---|---|---|
114
+ | `anthropic/claude-haiku-4-5-20251001` | $1.00 | $5.00 | 2025-10-01 | `prefill` | ✓ |
115
+ | `anthropic/claude-opus-4-1-20250805` | $15.00 | $75.00 | 2025-08-05 | `prefill` | ✓ |
116
+ | `anthropic/claude-opus-4-20250514` | $15.00 | $75.00 | 2025-05-22 | `prefill` | ✓ |
117
+ | `anthropic/claude-opus-4-5-20251101` | $5.00 | $25.00 | 2025-11-24 | `prefill` | ✓ |
118
+ | `anthropic/claude-opus-4-6` | $5.00 | $25.00 | 2026-02-05 | `system` | ✓ |
119
+ | `anthropic/claude-opus-4-7` | $5.00 | $25.00 | 2026-04-16 | `system` | ✓ |
120
+ | `anthropic/claude-sonnet-4-20250514` | $3.00 | $15.00 | 2025-05-22 | `prefill` | ✓ |
121
+ | `anthropic/claude-sonnet-4-5-20250929` | $3.00 | $15.00 | 2025-09-29 | `prefill` | ✓ |
122
+ | `anthropic/claude-sonnet-4-6` | $3.00 | $15.00 | 2026-02-17 | `system` | ✓ |
123
+ | `gemini/gemini-2.5-flash` | $0.30 | $2.50 | 2025-06-17 | `system` | ⚠ |
124
+ | `gemini/gemini-2.5-pro` | $1.25 | $10.00 | 2025-06-17 | `system` | ⚠ |
125
+ | `gemini/gemma-4-26b-a4b-it` | $0.07 | $0.35 | 2026-04-03 | `system` | ⚠ |
126
+ | `gemini/gemma-4-31b-it` | $0.13 | $0.38 | 2026-04-02 | `system` | ⚠ |
127
+ | `moonshot/kimi-k2-0905-preview` | $0.60 | $2.50 | 2025-07-11 | `system` | ⚠ |
128
+ | `moonshot/kimi-k2.5` | $0.60 | $3.00 | 2026-01-27 | `system` | ⚠ |
129
+ | `openai/gpt-4o-mini` | $0.15 | $0.60 | 2024-07-18 | `system` | ⚠ |
130
+ | `openai/gpt-5.4-mini` | $0.75 | $4.50 | 2026-03-17 | `system` | ✓ |
131
+ | `openrouter/moonshotai/kimi-k2.6` | $0.60 | $2.80 | 2026-04-20 | `system` | ⚠ |
132
+ | `zai/glm-4.7` | $0.60 | $2.20 | 2025-12-22 | `system` | ✓ |
133
+ | `zai/glm-5` | $1.00 | $3.20 | 2026-02-11 | `system` | ✓ |
134
+
135
+ Legend: `✓` = LiteLLM pricing present and release date available; `⚠` = missing/approximate field or known issue.
136
+
137
+ <!-- verified-models:end -->