https://github.com/dylibso/chainsocket
Proof of concept for a generative AI application framework powered by WebAssembly and Extism
https://github.com/dylibso/chainsocket
Last synced: about 1 year ago
JSON representation
Proof of concept for a generative AI application framework powered by WebAssembly and Extism
- Host: GitHub
- URL: https://github.com/dylibso/chainsocket
- Owner: dylibso
- Created: 2023-08-10T14:00:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T14:03:27.000Z (almost 3 years ago)
- Last Synced: 2025-03-30T20:13:01.382Z (about 1 year ago)
- Language: Rust
- Homepage: https://dylibso.com/blog/wasm-ai-plugins/
- Size: 706 KB
- Stars: 14
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Overview
This proof of concept aims to demonstrate a versatile software platform inspired by LangChain, facilitating the creation of generative AI applications through portable plugins. These plugins, written in various languages, can run on different host platforms with support for cross-environment compatibility and security through the use of [WebAssembly](https://webassembly.org/) and [Extism](https://extism.org/).
## Setup
Create a "secrets.json" file in the root directory with your [SerpApi](https://serpapi.com/) and [OpenAI](https://openai.com/) API keys
```json
{
"openai_apikey": "",
"google_apikey": ""
}
```
## Run
```
python3 chainsocket.py
```
Start chatting with the bot! Type 'end' to exit the conversation
## Modify a Plug-in
- cd into the plugin directory (e.g. cd plugins/self-ask)
- modify the lib.rs as desired
```
cargo build --release --target wasm32-unknown-unknown
```
- copy the the .wasm in "./target/wasm32-unknown-unknown/release to the top level of the plugins directory
## Create a new Plug-in
Follow the instructions at https://extism.org/docs/category/write-a-plug-in
> Each plug-in must implement a "call" function