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

Sync #8

Merged
merged 12 commits into from
Jul 21, 2024
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ jobs:

- name: Install and run ollama
run: |
systemctl is-active ollama.service && sudo systemctl stop ollama.service
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
ollama pull phi3:mini
ollama pull nomic-embed-text:latest
./scripts/ci.sh

- name: Run cargo test
uses: actions-rs/cargo@v1
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build
on:
push:
branches: [main]
tags: ["[0-9]+.[0-9]+.[0-9]+"]

jobs:
release:
Expand All @@ -18,5 +19,12 @@ jobs:
toolchain: stable
override: true

- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_API_TOKEN }}
- name: Publish `orch_response`
run: cargo publish -p orch_response --token ${{ secrets.CRATES_IO_API_TOKEN }}

- name: Publish `orch_response_derive`
run: cargo publish -p orch_response_derive --token ${{ secrets.CRATES_IO_API_TOKEN }}

- name: Publish `orch`
run: cargo publish -p orch --token ${{ secrets.CRATES_IO_API_TOKEN }}

14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@

# Changelog

# Version 0.0.4

No functional changes.

# Version 0.0.3

- Added support for streaming responses
- Added support for structured data generation
- Added a convenience proc macro (`#[derive(OrchResponseOptions)]`) for generating structured data generation options
- Added support for Open AI

## Version 0.0.2

No functional changes.

## Version 0.0.1

Initial release.
Initial release.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# orch

![Crates.io Version](https://img.shields.io/crates/v/orch?link=https%3A%2F%2Fcrates.io%2Fcrates%2Forch)
![Crates.io Total Downloads](https://img.shields.io/crates/d/orch?link=https%3A%2F%2Fcrates.io%2Fcrates%2Forch)

`orch` is a library for building language model powered applications and agents for the Rust programming language.
It was primarily built for usage in [magic-cli](https://github.com/guywaldman/magic-cli), but can be used in other contexts as well.

> [!NOTE]
>
> If the project gains traction, this can be compiled as an addon to other languages such as Python or a standalone WebAssembly module.

# Installation

```shell
cargo add orch
```

Alternatively, add `orch as a dependency to your `Cargo.toml` file:

```toml
[dependencies]
orch = "0.0.4"
```

# Basic Usage

## Simple Text Generation
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Release Process

1. Update the versions in all package `Cargo.toml` files and version in the README.md file
> Alternatively, rename all versions that are not in [CHANGELOG.md](CHANGELOG.md) to the next version.
1. Update the versions in the `README.md` file
1. Update [CHANGELOG.md](CHANGELOG.md)
1. Push the changes to the `main` branch with a tag (e.g., `0.0.4`)
6 changes: 3 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orch"
version = "0.0.3"
version = "0.0.4"
edition = "2021"
license = "MIT"
description = "Language model orchestration library"
Expand All @@ -9,8 +9,8 @@ repository = "https://github.com/guywaldman/orch"
keywords = ["llm", "openai", "ollama", "rust"]

[dependencies]
orch_response = { path = "../response", version = "0.0.3" }
orch_response_derive = { path = "../response_derive", version = "0.0.3" }
orch_response = { path = "../response", version = "0.0.4" }
orch_response_derive = { path = "../response_derive", version = "0.0.4" }
async-gen = "0.2.3"
dotenv = "0.15.0"
dyn-clone = "1.0.17"
Expand Down
2 changes: 1 addition & 1 deletion core/examples/structured_data_generation_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use orch::execution::*;
use orch::lm::*;
use orch_response_derive::*;
use orch::response::*;

#[derive(OrchResponseOptions)]
pub enum CapitalCityExecutorResponseOptions {
Expand Down
2 changes: 1 addition & 1 deletion core/examples/structured_data_generation_blog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use orch::execution::*;
use orch::lm::*;
use orch_response_derive::*;
use orch::response::*;

#[derive(OrchResponseOptions)]
pub enum BlogPostReviewerResponseOption {
Expand Down
7 changes: 6 additions & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
//! ```no_run
//! use orch::execution::*;
//! use orch::lm::*;
//! use orch_response_derive::*;
//! use orch::response::*;
//!
//! #[derive(OrchResponseOptions)]
//! pub enum CapitalCityExecutorResponseOptions {
Expand Down Expand Up @@ -122,3 +122,8 @@
pub mod execution;
pub mod lm;
mod net;

pub mod response {
pub use orch_response::*;
pub use orch_response_derive::*;
}
7 changes: 6 additions & 1 deletion response/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[package]
name = "orch_response"
version = "0.0.3"
version = "0.0.4"
edition = "2021"
license = "MIT"
description = "Models for orch Executor responses"
homepage = "https://github.com/guywaldman/orch"
repository = "https://github.com/guywaldman/orch"
keywords = ["llm", "openai", "ollama", "rust"]

[dependencies]
serde = "1.0.204"
Expand Down
6 changes: 3 additions & 3 deletions response_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "orch_response_derive"
version = "0.0.3"
version = "0.0.4"
edition = "2021"
license = "MIT"
description = "Utilities for working with orch Executor responses"
description = "Derive macros for orch Executor responses"
homepage = "https://github.com/guywaldman/orch"
repository = "https://github.com/guywaldman/orch"
keywords = ["llm", "openai", "ollama", "rust"]
Expand All @@ -12,7 +12,7 @@ keywords = ["llm", "openai", "ollama", "rust"]
proc-macro = true

[dependencies]
orch_response = { path = "../response" }
orch_response = { path = "../response", version = "0.0.4" }
darling = "0.20.10"
proc-macro2 = "1.0.86"
quote = "1.0.36"
Expand Down
16 changes: 16 additions & 0 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

for i in 1 2 3; do
systemctl is-active ollama.service && sudo systemctl stop ollama.service
curl -fsSL https://ollama.com/install.sh | sh
sleep 5
if systemctl is-active ollama.service; then
break
fi
done

ollama serve &
ollama pull phi3:mini
ollama pull nomic-embed-text:latest
Loading