Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged Moshi Integration (First Voice to Voice AI Model) and Hidden WebXR Features #161

Merged
merged 205 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
5abbfec
re-enable debug menu
kasumi-1 Sep 27, 2024
60bc34e
fix indentation
kasumi-1 Sep 27, 2024
a29b62f
wip webxr
kasumi-1 Sep 27, 2024
e9b649e
basic webxr
kasumi-1 Sep 28, 2024
79c8f56
webxr ui
kasumi-1 Sep 28, 2024
3a277d5
ignore if ending session fails
kasumi-1 Sep 28, 2024
fdd4651
disable ar button if ar not available
kasumi-1 Sep 28, 2024
4f0f81e
different keyboard behavior for onscreen keyboard users
kasumi-1 Sep 28, 2024
2ff240d
disable autocomplete on messageinput
kasumi-1 Sep 28, 2024
fadd1dc
await for end session to complete for error handling
kasumi-1 Sep 28, 2024
88f9dd9
fix amica being rendered twice after normal->ar->normal->ar switch
kasumi-1 Sep 28, 2024
46db8f3
cache camera pos/rot prior to ar mode to prevent reset
kasumi-1 Sep 28, 2024
74b12a7
add controller / reticle for xr
kasumi-1 Sep 29, 2024
1b3627e
import moshi worklet
kasumi-1 Sep 29, 2024
9e85f8b
additional debugpane padding for mobile
kasumi-1 Sep 29, 2024
fbaf1dd
remove unused m-plus-2
kasumi-1 Sep 29, 2024
11d79a0
import required libs for moshi
kasumi-1 Sep 29, 2024
df7ea34
import moshi client codebase from https://github.com/kyutai-labs/mosh…
kasumi-1 Sep 29, 2024
1f38f74
bump three and three-vrm versions
kasumi-1 Sep 29, 2024
94ec460
increase lighting as three or three-vrm update reduced it
kasumi-1 Sep 29, 2024
1f1cd4c
optimize models
kasumi-1 Sep 29, 2024
d2bdf1c
import decoderWorker from moshi
kasumi-1 Sep 29, 2024
e6d5a87
moshi import moving files around
kasumi-1 Sep 29, 2024
3443245
fix compile errors
kasumi-1 Sep 29, 2024
218ad92
more minor moshi work
kasumi-1 Sep 29, 2024
d90f533
fix color of disabled ar toggle button
kasumi-1 Sep 29, 2024
ed433e1
icon instead of vertical switch
kasumi-1 Sep 29, 2024
b5c796d
refactor
kasumi-1 Sep 29, 2024
9654df1
move language selector into settings
kasumi-1 Sep 29, 2024
d7eb424
stub moshi for testing
kasumi-1 Sep 29, 2024
e58e800
fix build
kasumi-1 Sep 29, 2024
963e044
update next.js to latest version
kasumi-1 Oct 1, 2024
04f7e93
upgrade tailwindcss/forms
kasumi-1 Oct 1, 2024
945f766
upgraded clsx
kasumi-1 Oct 1, 2024
0c3853a
npm audit
kasumi-1 Oct 1, 2024
e290147
upgrade tailwind and postcss
kasumi-1 Oct 1, 2024
4ded8be
upgrade i18next
kasumi-1 Oct 1, 2024
65f6dc9
upgrade transformers.js
kasumi-1 Oct 1, 2024
fb48756
upgrade filepond
kasumi-1 Oct 1, 2024
aedf670
upgrade prettier
kasumi-1 Oct 1, 2024
ca3e598
upgrade dexie
kasumi-1 Oct 1, 2024
3594299
update charcoal ui
kasumi-1 Oct 1, 2024
4d23dd7
bump heroicons
kasumi-1 Oct 1, 2024
49a20f0
bump typescript&fix type error
kasumi-1 Oct 1, 2024
d35040e
bump node/types
kasumi-1 Oct 1, 2024
088de63
bump tauri
kasumi-1 Oct 1, 2024
1dd24b9
upgrade gltf-transform
kasumi-1 Oct 1, 2024
a697374
bump tauri-cli
kasumi-1 Oct 1, 2024
380858f
bump headlessui
kasumi-1 Oct 1, 2024
0ee5cc5
bump fast-glob
kasumi-1 Oct 1, 2024
5ad6112
remove debug print
kasumi-1 Oct 1, 2024
95dd853
bump copy-webpack-plugin
kasumi-1 Oct 1, 2024
189e01c
use prettier inside npm run lint
kasumi-1 Oct 1, 2024
a2492cf
fix removed packages
kasumi-1 Oct 1, 2024
6289912
bump tabler/icons
kasumi-1 Oct 1, 2024
29390e2
bump next-pwa
kasumi-1 Oct 1, 2024
d12c6f0
bump i18next-parser
kasumi-1 Oct 1, 2024
ea03799
bump @ricky0123/vad-react
kasumi-1 Oct 1, 2024
231219b
make settings background gray instead of purple
kasumi-1 Oct 1, 2024
7e76380
close settings page by clicking outside of whitelisted elements
kasumi-1 Oct 1, 2024
ae4d8fb
Revert "bump @ricky0123/vad-react"
kasumi-1 Oct 1, 2024
96e4b4e
load next.js export type from env var OUTPUT
kasumi-1 Oct 1, 2024
38c33d1
fix tauri build
kasumi-1 Oct 1, 2024
88383df
Revert "Revert "bump @ricky0123/vad-react""
kasumi-1 Oct 1, 2024
7d34f58
disable change chat mode in ar view
kasumi-1 Oct 1, 2024
bb7d43e
minor refactor
kasumi-1 Oct 4, 2024
050096e
add vr mode
kasumi-1 Oct 11, 2024
2600ee3
fix pixelation near edges
kasumi-1 Oct 11, 2024
d1e465d
stub select event
kasumi-1 Oct 11, 2024
a98e640
add hand / controllers to ar/vr
kasumi-1 Oct 11, 2024
08b3556
add fps stats
kasumi-1 Oct 11, 2024
8d50a63
basic room load
kasumi-1 Oct 11, 2024
b2a7465
basic splat loading
kasumi-1 Oct 13, 2024
19512bd
moveable debug menu
kasumi-1 Oct 13, 2024
4dafca4
add white floor
kasumi-1 Oct 13, 2024
24a3e6d
niner menu placement
kasumi-1 Oct 13, 2024
9955408
wip raycast
kasumi-1 Oct 13, 2024
4c1d748
move hand rays
kasumi-1 Oct 14, 2024
9e3e6ce
bvh
kasumi-1 Oct 14, 2024
d8c1140
build raycast targets only on change
kasumi-1 Oct 14, 2024
6c802f7
naming
kasumi-1 Oct 14, 2024
80799dd
updates
kasumi-1 Oct 14, 2024
1ee714e
mouse raycast
kasumi-1 Oct 14, 2024
904c104
color balls
kasumi-1 Oct 14, 2024
f58036a
generate bvh after running animation, useful for static pose
kasumi-1 Oct 14, 2024
a49d616
tiny improvements
kasumi-1 Oct 14, 2024
57f646e
do two raycasts to detect if amica or room touch + some scaffolding. …
kasumi-1 Oct 14, 2024
581f183
add bathroom
kasumi-1 Oct 14, 2024
f8b3af0
use better strat for room, perf increase
kasumi-1 Oct 14, 2024
9bb499f
import from three webxr dir
kasumi-1 Oct 14, 2024
bb71295
import all controllers
kasumi-1 Oct 14, 2024
0c12fd0
mystery bench
kasumi-1 Oct 14, 2024
519390b
add developer page to settings
kasumi-1 Oct 14, 2024
a7c2f09
minor changes
kasumi-1 Oct 14, 2024
eff0d27
import wip bvh web worker scripts
kasumi-1 Oct 14, 2024
9e3436a
cleanup
kasumi-1 Oct 14, 2024
dc5ac39
wip web worker bvh generation
kasumi-1 Oct 15, 2024
d65abce
remove uikit (for now?)
kasumi-1 Oct 15, 2024
ca6452f
add use_webgpu config dev option
kasumi-1 Oct 15, 2024
fc520c5
remove unused montserrat
kasumi-1 Oct 15, 2024
8bb33d2
pass along use_webgpu in settings
kasumi-1 Oct 15, 2024
1b77674
properly wait for viewer setup
kasumi-1 Oct 15, 2024
f96b4de
experimental webgpu renderer (wip)
kasumi-1 Oct 15, 2024
5280684
bump three-vrm
kasumi-1 Oct 15, 2024
c693ccf
parcel package
kasumi-1 Oct 15, 2024
ced2d54
remove uiroot
kasumi-1 Oct 15, 2024
67b2072
parcel test
kasumi-1 Oct 15, 2024
d6559c9
upgrade outdated packages
kasumi-1 Oct 15, 2024
0ffffe1
optimize raycasting for static rooms
kasumi-1 Oct 15, 2024
12c9964
remove some commented out code
kasumi-1 Oct 15, 2024
72ae509
nicer todo
kasumi-1 Oct 15, 2024
1206e06
set mtoon debug mode
kasumi-1 Oct 15, 2024
2dae3ea
remove shadows from room
kasumi-1 Oct 15, 2024
0cb98ce
shrink floor
kasumi-1 Oct 15, 2024
a293c45
pass mtoon debug to settings page properly
kasumi-1 Oct 15, 2024
ccd212d
improve code
kasumi-1 Oct 15, 2024
7efc5c4
set mtoon material in config
kasumi-1 Oct 16, 2024
9512df5
set mtoon material in settings
kasumi-1 Oct 16, 2024
0d6b985
hands
kasumi-1 Oct 16, 2024
5fc897c
store and update gui mesh
kasumi-1 Oct 16, 2024
a7c43e4
improve new hand renderer
kasumi-1 Oct 16, 2024
b48aef3
loading progress progress
kasumi-1 Oct 16, 2024
761902e
remove console logs
kasumi-1 Oct 16, 2024
2850955
hide igroup unless in xr
kasumi-1 Oct 16, 2024
d33e8d1
update model every frame
kasumi-1 Oct 16, 2024
1d4e97b
fix camera
kasumi-1 Oct 16, 2024
d8c9f95
add note for igroup
kasumi-1 Oct 16, 2024
bab9b0a
camera..
kasumi-1 Oct 16, 2024
d3cfbcf
correct delta for model update
kasumi-1 Oct 16, 2024
0dc6e13
render a sphere on closest part / bone found
kasumi-1 Oct 16, 2024
f9193ab
ws
kasumi-1 Oct 16, 2024
5a0d173
disable hand lines
kasumi-1 Oct 16, 2024
df976cb
disable wind
kasumi-1 Oct 16, 2024
787036f
Merge remote-tracking branch 'origin/master' into webxr
kasumi-1 Oct 16, 2024
779c943
add type
kasumi-1 Oct 16, 2024
77f9634
uncomment accidentally committed comment
kasumi-1 Oct 16, 2024
1dd9389
add animation_procedural config
kasumi-1 Oct 16, 2024
d93cf87
watch debug options in settings
kasumi-1 Oct 16, 2024
8d9b3b0
use correct type
kasumi-1 Oct 16, 2024
407ca32
openai vision backend support
kasumi-1 Oct 18, 2024
837a7d7
remove some debug logs
kasumi-1 Oct 18, 2024
b0b4898
remove console logs
kasumi-1 Oct 19, 2024
b784a99
change defaults
kasumi-1 Oct 19, 2024
28a8347
make default backend chatgpt
kasumi-1 Oct 19, 2024
af44d8e
revert schizo genius default prompt
kasumi-1 Oct 19, 2024
762dc83
add sentry
kasumi-1 Oct 19, 2024
68eba72
remove test pages
kasumi-1 Oct 19, 2024
3bafaba
add optimization and analyzer scripts
kasumi-1 Oct 22, 2024
450f7a9
add example code for optimizers
kasumi-1 Oct 22, 2024
1f763e4
lint
kasumi-1 Oct 22, 2024
adc1fbb
wip procedural animation, scenarios, particles
kasumi-1 Oct 22, 2024
2363f04
improve scenario
kasumi-1 Oct 22, 2024
4cc485c
switch net
kasumi-1 Oct 22, 2024
fe870ab
disable sentry if not in prod
kasumi-1 Oct 23, 2024
1e972ef
enable google analytics in production
kasumi-1 Oct 23, 2024
184b9fe
method to change vrm transparency
kasumi-1 Oct 24, 2024
dc98339
next/thirdparties package.json
kasumi-1 Oct 24, 2024
390bfc6
import ammo physics
kasumi-1 Oct 24, 2024
9890643
big buttons on vr headsets
kasumi-1 Oct 24, 2024
9782c12
disable transparency of model
kasumi-1 Oct 24, 2024
2c9ede2
add room mover to gui
kasumi-1 Oct 24, 2024
054003a
dont highlight closest part (for now)
kasumi-1 Oct 24, 2024
a08d214
wait for scenario to setup complete
kasumi-1 Oct 24, 2024
8a5dd92
run physics during update loop
kasumi-1 Oct 24, 2024
454b98b
update scenario each frame
kasumi-1 Oct 24, 2024
70d034c
rename vars
kasumi-1 Oct 24, 2024
568fa17
test2 scenario
kasumi-1 Oct 24, 2024
11403f8
more testing
kasumi-1 Oct 24, 2024
181b49d
guard during scenario load
kasumi-1 Oct 29, 2024
b8ccac2
wrap updates in try/catch blocks
kasumi-1 Oct 29, 2024
1e00772
add local floor / bounded floor features
kasumi-1 Oct 29, 2024
fda7bba
disable sentry properly outside of production
kasumi-1 Oct 29, 2024
ecde79a
import rainbowkit
kasumi-1 Oct 30, 2024
d80cec3
remove sentry guard (done elsewhere)
kasumi-1 Oct 30, 2024
ba00c95
import helvetiker font
kasumi-1 Oct 30, 2024
815b1ee
fix broken ammo on hot reload
kasumi-1 Oct 30, 2024
131bffc
config options for popups
kasumi-1 Oct 30, 2024
defa41f
make language configurable in config for localization
kasumi-1 Oct 30, 2024
40f9186
load scenario url from config
kasumi-1 Oct 30, 2024
6fe9682
add stub for arbius chat
kasumi-1 Nov 4, 2024
2ef0054
remove bounded floor requirement
kasumi-1 Nov 4, 2024
d5cc7b7
remove connectbutton from messageinput
kasumi-1 Nov 5, 2024
984b872
arbius introduction text
kasumi-1 Nov 5, 2024
c9c203b
disable arbius intro by default
kasumi-1 Nov 5, 2024
148e18f
added moshi
flukexp Dec 5, 2024
c3c9986
fixed getBaseUrl
flukexp Dec 5, 2024
97a7bb9
added error handling for handleWebSocketMessage
flukexp Dec 5, 2024
1a031b9
removed unused file
flukexp Dec 12, 2024
5fa950e
Merge pull request #148 from ArbiusIntern/moshi
kasumi-1 Dec 13, 2024
68817d8
temporary disable xe feature
flukexp Dec 24, 2024
28c9f9d
fixed moshi bubble chat
flukexp Dec 30, 2024
7300e3d
uncommented debug button
flukexp Dec 31, 2024
bb6a0a7
temp commented some extra loading feature
flukexp Jan 8, 2025
f391a97
Added Moshi Docs
slowsynapse Jan 9, 2025
c7c644c
increased startup load performance
flukexp Jan 12, 2025
a578d8d
revert chat mode button
flukexp Jan 16, 2025
a7c7908
Merge pull request #153 from 4lukexp/disable-xr
slowsynapse Jan 17, 2025
8b291c8
reverted chat toggle icon
slowsynapse Jan 17, 2025
bb22794
reset initial camera pos
flukexp Feb 3, 2025
6d461f2
Merge pull request #159 from 4lukexp/reset-cam
slowsynapse Feb 4, 2025
07438a9
Updated Moshi Doc Installation Instructions
slowsynapse Feb 4, 2025
48d56c8
fixed ws port setup
flukexp Feb 4, 2025
501b33d
Merge pull request #160 from 4lukexp/fix-moshi-local
slowsynapse Feb 4, 2025
30417c9
Merge branch 'master' into webxr
slowsynapse Feb 4, 2025
88e787a
Update settings.tsx
slowsynapse Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NEXT_PUBLIC_AMICA_API_URL=https://store.heyamica.com
NEXT_PUBLIC_AMICA_STORAGE_URL=https://vrm.heyamica.com/file/amica-vrm
NEXT_PUBLIC_SUPABASE_URL=https://kzfcwefqffysqsjrlyld.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imt6ZmN3ZWZxZmZ5c3FzanJseWxkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDEyNzA5NjUsImV4cCI6MjAxNjg0Njk2NX0.z9zm2mbJu6RkdZ6zkCUltThIF43-ava_bLvk9qFQsiA
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=9f8cee238fde4f0011880ecef0616c88
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"]
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
/.next/
/out/

# parcel
/.parcel-cache/
/dist/

# production
/build

Expand All @@ -34,3 +38,6 @@ next-env.d.ts

working/*
!working/.gitkeep

# Sentry Config File
.env.sentry-build-plugin
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.1
v18.18.0
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
## 🔧 Other Guides

* [Using Window.ai](./guides/using-windowai.md)
* [Using Moshi (Voice to Voice)](./guides/using-moshi.md)

## 🧩 Plugin System

Expand Down
69 changes: 69 additions & 0 deletions docs/guides/using-moshi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Using Moshi (Voice to Voice)
order: 3
---


To test Moshi, you need to set up and run the Moshi Server on Runpod (Or your running it on your own computer/server):

---

### **Step 1: Set Up and Running Moshi Server for Amica**
1. Login to the Terminal on your instance, whether it is your own server or a Runpod instance (If you don't have a good GPU)
1. **Clone the Moshi Server**
```bash
git clone https://github.com/flukexp/moshi_server.git moshi && cd moshi
```

2. **Create a virtual environment**
```bash
python -m venv venv
```

3. **Activate the virtual environment**
- On macOS/Linux:
```bash
source venv/bin/activate
```
- On Windows (Command Prompt):
```bash
venv\Scripts\activate
```
- On Windows (PowerShell):
```powershell
.\venv\Scripts\Activate
```

---

### **Step 2: Run the Moshi Server**

Start the Moshi server (For Runpod):
```bash
uvicorn moshi_service:app --host 0.0.0.0 --port 8000
```
Start the Moshi server (For your own computer):
```bash
uvicorn moshi_service:app --host 127.0.0.1 --port 8000
```

---

### **Step 3: Change Settings on Amica to Use Moshi**

Open Settings > Chatbot Backend , and select Moshi.

Then go to Settings > Chatbot Backend > Moshi, and then insert the correct URL for accessing Moshi server. (E.g. http://localhost:8000 for local server and a runpod proxy URL, which is on your runpod instance and looks like : https://rn8xojhvb-8000.proxy.runpod.net, the URL has the runpod instance identifier and the port)

*There is no difference whether you are running locally or off the Amica demo.*


---

#### **Notes:**
- Ensure that **Python and pip** are installed before proceeding. **Edit the model URLs in the main python script if you want to use a different model from Kyutai.**
---

Replace the `{port-number}` in the URL with the actual port number (e.g 3000 for Amica and 8000 for Moshi).

---
64 changes: 55 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const CopyPlugin = require("copy-webpack-plugin");
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
});

const output = process.env.NEXT_OUTPUT || undefined;

/** @type {import('next').NextConfig} */
const nextConfig = {
output,
reactStrictMode: false,
assetPrefix: process.env.BASE_PATH || "",
basePath: process.env.BASE_PATH || "",
Expand All @@ -17,9 +20,9 @@ const nextConfig = {
// See https://webpack.js.org/configuration/resolve/#resolvealias
config.resolve.alias = {
...config.resolve.alias,
"sharp$": false,
sharp$: false,
"onnxruntime-node$": false,
}
};

config.plugins.push(
new CopyPlugin({
Expand Down Expand Up @@ -49,18 +52,61 @@ const nextConfig = {
to: "static/chunks/[name][ext]",
},
],
})
}),
);

config.plugins.push(
new webpack.DefinePlugin({
'process.env.NEXT_PUBLIC_CONFIG_BUILD_ID': JSON.stringify(buildId)
})
"process.env.NEXT_PUBLIC_CONFIG_BUILD_ID": JSON.stringify(buildId),
}),
);

return config;
},
}

};

module.exports = withPWA(nextConfig);

// Injected content via Sentry wizard below

const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(module.exports, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: "heyamica",
project: "chat-heyamica",

// Only print logs for uploading source maps in CI
silent: !process.env.CI,

// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},

// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
});
Loading