diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..60f2e42537e21320c941ce15828fef2c9bc8d5db 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +public/thumbnail.png filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 4d29575de80483b005c29bfcac5061cd2f45313e..0fd69139e3de1bb68ef3fd7548d7b1e38ede53df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,25 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - +# Logs +logs +*.log npm-debug.log* yarn-debug.log* yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +package-lock.json diff --git a/README.md b/README.md index 277d937e4f28418e28ac760139e70df7ca07b22a..c9931c8e5863c0b1c21efede23fc68b72a3041e2 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ emoji: 🐠 colorFrom: indigo colorTo: red sdk: static -pinned: false +pinned: true app_build_command: npm run build app_file: build/index.html license: apache-2.0 -short_description: Use MCP and LLM with WebGPU +short_description: Use MCP and WebGPU-based LLMs with tool calling --- -# Getting Started with Create React App +# WebGPU MCP -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +Run WebGPU-based language models with tool calling capabilities in your browser, powered by the Model Context Protocol (MCP). This project supports any WebGPU-compatible models from [Hugging Face ONNX Community](https://huggingface.co/onnx-community) that support tool calling. ## Available Scripts diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..f4616740a7d28f84d875b7faba57a092d686d4e4 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,23 @@ +import js from "@eslint/js"; +import globals from "globals"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; +import { globalIgnores } from "eslint/config"; + +export default tseslint.config([ + globalIgnores(["dist"]), + { + files: ["**/*.{ts,tsx}"], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs["recommended-latest"], + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]); diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..720fd74b4e0fea6fc4b1630a94217536ca884094 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + +
+ + +
- Edit src/App.js and save to reload.
-
+ {msg.content} +
++ {msg.content} +
+Click one to get started
++ Run WebGPU-based models with tool calling in your browser, powered by the{" "} + + + Model Context Protocol (MCP) + {" "} + enabling secure, real-time connections to remote servers. + +
+ ++ Connect seamlessly to remote{" "} + + MCP servers + {" "} + using streaming or SSE protocols with support for no-auth, basic + auth, and OAuth. +
++ Supports any WebGPU-compatible models from{" "} + + Hugging Face ONNX Community + {" "} + that support tool calling, optimized for on-device deployment. +
++ Everything runs entirely in your browser with{" "} + + Transformers.js + {" "} + and ONNX Runtime Web. +
+ + {/* Action */} ++ Select a model to load locally, and connect to a remote MCP server + to get started. +
+ +Error: {error}
+ ++ You will be redirected to authorize this app with the MCP + server. +
++ {connection.config.url} +
++ Transport: {connection.config.transport} + {connection.config.auth && + ` • Auth: ${connection.config.auth.type}`} + {connection.isConnected && + ` • ${connection.tools.length} tools available`} +
+{status}
+Error: {error}
: null} +
+ {result !== undefined && result !== null
+ ? (typeof result === "object" ? JSON.stringify(result, null, 2) : String(result))
+ : "No result"}
+
+
+ {extractToolCallContent(content) ?? "..."}
+
+ + {isRunning + ? "Executing tool call..." + : hasError + ? "Tool call failed" + : "Tool call completed"} +
+