Skip to content

Commit ce99feb

Browse files
readme updates
1 parent 2bea7ac commit ce99feb

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A minimal React + TypeScript starter app demonstrating **on-device AI in the bro
66

77
| Tab | What it does |
88
|-----|-------------|
9-
| **Chat** | Stream text from an on-device LLM (SmolLM2 360M) |
9+
| **Chat** | Stream text from an on-device LLM (LFM2 350M) |
1010
| **Vision** | Point your camera and describe what the VLM sees (LFM2-VL 450M) |
1111
| **Voice** | Speak naturally — VAD detects speech, STT transcribes, LLM responds, TTS speaks back |
1212

@@ -31,9 +31,10 @@ Open [http://localhost:5173](http://localhost:5173). Models are downloaded on fi
3131
The app imports everything from `@runanywhere/web`:
3232

3333
```typescript
34-
import { RunAnywhere, TextGeneration, VLMWorkerBridge } from '@runanywhere/web';
34+
import { RunAnywhere, SDKEnvironment } from '@runanywhere/web';
35+
import { TextGeneration, VLMWorkerBridge } from '@runanywhere/web-llamacpp';
3536

36-
await RunAnywhere.initialize({ environment: 'development' });
37+
await RunAnywhere.initialize({ environment: SDKEnvironment.Development });
3738

3839
// Stream LLM text
3940
const { stream } = await TextGeneration.generateStream('Hello!', { maxTokens: 200 });

src/components/VisionTab.tsx

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,37 @@ export function VisionTab() {
3939
const startCamera = useCallback(async () => {
4040
if (captureRef.current?.isCapturing) return;
4141

42-
const cam = new VideoCapture({ facingMode: 'environment' });
43-
await cam.start();
44-
captureRef.current = cam;
45-
46-
const mount = videoMountRef.current;
47-
if (mount) {
48-
const el = cam.videoElement;
49-
el.style.width = '100%';
50-
el.style.borderRadius = '12px';
51-
mount.appendChild(el);
52-
}
42+
setError(null);
43+
44+
try {
45+
const cam = new VideoCapture({ facingMode: 'environment' });
46+
await cam.start();
47+
captureRef.current = cam;
48+
49+
const mount = videoMountRef.current;
50+
if (mount) {
51+
const el = cam.videoElement;
52+
el.style.width = '100%';
53+
el.style.borderRadius = '12px';
54+
mount.appendChild(el);
55+
}
5356

54-
setCameraActive(true);
57+
setCameraActive(true);
58+
} catch (err) {
59+
const msg = err instanceof Error ? err.message : String(err);
60+
61+
if (msg.includes('NotAllowed') || msg.includes('Permission')) {
62+
setError(
63+
'Camera permission denied. On macOS, check System Settings → Privacy & Security → Camera and ensure your browser is allowed.',
64+
);
65+
} else if (msg.includes('NotFound') || msg.includes('DevicesNotFound')) {
66+
setError('No camera found on this device.');
67+
} else if (msg.includes('NotReadable') || msg.includes('TrackStartError')) {
68+
setError('Camera is in use by another application.');
69+
} else {
70+
setError(`Camera error: ${msg}`);
71+
}
72+
}
5573
}, []);
5674

5775
// Cleanup on unmount

0 commit comments

Comments
 (0)