Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zckly/create-t3-turbo-ai
Build full-stack, type-safe, LLM-powered apps with the T3 Stack, Turborepo, OpenAI, and Langchain
https://github.com/zckly/create-t3-turbo-ai
ai gpt-3 langchain
Last synced: 2 days ago
JSON representation
Build full-stack, type-safe, LLM-powered apps with the T3 Stack, Turborepo, OpenAI, and Langchain
- Host: GitHub
- URL: https://github.com/zckly/create-t3-turbo-ai
- Owner: zckly
- License: mit
- Created: 2023-02-27T21:20:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-02-27T22:37:21.000Z (over 1 year ago)
- Last Synced: 2024-08-02T16:46:42.878Z (3 months ago)
- Topics: ai, gpt-3, langchain
- Language: TypeScript
- Homepage:
- Size: 317 KB
- Stars: 335
- Watchers: 15
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-langchain-zh - create-t3-turbo-ai - t3-turbo-ai?style=social): 基于 t3 ,适合 Langchain 的模板,用于构建类型安全,全栈,LLM 动力的带有 Nextjs 和 Prisma 的网络应用程序 (工具 / 模板)
- awesome-langchain - create-t3-turbo-ai - friendly boilerplate for building type-safe, full-stack, LLM-powered web apps with Nextjs and Prisma ![GitHub Repo stars](https://img.shields.io/github/stars/zckly/create-t3-turbo-ai?style=social) (Tools / Templates)
README
# create-t3-turbo-ai
## NOTE: THIS IS VERY MUCH 🚧 WIP 🚧. A lot of the features are yet to come - stay tuned!
## About
The ultimate starter repo for building full-stack, type-safe, LLM-powered web apps. It uses:
- [Turborepo](https://turborepo.com/) for monorepo management
- [tRPC](https://trpc.io/) for API routing
- [Prisma](https://www.prisma.io/) for database access
- [Next.js](https://nextjs.org/) for the web app
- [OpenAI](https://openai.com/) for the AI
- [Langchain](https://hwchase17.github.io/langchainjs/docs/overview) for LLM managementAnd much more!
## Folder structure
```
.github
└─ workflows
└─ CI with pnpm cache setup
.vscode
└─ Recommended extensions and settings for VSCode users
apps
└─ next.js
├─ Next.js 13
├─ React 18
├─ Tailwind CSS
└─ E2E Typesafe API Server & Client
packages
├─ api
| └─ tRPC v10 router definition
├─ auth
└─ authentication using next-auth. **NOTE: Only for Next.js app, not Expo**
└─ db
└─ typesafe db-calls using Prisma
```## FAQ
## Quick Start
To get it running, follow the steps below:
### Setup dependencies
```diff
# Install dependencies
pnpm i# In packages/db/prisma update schema.prisma provider to use sqlite
# or use your own database provider
- provider = "postgresql"
+ provider = "sqlite"# Configure environment variables.
# There is an `.env.example` in the root directory you can use for reference
# Make sure you add the OPENAI_API_KEY environment variable!
cp .env.example .env# Push the Prisma schema to your database
pnpm db:push
```## Deployment
### Next.js
#### Prerequisites
_We do not recommend deploying a SQLite database on serverless environments since the data wouldn't be persisted. I provisioned a quick Postgresql database on [Railway](https://railway.app), but you can of course use any other database provider. Make sure the prisma schema is updated to use the correct database._
**Please note that the Next.js application with tRPC must be deployed in order for the Expo app to communicate with the server in a production environment.**
#### Deploy to Vercel
Let's deploy the Next.js application to [Vercel](https://vercel.com/). If you have ever deployed a Turborepo app there, the steps are quite straightforward. You can also read the [official Turborepo guide](https://vercel.com/docs/concepts/monorepos/turborepo) on deploying to Vercel.
1. Create a new project on Vercel, select the `apps/nextjs` folder as the root directory and apply the following build settings:
> The install command filters out the expo package and saves a few second (and cache size) of dependency installation. The build command makes us build the application using Turbo.
2. Add your `DATABASE_URL` environment variable.
3. Done! Your app should successfully deploy. Assign your domain and use that instead of `localhost` for the `url` in the Expo app so that your Expo app can communicate with your backend when you are not in development.
## TODO
- [ ] Organize prompts in a prompt library (rather than leaving them in the API folder)
- [ ] Add Promptable.js option
- [ ] Add embeddings example
- [ ] Add PromptLayer example
- [ ] Add Vercel Edge Functions to handle streaming
- [ ] Add ChatGPT w/ memory example
- [ ] Add LLM + Agents example
- [ ] Update to NextJS app directory (once stable)## References
The stack originates from [create-t3-app](https://github.com/t3-oss/create-t3-app) and [create-t3-turbo](https://github.com/t3-oss/create-t3-turbo). The maintainers of these projects deserve all the credit!