当前位置: 首页 > news >正文

AI智算-k8s部署大语言模型管理工具Ollama

文章目录

      • 简介
      • k8s部署Ollama
      • Open WebUI
        • 访问Open-WebUI

简介

Github:https://github.com/ollama/ollama
官网:https://ollama.com/
API:https://github.com/ollama/ollama/blob/main/docs/api.md

Ollama 是一个基于 Go 语言开发的可以本地运行大模型的开源框架,同时提供 REST API 管理和使用大模型。

k8s部署Ollama

~# cat ollama-dp.yaml 
kind: Deployment
apiVersion: apps/v1
metadata:name: ollamalabels:app: ollama
spec:replicas: 1selector:matchLabels:app: ollamatemplate:metadata:labels:app: ollamaspec:volumes:- name: ollama-modelshostPath:path: /file_CPU_01/cyw_data/ollamatype: ''- name: host-timehostPath:path: /etc/localtimetype: ''containers:- name: ollamaimage: ollama/ollama:0.5.1ports:- name: http-11434containerPort: 11434protocol: TCPresources:limits:nvidia.com/gpu: '8'requests:nvidia.com/gpu: '8'volumeMounts:- name: ollama-modelsmountPath: /root/.ollama- name: host-timereadOnly: truemountPath: /etc/localtimeimagePullPolicy: IfNotPresentrestartPolicy: AlwaysschedulerName: volcano
---
kind: Service
apiVersion: v1
metadata:name: ollamalabels:app: ollama
spec:ports:- name: http-11434protocol: TCPport: 11434targetPort: 11434nodePort: 31434selector:app: ollamatype: NodePort
~# kubectl get pods -n sre-tools |grep ollama
ollama-8cd499f48-4b6wv      1/1     Running   0          13m
~# kubectl get svc -n sre-tools |grep ollama
ollama   NodePort   10.233.6.148   <none>        11434:31434/TCP   13m

测试接口:

~# curl -i  http://10.0.xx.xx:31434
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Thu, 12 Dec 2024 08:46:55 GMT
Content-Length: 17Ollama is running

Open WebUI

Github:https://github.com/open-webui/open-webui
官网:https://openwebui.com/

Open WebUI 是一个可扩展、功能丰富且用户友好的自托管 AI 界面,旨在完全离线运行。它支持各种 LLM 运行器,包括 Ollama 和 OpenAI 兼容 API。

~# cat open-webui.yaml 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: open-webui-data-pvc
spec:accessModes:- ReadWriteOnceresources:requests:storage: 20GistorageClassName: nfs-client---
apiVersion: apps/v1
kind: Deployment
metadata:name: open-webui-deployment
spec:replicas: 1selector:matchLabels:app: open-webuitemplate:metadata:labels:app: open-webuispec:containers:- name: open-webuiimage: ghcr.mirrorify.net/open-webui/open-webui:mainports:- containerPort: 8080env:- name: OLLAMA_BASE_URLvalue: "http://10.0.xx.xx:31434"   #ollama地址volumeMounts:- name: open-webui-datamountPath: /app/backend/datavolumes:- name: open-webui-datapersistentVolumeClaim:claimName: open-webui-data-pvc---
apiVersion: v1
kind: Service
metadata:name: open-webui-service
spec:type: ClusterIPports:- port: 3000targetPort: 8080 selector:app: open-webui---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:name: open-webui-ingress
spec:rules:- host: open-webui.xxx-sh.comhttp:paths:- backend:service:name: open-webui-serviceport:number: 3000path: /pathType: Prefixtls:- hosts:- open-webui.xxx-sh.comsecretName: xxx-tls
访问Open-WebUI

https://open-webui.xxx-sh.com
Open WebUI
在这里插入图片描述

http://www.lryc.cn/news/504258.html

相关文章:

  • CloudberryDB(二) 演化路线图
  • 《拉依达的嵌入式\驱动面试宝典》—C/CPP基础篇(二)
  • 实现canal监控binlog日志再通过消息队列异步处理
  • Linux DNS 协议概述
  • linux打包qt程序
  • 软考中级-软件设计师通过心路经验分享
  • safe area helper插件
  • 李宏毅机器学习-批次 (batch)和动量(momentum)
  • C# 网络编程--关于UDP 通信(二)
  • 【k8s集群应用】Kubernetes部署安装-二进制部署实例
  • js常见代码输出问题之promise,await,变量提升以及闭包(包括例子以及详细解析)
  • 遗传算法与深度学习实战(27)——进化卷积神经网络
  • 【Vue3】前端使用 FFmpeg.wasm 完成用户视频录制,并对视频进行压缩处理
  • 基础算法——前缀和
  • spring实例化对象的几种方式(使用XML配置文件)
  • 【二叉树】力扣 129.求根节点到叶子节点数字之和
  • 深度学习物体检测之YOLOV5源码解读
  • 音频数据采样入门详解 - 给Python初学者的简单解释
  • Unity类银河战士恶魔城学习总结(P179 Enemy Archer 弓箭手)
  • SpringCloud集成sleuth和zipkin实现微服务链路追踪
  • Python随机抽取Excel数据并在处理后整合为一个文件
  • Linux+Docker onlyoffice 启用 HTTPS 端口支持
  • 在 Visual Studio Code 中编译、调试和执行 Makefile 工程 llama2.c
  • python中math模块常用函数
  • 优化 Vue 3 开发体验:配置 Vite 使用 WebStorm 作为 Vue DevTools 的默认编辑器
  • 【C语言练习(9)—有一个正整数,求是几位数然后逆序打印】
  • 热敏打印机的控制
  • 【closerAI ComfyUI】电商赋能,AI模特套图生产,各种姿势自定义,高度保持人物服饰场景一致性,摆拍街拍专用
  • ARM学习(36)静态扫描规则学习以及工具使用
  • 使用 Docker Compose 部署 Redis 主从与 Sentinel 高可用集群