Sinapsis Vowpal-Wabbit
Contextual bandit learning and prediction with Vowpal Wabbit.
Overview
sinapsis-vowpal-wabbit — Package for Vowpal Wabbit algorithms, featuring high-performance implementations of Contextual Bandits (ADF) and reinforcement learning patterns.
Contextual bandits model decisions where feedback arrives after selecting an action. Wrapping exploration, learning and scoring in Templates helps connect data preparation, action selection and updates in one observable flow.
Where it fits
Use this for online decision policies with explicit action/reward semantics, not as a drop-in replacement for standard classification. Explore/exploit settings and logging policy affect learning quality.
Installation
Requires Python 3.13 or later, as declared in this package’s manifest. Install the base distribution using your preferred package manager:
uv pip install sinapsis-vowpal-wabbit
# or
pip install sinapsis-vowpal-wabbit
Optional features and dependencies
The base installation includes the dependencies required by the package. The following extras are declared in this package’s pyproject.toml; install only those needed by your workflow. They are standard Python optional dependencies, not separate execution profiles.
| Extra | Adds / when to select it |
|---|---|
sinapsis-data-readers |
Load external media or datasets into DataContainers. Dependencies: sinapsis-data-readers |
all |
Bundle declared by this package; its manifest includes scikit-learn, sentence-transformers, sinapsis-data-readers. |
sentence-transformers |
Sentence transformers support. Dependencies: sentence-transformers |
scikit-learn |
Scikit learn support. Dependencies: scikit-learn |
For example:
uv pip install "sinapsis-vowpal-wabbit[sinapsis-data-readers]"
The manifest also defines development-only dependency groups: dev (pre-commit, ty). These support source development and testing and are not runtime extras.
🚀 Features
Templates Supported
This repository implements specific templates for Vowpal Wabbit's most powerful reductions:
-
CBExploreADFPredict: Handles real-time inference for Contextual Bandits using Action-Dependent Features (ADF).
-
CBExploreADFLearn: Template to perform offline learning. It iterates through historical datasets (context, action, reward) for a defined number of epochs to optimize the model weights before deployment.
-
CBExploreADFPredictEmbeddings: Handles real-time inference for Contextual Bandits using Action-Dependent Features (ADF) enhanced with text embeddings. This template processes incoming context and actions by combining traditional raw text features with vector-based embeddings to provide more nuanced, semantically aware predictions in production environments.
-
CBExploreADFLearnEmbeddings: Template for offline learning that incorporates text embeddings into the optimization process. It iterates through historical datasets (context, actions, and rewards) over a defined number of epochs. By training on a combination of raw text and sentence based embeddings, it captures deeper semantic relationships to more effectively optimize model weights prior to deployment.
Example Agent
The following is adapted directly from the package’s shipped cb_explore_adf_predict_from_pdf_loader.yaml configuration. Save it as my_vowpal_wabbit_agent.yaml. The example may require model checkpoints, input files, additional Template packages, or provider credentials as described in its configuration.
agent:
name: my_vowpal_wabbit_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: PyPDFLoaderWrapper_70780
class_name: PyPDFLoaderWrapper
template_input: InputTemplate
attributes:
pypdfloader_init:
mode: single
file_path: "path"
extract_images: false
extraction_mode: plain
pages_delimiter: "\n\f"
extraction_kwargs: { }
images_inner_format: text
#add_document_as_text_packet: True
- template_name: Splitter
class_name: RegexTurnSplitter
template_input: InputTemplate
attributes:
generic_key: PyPDFLoaderWrapper_70780
pattern_1: ['User 1', 'User 2']
pattern_2: "\\d{2}:\\d{2}"
return_as_text_packets: true
- template_name: CBExploreADFPredict
class_name: CBExploreADFPredictEmbeddings
template_input: Splitter
attributes:
random_seed: 42
actions:
[
"contact_customer_service",
"schedule_follow_up_meeting",
"send_email_with_product_information",
"register_new_client",
"provide_financing_options",
]
model_path: artifacts/cb_model-embeddings-quadratic.vw
threshold: 0
remove_special_characters: True
vw_workspace_params:
exploration_method: epsilon
exploration_value: 0.3
adaptive: True
normalized: True
quiet: True
quadratic_interactions: [":A"]
sinx jobs run my_vowpal_wabbit_agent.yaml
More configurations: cb_explore_adf_learn_embeddings.yaml, cb_explore_adf_predict_from_pdf_loader.yaml, cb_explore_adf_predict_embeddings.yaml, cb_explore_adf_learn.yaml, cb_explore_adf_predict.yaml, cb_explore_adf_predict_from_pdf_loader_summary.yaml.
Documentation
License
Sinapsis open-source components are available under your choice of the MIT License or the Apache License 2.0, unless otherwise noted.
Metadata
Release files for sinapsis-vowpal-wabbit 1.0.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 |
|---|---|---|---|---|
| sinapsis_vowpal_wabbit-1.0.0.tar.gz | 112.5 kB | Without provenance | Details for sinapsis_vowpal_wabbit-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sinapsis_vowpal_wabbit-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sinapsis_vowpal_wabbit-1.0.0-py3-none-any.whl |
Total release size: 141.4 kB
Release files / sinapsis_vowpal_wabbit-1.0.0.tar.gz
| Download URL | sinapsis_vowpal_wabbit-1.0.0.tar.gz |
|---|---|
| Size | 112.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b3a1d5eb1618b73320af6df371852342b19483f1fda10663332bd8e0ee6026f
|
|
BLAKE2b-256 checksum How to use checksums |
fb35680e03e54ed5cbe63570bc8654b6c243778dad1489856c64310762fac2fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Release files / sinapsis_vowpal_wabbit-1.0.0-py3-none-any.whl
| Download URL | sinapsis_vowpal_wabbit-1.0.0-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23e619f87262015b7e88a9ab33dac622d25f48f9454ca9019ac8996489f7012b
|
|
BLAKE2b-256 checksum How to use checksums |
e19e3c4a08d2f5429528c1e5edf24623ae520c8c93bd1aa7d96d2dc3bbe121ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Security for sinapsis-vowpal-wabbit 1.0.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.