Package for Vowpal Wabbit algorithms, featuring high-performance implementations of Contextual Bandits (ADF) and reinforcement learning patterns.
Project description
Sinapsis Vowpal-Wabbit
High-performance Contextual Bandits and Reinforcement Learning using Vowpal Wabbit
🐍 Installation • 🚀 Features • 📚 Usage example • 📙 Documentation • 🔍 License
Sinapsis Vowpal Wabbit provides a modular framework for implementing real-time decision-making systems. By leveraging the industry-standard Vowpal Wabbit engine, this module enables efficient online learning and reinforcement learning (RL) workflows with minimal latency.
🐍 Installation
Install using your package manager of choice. We encourage the use of uv
Example with uv:
uv pip install sinapsis-vowpal-wabbit --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-vowpal-wabbit --extra-index-url https://pypi.sinapsis.tech
[!IMPORTANT] Templates may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
with uv:
uv pip install sinapsis-vowpal-wabbit[all] --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-vowpal-wabbit[all] --extra-index-url https://pypi.sinapsis.tech
[!TIP] Use CLI command
sinapsis info --all-template-namesto show a list with all the available Template names installed with Sinapsis OCR.
[!TIP] Use CLI command
sinapsis info --example-template-config CBExploreADFPredictto produce an example Agent config for the CBExploreADFPredict template.
🚀 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.
📚 Usage example
CBExploreADFPredict Example
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: CBExploreADFPredict
class_name: CBExploreADFPredict
template_input: InputTemplate
attributes:
stop_words: ["from", "at", "i", "you"]
clean_text_pattern: '[^a-z0-9\s]'
actions: ["action_1", "action_2","action_3"]
vw_workspace_params:
bit_precision: 24
quadratic_interactions: ["CA"]
cubic_interactions: []
ngram_namespaces: ["C"]
ngram_size: 2
learning_rate: 0.5
l1: 0.0
l2: 0.0
exploration_method: epsilon
exploration_value: 0.2
adaptive: true
normalized: true
quiet: false
remove_stop_words: false
remove_special_characters: true
model_path: "artifacts/model.vw"
inference_only: true
threshold: 0
top_k: 3
To run, simply use:
sinapsis run name_of_the_config.yml
📙 Documentation
Documentation for this and other sinapsis packages is available on the sinapsis website
Tutorials for different projects within sinapsis are available at sinapsis tutorials page
🔍 License
This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.
For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sinapsis_vowpal_wabbit-0.1.2.tar.gz.
File metadata
- Download URL: sinapsis_vowpal_wabbit-0.1.2.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d940445ea7d3e29722ca92e129ea3d06dbd2477ba12f673736d21913de360fa1
|
|
| MD5 |
5c4b38ba4e1110cf673dfca01da6e799
|
|
| BLAKE2b-256 |
5cea03288495169e7149d3d97a39c2b18821436619369c9a76ac64c1b5614ac4
|
File details
Details for the file sinapsis_vowpal_wabbit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sinapsis_vowpal_wabbit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70033f6ad26d70e045565ea7fb213faf4b48251e25642121fd6426b9e8aae0f2
|
|
| MD5 |
68316211118eb3cfd3dfd30aad8f78ae
|
|
| BLAKE2b-256 |
80f6b97945756581c89e1502e5f0aedf716a5631b91d1daf7b7fdf760b624960
|