Skip to main content

Multi-provider LLM and message queue abstraction for distributed agent systems

Project description

teenyfactories

Agent runtime for TeenyFactories. Postgres-backed pub/sub, multi-provider LLM calls, vector search.

pip install --pre teenyfactories
import teenyfactories as tf

@tf.on_state('documents', 'loaded').do
def analyse(item):
    tf.collection('documents').set(item['key'], state='analysed')

while True:
    tf.run_pending()
    tf.sleep(1)

Writing a row with a given state fires NOTIFY {factory}.{collection}.{state}. Every subscriber to that pair gets the row. That's the framework.

Public API

Group Names
Pub/sub on_state, on_message, send_message, run_pending
Data collection (.set, .add, .get, .get_all, .remove, .count, .exists, .vector_search)
LLM call_llm, embed
MCP add_mcp_server, add_mcp_tool
Schedule on_schedule.every(N).<unit>.do(handler)
Logging log_debug, log_info, log_warn, log_error, log_persona
Time / IDs get_timestamp, get_timestamp_utc, generate_unique_id
Util sleep, PROJECT_NAME, FACTORY_PREFIX, __version__

Anything not in this list is not part of the supported surface — don't reach into submodules.

How it plugs in

A factory is a directory:

my_factory/
├── factory.yml
└── agents/
    ├── poller.py
    └── enricher.py

Each agents/*.py runs in its own container based on ghcr.io/teenyfactories/agent:dev — which has this library pre-installed. Single-factory mode runs each file as a docker compose service; multi-factory mode runs them under the orchestrator. Either way, agent code is just import teenyfactories as tf + handlers + main loop.

Full setup, compose templates, environment variable reference: see the core repo.

Versioning

PEP 440 dev pre-releases: 0.1.0.devYYYYMMDD. pip install teenyfactories will NOT pick these up — you need --pre (latest dated build) or an explicit pin (teenyfactories==0.1.0.dev20260512).

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teenyfactories-0.1.0.dev20260616.tar.gz (77.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teenyfactories-0.1.0.dev20260616-py3-none-any.whl (85.2 kB view details)

Uploaded Python 3

File details

Details for the file teenyfactories-0.1.0.dev20260616.tar.gz.

File metadata

File hashes

Hashes for teenyfactories-0.1.0.dev20260616.tar.gz
Algorithm Hash digest
SHA256 a886a6656f6fa0ba467850e509bf4fd4a3bb865c2c3c8e0d76e61aa489028ac2
MD5 c20e405c36c26373135b59ed75d4e3a9
BLAKE2b-256 94016a38f2f167278091b05a232506ac0e2559838c6a96f83509f04911ed6401

See more details on using hashes here.

File details

Details for the file teenyfactories-0.1.0.dev20260616-py3-none-any.whl.

File metadata

File hashes

Hashes for teenyfactories-0.1.0.dev20260616-py3-none-any.whl
Algorithm Hash digest
SHA256 220c3305625c4686dd2d0c5f2a64c41ed5cc1c5c177e24e37c69fea92ef76360
MD5 415e0f449d445777e0c980560c35560e
BLAKE2b-256 115154a6f193c0832d2e4756f5b99fa3fbc5753889c0fbfb58a4110efcec4e3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page