smolagents-lats
LATS (Language Agent Tree Search) agent for smolagents.
Instead of a linear ReAct loop, LATSAgent expands a search tree, scores branches with UCT, and reflects on failed paths.
Based on the paper: arxiv.org/abs/2310.04406
Install
pip install smolagents-lats
Usage
from smolagents import HfApiModel
from smolagents_lats import LATSAgent
model = HfApiModel()
agent = LATSAgent(
tools=[],
model=model,
n_branches=3,
max_depth=4,
)
result = agent.run("What is the 10th Fibonacci number?")
print(result)
How it works
- Expand — generates
n_branchescandidate actions at each step - Score — asks the LLM to score each branch (0.0 → 1.0)
- UCT select — picks the most promising unexplored branch
- Reflect — on failed paths, generates a verbal self-critique fed back as context
Parameters
| Parameter | Default | Description |
|---|---|---|
n_branches |
3 | Candidate actions generated per step |
max_depth |
4 | Max tree depth before forcing answer |
exploration_weight |
1.4 | UCT exploration constant |
License
MIT
Metadata
Release files for smolagents-lats 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smolagents_lats-0.1.0.tar.gz | 6.7 kB | Without provenance | Details for smolagents_lats-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smolagents_lats-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for smolagents_lats-0.1.0-py3-none-any.whl |
Total release size: 12.8 kB
Release files / smolagents_lats-0.1.0.tar.gz
| Download URL | smolagents_lats-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af928d0743a1714e8c5a59caaec149c6e66da30993c999c8e3ab84dac11e3126
|
|
BLAKE2b-256 checksum How to use checksums |
22f41bda982dea5f70b1e1c828f209d3cbdcbb350eb080f73860e4ed9bd90ff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / smolagents_lats-0.1.0-py3-none-any.whl
| Download URL | smolagents_lats-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ec23707e1710140409296ee55a89ff10120c3f571e7ace46fdc4dc26d78c311
|
|
BLAKE2b-256 checksum How to use checksums |
05d76b1897ca70154dde96ffd15944e3e048b8b9cb162738ceeba9b41b001d61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for smolagents-lats 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.