Skip to content

Commit 466e51c

Browse files
committed
docs: added docs about kollama cli
Signed-off-by: Neko Ayaka <neko@ayaka.moe>
1 parent dd1acb0 commit 466e51c

22 files changed

Lines changed: 481 additions & 413 deletions

docs/.vitepress/config.mts

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { defineConfig } from 'vitepress'
2+
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
23

34
// https://vitepress.dev/reference/site-config
45
export default defineConfig({
6+
markdown: {
7+
config(md) {
8+
md.use(tabsMarkdownPlugin)
9+
}
10+
},
511
title: "Ollama Operator",
612
description: "Large language models, scaled, deployed. - Yet another operator for running large language models on Kubernetes with ease. 🙀",
713
lastUpdated: true,
@@ -62,8 +68,15 @@ export default defineConfig({
6268
text: 'Guide',
6369
items: [
6470
{ text: 'Overview', link: '/pages/en/guide/overview' },
71+
{
72+
text: 'Getting started',
73+
items: [
74+
{ text: 'Install Ollama Operator', link: '/pages/en/guide/getting-started/' },
75+
{ text: 'Deploy models through CLI', link: '/pages/en/guide/getting-started/cli' },
76+
{ text: 'Deploy models through CRD', link: '/pages/en/guide/getting-started/crd' },
77+
]
78+
},
6579
{ text: 'Supported models', link: '/pages/en/guide/supported-models' },
66-
{ text: 'Getting started', link: '/pages/en/guide/getting-started' },
6780
]
6881
},
6982
{
@@ -83,8 +96,15 @@ export default defineConfig({
8396
text: 'Guide',
8497
items: [
8598
{ text: 'Overview', link: '/pages/en/guide/overview' },
99+
{
100+
text: 'Getting started',
101+
items: [
102+
{ text: 'Install Ollama Operator', link: '/pages/en/guide/getting-started/' },
103+
{ text: 'Deploy models through CLI', link: '/pages/en/guide/getting-started/cli' },
104+
{ text: 'Deploy models through CRD', link: '/pages/en/guide/getting-started/crd' },
105+
]
106+
},
86107
{ text: 'Supported models', link: '/pages/en/guide/supported-models' },
87-
{ text: 'Getting started', link: '/pages/en/guide/getting-started' },
88108
]
89109
},
90110
{
@@ -113,8 +133,15 @@ export default defineConfig({
113133
text: '指南',
114134
items: [
115135
{ text: '概览', link: '/pages/zh-CN/guide/overview' },
136+
{
137+
text: '快速上手',
138+
items: [
139+
{ text: '安装 Ollama Operator', link: '/pages/zh-CN/guide/getting-started/' },
140+
{ text: '通过 CLI 部署模型', link: '/pages/zh-CN/guide/getting-started/cli' },
141+
{ text: '通过 CRD 部署模型', link: '/pages/zh-CN/guide/getting-started/crd' },
142+
]
143+
},
116144
{ text: '支持模型', link: '/pages/zh-CN/guide/supported-models' },
117-
{ text: '快速开始', link: '/pages/zh-CN/guide/getting-started' },
118145
]
119146
},
120147
{
@@ -134,8 +161,15 @@ export default defineConfig({
134161
text: '指南',
135162
items: [
136163
{ text: '概览', link: '/pages/zh-CN/guide/overview' },
164+
{
165+
text: '快速上手',
166+
items: [
167+
{ text: '安装 Ollama Operator', link: '/pages/zh-CN/guide/getting-started/' },
168+
{ text: '通过 CLI 部署模型', link: '/pages/zh-CN/guide/getting-started/cli' },
169+
{ text: '通过 CRD 部署模型', link: '/pages/zh-CN/guide/getting-started/crd' },
170+
]
171+
},
137172
{ text: '支持模型', link: '/pages/zh-CN/guide/supported-models' },
138-
{ text: '快速开始', link: '/pages/zh-CN/guide/getting-started' },
139173
]
140174
},
141175
{

docs/.vitepress/theme/components/AsciinemaPlayer.vue

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<template>
2+
<TitleBlockContainerGroup>
3+
<TitleBlockContainer
4+
href="/pages/en/guide/getting-started/cli"
5+
bg="zinc-50 dark:zinc-800"
6+
border="transparent solid 2 hover:zinc-200 dark:hover:zinc-800"
7+
class="[&_.title-block-container]:bg-zinc-200 [&_.title-block-container]:dark:bg-zinc-600 [&_.title-block-container]:text-zinc-900 [&_.title-block-container]:dark:text-zinc-100"
8+
>
9+
<template #title>
10+
<div flex-1 flex items-center gap-2>
11+
<div class="title-block-container" transition="all ease-in-out duration-300" p-2 rounded-lg w-10 h-10 items-center flex justify-center>
12+
<div i-icon-park-outline:bank-card-two />
13+
</div>
14+
<span font-semibold>Deploy models through Kollama CLI</span>
15+
</div>
16+
</template>
17+
<div flex="~ col" h-full>
18+
<div>
19+
<p m="0!" pt="2" text="zinc-500">Dislike YAML?</p>
20+
<p m="0!" text="zinc-500">Faster and better UX?</p>
21+
<p m="0!" text="zinc-500">No worries, kollama here to rescue!</p>
22+
</div>
23+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
24+
<p m="0!" text="zinc-400"># <span>as regular binary cli</span></p>
25+
<p m="0!">$ <span text="blue-800 dark:blue-300">kollama </span><span text="green-800 dark:green-300">deploy phi</span></p>
26+
</div>
27+
<span flex="~ 1" items-center>or</span>
28+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
29+
<p m="0!" text="zinc-400"># <span>as kubectl plugin</span></p>
30+
<p m="0!">$ <span text="blue-800 dark:blue-300">kubectl </span><span text="green-800 dark:green-300">ollama deploy phi</span></p>
31+
</div>
32+
</div>
33+
</TitleBlockContainer>
34+
<TitleBlockContainer
35+
href="/pages/en/guide/getting-started/crd"
36+
bg="zinc-50 dark:zinc-800"
37+
border="transparent solid 2 hover:zinc-200 dark:hover:zinc-800"
38+
class="[&_.title-block-container]:bg-zinc-200 [&_.title-block-container]:dark:bg-zinc-600 [&_.title-block-container]:text-zinc-900 [&_.title-block-container]:dark:text-zinc-100"
39+
>
40+
<template #title>
41+
<div flex-1 flex items-center gap-2>
42+
<div class="title-block-container" transition="all ease-in-out duration-300" p-2 rounded-lg w-10 h-10 items-center flex justify-center>
43+
<div i-icon-park-outline:file-code />
44+
</div>
45+
<span font-semibold>Deploy models through CRD</span>
46+
</div>
47+
</template>
48+
<div flex="~ col" h-full>
49+
<div>
50+
<p m="0!" pt="2" text="zinc-500">Fine-grained control over parameters?</p>
51+
<p m="0!" text="zinc-500">GitOps and CI/CD?</p>
52+
<p m="0!" text="zinc-500">CRD is simple enough with 6 lines!</p>
53+
</div>
54+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
55+
<p m="0!"><span text="blue-800 dark:blue-300">apiVersion: </span><span text="green-800 dark:green-300">ollama.ayaka.io/v1</span></p>
56+
<p m="0!"><span text="blue-800 dark:blue-300">kind: </span><span text="green-800 dark:green-300">Model</span></p>
57+
<p m="0!"><span text="blue-800 dark:blue-300">metadata:</span></p>
58+
<p m="0!"><span text="blue-800 dark:blue-300">&nbsp;&nbsp;name: </span><span text="green-800 dark:green-300">phi</span></p>
59+
<p m="0!"><span text="blue-800 dark:blue-300">spec:</span></p>
60+
<p m="0!"><span text="blue-800 dark:blue-300">&nbsp;&nbsp;image: </span><span text="green-800 dark:green-300">phi</span></p>
61+
</div>
62+
</div>
63+
</TitleBlockContainer>
64+
</TitleBlockContainerGroup>
65+
</template>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<template>
2+
<TitleBlockContainerGroup>
3+
<TitleBlockContainer
4+
href="/pages/zh-CN/guide/getting-started/cli"
5+
bg="zinc-50 dark:zinc-800"
6+
border="transparent solid 2 hover:zinc-200 dark:hover:zinc-800"
7+
class="[&_.title-block-container]:bg-zinc-200 [&_.title-block-container]:dark:bg-zinc-600 [&_.title-block-container]:text-zinc-900 [&_.title-block-container]:dark:text-zinc-100"
8+
>
9+
<template #title>
10+
<div flex-1 flex items-center gap-2>
11+
<div class="title-block-container" transition="all ease-in-out duration-300" p-2 rounded-lg w-10 h-10 items-center flex justify-center>
12+
<div i-icon-park-outline:bank-card-two />
13+
</div>
14+
<span font-semibold>通过 Kollama CLI 部署模型</span>
15+
</div>
16+
</template>
17+
<div flex="~ col" h-full>
18+
<div>
19+
<p m="0!" pt="2" text="zinc-500">讨厌 YAML?</p>
20+
<p m="0!" text="zinc-500">更好更快的使用体验?</p>
21+
<p m="0!" text="zinc-500">没问题的,用 kollama 也可以!</p>
22+
</div>
23+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
24+
<p m="0!" text="zinc-400"># <span>常规二进制</span></p>
25+
<p m="0!">$ <span text="blue-800 dark:blue-300">kollama </span><span text="green-800 dark:green-300">deploy phi</span></p>
26+
</div>
27+
<span flex="~ 1" items-center>or</span>
28+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
29+
<p m="0!" text="zinc-400"># <span>作为 kubectl 插件</span></p>
30+
<p m="0!">$ <span text="blue-800 dark:blue-300">kubectl </span><span text="green-800 dark:green-300">ollama deploy phi</span></p>
31+
</div>
32+
</div>
33+
</TitleBlockContainer>
34+
<TitleBlockContainer
35+
href="/pages/zh-CN/guide/getting-started/crd"
36+
bg="zinc-50 dark:zinc-800"
37+
border="transparent solid 2 hover:zinc-200 dark:hover:zinc-800"
38+
class="[&_.title-block-container]:bg-zinc-200 [&_.title-block-container]:dark:bg-zinc-600 [&_.title-block-container]:text-zinc-900 [&_.title-block-container]:dark:text-zinc-100"
39+
>
40+
<template #title>
41+
<div flex-1 flex items-center gap-2>
42+
<div class="title-block-container" transition="all ease-in-out duration-300" p-2 rounded-lg w-10 h-10 items-center flex justify-center>
43+
<div i-icon-park-outline:file-code />
44+
</div>
45+
<span font-semibold>通过 CRD 部署模型</span>
46+
</div>
47+
</template>
48+
<div flex="~ col" h-full>
49+
<div>
50+
<p m="0!" pt="2" text="zinc-500">对部署参数的精细控制?</p>
51+
<p m="0!" text="zinc-500">GitOps 和自动化部署?</p>
52+
<p m="0!" text="zinc-500">CRD 也超简单,只有 6 行!</p>
53+
</div>
54+
<div class="title-block-body" transition="all ease-in-out duration-300" font-mono p-2 mt-2 bg="zinc-200/50 dark:zinc-700/80" rounded-lg>
55+
<p m="0!"><span text="blue-800 dark:blue-300">apiVersion: </span><span text="green-800 dark:green-300">ollama.ayaka.io/v1</span></p>
56+
<p m="0!"><span text="blue-800 dark:blue-300">kind: </span><span text="green-800 dark:green-300">Model</span></p>
57+
<p m="0!"><span text="blue-800 dark:blue-300">metadata:</span></p>
58+
<p m="0!"><span text="blue-800 dark:blue-300">&nbsp;&nbsp;name: </span><span text="green-800 dark:green-300">phi</span></p>
59+
<p m="0!"><span text="blue-800 dark:blue-300">spec:</span></p>
60+
<p m="0!"><span text="blue-800 dark:blue-300">&nbsp;&nbsp;image: </span><span text="green-800 dark:green-300">phi</span></p>
61+
</div>
62+
</div>
63+
</TitleBlockContainer>
64+
</TitleBlockContainerGroup>
65+
</template>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
title?: string
4+
href?: string
5+
}>()
6+
</script>
7+
8+
<template>
9+
<a w-full p-4 rounded-lg transition="all ease-in-out duration-300" cursor-pointer flex="~ col" :href="props.href" decoration="none!">
10+
<div flex="1">
11+
<div flex="~" items-center>
12+
<div v-if="props.title" text-lg font-semibold flex-1>
13+
<span>{{ props.title }}</span>
14+
</div>
15+
<template v-else>
16+
<slot name="title" />
17+
</template>
18+
</div>
19+
</div>
20+
<slot />
21+
</a>
22+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div flex="~ row <md:col" w-full my-4 gap-4>
3+
<slot />
4+
</div>
5+
</template>

docs/.vitepress/theme/index.mts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@ import {
1515
NolebaseHighlightTargetedHeading,
1616
} from '@nolebase/vitepress-plugin-highlight-targeted-heading/client'
1717

18+
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
19+
20+
import TitleBlockContainer from './components/TitleBlockContainer.vue'
21+
import TitleBlockContainerGroup from './components/TitleBlockContainerGroup.vue'
22+
import GettingStartedBlocksEn from './components/GettingStartedBlocksEn.vue'
23+
import GettingStartedBlocksZhCn from './components/GettingStartedBlocksZhCn.vue'
24+
1825
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css'
1926
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
2027
import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
2128

22-
import AsciinemaPlayer from './components/AsciinemaPlayer.vue'
29+
import 'asciinema-player/dist/bundle/asciinema-player.css';
2330

2431
import 'virtual:uno.css'
2532
import './style.css'
@@ -42,7 +49,12 @@ export default {
4249
})
4350
},
4451
enhanceApp({ app }) {
45-
app.component('AsciinemaPlayer', AsciinemaPlayer)
52+
app.component('TitleBlockContainer', TitleBlockContainer)
53+
app.component('TitleBlockContainerGroup', TitleBlockContainerGroup)
54+
app.component('GettingStartedBlocksEn', GettingStartedBlocksEn)
55+
app.component('GettingStartedBlocksZhCn', GettingStartedBlocksZhCn)
56+
57+
app.use(enhanceAppWithTabs)
4658
app.provide(InjectionKey, {
4759
spotlight: {
4860
defaultToggle: true

docs/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
},
99
"devDependencies": {
1010
"@antfu/eslint-config": "^2.13.3",
11+
"@iconify-json/carbon": "^1.1.31",
1112
"@iconify-json/icon-park-outline": "^1.1.15",
13+
"@iconify-json/octicon": "^1.1.53",
1214
"@iconify-json/simple-icons": "^1.1.99",
1315
"@iconify-json/twemoji": "^1.1.15",
16+
"@nolebase/ui": "2.0.0-rc8",
1417
"@nolebase/vitepress-plugin-enhanced-mark": "^2.0.0-rc8",
1518
"@nolebase/vitepress-plugin-enhanced-readabilities": "2.0.0-rc8",
1619
"@nolebase/vitepress-plugin-git-changelog": "2.0.0-rc8",
@@ -24,6 +27,7 @@
2427
"vite": "^5.2.8",
2528
"vite-plugin-inspect": "^0.8.3",
2629
"vitepress": "^1.1.0",
30+
"vitepress-plugin-tabs": "^0.5.0",
2731
"vue": "^3.4.21"
2832
}
2933
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Deploy through `kollama` CLI
2+
3+
We have a CLI called `kollama` here to simplify the deployment process. It is a simple way to deploy Ollama models to your Kubernetes cluster.
4+
5+
## Getting Started
6+
7+
1. Install the CLI:
8+
9+
```shell
10+
go install github.com/nekomeowww/ollama-operator/cmd/kollama@latest
11+
```
12+
13+
2. Deploy a model:
14+
15+
```shell
16+
kollama deploy phi --expose --node-port 30001
17+
```
18+
19+
That's it.
20+
21+
3. Interact with the model:
22+
23+
```shell
24+
OLLAMA_HOST=<Node ip>:30001 ollama run phi
25+
```
26+
27+
or use the OpenAI API compatible endpoint:
28+
29+
```shell
30+
curl http://<Node ip>:30001/v1/chat/completions -H "Content-Type: application/json" -d '{
31+
"model": "phi",
32+
"messages": [
33+
{
34+
"role": "user",
35+
"content": "Hello!"
36+
}
37+
]
38+
}'
39+
```

0 commit comments

Comments
 (0)