@@ -3,9 +3,11 @@ import { useChatStore } from '../ui/chat/useChatStore';
33import { ChatPanel } from '../ui/chat/ChatPanel' ;
44import { useEngine } from '../ui/model/useEngine' ;
55import { usePrebuiltModels } from '../ui/model/usePrebuiltModels' ;
6+ import { useWebGPU } from '../ui/model/useWebGPU' ;
67
78export default function App ( ) {
89 const modelList = usePrebuiltModels ( ) ;
10+ const webgpu = useWebGPU ( ) ;
911 const [ selectedModel , setSelectedModel ] = useState < string > ( modelList [ 0 ] ?. id || '' ) ;
1012 const engine = useEngine ( ) ;
1113 const chat = useChatStore ( selectedModel ) ;
@@ -28,9 +30,13 @@ export default function App() {
2830 return (
2931 < div className = "app" >
3032 < header className = "topbar" >
31- < div className = "row" >
33+ < div className = "row" style = { { gap : 12 } } >
3234 < div className = "brand" > Web LLM Starter</ div >
33- < div className = "muted" > React + WebGPU</ div >
35+ < div className = { `badge ${ webgpu . supported ? 'ok' : 'warn' } ` } title = { webgpu . supported ? `Adapter: ${ webgpu . adapter } ` : ( webgpu . error || 'WebGPU unsupported' ) } >
36+ < span className = { `dot ${ webgpu . supported ? 'ok' : 'warn' } ` } />
37+ WebGPU { webgpu . supported ? 'On' : 'Off' }
38+ </ div >
39+ { webgpu . supported && < div className = "muted" title = { webgpu . features . join ( ', ' ) || undefined } > { webgpu . adapter } </ div > }
3440 </ div >
3541 < div className = "row" >
3642 < span className = "muted" > Tok/s</ span >
@@ -54,6 +60,11 @@ export default function App() {
5460 < option key = { m . id } value = { m . id } > { m . label } </ option >
5561 ) ) }
5662 </ select >
63+ { ! webgpu . supported && (
64+ < div className = "muted" style = { { fontSize : 12 } } >
65+ WebGPU not detected. You can still try, but performance may be limited.
66+ </ div >
67+ ) }
5768
5869 { engine . state !== 'ready' ? (
5970 < button
0 commit comments