Skip to content

Commit

Permalink
Adds Ollamark Server, Web Frontend, and many updates
Browse files Browse the repository at this point in the history
  • Loading branch information
metaspartan committed Jun 24, 2024
1 parent 98a3c38 commit ca3bac2
Show file tree
Hide file tree
Showing 27 changed files with 2,907 additions and 100 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OLLAMARK_API=https://ollamark.com
API_KEY=
PUBLIC_KEY=
KEY=
11 changes: 10 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: Go

on:
push:
branches: [ "main" ]
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
environment: main
steps:
- uses: actions/checkout@v4

Expand All @@ -20,6 +22,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libgl1-mesa-dev libxi-dev libxext-dev libglu1-mesa-dev xorg-dev
- name: Create .env file
run: |
echo "OLLAMARK_API=${{ secrets.OLLAMARK_API }}" > .env
echo "PUBLIC_KEY=${{ secrets.PUBLIC_KEY }}" >> .env
echo "KEY=${{ secrets.KEY }}" >> .env
shell: bash

- name: Build
run: go build -v ./...

Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Release

on:
push:
tags:
- 'v*'
branches: [ "main" ]

jobs:
release:
runs-on: ${{ matrix.os }}
environment: main
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -21,7 +21,9 @@ jobs:
go-version: '1.20' # Ensure this is the version you want to use

- name: Install fyne-cross
run: go install github.com/fyne-io/fyne-cross@latest
run: |
go install github.com/fyne-io/fyne-cross@latest
fyne-cross -v
- name: Install X11 development libraries
if: matrix.os == 'ubuntu-latest'
Expand All @@ -30,28 +32,35 @@ jobs:
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libgl1-mesa-dev libxi-dev libxext-dev libglu1-mesa-dev xorg-dev
- name: Download macOS SDK
if: matrix.os == 'macos-latest'
run: |
curl -L -o MacOSX13.3.sdk.tar.xz "https://github.com/joseluisq/macosx-sdks/releases/download/13.3/MacOSX13.3.sdk.tar.xz"
sudo mkdir -p /opt/MacOSX13.3.sdk
sudo tar -xJf MacOSX13.3.sdk.tar.xz -C /opt/MacOSX13.3.sdk
- name: Create .env file
run: |
echo "OLLAMARK_API=${{ secrets.OLLAMARK_API }}" > .env
echo "PUBLIC_KEY=${{ secrets.PUBLIC_KEY }}" >> .env
echo "KEY=${{ secrets.KEY }}" >> .env
shell: bash

- name: Build
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
fyne-cross windows -arch=amd64 -icon icon.png
fyne-cross linux -arch=amd64 -icon icon.png
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
# elif [ "${{ matrix.os }}" == "macos-latest" ]; then
fyne-cross darwin -arch=arm64 -icon icon.png -app-id com.contextlabs.ollamark
fi
shell: bash
env:
FYNE_CROSS_TARGETS: windows/amd64 linux/amd64 darwin/arm64
FYNE_CROSS_DARWIN_SDK: /opt/MacOSX13.3.sdk
SDKROOT: /opt/MacOSX13.3.sdk
PATH: ${{ github.workspace }}/go/bin:$PATH

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
fyne-cross/bin/windows-amd64/Ollamark.exe
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ ollamark
ollamark.exe
ollamark.app

.env
.env
private_key.pem
public_key.pem
server/server.exe
server/server

node_modules
package-lock.json
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# Ollamark README
# Ollamark

### By Carsen Klock (https://twitter.com/carsenklock) for Ollama (https://ollama.com/) Benchmarking!

## Overview
Ollamark and Ollamark CLI is a command-line/UI interface for benchmarking models using the Ollama API. It allows users to specify the model to benchmark, whether to submit the benchmark results, and the API endpoint.
Ollamark and Ollamark CLI is a command-line/UI interface for benchmarking models using the Ollama API. It allows users to specify the model to benchmark, whether to submit and share the benchmark results, the API endpoint, and number of iterations.

**This is a WIP and is subject to change! (Submitting benchmarks is not completed yet.)**
**This is a WIP and is subject to change! Ollamark.com coming soon!**

## Installation
## Building
Ensure you have Go installed on your system. Clone the repository and build the project using:
```bash
go build
```

## Installing
- Download and Install Ollama from https://ollama.com/download
- Ollama will start automatically in the background
- Run Ollamark with flags to start the benchmarking process in CLI mode or without flags to run in GUI mode

## Usage
Run the Ollamark CLI using the following flags to customize the benchmarking process:

### Flags
- `-m`: Model name to benchmark. Default is `"llama3"`.
- `-s`: Submit benchmark results. It accepts a boolean value. Default is `false`.
- `-o`: Ollama API endpoint. Default is `"http://localhost:11434/api/generate"`.
- `-o`: Ollama API endpoint. Default is `"http://localhost:11434"`.
- `-i`: Number of iterations to run the benchmark. Default is `2`.
- `-h` or `-help`: Display the help message below.

Expand All @@ -29,43 +36,42 @@ Options:
-m string
Model name to benchmark (default "llama3")
-o string
Ollama API endpoint (default "http://localhost:11434/api/generate")
Ollama API endpoint (default "http://localhost:11434")
-s Submit benchmark results to Ollamark (default false)
Examples:
For Ollamark GUI mode:
ollamark (no flags)
For Ollamark CLI mode:
ollamark -m llama3 -i 10
ollamark -m phi3
ollamark -m phi3 -s -o http://localhost:11434/api/generate
ollamark -m phi3 -s -o http://localhost:11434
```

### Example
```bash
./ollamark -m llama3 -s true -i 5 -o "http://localhost:11434/api/generate"
./ollamark -m llama3 -s -i 5 -o "http://localhost:11434"
```

This command will benchmark the model "llama3" for 5 iterations, submit the results, and use the specified API endpoint to interface with Ollama.

## Configuration
The CLI checks for command-line arguments and if provided, Ollamark runs in CLI mode. If no arguments are provided, it defaults to the Ollamark GUI application.


## Additional Information
## Additional Information for Building/Forking
- Ensure the `.env` file is correctly configured as it loads environment variables crucial for the application.
- The application can also be run as a Fyne GUI application if no CLI flags are provided.

Example .env file:
```
API_ENDPOINT=http://localhost:11434/api/generate
API_KEY=
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
This project is licensed under the MIT License - see the LICENSE file for details.

## Author
- Carsen Klock (https://twitter.com/carsenklock)

## Acknowledgments
- [Ollama](https://ollama.com/) for providing the Ollama API.
- [Ollama](https://ollama.com/) for providing Ollama.
- [GoLang](https://golang.org/) for providing the Go programming language.
- [Fyne](https://fyne.io/) for providing the Fyne GUI framework.
- [Gin](https://gin.github.io/) for providing the Gin HTTP web framework.
68 changes: 64 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,92 @@ require (
fyne.io/fyne/v2 v2.4.4 // indirect
fyne.io/systray v1.10.1-0.20231115130155-104f5ef7839e // indirect
fyne.io/x/fyne v0.0.0-20240326131024-3ba9170cc3be // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/carsenk/gotribushash v0.0.0-20171104193954-ddd27ce24bbf // indirect
github.com/charmbracelet/bubbletea v0.26.4 // indirect
github.com/charmbracelet/lipgloss v0.11.0 // indirect
github.com/charmbracelet/x/ansi v0.1.2 // indirect
github.com/charmbracelet/x/input v0.1.0 // indirect
github.com/charmbracelet/x/term v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.1.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/didip/tollbooth/v6 v6.1.2 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/fredbi/uri v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504 // indirect
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/cors v1.7.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.10.0 // indirect
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-pkgz/expirable-cache v0.0.3 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-redis/redis v6.15.9+incompatible // indirect
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8 // indirect
github.com/go-text/typesetting v0.1.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/tevino/abool v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
github.com/yuin/goldmark v1.5.5 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.mongodb.org/mongo-driver v1.15.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/image v0.11.0 // indirect
golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect
)
Loading

0 comments on commit ca3bac2

Please sign in to comment.