Skip to content

Commit

Permalink
Merge pull request #6 from amirrezaDev1378/docs/docusaurus
Browse files Browse the repository at this point in the history
Docs/docusaurus
  • Loading branch information
amirrezaDev1378 authored Nov 21, 2024
2 parents f01a5c4 + 6cb4193 commit 1015da6
Show file tree
Hide file tree
Showing 17 changed files with 484 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
- docs/*

defaults:
run:
working-directory: documents
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Get bun store path
id: bun-store-path
run: echo "STORE_PATH=$(bun pm cache dir)" >> $GITHUB_OUTPUT

- name: Cache bun dependencies
uses: actions/cache@v3
with:
path: ${{ steps.bun-store-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-bun-store-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-store-
- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build website
run: bun run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: documents/build/

deploy:
name: Deploy to GitHub Pages
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
The Ollama Model Direct Link Generator and Installer is a utility designed to streamline the process of obtaining direct
download links for Ollama models and installing them. This tool is intended for developers, researchers, and enthusiasts
interested in Ollama models, providing a straightforward and efficient solution.
_________

## [New Tutorial & Documentation](https://amirrezadev1378.github.io/ollama-model-direct-download/)

___________
### Table of Contents

- [Introduction](#Introduction)
Expand Down
20 changes: 20 additions & 0 deletions documents/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
44 changes: 44 additions & 0 deletions documents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without
having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting
service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the
`gh-pages` branch.
Binary file added documents/bun.lockb
Binary file not shown.
48 changes: 48 additions & 0 deletions documents/docs/Getting Direct Links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
sidebar_position: 2
---

# Getting Direct Links

In this section you will learn how to use the project to generate direct download link for the projects.

## Finding a model

You first need to find a model from [here](https://ollama.com/library)

Copy the model name (and tag name if you want to download a version of model)

![Docusaurus logo](/img/model-name-and-tag.png)

In this case the model name is qwen2.5-coder and the tag name is 3b

## Generating Links

Use this command to generate direct links

```shell
./omdd get qwen2.5-coder:3b
```

You may omit the tag if you want to get the latest tag

```shell
./omdd get qwen2.5-coder
```

The results should look like this:

```text
get direct download link for model : qwen2.5-coder
Manifest download link: https://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest
Download links for layers:
1- https://registry.ollama.ai/v2/library/qwen2.5-coder/blobs/sha256:60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463
2- https://registry.ollama.ai/v2/library/qwen2.5-coder/blobs/sha256:66b9ea09bd5b7099cbb4fc820f31b575c0366fa439b08245566692c6784e281e
3- https://registry.ollama.ai/v2/library/qwen2.5-coder/blobs/sha256:e94a8ecb9327ded799604a2e478659bc759230fe316c50d686358f932f52776c
4- https://registry.ollama.ai/v2/library/qwen2.5-coder/blobs/sha256:832dd9e00a68dd83b3c3fb9f5588dad7dcf337a0db50f7d9483f310cd292e92e
5- https://registry.ollama.ai/v2/library/qwen2.5-coder/blobs/sha256:d9bb33f2786931fea42f50936a2424818aa2f14500638af2f01861eb2c8fb446
Generated download links for model : qwen2.5-coder finished successfully.
```

As you can see we get the links for blobs and the manifest of model
46 changes: 46 additions & 0 deletions documents/docs/Installing A Model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
sidebar_position: 3
---

# Installing A Downloaded Model

In this section you will learn how to install a downloaded model.

## Disclaimer

Please make sure you have a backup of your currently installed models!!!

[Where are ollama models stored?](https://github.com/ollama/ollama/blob/main/docs/faq.md#where-are-models-stored)

## Copy all required file to a directory(preferably the same as the executable)

You first need to copy all downloaded blobs to a folder, keep in mind there are no proper validation of you blobs so
make sure you have only the blobs there!

## Rename the manifest file

You should the manifest file (which may be the tag name of you model or latest) to `manifest`

## Install your model

You can use this command to install model:

```shell
omdd install --model=<your-model-name> --blobsPath=<downlaoded-blobs-relative-path>
```

In this case `<your-model-name>` is the name of your model (this can be anything you like you dont have to put the name
of downloaded model) and `<downlaoded-blobs-relative-path>` is the relative path to your model.

### Examples:

```shell
omdd install --model=MyAwesomeModel --blobsPath=./
```

Or if your models are somewhere else

```shell
omdd install --model=MyAwesomeModel --blobsPath=../../path/to/blobs
```

19 changes: 19 additions & 0 deletions documents/docs/Installing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
sidebar_position: 1
---

# Installation Tutorial

In this section you will learn how to install this project

## Getting Started

You will need to download the executable cli from
**[here](https://github.com/amirrezaDev1378/ollama-model-direct-download/releases/latest)**

## Preparing for usage

*Please note that this project does not come with an installer and a graphical interface this is a CLI based app!*

After downloading the executable cli, you need to create a new directory and paste the cli there, Also if you have any
models downloaded and you want to install them copy them in the same directory
60 changes: 60 additions & 0 deletions documents/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {themes as prismThemes} from "prism-react-renderer";
import type {Config} from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const config: Config = {
title: "OMDD",
tagline: 'Ollama Model Direct Downloader & Installer',
url: "https://amirrezaDev1378.github.io",
baseUrl: "/ollama-model-direct-download/",
organizationName: "amirrezaDev1378",
projectName: "ollama-model-direct-download",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
i18n: {
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
"classic",
{
docs: {
sidebarPath: "./sidebars.ts",
},
theme: {
customCss: "./src/css/custom.css",
},
} satisfies Preset.Options,
],
],

themeConfig: {
colorMode: {defaultMode: "dark"},
navbar: {
title: "OMDD",
items: [
{
type: "docSidebar",
sidebarId: "tutorialSidebar",
position: "left",
label: "Tutorial",
},
{
href: "https://github.com/amirrezaDev1378/ollama-model-direct-download",
label: "GitHub",
position: "right",
},
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
47 changes: 47 additions & 0 deletions documents/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name" : "documents",
"version" : "0.0.0",
"private" : true,
"scripts" : {
"docusaurus" : "docusaurus",
"start" : "docusaurus start",
"build" : "docusaurus build",
"swizzle" : "docusaurus swizzle",
"deploy" : "docusaurus deploy",
"clear" : "docusaurus clear",
"serve" : "docusaurus serve",
"write-translations" : "docusaurus write-translations",
"write-heading-ids" : "docusaurus write-heading-ids",
"typecheck" : "tsc"
},
"dependencies" : {
"@docusaurus/core" : "3.6.1",
"@docusaurus/preset-classic" : "3.6.1",
"@mdx-js/react" : "^3.0.0",
"clsx" : "^2.0.0",
"prism-react-renderer" : "^2.3.0",
"react" : "^18.0.0",
"react-dom" : "^18.0.0"
},
"devDependencies" : {
"@docusaurus/module-type-aliases" : "3.6.1",
"@docusaurus/tsconfig" : "3.6.1",
"@docusaurus/types" : "3.6.1",
"typescript" : "~5.6.2"
},
"browserslist" : {
"production" : [
">0.5%",
"not dead",
"not op_mini all"
],
"development" : [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines" : {
"node" : ">=18.0"
}
}
Loading

0 comments on commit 1015da6

Please sign in to comment.