Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actualwitch committed Jan 27, 2025
1 parent dcdbb12 commit fa4659f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 30 deletions.
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
.DS_Store
node_modules
build
static
*.bun-build
magick
/node_modules
/build
/static
/magick
/target
/.venv

# playwright
playwright-report
playwright-screenshots
playwright-traces
test-results

# Added by cargo

/target
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p align="center">
<a href="https://actualwitch.github.io/experiment/">
Browser
Web
</a>
<a href="https://github.com/actualwitch/experiment/releases/latest">
Expand All @@ -27,7 +27,7 @@

[![Tests](https://github.com/actualwitch/experiment/actions/workflows/test.yml/badge.svg)](https://github.com/actualwitch/experiment/actions/workflows/test.yml)

**Experiment** is a LLM chat UI with advanced tool use debugging facilities. You can use it to make completion requests via Anthropic, OpenAI and Mistral APIs or explore/fork existing completions recorded for example via OpenAI proxy (not included in this repo). For now only .csv files are supported for importing completions.
**Experiment** is a feature-rich chat interface for Large Language Models (LLMs) like Anthropic, OpenAI, and Mistral. It offers advanced debugging tools for prompt engineering and tool integration, allowing developers to visualize and manage tool interactions seamlessly.

<a href="docs/tool-debugging.md">Read more about tool debugging →</a>

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

## Reporting a Vulnerability

[Report privately via GitHub](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) (Security tab on repo).
[Report privately via GitHub](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) via `Security` tab on repo.
12 changes: 6 additions & 6 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
},
"packages": {
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.36.2", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-+/DcVCGoPtUBOPO+1w+7YPdw9Xzt2M5GW6LpSxeGwDfdUSoJbyezGJvGEtdYjV/XXyGx5pf852S4+PG+3MUEsA=="],
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.36.3", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-+c0mMLxL/17yFZ4P5+U6bTWiCSFZUKJddrv01ud2aFBWnTPLdRncYV76D3q1tqfnL7aCnhRtykFnoCFzvr4U3Q=="],

"@asamuzakjp/css-color": ["@asamuzakjp/css-color@2.8.3", "", { "dependencies": { "@csstools/css-calc": "^2.1.1", "@csstools/css-color-parser": "^3.0.7", "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3", "lru-cache": "^10.4.3" } }, "sha512-GIc76d9UI1hCvOATjZPyHFmE5qhRccp3/zGfMPapK3jBi+yocEzp6BBB0UnfRYP9NP4FANqUZYb0hnfs3TM3hw=="],

Expand Down Expand Up @@ -461,7 +461,7 @@

"jotai": ["jotai@2.11.1", "", { "peerDependencies": { "@types/react": ">=17.0.0", "react": ">=17.0.0" }, "optionalPeers": ["@types/react", "react"] }, "sha512-41Su098mpHIX29hF/XOpDb0SqF6EES7+HXfrhuBqVSzRkxX48hD5i8nGsEewWZNAsBWJCTTmuz8M946Ih2PfcQ=="],

"jotai-effect": ["jotai-effect@1.1.4", "", { "peerDependencies": { "jotai": ">=2.5.0" } }, "sha512-kEdxcmU6XSxHdEvig9jBUmD27F7hkIpFAaZnOwcrHNORf/M3/DNtXlUJwt8VndoipVgGqNDYLsCXJIRdROXZbA=="],
"jotai-effect": ["jotai-effect@1.1.5", "", { "peerDependencies": { "jotai": ">=2.5.0" } }, "sha512-oHQ7HOE7xTrOywSKTfMyg4BCHyEnZJf1LyYc1VweRU9glNQuhByfrSkGRC6q+/MCncmHj6Eudfiv5kKuQ29uuw=="],

"jotai-optics": ["jotai-optics@0.4.0", "", { "peerDependencies": { "jotai": ">=2.0.0", "optics-ts": ">=2.0.0" } }, "sha512-osbEt9AgS55hC4YTZDew2urXKZkaiLmLqkTS/wfW5/l0ib8bmmQ7kBXSFaosV6jDDWSp00IipITcJARFHdp42g=="],

Expand Down Expand Up @@ -521,11 +521,11 @@

"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],

"react": ["react@19.1.0-canary-de1eaa26-20250124", "", {}, "sha512-w8OT67nNhi0bBuZfQEZM4bTqfgn+kSGR8+W59y1O0fQAiSaczsRE9Q/Ay3S5eACnY1EIC+u+S1Ma7yaWjIlL+A=="],
"react": ["react@19.1.0-canary-9eabb373-20250124", "", {}, "sha512-qTyUYmsAW6Y2ce48dEFozUjNoji4bLXd3i3vxsJerlhclQSGu1/HbooAD+DLi/rXZNLgzCtUonchBAsvfKxRbA=="],

"react-aria": ["react-aria@3.37.0", "", { "dependencies": { "@internationalized/string": "^3.2.5", "@react-aria/breadcrumbs": "^3.5.20", "@react-aria/button": "^3.11.1", "@react-aria/calendar": "^3.7.0", "@react-aria/checkbox": "^3.15.1", "@react-aria/color": "^3.0.3", "@react-aria/combobox": "^3.11.1", "@react-aria/datepicker": "^3.13.0", "@react-aria/dialog": "^3.5.21", "@react-aria/disclosure": "^3.0.1", "@react-aria/dnd": "^3.8.1", "@react-aria/focus": "^3.19.1", "@react-aria/gridlist": "^3.10.1", "@react-aria/i18n": "^3.12.5", "@react-aria/interactions": "^3.23.0", "@react-aria/label": "^3.7.14", "@react-aria/link": "^3.7.8", "@react-aria/listbox": "^3.14.0", "@react-aria/menu": "^3.17.0", "@react-aria/meter": "^3.4.19", "@react-aria/numberfield": "^3.11.10", "@react-aria/overlays": "^3.25.0", "@react-aria/progress": "^3.4.19", "@react-aria/radio": "^3.10.11", "@react-aria/searchfield": "^3.8.0", "@react-aria/select": "^3.15.1", "@react-aria/selection": "^3.22.0", "@react-aria/separator": "^3.4.5", "@react-aria/slider": "^3.7.15", "@react-aria/ssr": "^3.9.7", "@react-aria/switch": "^3.6.11", "@react-aria/table": "^3.16.1", "@react-aria/tabs": "^3.9.9", "@react-aria/tag": "^3.4.9", "@react-aria/textfield": "^3.16.0", "@react-aria/tooltip": "^3.7.11", "@react-aria/utils": "^3.27.0", "@react-aria/visually-hidden": "^3.8.19", "@react-types/shared": "^3.27.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-u3WUEMTcbQFaoHauHO3KhPaBYzEv1o42EdPcLAs05GBw9Q6Axlqwo73UFgMrsc2ElwLAZ4EKpSdWHLo1R5gfiw=="],

"react-dom": ["react-dom@19.1.0-canary-de1eaa26-20250124", "", { "dependencies": { "scheduler": "0.26.0-canary-de1eaa26-20250124" }, "peerDependencies": { "react": "19.1.0-canary-de1eaa26-20250124" } }, "sha512-64i/p179IBwJUWSopxan6cHKP1duZjB6tJfxCg7YK7bio2rNbVs85rU5T6caqoLXPH2WW+nZ0GG9+UTvOT4kAw=="],
"react-dom": ["react-dom@19.1.0-canary-9eabb373-20250124", "", { "dependencies": { "scheduler": "0.26.0-canary-9eabb373-20250124" }, "peerDependencies": { "react": "19.1.0-canary-9eabb373-20250124" } }, "sha512-JfymJBIZ9dQJInu+V9KVS6XQXxohjWR4hMNZwauY8wWnicBfvFJcZ6pER8JdinfnZqeSLbQ3k4IMLxm8N31v8g=="],

"react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],

Expand All @@ -547,7 +547,7 @@

"saxes": ["saxes@6.0.0", "", { "dependencies": { "xmlchars": "^2.2.0" } }, "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA=="],

"scheduler": ["scheduler@0.26.0-canary-de1eaa26-20250124", "", {}, "sha512-R8Box8zrvPTPATP80ODRO+yRC2XQf+rGf6DYvmndrtgDSfDCeWYXqqtjKHG08DrS2lGkLCSLPAhI4wda3iNBGQ=="],
"scheduler": ["scheduler@0.26.0-canary-9eabb373-20250124", "", {}, "sha512-uKqT36r+296ibTj3iuVGaNHtQgMxpJvl0yrXBvYOcZfggt1XG57qxHQClz8ZXDvGAiB+PnW0gFkwjcU0uuLyIA=="],

"set-cookie-parser": ["set-cookie-parser@2.7.1", "", {}, "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ=="],

Expand Down Expand Up @@ -577,7 +577,7 @@

"turbo-stream": ["turbo-stream@2.4.0", "", {}, "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g=="],

"typescript": ["typescript@5.8.0-dev.20250126", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-O6/x8/wq0TtUsgg/pW0Roc5cnWGbE+NMSul1fGjWzjZOpaoZ4Oj2QeNS1VJp3ef0FoU/yI3FmyniWBa3vBleGw=="],
"typescript": ["typescript@5.8.0-dev.20250127", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-2U15vRJzZaFB3ONX6hHjSXJ/8VRP0hYLz1osL7DNfyHcacYtE9UfrtEo1HU7PA5ow6JoVgSSlqUDSVeUCzHxLw=="],

"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],

Expand Down
21 changes: 18 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# Architecture

This project uses custom architecture I refer to as `entangled atoms` which extends [jōtai](https://jotai.org/) atoms to synchronize state across different [realms](https://262.ecma-international.org/#realm). This allows for end-to-end isomorphic state management where same primitives are used to manage state everywhere. Unconventional nature of this approach led me to design my own boilerplate; after trying out different runtimes I decided to make use of [Bun](https://bun.sh/) which is very fast and offers neat features like macros and programmatically accessible bundler.
This project uses custom architecture I refer to as `entangled atoms` which extends [jōtai](https://jotai.org/) atoms to synchronize state across different [realms](https://262.ecma-international.org/#realm). This allows for end-to-end isomorphic state management where same primitives are used to manage state everywhere.

There is no Next.js, Remix, Vite, Webpack or Babel here; my aim is simplicity and minimalism in terms of requirements and general architecture. Currently, boilerplate implements full streaming Server-Side Rendering(SSR) with transparent bundling, hydration and Server-Sent Events(SSE) for state sync.
# Platform

There are some disadvatages to this approach. For example, `emotion` uses babel transform to allow referencing other components in styles, which is not possible until I rewrite it as Bun bundler plugin. Assets like images/css are also not implemented yet which breaks `monaco`.
For this project, I decided to explore what modern frontend project can look like if you discard conventional approach and carefully craft the dependency tree decision by decision. Instead of using Next.js or Remix, I simply implemented streaming Server-Side Rendering (SSR) server and static HTML render. Instead of implementing api routes to exchange information, I used `entangled atoms` which use Server-Sent Events (SSE) to sync state behind the scenes.

The choice of TypeScript seems natural for an isomorphic crosplatform app, and I picked [Bun](https://bun.sh/) as a runtime and bundler. Not using Babel presents challenges for dependencies that require Babel plugins to work properly, like `emotion` which is used for styling.

# Jōtai

In my experience, projects making use of dedicated state management libraries invariably also use hooks given enough time and scope. Impedance mismatch between these two forms may end up inflicting significant story point damage on the project in the long term. Jōtai solves this by offering a drop-in replacement for `useState` so you can easily refactor between them.

# Principles

1. **Less is more.** Going just 20% of the path is fine if it gets the job done.
2. **Agile and Lean.** Optimize for flexibility and reduce waste.
3. **Isomorphic.** Run exact same code wherever possible.
4. **Low level.** Skip unnecessary abstractions and acknowledge the underlying platform.
5. **Visually consistent.** System fonts and server side rendering for instant loading and no flickering.
6. **Bleeding edge.** To prevent stale dependency hell, dev mode always upgrades dependencies to the latest version.
8 changes: 0 additions & 8 deletions docs/principles.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/tool-debugging.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Tool use debugging

While Experiment cannot execute actual tools (yet), it is still a massive boon when it comes to debugging them. Add tools by pasting a JSON schema into chat and you will see it visualized in a convenient form with all props sorted first by name, then by depth. Click on the name of the prop to collapse it. You can append multiple tools to chat and they will be available to the model. Tool use completions are also visualized in a similar manner. By default UI uses `markdown` renderer mode, but in some cases switching to `Text + JSON` can be helpful, as in this mode inline JSON is rendered by the same component as tools.
Although Experiment doesn't execute tools directly at this time, it provides comprehensive debugging capabilities to visualize and manage tool schemas within your chat interactions. Add tools by pasting a JSON schema into chat and creating a message with it by pressing (Enter) and you will see it visualized in a convenient form with all props sorted first by name, then by depth. Click on the name of the prop to collapse it. You can append multiple tools to chat and they will be available to the model. Tool use completions are also visualized in a similar manner. By default UI uses `markdown` renderer mode, but in some cases switching to `Text + JSON` can be helpful, as in this mode inline JSON is rendered by the same component as tools.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "🔬 Experiment is a LLM chat UI with advanced tool use debugging facilities.",
"keywords": ["inference", "experiment-tracking", "llm"],
"repository": "github:actualwitch/experiment",
"version": "0.3.1",
"version": "0.4.0",
"author": "Ade あで Fisher",
"license": "MIT",
"private": true,
Expand Down

0 comments on commit fa4659f

Please sign in to comment.