├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── README.md ├── chat-stats.png ├── eslint.config.js ├── index.html ├── model-playground.png ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── qwen.webp ├── smollm.png └── vite.svg ├── src ├── App.tsx ├── assets │ ├── meta.svg │ ├── qwen.svg │ └── react.svg ├── components │ ├── ChatBox.tsx │ ├── ChatHeader.tsx │ ├── ChatStats.tsx │ ├── Header.tsx │ ├── InputArea.tsx │ ├── ModelSearch │ │ ├── FamilyFilter.tsx │ │ ├── ModelList.tsx │ │ ├── ModelRow.tsx │ │ ├── ModelSearch.tsx │ │ └── SearchInput.tsx │ ├── ModelSelector.tsx │ └── icons │ │ ├── GoogleIcon.tsx │ │ ├── MetaIcon.tsx │ │ ├── MicrosoftIcon.tsx │ │ ├── MistralIcon.tsx │ │ ├── QwenIcon.tsx │ │ ├── SmolLMIcon.tsx │ │ ├── SnowflakeIcon.tsx │ │ └── index.ts ├── index.css ├── main.tsx └── utils │ └── llm.ts ├── tailwind.config.js ├── tsconfig.app.json ├── tsconfig.app.tsbuildinfo ├── tsconfig.json ├── tsconfig.node.json ├── tsconfig.node.tsbuildinfo ├── vite.config.ts └── webllm.gif /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to Hugging Face Spaces 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build-and-deploy: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v3 16 | 17 | - name: Set up Node.js 18 | uses: actions/setup-node@v3 19 | with: 20 | node-version: '20' 21 | 22 | - name: Install dependencies 23 | run: npm ci 24 | 25 | - name: Build project 26 | run: npm run build 27 | 28 | - name: Copy README to dist 29 | run: cp README.md dist/ 30 | 31 | - name: Push to Hugging Face Spaces 32 | env: 33 | HF_TOKEN: ${{ secrets.HF_TOKEN }} 34 | run: | 35 | cd dist 36 | git init 37 | git config user.email "github-actions[bot]@users.noreply.github.com" 38 | git config user.name "github-actions[bot]" 39 | git add . 40 | git commit -m "Update build artifacts and README" 41 | git push --force https://${{ secrets.HF_USERNAME }}:$HF_TOKEN@huggingface.co/spaces/${{ secrets.HF_USERNAME }}/${{ secrets.SPACE_NAME }} HEAD:main -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WebLLM Playground 3 | emoji: 🏎️ 4 | colorFrom: purple 5 | colorTo: indigo 6 | sdk: static 7 | pinned: true 8 | header: mini 9 | license: apache-2.0 10 | --- 11 |  12 | 13 |
140 | WebGPU is not supported in your browser. 😢 141 |
142 |17 | {description} 18 |
19 |74 | First download may take a little bit. Subsequent loads will read from cache. 75 |
76 | )} 77 | {loadProgress && ( 78 |