Skip to main content

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-names to show a list with all the available Template names installed with Sinapsis OCR.

[!TIP] Use CLI command sinapsis info --example-template-config CBExploreADFPredict to 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


Download files

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

Source Distribution

sinapsis_vowpal_wabbit-0.1.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

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

sinapsis_vowpal_wabbit-0.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_vowpal_wabbit-0.1.0.tar.gz.

File metadata

File hashes

Hashes for sinapsis_vowpal_wabbit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cb0a5b4f55321d89ed79b0a88efb77a61c6016fa5283cfeb4016c030e92db82d
MD5 11096c2bfaefd3996acb4fd062e9e88d
BLAKE2b-256 b024e0dcf59f6ca8b9cb84b0fe15a14ba5cbd6e57d3841bc8feb6d629bcf7584

See more details on using hashes here.

File details

Details for the file sinapsis_vowpal_wabbit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_vowpal_wabbit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b80c582884f257ffe37e50a1d49b61a5e3f40005f64048bc4215daabfb76e5db
MD5 75142f8558430a29968e0e96506f11a8
BLAKE2b-256 24228aeb98dda9b3b1e896bbc1a310033fe60c674129d4f281ac91a9bef24c69

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