{"id":25345599,"url":"https://github.com/baseline-js/baseline-ai-stack","last_synced_at":"2026-03-03T20:32:26.905Z","repository":{"id":262907807,"uuid":"858018038","full_name":"Baseline-JS/baseline-ai-stack","owner":"Baseline-JS","description":"Baseline AI Stack is an open-source, serverless, typescript template to build AI powered apps","archived":false,"fork":false,"pushed_at":"2024-11-18T00:13:52.000Z","size":1274,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T10:52:06.870Z","etag":null,"topics":["ai","aws","bedrock","boilerplate","framework","project-template","serverless"],"latest_commit_sha":null,"homepage":"https://baselinejs.com","language":"TypeScript","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/Baseline-JS.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-16T06:45:09.000Z","updated_at":"2025-01-22T02:00:16.000Z","dependencies_parsed_at":"2025-06-14T18:08:39.287Z","dependency_job_id":"24a00fda-80ad-46f0-aae6-62c7bef89baf","html_url":"https://github.com/Baseline-JS/baseline-ai-stack","commit_stats":null,"previous_names":["baseline-js/baseline-ai-stack"],"tags_count":0,"template":false,"template_full_name":"github/codespaces-blank","purl":"pkg:github/Baseline-JS/baseline-ai-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fbaseline-ai-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fbaseline-ai-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fbaseline-ai-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fbaseline-ai-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Baseline-JS","download_url":"https://codeload.github.com/Baseline-JS/baseline-ai-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseline-JS%2Fbaseline-ai-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30058287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","aws","bedrock","boilerplate","framework","project-template","serverless"],"created_at":"2025-02-14T12:39:16.020Z","updated_at":"2026-03-03T20:32:26.887Z","avatar_url":"https://github.com/Baseline-JS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"1253\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2a5e7395-a2e9-4caf-9496-e3c60f2d436c\"\u003e\n\n\n# Baseline AI Stack\n\nBaselineJS AI Stack is an open-source, fullstack TypeScript, serverless first framework designed to make building cloud native applications easier. This is a customized version of BaselineJS that demonstrates how Bedrock AI can be integrated into the BaselineJS framework in a working application.\n\nIf you like BaselineJS give us a ⭐️\n\n[Baseline AI Stack](https://github.com/Baseline-JS/baseline-ai-stack)\n\n[Baseline](https://github.com/Baseline-JS/core) |\n[Website](https://baselinejs.com/) |\n[Documentation](https://docs.baselinejs.com/) |\n[Discord](https://discord.gg/beCj9VDeMm) |\n[LinkedIn](https://www.linkedin.com/company/baselinejs) |\n[YouTube](https://www.youtube.com/@Baseline-JS)\n\nStartups, want $10k USD of AWS Credits to Get Started? [Apply Here](https://share.hsforms.com/1P6p_G9Q_Q-SJAESAYtLftgqm3as)\n\n![baseline-ai-stack-demo](https://github.com/user-attachments/assets/d4439104-8a58-4adc-b73d-f17b7bd013f1)\n\n# Getting Started\n\nYou have 3 different options to setup Baseline AI Stack:\n\n1. [Workshop Form](#workshop-form)\n2. [Quickstart](#quickstart)\n3. [Setup](#setup)\n\n## Workshop Form\n\nA simplified deployment to try out the Baseline AI Stack can be found at [Baseline AI Workshop](https://baselinejs.com/workshop-ai). This will guide you through the process of deploying the Baseline AI Stack to your AWS account. This is the easiest no code way to get started.\n\n## Quickstart\n\n1. `npx @baselinejs/quickstart-ai` and follow the setup instructions\n\n## Setup\n\nAlternatively, follow the setup instructions below.\n\n1. [Install requirements](#local-requirements) `pnpm run install:requirements`\n2. `npx @baselinejs/create-ai`\n3. `pnpm install`\n4. `pnpm run setup` to name your project and set the region\n5. `pnpm run aws:profile` to setup your AWS credentials profile (if you have issues please [update aws cli](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html]))\n6. `pnpm run deploy:staging` to deploy api \u0026 chat\n7. `pnpm run add:user:staging` to add a chat user to the application\n8. `pnpm run urls:staging` To see your project URLs\n\n### Setup the AI settings\n\n`packages/api/src/baseblocks/chat/chat-api.ts` contains the settings for the AI model. Set them to the desired values. Deploy the application again after changing these settings with `pnpm run deploy:staging`.\n\nThe settings are as follows:\n\n```typescript\nconst MODEL_REGION = 'ap-southeast-2';\nconst MODEL_ID = ModelIdentifiers.MISTRAL_MISTRAL_7B_INSTRUCT_V0;\nconst MAX_INPUT_TOKENS = 100000;\nconst MAX_OUTPUT_TOKENS = 100000;\nconst MAX_COMPUTE_MS = 1000000;\nconst MAX_TOTAL_TOKENS = 0; // No limit\nconst GLOBAL_MAX_INPUT_TOKENS = 1000000;\nconst GLOBAL_MAX_OUTPUT_TOKENS = 1000000;\nconst GLOBAL_MAX_COMPUTE_MS = 10000000;\nconst GLOBAL_MAX_TOTAL_TOKENS = 0; // No limit\n```\n\nExplanation of the settings:\n\n- `MODEL_REGION`: The region of the AI model.\n- `MODEL_ID`: The ID of the AI model. [See the Bedrock AI docs for list](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html).\n- `MAX_INPUT_TOKENS`: The maximum number of tokens in the input to the AI model.\n- `MAX_OUTPUT_TOKENS`: The maximum number of tokens in the output from the AI model.\n- `MAX_COMPUTE_MS`: The maximum time in milliseconds the AI model can take to compute.\n- `MAX_TOTAL_TOKENS`: The maximum number of tokens in the input and output combined.\n- `GLOBAL_MAX_INPUT_TOKENS`: The maximum number of tokens in the input to the AI model for all users combined.\n- `GLOBAL_MAX_OUTPUT_TOKENS`: The maximum number of tokens in the output from the AI model for all users combined.\n- `GLOBAL_MAX_COMPUTE_MS`: The maximum time in milliseconds the AI model can take to compute for all users combined.\n- `GLOBAL_MAX_TOTAL_TOKENS`: The maximum number of tokens in the input and output combined for all users combined.\n\nSet any of them to 0 to disable the limit.\n\nThe user and global limits will be enforced by the API. If the limits are exceeded, the API will return an error. The user limits are enforced per user, and the global limits are enforced for all users combined. A DynamoDB table is used to store the usage of each user as well as the default values, that way any user can be tracked and the limits can be enforced as well as modified.\n\n## Local Requirements\n\nThese must be installed before following the setup instructions.\n\n- Macos/Linux OS/Windows Subsystem for Linux\n  - Node.js v20 (v20 or higher) \u0026 npm@10.5.0 or higher [(we suggest installing and using nvm)](https://github.com/nvm-sh/nvm#install--update-script) follow instructions in the link to install, you will generally need to create a new terminal session after installing. If you already have nvm update it before proceeding.\n    - If nvm is installed you can switch versions with `nvm install 20 \u0026\u0026 nvm use 20 \u0026\u0026 nvm alias default 20 \u0026\u0026 nvm install-latest-npm`\n    - If not using nvm you can manually install node and npm, download from \u003chttps://nodejs.org/en/download/\u003e alternatively use the operating system package manager or any other appropriate tool to install node\n    - Current versions can be checked with `node -v`, `npm -v`\n  - pnpm version 9, version can be checked with `pnpm -v`, install with `npm install -g pnpm@9` [or other methods](https://pnpm.io/installation)\n  - [AWS CLI v2](https://aws.amazon.com/cli)\n  - Homebrew, for Mac users only, follow install instructions [here](https://brew.sh/)\n  - [jq](https://stedolan.github.io/jq/download/) for extracting Cloudformation outputs\n    - Install on mac `brew install jq`\n    - Install on Linux `sudo yum install jq` or `sudo apt-get install jq`, or other appropriate methods\n  - Java Runtime Environment (JRE) version 8.x or newer, it is only required for [DynamoDB local](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html)\n    - Install on mac `brew install java`\n    - Install on linux `sudo yum install java` or `sudo apt-get install openjdk-8-jdk`, or other appropriate methods\n    - DynamoDB local will automatically install in the project when the api is started, java needs to installed before this occurs\n  - curl which is used in some of the bash scripts, [curl install instructions](https://everything.curl.dev/get)\n  - An IDE such as [Visual Studio Code](https://code.visualstudio.com/)\n- Internet connectivity\n- AWS Account \u003chttps://aws.amazon.com/getting-started/\u003e\n- IAM credentials \u003chttps://docs.aws.amazon.com/cli/latest/userguide/getting-started-prereqs.html#getting-started-prereqs-iam\u003e be sure to follow [Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)\n\n### Experimental Requirements Installation\n\nAlternatively, try the experimental requirements installation script. Use at your own risk.\n\nIf you are starting a new Baseline project.\n\n```bash\ncurl -o- https://raw.githubusercontent.com/Baseline-JS/core/main/scripts/experimental-install-requirements.sh | bash\n```\n\nor\n\n```bash\nwget -qO- https://raw.githubusercontent.com/Baseline-JS/core/main/scripts/experimental-install-requirements.sh | bash\n```\n\nIf you are joining an existing Baseline project\n\n```bash\npnpm run install:requirements\n```\n\n## Run Locally\n\nIf the project is already setup and you are trying run the project locally make sure you run `pnpm run aws:profile` first so that you have the correct credentials for AWS configured locally.\n\n### Commands\n\nStart the api and chat in their own terminal windows/tabs with the following commands.\n\n1. `pnpm run generate:env:local` to generate the env files for the frontend clients\n2. `pnpm run start:api`\n3. `pnpm run start:chat`\n\n### Running locally Limitations\n\n- API, Chat: No S3, you will need to rely on AWS staging S3\n- API: No local Cognito Authorizer, the deployed staging cognito can be used (see `packages/api/serverless.yml`) or the payload set by `AUTHORIZER` in `packages/api/scripts/run-api-local.sh`.\n- Chat: Cognito UI relies on an active AWS Cognito user pool, use deployed staging\n\n## Deploy a Change\n\nSwap `staging` to `prod` to deploy to production. All environment variables will be automatically set in the process.\n\n1. `pnpm run deploy:staging` to deploy api and chat\n\n## Remove Stack\n\nTo destroy the deployed cloudformation stacks so it is no longer on AWS run `pnpm run remove:staging`. This will likely destroy all data associated with the application.\n\n## Major Components\n\n- 🚀 API\n- 🌐 React User Application\n- ⚙️ CI/CD\n- 🔧 Developer Tooling\n- 🔒 Authentication\n- 🔄 Multiple Environments\n- 💻 Run Locally\n- 🏗️ Infrastructure as Code (IaC)\n- 📦 Managed Environment Variables\n- ✨ Baseline Commands\n\n## Technology\n\n- 🎁 Package Management: Pnpm + Monorepo\n- 🔨 Language \u0026 Build: TypeScript + ESBuild\n- 🖼 Frontend: React + Vite\n- ⚙️ Backend: NodeJS + Express\n- 🎨 Linting \u0026 Formatting: Prettier + Eslint\n- 🏗 IaC: AWS + Serverless Framework\n- 🚀 Deploy: Local/Bitbucket/GitHub CI/CD\n\n## AWS Services\n\n- Cognito\n- S3\n- Lambda\n- DynamoDB\n- CloudFormation\n- Route53\n- Systems Manager\n- CloudFront\n- API Gateway\n- CloudWatch\n- SNS\n\n## What can you build with Baseline?\n\n- 🌐 SaaS Solutions: Build software-as-a-service solutions tailored to your audience.\n- 🖥️ Web Applications: Develop responsive and scalable web applications.\n- 🛒 Marketplaces: Launch and manage online marketplaces with ease.\n- 📱 Mobile Applications: Create robust mobile apps for iOS and Android platforms.\n- 💼🛍️ B2B/B2C Applications: Seamlessly cater to both business and consumer audiences.\n- 🗄️ Headless CMS: Manage content efficiently using a headless content management system.\n\n## Benefits\n\n- Serverless First\n- Open source\n- Full control\n- Cost effective implementation\n- Hosted in your own AWS account\n- Uses popular technology\n- Scales on demand\n- Staging and production environments\n- Runs locally\n\n# Baseline\n\nIf you would like to learn more about what we do please visit [Baseline](https://baselinejs.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseline-js%2Fbaseline-ai-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaseline-js%2Fbaseline-ai-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseline-js%2Fbaseline-ai-stack/lists"}