Skip to content

Commit

Permalink
chore: include ollama-cli in workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
covercash2 committed Nov 20, 2024
1 parent c0f2d11 commit 502e369
Show file tree
Hide file tree
Showing 96 changed files with 1,084 additions and 181 deletions.
File renamed without changes.
1,173 changes: 1,050 additions & 123 deletions djinn-rs/Cargo.lock → Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions djinn-rs/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [ "djinn-cli","djinn-core", "djinn-server"]
default-members = ["djinn-cli"]
members = [ "djinn-cli","djinn-core", "djinn-server", "ollama-cli" ]
default-members = ["djinn-cli", "ollama-cli"]
resolver = "2"

[workspace.package]
Expand Down
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
# djinn
# `djinn-rs`

Right now the Rust implementation is most complete.
a Rust playground
for running language models
and some other machine learning models.

Run with command line arguments:
## `djinn-cli`
the main entrypoint
for running either
a server (with `djinn-server`)
or a one shot inference.

```sh
$ cd djinn-rs
$ cargo run -- --help
# example prompt
$ cargo run --release -- llama --disable-flash-attention --model-version v1 --dtype f32
"In a world" --sample-len 256 --repeat-penalty 50
```
## `djinn-core`

core ML functionality and model implementations.

## `djinn-server`

## supported models
an HTTP server
with an API
and HTMX front-end
for running models

- Llama 1
- YOLOv8
# examples

run the server on a Macbook M-series:

```sh
cargo run --release --features djinn-core/mac -- server-config --name test
```

### TODO
- Llama 2
- [LoRA](https://github.com/EricLBuehler/candle-lora)
breakdown:
- `cargo run --release` to build in release mode for best performance
- `--features djinn-core/mac` to enable CoreML acceleration
- `--` everything before this are `cargo` args and everything after are `djinn` args
- `server-config` command to run the server from a config file
- `--name test` to run the config named `test`, in `./configs/server/test.toml`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions djinn-rs/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ pub mod widget_item;
pub mod widget_rendering;
pub mod widget_state;

const TEST_OUTPUT: &str = include_str!("../../../example_output.txt");

#[derive(Clone, Debug)]
pub struct MessagesViewModel {
/// Streaming response from the model before it's finished.
Expand All @@ -37,7 +35,7 @@ impl Default for MessagesViewModel {
fn default() -> Self {
Self {
model_stream: Default::default(),
messages: VecDeque::from([Message::Assistant(TEST_OUTPUT.into())]),
messages: VecDeque::from([Message::Assistant("".into())]),
state: Default::default(),
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 502e369

Please sign in to comment.