{"id":13877916,"url":"https://github.com/sublayerapp/sublayer","last_synced_at":"2025-07-16T13:32:58.031Z","repository":{"id":219308544,"uuid":"713561331","full_name":"sublayerapp/sublayer","owner":"sublayerapp","description":"A model-agnostic Ruby Generative AI DSL and framework. Provides base classes for building Generators, Actions, Tasks, and Agents that can be used to build AI powered applications in Ruby.","archived":false,"fork":false,"pushed_at":"2024-10-29T20:30:21.000Z","size":312,"stargazers_count":110,"open_issues_count":31,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-29T21:38:30.080Z","etag":null,"topics":["agents","ai","ai-agents","ai-agents-framework","dsl","ruby"],"latest_commit_sha":null,"homepage":"https://docs.sublayer.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sublayerapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-02T19:14:39.000Z","updated_at":"2024-10-29T15:33:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"27d119ed-85d3-4fb1-b1bb-54763473d231","html_url":"https://github.com/sublayerapp/sublayer","commit_stats":null,"previous_names":["sublayerapp/sublayer"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublayerapp%2Fsublayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublayerapp%2Fsublayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublayerapp%2Fsublayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sublayerapp%2Fsublayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sublayerapp","download_url":"https://codeload.github.com/sublayerapp/sublayer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226134226,"owners_count":17578778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","ai-agents","ai-agents-framework","dsl","ruby"],"created_at":"2024-08-06T08:01:34.823Z","updated_at":"2024-11-24T06:31:38.710Z","avatar_url":"https://github.com/sublayerapp.png","language":"Ruby","readme":"# Sublayer\n\nA model-agnostic Ruby AI Agent framework. Provides base classes for\nbuilding Generators, Actions, Tasks, and Agents that can be used to build AI\npowered applications in Ruby.\n\nFor more detailed documentation visit our documentation site: [https://docs.sublayer.com](https://docs.sublayer.com).\n\n## Note on Versioning\n\nPre-1.0 we anticipate many breaking changes to the API. Our current plan is to\nkeep breaking changes to minor, 0.x releases, and patch releases (0.x.y) will be used\nfor new features and bug fixes.\n\nTo maintain stability in your application, we recommend pinning the version of\nSublayer in your Gemfile to a specific minor version. For example, to pin to\nversion 0.2.x, you would add the following line to your Gemfile:\n\n```ruby\ngem 'sublayer', '~\u003e 0.2'\n```\n\n## Notes on 0.2\n\nNew default model update: gpt 4 turbo -\u003e gpt 4o\n\nGemini: Updates include the use of beta API function calling features. Experimental and unstable.\n\n## Installation\n\nInstall the gem by running the following commands:\n\n    $ gem install sublayer\n\nOr add this line to your application's Gemfile:\n\n```ruby\ngem 'sublayer', '~\u003e 0.2'\n```\n\n## Choose your AI Model\n\nSublayer is model-agnostic and can be used with any AI model. Below are the supported LLM Providers. Check out our [docs](https://docs.sublayer.com) to add your own custom Provider.\n\n### OpenAI (Default)\n\nExpects you to have an OpenAI API key set in the `OPENAI_API_KEY` environment variable.\n\nVisit [OpenAI](https://openai.com/product) to get an API key.\n\nUsage:\n```ruby\nSublayer.configuration.ai_provider = Sublayer::Providers::OpenAI\nSublayer.configuration.ai_model = \"gpt-4o\"\n```\n\n### Gemini [UNSTABLE]\n\n(Gemini's function calling API is in beta. Not recommended for production use.)\n\nExpects you to have a Gemini API key set in the `GEMINI_API_KEY` environment variable.\n\nVisit [Google AI Studio](https://ai.google.dev/) to get an API key.\n\nUsage:\n```ruby\nSublayer.configuration.ai_provider = Sublayer::Providers::Gemini\nSublayer.configuration.ai_model = \"gemini-1.5-pro\"\n```\n\n### Claude\n\nExpect you to have a Claude API key set in the `ANTHROPIC_API_KEY` environment variable.\n\nVisit [Anthropic](https://anthropic.com/) to get an API key.\n\n\nUsage:\n```ruby\nSublayer.configuration.ai_provider = Sublayer::Providers::Claude\nSublayer.configuration.ai_model =\"claude-3-5-sonnet-20240620\"\n```\n\n## Concepts\n\n### Generators\n\nGenerators are responsible for generating specific outputs based on input data.\nThey focus on a single generation task and do not perform any actions or complex\ndecision-making. Generators are the building blocks of the Sublayer framework.\n\nExamples (in the `/spec/generators/examples` directory):\n- [CodeFromDescriptionGenerator](https://github.com/sublayerapp/sublayer/blob/main/spec/generators/examples/code_from_description_generator.rb):\n  Generates code based on a description and the technologies used.\n- [DescriptionFromCodeGenerator](https://github.com/sublayerapp/sublayer/blob/main/spec/generators/description_from_code_generator_spec.rb):\n  Generates a description of the code passed in to it.\n- [CodeFromBlueprintGenerator](https://github.com/sublayerapp/sublayer/blob/main/spec/generators/examples/code_from_blueprint_generator.rb):\n  Generates code based on a blueprint, a blueprint description, and a description of the desired code.\n\n\n### Actions\n\nActions perform specific operations to either get inputs for a Generator or use\nthe generated output from a Generator. Actions do not involve complex decision making.\n\nExamples:\n- [WriteFileAction](https://github.com/sublayerapp/tddbot/blob/43297c5da9445bd6c8882d5e3876cff5fc6b2650/lib/tddbot/sublayer/actions/write_file_action.rb):\n  Saves generated output to a file.\n- [RunTestCommandAction](https://github.com/sublayerapp/tddbot/blob/43297c5da9445bd6c8882d5e3876cff5fc6b2650/lib/tddbot/sublayer/actions/run_test_command_action.rb):\n  Runs a generated command line command.\n\n### Agents\n\nSublayer Agents are autonomous entities designed to perform specific\ntasks or monitor systems.\n\nExamples:\n- [RSpecAgent](https://github.com/sublayerapp/sublayer/blob/main/spec/agents/examples/rspec_agent.rb):\n  Runs tests whenever a file is changed. If the tests fail the code is changed\n  by the agent to pass the tests.\n\n### Triggers\n\nSublayer Triggers are used in agents. Triggers decide when an agent is activated\nand performs its task\n\nExamples:\n- [FileChange](https://github.com/sublayerapp/sublayer/blob/main/lib/sublayer/triggers/file_change.rb):\n  This built in sublayer trigger, listens for file changes\n- [TimeInterval](https://docs.sublayer.com/docs/guides/build-a-custom-trigger)\n  This custom trigger tutorial shows how to create your own trigger, this one activates on a time interval\n\n## Usage Examples\n\nThere are sample Generators in the /examples/ directory that demonstrate how to\nbuild generators using the Sublayer framework. Alternatively below are links to\nopen source projects that are using generators in different ways:\n\n- [Blueprints](https://blueprints.sublayer.com) - An open source AI code\n  assistant that allows you to capture patterns in your codebase to use as a\nbase for generating new code.\n\n- [Clag](https://github.com/sublayerapp/clag) - A ruby gem that generates\n  command line commands from a simple description right in your terminal.\n","funding_links":[],"categories":["Ruby","Open Source"],"sub_categories":["Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublayerapp%2Fsublayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsublayerapp%2Fsublayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublayerapp%2Fsublayer/lists"}