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

Add build workflow and docs #87

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Release Uberjar

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Install Leiningen
uses: DeLaGuardo/setup-clojure@13.0
with:
lein: latest

- name: Build uberjar
run: lein uberjar

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: accent-${{ github.ref }}
draft: false
prerelease: ${{ contains(github.ref, 'rc') }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/uberjar/accent-*-standalone.jar
asset_name: accent-${{ github.ref_name }}.jar
asset_content_type: application/java-archive
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,41 @@ This is such an application. Some data management responsibilities[^2][^3] prior

Everyone is a curator and could benefit from AI-assisted curation. This open-source application originally developed for biomedical data curation is actually quite reusable for other domains and personal use cases. Some "off-label" use cases will be demonstrated. -->


### Usage

With more power comes more responsibility.
Unlike interacting with generative AI in the default web interface, the application infrastructure here includes prompts and logic already optimized to project-specific workflows, direct API access to relevant platforms (Synapse), the local file system, configured databases, and additional tools/agents to accomplish various tasks. This infrastructure will also need to include guardrails.

Until this is released as a .jar, you do need some Clojure tooling.
Regular end users should download and use the artifact .jar.

##### With a release jar (most end users)

- Download some available release from the [releases page](https://github.com/anngvu/accent/releases).
- Run the jar, e.g. `java -jar accent-{version}.jar` after setting up the config in the same location as your jar. See [Configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration)!
By default, startup will open a web app with Syndi as your assistant.

##### With Clojure dev tooling

If you're comfortable with Clojure (or want to be comfortable with Clojure) and enable additional hacking:

- Clone this repo.
- Install [Leiningen](https://leiningen.org/) (the easiest way to use Clojure).
- Run `lein deps` to install dependencies.
- Create a config file called `config.edn`. See the section [configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration).

- Create a config file called `config.edn`. See [Configuration](https://github.com/anngvu/accent/tree/web-ui?tab=readme-ov-file#configuration)!
- Choose UI:
- For web UI, which is recommended and already default: `lein run -m accent.app`
- Alternatively, the terminal console/REPL currently allows different agents other than Syndi, or to interact with different module functions directly.

#### Configuration

Settings and (optionally) credentials can be defined in `config.edn`.
Review the `example_config.edn` file; rename it to `config.edn` and modify as needed.
In addition to the comments in the example file, more discussion is provided below.

##### AI Providers
##### AI Providers specification

> [!NOTE]
> Only OpenAI works with *both* web app UI and developer console for now. Anthropic only works with the developer console.

The app integrates two providers, Anthropic and OpenAI, and an initial model provider must be specified.
In the *same chat*, it is possible to switch between models from the *same provider* but not between different providers, e.g. switching from ChatGPT-3.5 to ChatGPT-4o, but not from ChatGTP-3.5 to Claude Sonnet-3.5.
Expand All @@ -59,28 +74,16 @@ Tip for usage: Trying to reduce costs by switching to a cheaper model for some t
- To use, must have `ANTHROPIC_API_KEY` in env or set in config.
- The default model is Claude Sonnet 3.5.

#### Run your preferred UI and specialized curation agent

> [!NOTE]
> Currently, there are some tradeoffs between the terminal vs web UI. The web UI will have some features that the terminal will not, such as showing figures. On the other hand, web UI only works with OpenAI for now.

##### For Synapse curation
#### Demos and Tutorials (WIP)

The **web UI is highly recommended**:
- `lein run -m accent.app`

For the terminal:
- `lein run -m agents.syndi`
Planned demo materials will be linked once available:
- **Assisted curation workflow** for preparing some kind of data asset for Synapse (e.g. a dataset).
- **Data model exploration and development** for working with different DCC-specific models to reuse concepts, maintain alignment, improve quality, etc.

<!-- ##### For personal knowledge curation

TBD. -->

#### Demos / tutorials for various scenarios

- **Assisted curation workflow** - You are preparing some kind of data asset for Synapse (e.g. a dataset).
- **Data model exploration and development** - You want to develop your DCC-specific model with the benefit of analytical capabilities and accessible context with other DCC models (to reuse concepts, maintain alignment, improve quality, etc.)

### Dynamic Roadmap

**This roadmap adapts to the feedback and interest received.**
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject accent "0.4.0-SNAPSHOT"
(defproject accent "0.4.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion script/native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export GRAALVM_HOME="$HOME/graalvm-ce-java17-22.3.1"
--libc=musl \
-H:CCompilerOption=-Wl,-z,stack-size=2097152 \
-H:Optimize=2 \
-jar ./target/uberjar/accent-0.1.0-SNAPSHOT-standalone.jar
-jar ./target/uberjar/accent-0.4.0-standalone.jar

1 change: 1 addition & 0 deletions src/accent/app.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(ns accent.app
(:gen-class)
(:require [server.core :refer [start-server]]
))

Expand Down