Sublayer
Sublayer is a platform designed to integrate Generative AI into your product development process for agile project management. The primary components of Sublaye...
Last verified:
What is Sublayer?
Sublayer is a model-agnostic Ruby AI Agent framework that enables developers to build generative AI-powered applications and automations. It provides a Ruby DSL and framework with base classes for creating Generators, Actions, Tasks, and Agents. The framework is self-assembling and works with any AI model, making it flexible for different LLM providers.
Key features include Generators that take string inputs and run them through an LLM to generate new string output, Actions that perform specific operations to get inputs for Generators or use generated output, and Agents that are autonomous entities designed to perform specific tasks or monitor systems. The framework also includes Triggers that decide when an agent is activated, such as FileChange triggers that listen for file changes or TimeInterval triggers that activate on a time interval.
Sublayer is designed for Ruby developers who want to create AI-powered applications, including code generation tools, automated testing systems, and generative AI automations. It supports multiple LLM providers including OpenAI (default with GPT-4o), Gemini (unstable/beta), and Claude (claude-3-5-sonnet). The framework is open source with an MIT license and has 175 stars on GitHub.
Sublayer pricing
Pricing model: Free
Sublayer is open source software available under the MIT license with no cost for the framework itself. However, users must obtain their own API keys from LLM providers which are paid services: OpenAI API (default, requires OPENAI_API_KEY), Google Gemini API (requires GEMINI_API_KEY), and Anthropic Claude API (requires ANTHROPIC_API_KEY). Users visit OpenAI, Google AI Studio, or Anthropic to get API keys and pay for their usage.
Sublayer pros
- Model-agnostic - works with any AI model
- Open source with MIT license
- Simple and easy-to-use interface
- Self-assembling framework
- Supports OpenAI, Gemini, and Claude providers
- Built-in FileChange trigger for file monitoring
- Built-in TimeInterval trigger for scheduled tasks
- Generators focus on single generation tasks
- Actions handle input retrieval and output usage
- Agents enable autonomous task performance
- Ruby DSL for intuitive syntax
- Community-driven with Discord support
- Examples directory with sample code
- Blueprints integration for AI-assisted coding
- Base classes for rapid development
Sublayer cons
- Pre-1.0 version with many breaking API changes expected
- Gemini provider is unstable and not recommended for production
- Only supports Ruby programming language
- Requires API key from LLM provider (paid services)
- Limited to 3 contributors on GitHub
- Only 9 forks indicating small community
- No packages published on RubyGems
- Beta API features may be unreliable
Frequently asked questions about Sublayer
What is Sublayer?
Sublayer is a model-agnostic Ruby AI Agent framework that allows you to effortlessly create generative AI-powered automations. It is self-assembling and provides base classes for building Generators, Actions, Tasks, and Agents that can be used to build AI powered applications in Ruby.
What AI models does Sublayer support?
Sublayer is model-agnostic and can be used with any AI model. Supported LLM providers include OpenAI (default with gpt-4o), Gemini (gemini-1.5-pro, but unstable/beta), and Claude (claude-3-5-sonnet-20240620). Users can also add custom providers through the documentation.
How do I install Sublayer?
You can install the Sublayer gem by running $ gem install sublayer in your terminal, or add gem 'sublayer', '~> 0.2' to your application's Gemfile. The version is pinned to minor version 0.2 for stability since pre-1.0 has breaking API changes.
What are Generators in Sublayer?
Generators are responsible for generating specific outputs based on input data. They focus on a single generation task and do not perform any actions or complex decision-making. Examples include CodeFromDescriptionGenerator (generates code from description), DescriptionFromCodeGenerator (generates description from code), and CodeFromBlueprintGenerator (generates code from blueprints).
What are Actions in Sublayer?
Actions perform specific operations to either get inputs for a Generator or use the generated output from a Generator. Actions do not involve complex decision making. Examples include WriteFileAction (saves generated output to a file) and RunTestCommandAction (runs a generated command line command).
What are Agents in Sublayer?
Sublayer Agents are autonomous entities designed to perform specific tasks or monitor systems. An example is RSpecAgent which runs tests whenever a file is changed, and if tests fail, the agent changes the code to pass the tests.
What are Triggers in Sublayer?
Sublayer Triggers are used in agents to decide when an agent is activated and performs its task. Built-in triggers include FileChange (listens for file changes) and TimeInterval (activates on a time interval, shown in a custom trigger tutorial).
Is Sublayer production-ready?
Sublayer is pre-1.0 with anticipated many breaking changes to the API in minor 0.x releases. For stability, the team recommends pinning to a specific minor version in your Gemfile (e.g., gem 'sublayer', '~> 0.2'). Additionally, the Gemini provider is explicitly marked as unstable and not recommended for production use.
How do I set up my environment for Sublayer?
After installing the gem, set your LLM provider API key as an environment variable. For OpenAI (default): export OPENAI_API_KEY='your-api-key'. For Gemini: export GEMINI_API_KEY='your-api-key'. For Claude: export ANTHROPIC_API_KEY='your-api-key'. Get API keys from OpenAI, Google AI Studio, or Anthropic respectively.
What is Blueprints in relation to Sublayer?
Blueprints is an open source AI code assistant built with Sublayer that allows you to capture patterns in your codebase to use as a base for generating new code. It is personalized to you and your team's unique style and represents a new approach to AI-assisted coding that leverages existing codebase patterns.