Skip to content

Commit

Permalink
cargo bundle package + logo + readme WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mdegans committed May 21, 2024
1 parent 4453184 commit 1004c01
Show file tree
Hide file tree
Showing 20 changed files with 462 additions and 141 deletions.
169 changes: 84 additions & 85 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
name = "weave"
version = "0.1.0"
edition = "2021"
description = "A tool for collaborative generative writing."

[package.metadata.bundle]
name = "Weave"
identifier = "dev.mdegans.weave"
resources = ["resources"]
copyright = "2024, Michael de Gans"
category = "public.app-category.productivity"
long_description = """
A tool for collaborative generative writing. It supports multiple generative
backends such as OpenAI and LLaMA. Stories can branch, allowing for multiple
paths through a story. It is designed to be used by writers, game developers,
or anyone who needs to generate text.
"""
icon = [
# "resources/icon.32.png",
# "resources/icon.32@2x.png",
# "resources/icon.64.png",
# "resources/icon.64@2x.png",
# "resources/icon.128.png",
# "resources/icon.128@2x.png",
"resources/icon.256.png",
# "resources/icon.256@2x.png",
"resources/icon.512.png",
"resources/icon.512@2x.png",
# "resources/icon.1024.png",
]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -40,6 +67,7 @@ openai = [
"dep:futures",
"dep:keyring",
"dep:tokio",
"tokio/rt-multi-thread",
]
ollama = ["generate", "dep:ollama-rs"]
# TODO: Claude does not yet have a good rust library. Will have to use reqwests
Expand Down
60 changes: 51 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# `weave` multiversal writing tool

![Weave Icon](/resources/icon.inkscape.svg)

Weave is a "multiversal" generative tree writing tool akin to [`loom`](https://github.com/socketteer/loom). It supports multiple generative backends such as:

- [x] [`drama_llama`](https://github.com/mdegans/drama_llama) - llama.cpp wrapper supporting all llama.cpp models
- [ ] OpenAI models
- [ ] GPT 3.5 completions
- [ ] Shim for GPT 4+ chat completions API.
- [ ] Anthropic models
-[`drama_llama`](https://github.com/mdegans/drama_llama) - llama.cpp wrapper supporting all llama.cpp models
- ✅ OpenAI models
- ✅ Shim for GPT 3.5+ chat completions API, including GPT 4o.
- 🔲 Anthropic models

## Features

Notable features:

- **Live switching of backends** - It's possible to generate part of a story
with OpenAI and another part with LLaMA -- all without restarting the app.
- **Streaming responses** - It's possible to cancel generations in progress --
both local and online.
- **Live editing** - It's possible to edit posts during generation, but not to
add or remove nodes, so you need not wait for generation to complete to tweak
the text to your liking. New tokens are always appended to the end.

# Features
Coming soon:

The goal of `weave` is feature parity with [`loom`](https://github.com/socketteer/loom?tab=readme-ov-file#features).
- Fine-grained support over sampling for local models and potentially remote as
well for backends returning logprobs. The backend code is already written in
`drama_llama` but this is not exposed.
- Keyboard shortcuts.

Additionally, one goal of `weave` is feature parity with [`loom`](https://github.com/socketteer/loom?tab=readme-ov-file#features).

- ☑️ Read mode
- ✅ Linear story view
Expand All @@ -28,9 +46,33 @@ The goal of `weave` is feature parity with [`loom`](https://github.com/sockettee
- 🔲 'Visited' state
- ☑️ Generation
- 🔲 Generate N children with various models (currently one a time).
- Modify generation settings
- ☑️ Modify generation settings (Complete for OpenAI but not yet from LLaMA)
- ☑️ File I/O
- ✅ Serializable application state, including stories, to JSON.
- 🔲 Open/save trees as JSON files
- Open/save trees as JSON files
- 🔲 Work with trees in multiple tabs
- 🔲 Combine multiple trees

# Notable issues

- On some platforms (like MacOS) the Weave icon will change to an `e` shortly
after launch. See [this
issue](https://github.com/emilk/egui/issues/3823#issuecomment-1892423108) for
details.
- With each new generation, all tokens need to be injested again with most
backends. This is solvable with `drama_llama` (longest prefix cache) but not
for the OpenAI API. So for OpenAI, it's recommended to generate larger posts.
The system prompt is customizable so you can tweak the agent's instructions on
verbosity.
- It is not currently possible to have a scrollable viewport so it's
recommended to collapse nodes if things get cluttered. This is because the
nodes are implemented with [`egui::containers::Window`](https://docs.rs/egui/latest/egui/containers/struct.Window.html) which ignore scrollable areas. This is fixable
but not easily and not cleanly. When it is resolved the central panel will be
split into story and node views.
- For the same reason as the above, nodes may obscure the generated text view.
- The `drama_llama` backend will crash if the model's output is not valid
unicode. This will be fixed. If this happens, go to settings, switch backends,
and then switch back `drama_llama`.
- The BOS token is not added for the `drama_llama` backend. This will be added
as an option and enabled by default since most models expect it. Generation
will still work but the quality may be affected.
7 changes: 7 additions & 0 deletions resources/COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Icon Copyright

The app Icon was generated by Bing's Copilot and Dall-E 3. It was then post
processed in inkscape to create a vector version then rasterized at several
different resolutions.

Because the icon is generated, it effectively falls into the public domain.
Binary file added resources/icon.1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icon.128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icon.128@2x.png
Binary file added resources/icon.256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icon.256@2x.png
Binary file added resources/icon.32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icon.32@2x.png
Binary file added resources/icon.512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icon.512@2x.png
Binary file added resources/icon.64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icon.64@2x.png
Loading

0 comments on commit 1004c01

Please sign in to comment.