Skip to content

A ChatGPT interface in C++ compiled to WASM with Emscripten, running in the browser, rendering an imgui interface with WebGPU.

License

Notifications You must be signed in to change notification settings

Armchair-Software/chatgpt-emscripten-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Build

ChatGPT Emscripten WebGPU demo for the Armchair Engine

This demo integrates with OpenAI's completions API (i.e. ChatGPT) using Emscripten's fetch mechanism in the browser, providing a simple interface with Dear Imgui.

This is part four of a simple proof of concept, a minimal 3D engine written in C++, compiled to WASM with Emscripten. Running in the browser, rendering with WebGPU.

You need to provide your own OpenAI API key.

For the other demos, see:

image

Live demo

Live demo: https://armchair-software.github.io/chatgpt-emscripten-demo/

This requires Firefox Nightly, or a recent version of Chrome or Chromium, with webgpu and Vulkan support explicitly enabled.

Dependencies

Building

The easiest way to assemble everything is to use the included build script:

./build.sh

To launch a local server and bring up a browser:

./run.sh

For manual builds with CMake, and to adjust how the example is run locally, inspect the build.sh and run.sh scripts.

About

A ChatGPT interface in C++ compiled to WASM with Emscripten, running in the browser, rendering an imgui interface with WebGPU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published