-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
701 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2024. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// CustomModelSpec defines the desired state of CustomModel | ||
type CustomModelSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
ModelName string `json:"modelName"` | ||
ModelFile string `json:"modelFile"` | ||
} | ||
|
||
// CustomModelStatus defines the observed state of CustomModel | ||
type CustomModelStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
|
||
// CustomModel is the Schema for the custommodels API | ||
type CustomModel struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CustomModelSpec `json:"spec,omitempty"` | ||
Status CustomModelStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// CustomModelList contains a list of CustomModel | ||
type CustomModelList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CustomModel `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&CustomModel{}, &CustomModelList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
config/crd/bases/ollama.ollama.startupnation_custommodels.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.16.1 | ||
name: custommodels.ollama.ollama.startupnation | ||
spec: | ||
group: ollama.ollama.startupnation | ||
names: | ||
kind: CustomModel | ||
listKind: CustomModelList | ||
plural: custommodels | ||
singular: custommodel | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: CustomModel is the Schema for the custommodels API | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: CustomModelSpec defines the desired state of CustomModel | ||
properties: | ||
modelFile: | ||
type: string | ||
modelName: | ||
type: string | ||
required: | ||
- modelFile | ||
- modelName | ||
type: object | ||
status: | ||
description: CustomModelStatus defines the observed state of CustomModel | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# permissions for end users to edit custommodels. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: simple-ollama-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: custommodel-editor-role | ||
rules: | ||
- apiGroups: | ||
- ollama.ollama.startupnation | ||
resources: | ||
- custommodels | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- ollama.ollama.startupnation | ||
resources: | ||
- custommodels/status | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# permissions for end users to view custommodels. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: simple-ollama-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: custommodel-viewer-role | ||
rules: | ||
- apiGroups: | ||
- ollama.ollama.startupnation | ||
resources: | ||
- custommodels | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- ollama.ollama.startupnation | ||
resources: | ||
- custommodels/status | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
## Append samples of your project ## | ||
resources: | ||
- ollama_v1_model.yaml | ||
- ollama_v1_custommodel.yaml | ||
# +kubebuilder:scaffold:manifestskustomizesamples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: ollama.ollama.startupnation/v1 | ||
kind: CustomModel | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: simple-ollama-operator | ||
app.kubernetes.io/managed-by: kustomize | ||
name: mario-custommodel-sample | ||
spec: | ||
modelName: mario-custommodel-sample | ||
modelFile: >- | ||
FROM llama3.2 | ||
# sets the temperature to 1 [higher is more creative, lower is more coherent] | ||
PARAMETER temperature 1 | ||
# sets the context window size to 4096, this controls how many tokens the LLM can use as context to generate the next token | ||
PARAMETER num_ctx 4096 | ||
# sets a custom system message to specify the behavior of the chat assistant | ||
SYSTEM You are Mario from super mario bros, acting as an assistant. You are in a conversation with Luigi, who is asking you for help. You are in a hurry to save Princess Peach from Bowser, so you are trying to be as helpful as possible while also being brief. You are in a good mood and are excited to help Luigi. |
Oops, something went wrong.