Skip to content

Commit 54fb8b5

Browse files
DYNAMOatGHUBclaude
andcommitted
Release: prepare TinyAgent for open-source publication
Add everything needed to publish the library publicly and accept outside contributions. - LICENSE: MIT, copyright the four authors. pyproject declares it with an SPDX expression (license = "MIT", license-files), which needs setuptools >= 77. - pyproject: the PyPI distribution name becomes tinyagent-slm because "tinyagent" is already taken on PyPI by an unrelated project. The import name stays tinyagent. Add authors and Homepage, Documentation, Issues and Changelog URLs. - README: install from PyPI or GitHub, warn about the import-name clash with the other "tinyagent" package, add Contributing and License sections, and use absolute links so they work on the PyPI page. - CONTRIBUTING.md (setup, checks, design rules, PR and release steps), SECURITY.md (private reporting, scope, documented non-issues), CODE_OF_CONDUCT.md (Contributor Covenant 2.1), CHANGELOG.md (0.1.0). - Issue templates (bug, feature, security link) and a PR template. - Release workflow: on a v* tag, check the tag against the version in pyproject and __init__, run tests and sim eval, build, twine check, publish to PyPI with trusted publishing (no stored token), then create a GitHub release with the built files. - CI clean-install job now builds the sdist and wheel and runs twine check --strict. Verified locally: build succeeds, twine check passes for both files, and the wheel installs into fresh Python 3.10 and 3.13 venvs, where the CLI works with the simulated backend and live Ollama. 93 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent eea5a87 commit 54fb8b5

13 files changed

Lines changed: 366 additions & 10 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Something does not work as documented
4+
labels: bug
5+
---
6+
7+
**What happened**
8+
<!-- What did you expect, and what happened instead? -->
9+
10+
**How to reproduce**
11+
```python
12+
# The smallest code that shows the problem
13+
```
14+
15+
**Model output** (for routing problems, run the CLI with `--verbose` and paste the prompt and raw output)
16+
```
17+
```
18+
19+
**Environment**
20+
- TinyAgent version (`python -c "import tinyagent; print(tinyagent.__version__)"`):
21+
- Python version:
22+
- OS:
23+
- Runtime and version (Ollama / llama.cpp):
24+
- Model and quantization:

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Report a security vulnerability
4+
url: https://github.com/LLM-project-Team/TinyAgent-SLM/security/advisories/new
5+
about: Please report security issues privately, not as a public issue.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Feature request
3+
about: Suggest an improvement
4+
labels: enhancement
5+
---
6+
7+
**What problem would this solve?**
8+
9+
**What would you like to happen?**
10+
11+
**Alternatives you considered**
12+
13+
<!-- Note: TinyAgent deliberately keeps one tool call per query, no runtime
14+
dependencies and a bounded number of model calls. Please say how the idea fits
15+
those constraints. -->

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## What this changes
2+
3+
<!-- One or two sentences. Link the issue if there is one: "Fixes #123". -->
4+
5+
## Checklist
6+
7+
- [ ] `python -m unittest discover -s tests -t .` passes
8+
- [ ] `python -m eval.run_eval --mode sim` passes
9+
- [ ] Tests added or updated
10+
- [ ] `README.md` and `CHANGELOG.md` updated if users will notice the change
11+
- [ ] No new runtime dependencies, and no `eval`/`exec`-style calls
12+
- [ ] Public API or prompt template unchanged, or the change was agreed in an issue first

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
run: |
3939
python -m venv "$RUNNER_TEMP/venv"
4040
"$RUNNER_TEMP/venv/bin/pip" install .
41+
- name: Build and check the distribution
42+
run: |
43+
"$RUNNER_TEMP/venv/bin/pip" install build twine
44+
"$RUNNER_TEMP/venv/bin/python" -m build --outdir "$RUNNER_TEMP/dist"
45+
"$RUNNER_TEMP/venv/bin/twine" check --strict "$RUNNER_TEMP"/dist/*
4146
- name: Smoke test outside the source tree
4247
working-directory: ${{ runner.temp }}
4348
run: |

‎.github/workflows/release.yml‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["v*"]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Check the tag matches the package version
19+
run: |
20+
version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
21+
init=$(python -c "import tinyagent; print(tinyagent.__version__)")
22+
echo "tag=$GITHUB_REF_NAME pyproject=$version __init__=$init"
23+
test "$GITHUB_REF_NAME" = "v$version"
24+
test "$init" = "$version"
25+
- name: Tests and simulated evaluation
26+
run: |
27+
python -m unittest discover -s tests -t .
28+
python -m eval.run_eval --mode sim --out "$RUNNER_TEMP/report.json"
29+
- name: Build sdist and wheel
30+
run: |
31+
python -m pip install --upgrade build twine
32+
python -m build
33+
python -m twine check --strict dist/*
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: dist
37+
path: dist/
38+
39+
publish-pypi:
40+
needs: build
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 10
43+
environment:
44+
name: pypi
45+
url: https://pypi.org/project/tinyagent-slm/
46+
permissions:
47+
id-token: write # PyPI trusted publishing; no API token is stored
48+
steps:
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: dist
52+
path: dist/
53+
- uses: pypa/gh-action-pypi-publish@release/v1
54+
55+
github-release:
56+
needs: publish-pypi
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 10
59+
permissions:
60+
contents: write
61+
steps:
62+
- uses: actions/download-artifact@v4
63+
with:
64+
name: dist
65+
path: dist/
66+
- name: Create the GitHub release
67+
env:
68+
GH_TOKEN: ${{ github.token }}
69+
run: |
70+
gh release create "$GITHUB_REF_NAME" dist/* \
71+
--repo "$GITHUB_REPOSITORY" \
72+
--title "$GITHUB_REF_NAME" \
73+
--notes "See [CHANGELOG.md](https://github.com/$GITHUB_REPOSITORY/blob/main/CHANGELOG.md). Install with \`pip install tinyagent-slm\`."

‎CHANGELOG.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented here. The format follows
4+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
5+
[Semantic Versioning](https://semver.org/).
6+
7+
## [Unreleased]
8+
9+
## [0.1.0] - 2026-10-13
10+
11+
First public release.
12+
13+
### Added
14+
15+
- `@tiny_tool` decorator that builds a tool description from a function's
16+
signature, type hints and docstring.
17+
- Compact single-prompt rendering (about 100 tokens) with query sanitization and
18+
a non-growing repair prompt.
19+
- `OllamaBackend` and `LlamaCppBackend` using greedy, seeded decoding over the
20+
standard library HTTP client. `LlamaCppBackend` applies the model's chat
21+
template by default.
22+
- Quote-aware parser for `ACTION:` / `FINAL:` replies that tolerates common
23+
small-model formatting errors and rejects ambiguous output.
24+
- Strict argument coercion for `str`, `int`, `float`, `bool` and `Optional`.
25+
- Allowlisted executor with a per-call timeout, output cap and redacted errors.
26+
- `TinyAgent.run` with at most `1 + max_repairs` model calls and an
27+
`AgentResult` that always reports provenance.
28+
- `tinyagent` command-line tool, simulated, recording and replay backends, a
29+
fault-injection evaluation harness and recorded live evaluations.
30+
31+
[Unreleased]: https://github.com/LLM-project-Team/TinyAgent-SLM/compare/v0.1.0...HEAD
32+
[0.1.0]: https://github.com/LLM-project-Team/TinyAgent-SLM/releases/tag/v0.1.0

‎CODE_OF_CONDUCT.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Code of Conduct
2+
3+
This project follows the
4+
[Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
5+
6+
In short: be respectful and constructive, welcome newcomers, and focus on what
7+
is best for the project and its users. Harassment, insults and personal attacks
8+
are not tolerated in issues, pull requests or any other project space.
9+
10+
## Reporting
11+
12+
If someone's behaviour concerns you, contact a maintainer (Aisha Amna,
13+
Deepak, Dharshini or Dhyanesh) privately. Reports are handled confidentially.
14+
Maintainers may remove comments, commits or other contributions that break this
15+
code, and may ban contributors who repeatedly do so.

‎CONTRIBUTING.md‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to TinyAgent
2+
3+
Thank you for helping. Bug reports, questions, documentation fixes and code are
4+
all welcome.
5+
6+
## Reporting a bug or asking for a feature
7+
8+
Open an issue using one of the templates. For a bug, include the TinyAgent
9+
version, Python version, runtime (Ollama or llama.cpp, with its version), the
10+
model, and the smallest code that reproduces the problem. If it is a routing
11+
problem, run the CLI with `--verbose` and paste the printed prompt and raw model
12+
output.
13+
14+
Security problems must not be reported in public issues. See
15+
[SECURITY.md](SECURITY.md).
16+
17+
## Development setup
18+
19+
TinyAgent has no runtime dependencies and no development dependencies beyond
20+
Python 3.10 or newer.
21+
22+
```bash
23+
git clone https://github.com/LLM-project-Team/TinyAgent-SLM.git
24+
cd TinyAgent-SLM
25+
python -m venv .venv && source .venv/bin/activate
26+
pip install -e .
27+
```
28+
29+
Run the same checks CI runs:
30+
31+
```bash
32+
python -m unittest discover -s tests -t . # all tests
33+
python -m eval.run_eval --mode sim # simulated evaluation, exits 1 on failure
34+
python -m bench.bench_parser # parser latency benchmark
35+
```
36+
37+
No model is needed for any of these. To try a live model, install
38+
[Ollama](https://ollama.com), run `ollama pull llama3:8b`, then
39+
`python -m tinyagent --backend ollama "What is 2+3?" --verbose`.
40+
41+
## Rules every change must follow
42+
43+
These are design guarantees, and CI enforces most of them. A pull request that
44+
breaks one will not be merged.
45+
46+
- **No runtime dependencies.** Standard library only (`tests/test_no_deps.py`).
47+
- **Model text never becomes code.** No `eval`, `exec`, `compile`,
48+
`__import__`, `ast.literal_eval`, `pickle` or `importlib` in `tinyagent/`
49+
(`tests/test_static_gate.py`).
50+
- **Bounded model calls.** A query uses at most `1 + max_repairs` model calls.
51+
- **Fail closed.** Ambiguous model output is rejected with an error code, never
52+
guessed.
53+
- **Tools are never retried** after they raise or time out.
54+
- The public signatures and the contracts in `tinyagent/types.py` and
55+
`tinyagent/errors.py` are listed in Section 8 of
56+
[ARCHITECTURE.md](ARCHITECTURE.md). Changing them needs agreement from all
57+
maintainers (Section 12). Open an issue to discuss first.
58+
- Changes to the prompt template need a live evaluation run showing no
59+
regression (`python -m eval.run_eval --mode live ...`).
60+
61+
## Pull requests
62+
63+
1. Fork the repository and create a branch from `main`.
64+
2. Keep the change focused on one thing, and match the style of the
65+
surrounding code.
66+
3. Add or update tests. Bug fixes should include a test that fails without the
67+
fix.
68+
4. Update `README.md` if behaviour visible to users changes, and add a line
69+
under "Unreleased" in [CHANGELOG.md](CHANGELOG.md).
70+
5. Make sure all three checks above pass, then open the pull request and fill
71+
in the template.
72+
73+
## Releasing (maintainers)
74+
75+
1. Move the "Unreleased" entries in `CHANGELOG.md` under the new version.
76+
2. Set the same version in `pyproject.toml` and `tinyagent/__init__.py`.
77+
3. Merge to `main`, then tag and push: `git tag v0.2.0 && git push origin v0.2.0`.
78+
79+
The `Release` workflow checks that the tag matches the version, runs the tests,
80+
publishes to PyPI and creates a GitHub release.
81+
82+
## License
83+
84+
By contributing, you agree that your contributions are licensed under the
85+
[MIT License](LICENSE).

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Aisha Amna, Deepak, Dharshini and Dhyanesh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)