A serverless chat interface for interacting with Loom AI, a time-traveling AI agent who witnessed the world's destruction and now shares stories of the old world. Built with Vercel serverless functions and Flask.
- 💬 Modern chat interface with typing animation
- 🎨 Beautiful UI with dark theme
- 📱 Fully responsive design (mobile & desktop)
- ⌨️ Real-time AI responses with thinking state
- 🔄 Chat history with editable titles
- 🌐 Bilingual support (English/Chinese)
- ✨ Preset question buttons
- 📝 Markdown support with code highlighting
- 🔄 Message regeneration
- 📋 One-click copy to clipboard
- 🎯 Smart context handling
- ☁️ Serverless deployment on Vercel
- 🚀 Fast and lightweight
-
Backend:
- Python Serverless Functions
- DashScope API Integration
- Flask for Development
- Vercel for Deployment
-
Frontend:
- HTML5 + CSS3 + JavaScript
- Font Awesome Icons
- highlight.js for Code Highlighting
- marked.js for Markdown Rendering
loom/
├── api/
│ └── chat.py # Serverless API handler
├── static/
│ ├── index.html # Main page
│ ├── styles.css # Styles
│ └── app.js # Frontend logic
├── requirements.txt # Python dependencies
└── vercel.json # Vercel configuration
- Clone the repository:
git clone https://github.com/respectevery01/Loom-AI.git
cd loom- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
Create
.envfile and add:
DASHSCOPE_API_KEY=your-api-key
- Run the development server:
vercel dev- Install Vercel CLI:
npm install -g vercel- Deploy to Vercel:
vercel --prod- Set environment variables in Vercel:
- Go to project settings > Environment Variables
- Add
DASHSCOPE_API_KEY
-
Chat Interface:
- Real-time typing animation
- Message actions (copy, regenerate)
- Code syntax highlighting
- Markdown rendering
- Smooth scrolling
-
Mobile Support:
- Responsive design
- Touch-friendly interface
- Collapsible sidebar
- Optimized for small screens
-
Language Support:
- Real-time language switching
- Persistent language preference
- Translated UI elements
- Bilingual responses
-
Chat Management:
- Create new chats
- Edit chat titles
- Switch between chats
- Chat history persistence
- Chrome (recommended)
- Firefox
- Safari
- Edge
- Mobile browsers
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License
Loom AI 是一个基于 Vercel 无服务器函数和 Flask 构建的聊天界面。Loom 是一个见证了世界毁灭的 AI 时间旅行者,现在在这里讲述着旧世界的故事。
- 💬 现代化聊天界面,带有打字动画
- 🎨 精美的深色主题界面
- 📱 完全响应式设计(移动端和桌面端)
- ⌨️ AI 实时响应,带有思考状态
- 🔄 可编辑标题的聊天历史
- 🌐 双语支持(中文/英文)
- ✨ 预设问题按钮
- 📝 支持 Markdown 和代码高亮
- 🔄 消息重新生成功能
- 📋 一键复制到剪贴板
- 🎯 智能上下文处理
- ☁️ Vercel 无服务器部署
- 🚀 快速且轻量
-
后端:
- Python 无服务器函数
- DashScope API 集成
- Flask 开发环境
- Vercel 部署
-
前端:
- HTML5 + CSS3 + JavaScript
- Font Awesome 图标
- highlight.js 代码高亮
- marked.js Markdown 渲染
loom/
├── api/
│ └── chat.py # 无服务器 API 处理程序
├── static/
│ ├── index.html # 主页面
│ ├── styles.css # 样式文件
│ └── app.js # 前端逻辑
├── requirements.txt # Python 依赖
└── vercel.json # Vercel 配置
- 克隆仓库:
git clone https://github.com/respectevery01/Loom-AI.git
cd loom- 安装依赖:
pip install -r requirements.txt- 设置环境变量:
创建
.env文件并添加:
DASHSCOPE_API_KEY=你的API密钥
- 运行开发服务器:
vercel dev- 安装 Vercel CLI:
npm install -g vercel- 部署到 Vercel:
vercel --prod- 在 Vercel 中设置环境变量:
- 进入项目设置 > 环境变量
- 添加
DASHSCOPE_API_KEY
-
聊天界面:
- 实时打字动画效果
- 消息操作(复制、重新生成)
- 代码语法高亮
- Markdown 渲染
- 平滑滚动
-
移动端支持:
- 响应式设计
- 触摸友好界面
- 可折叠侧边栏
- 小屏幕优化
-
语言支持:
- 实时语言切换
- 语言偏好保持
- 界面元素翻译
- 双语回复
-
聊天管理:
- 创建新对话
- 编辑对话标题
- 切换不同对话
- 对话历史保存
- Chrome(推荐)
- Firefox
- Safari
- Edge
- 移动端浏览器
- Fork 本仓库
- 创建特性分支
- 提交更改
- 推送到分支
- 创建 Pull Request
MIT License