国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

無(wú)需 GPU 服務(wù)器,借助 OpenRouter 零成本搭建自己的大模型助手

這篇具有很好參考價(jià)值的文章主要介紹了無(wú)需 GPU 服務(wù)器,借助 OpenRouter 零成本搭建自己的大模型助手。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

一、搭建自己的大模型助手

大型模型的出現(xiàn)為許多領(lǐng)域帶來(lái)了革命性的變化,從自然語(yǔ)言處理到計(jì)算機(jī)視覺(jué),甚至是醫(yī)學(xué)和金融領(lǐng)域。然而,對(duì)于許多開發(fā)者來(lái)說(shuō),使用一些開源的模型進(jìn)行實(shí)驗(yàn)和應(yīng)用卻是一個(gè)挑戰(zhàn),因?yàn)樗鼈兺ǔP枰嘿F的硬件資源來(lái)運(yùn)行。大多數(shù)情況下,使用這些模型需要擁有一臺(tái)配備高性能GPU的服務(wù)器,而這往往是一項(xiàng)昂貴的投資。而 OpenRouter 為使用者提供了部分開源模型的實(shí)現(xiàn),可以通過(guò)API免費(fèi)使用,主要聚焦在7B規(guī)模大小的模型,比如谷歌的 gemma-7bMistral AImistral-7b-instruct,一定程度避免了自己去部署大模型的成本。

本文就基于 OpenRouter 中免費(fèi)模型接口的能力,使用谷歌的 gemma-7b 模型,搭建自己的大模型助手,實(shí)現(xiàn)效果如下:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維
openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

二、OpenRouter 使用

在實(shí)驗(yàn)前首先了解下 OpenRouter 是什么。OpenRouter 是一款整合了各類大模型的中間代理商,而且在國(guó)內(nèi)無(wú)需梯子即可訪問(wèn),通過(guò) OpenRouter 可以調(diào)用超 100 種優(yōu)秀的大模型,其中包括比較流行的 OpenAIChatGPT 系列(包括GPT4V),AnthropicClaude 系列,谷歌的 PaLMGemini 系列等,而且更換模型僅需修改模型的名字即可,無(wú)需修改調(diào)用代碼得邏輯:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維
openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

官方地址如下:

https://openrouter.ai/

OpenRouter 沒(méi)有對(duì)QQ郵箱做限制,支持 QQ 郵箱登錄注冊(cè),一定程度上給國(guó)內(nèi)的一些用戶提供了便利,并且還免費(fèi)提供了一批7B的模型,包括 nous-capybara-7b、mistral-7b-instruct、mythomist-7b、toppy-m-7b、cinematika-7b、gemma-7b-it

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

因此,當(dāng)我們沒(méi)有 GPU 服務(wù)器的時(shí)候,又想借助開源模型搭建一套自己的大模型助手時(shí),就可以考慮使用 OpenRouter 了,注意使用前需要先注冊(cè)賬號(hào),并生成 Api key

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

OpenRouter 主要以 http 的交互方式,因此幾乎可以使用任何支持 http 的語(yǔ)言和框架去調(diào)用 ,同時(shí)也支持通過(guò) OpenAIclient.chat.completions.create 方式調(diào)用:

例如:使用 Python 語(yǔ)言 http 的方式,調(diào)用 gemma-7b 模型:

import requests
import json

url = "https://openrouter.ai/api/v1/chat/completions"
model = "google/gemma-7b-it:free"
request_headers = {
    "Authorization": "Bearer 你的api_key",
    "HTTP-Referer": "http://localhost:8088",
    "X-Title": "test"
}
default_prompt = "You are an AI assistant that helps people find information."

def llm(user_prompt,system_prompt=default_prompt):
    messages = [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_prompt},
    ]
    request_json = {
        "model": model,
        "messages": messages,
        "max_tokens": 2048
    }
    respose = requests.request(
        url=url,
        method="POST",
        json=request_json,
        headers=request_headers
    )
    return json.loads(respose.content.decode('utf-8'))['choices'][0]['message']['content']

if __name__ == '__main__':
    print(llm("你好,介紹一下你自己"))

運(yùn)行輸出:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

使用 OpenAIclient.chat.completions.create 方式,調(diào)用 gemma-7b 模型:

from openai import OpenAI

model = "google/gemma-7b-it:free"
default_prompt = "You are an AI assistant that helps people find information."
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="你的api_key",
)

def llm(user_prompt, system_prompt=default_prompt):
    messages = [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_prompt},
    ]
    completion = client.chat.completions.create(
        extra_headers={
            "HTTP-Referer": "http://localhost:8088",
            "X-Title": "test",
        },
        model=model,
        messages=messages,
        max_tokens = 2048
    )
    return completion.choices[0].message.content


if __name__ == '__main__':
    print(llm("你好,介紹一下你自己"))

運(yùn)行輸出:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

流式輸出示例:

from openai import OpenAI

model = "google/gemma-7b-it:free"
default_prompt = "You are an AI assistant that helps people find information."
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="你的api_key",
)

def llm(user_prompt, system_prompt=default_prompt):
    messages = [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_prompt},
    ]
    completion = client.chat.completions.create(
        extra_headers={
            "HTTP-Referer": "http://localhost:8088",
            "X-Title": "test",
        },
        model=model,
        messages=messages,
        max_tokens = 2048,
        stream=True
    )
    for respose in completion:
        if respose and respose.choices and len(respose.choices) > 0:
            msg = respose.choices[0].delta.content
            print(msg, end='', flush=True)


if __name__ == '__main__':
    llm("你好,介紹一下你自己")

運(yùn)行輸出:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

三、搭建大模型助手

上面簡(jiǎn)單認(rèn)識(shí)了 OpenRouter 的能力,下面基于 OpenRouter 上谷歌的 gemma-7b 模型搭建一個(gè)自己的大模型助手,簡(jiǎn)單的執(zhí)行過(guò)程如下。

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

其中后端服務(wù)使用 Python + tornado 實(shí)現(xiàn) Web 服務(wù),前端使用基礎(chǔ)的 Html + Jquery 的方式。

3.1 服務(wù)端搭建

所屬依賴版本如下:

openai==0.27.8
tornado==6.3.2

構(gòu)建問(wèn)答助手接口 server.py

接口我們接收兩個(gè)參數(shù) questionshistory ,其中 history 由后端維護(hù)并追加聊天記錄,前端只負(fù)責(zé)臨時(shí)存儲(chǔ),每次請(qǐng)求攜帶上一次請(qǐng)求返回的 history 即可,調(diào)用 OpenRouter 使用 OpenAI 庫(kù)的方式。

整體實(shí)現(xiàn)邏輯如下:

from tornado.concurrent import run_on_executor
from tornado.web import RequestHandler
import tornado.gen
from openai import OpenAI
import json

class Assistant(RequestHandler):
    model = "google/gemma-7b-it:free"
    client = OpenAI(
        base_url="https://openrouter.ai/api/v1",
        api_key="你的api_key",
    )
    default_prompt = "You are an AI assistant that helps people find information."

    def prepare(self):
        self.executor = self.application.pool

    def set_default_headers(self):
        self.set_header('Access-Control-Allow-Origin', "*")
        self.set_header('Access-Control-Allow-Headers', "Origin, X-Requested-With, Content-Type, Accept")
        self.set_header('Access-Control-Allow-Methods', "GET, POST, PUT, DELETE, OPTIONS")

    @tornado.gen.coroutine
    def post(self):
        json_data = json.loads(self.request.body)
        if 'questions' not in json_data or 'history' not in json_data:
            self.write({
                "code": 400,
                "message": "缺少必填參數(shù)"
            })
            return
        questions = json_data['questions']
        history = json_data['history']
        result = yield self.do_handler(questions, history)
        self.write(result)

    @run_on_executor
    def do_handler(self, questions, history):
        try:
            answer, history = self.llm(questions, history)
            return {
                "code": 200,
                "message": "success",
                "answer": answer,
                "history": history
            }
        except Exception as e:
            return {
                "code": 400,
                "message": str(e)
            }

    def llm(self, user_prompt, messages, system_prompt=default_prompt):
        if not messages:
            messages = []
        messages.append({"role": "user", "content": user_prompt})
        completion = self.client.chat.completions.create(
            extra_headers={
                "HTTP-Referer": "http://localhost:8088",
                "X-Title": "test",
            },
            model=self.model,
            messages=messages,
            max_tokens=2048
        )
        answer = completion.choices[0].message.content
        messages.append({"role": "assistant", "content": answer})
        return answer, messages

路由配置,并啟動(dòng)服務(wù) app.py

import tornado.web
import tornado.ioloop
import tornado.httpserver
import os
from concurrent.futures.thread import ThreadPoolExecutor
from server import Assistant

## 配置
class Config():
    port = 8081
    base_path = os.path.dirname(__file__)
    settings = {
        # "debug":True,
        # "autore load":True,
        "static_path": os.path.join(base_path, "resources/static"),
        "template_path": os.path.join(base_path, "resources/templates"),
        "autoescape": None
    }

# 路由
class Application(tornado.web.Application):
    def __init__(self):
        handlers = [
            ("/assistant", Assistant),
            ("/(.*)$", tornado.web.StaticFileHandler, {
                "path": os.path.join(Config.base_path, "resources/static"),
                "default_filename": "index.html"
            })
        ]
        super(Application, self).__init__(handlers, **Config.settings)
        self.pool = ThreadPoolExecutor(10)


if __name__ == '__main__':
    app = Application()

    httpserver = tornado.httpserver.HTTPServer(app)

    httpserver.listen(Config.port)

    print("start success", "prot = ", Config.port)

    print("http://localhost:" + str(Config.port) + "/")

    tornado.ioloop.IOLoop.current().start()

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

下面可以使用 Postman 進(jìn)行測(cè)試:

請(qǐng)求內(nèi)容:

{
	"questions":"你好,介紹下你自己",
	"history":[]
}

輸出示例:
openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

從結(jié)果看接口訪問(wèn)正常,下面開始前端的搭建。

3.2 前端搭建

前端需要構(gòu)建一個(gè)問(wèn)答聊天界面,需要注意的是,模型返回的內(nèi)容可能是 MD 格式,前端需要解析成html 格式展示,整體實(shí)現(xiàn)過(guò)程如下:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>AI 聊天對(duì)話</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        .container {
            display: flex;
            height: 100vh;
        }

        .left-panel {
            flex: 15%;
            background-color: #f2f2f2;
            padding: 10px;
        }

        .right-panel {
            flex: 85%;
            background-color: #ffffff;
            display: flex;
            flex-direction: column;
        }

        .chat-log {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .chat-bubble {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }

        .user-bubble {
            justify-content: flex-end;
        }

        .bubble-content {
            padding: 10px 15px;
            border-radius: 20px;
        }

        .user-bubble .bubble-content {
            background-color: #d6eaff;
            color: #000000;
        }

        .ai-bubble .bubble-content {
            background-color: #e5ece7;
            color: #000;
        }

        .input-area {
            display: flex;
            align-items: center;
            padding: 20px;
        }

        .input-text {
            flex: 1;
            padding: 10px;
            margin-right: 10px;
        }

        .submit-button {
            padding: 10px 20px;
            background-color: #2196f3;
            color: #ffffff;
            border: none;
            cursor: pointer;
        }

        li {
            margin-top: 10px;
        }

        a {
            text-decoration: none;
        }

        table {
            border: 1px solid #000;
            border-collapse: collapse;
        }

        table td, table th {
            border: 1px solid #000;
        }

        table td, table th {
            padding: 10px;
        }

        .language-sql {
            width: 95%;
            background-color: #F6F6F6;
            padding: 10px;
            font-weight: bold;
            border-radius: 5px;
            word-wrap: break-word;
            white-space: pre-line;
            /* overflow-wrap: break-word; */
            display: block;
        }

        select {
            width: 100%;
            height: 30px;
            border: 2px solid #6089a4;
            font-size: 15px;
            margin-top: 5px;
        }
        .recommendation{
            color: #1c4cf3;
            margin-top: 10px;
        }

    </style>
</head>
<body>
<div class="container">
    <div class="left-panel">
        <h2>智能問(wèn)答助手</h2>
        <h3>常用問(wèn)題</h3>
        <div class="recommendation">幫我寫一個(gè)Java快速排序</div>
        <div class="recommendation">Java 8有什么新特性</div>
        <div class="recommendation">JVM優(yōu)化建議</div>
        <div class="recommendation">內(nèi)存占用高,如何優(yōu)化</div>
        <div class="recommendation">MySQL優(yōu)化建議</div>
        <div class="recommendation">MySQL如何查看執(zhí)行計(jì)劃</div>
    </div>
    <div class="right-panel">
        <div class="chat-log" id="chat-log">

        </div>
        <div class="input-area">
            <input type="text" id="user-input" class="input-text" placeholder="請(qǐng)輸入您的問(wèn)題,回車或點(diǎn)擊發(fā)送確定。">
            <button id="submit" style="margin-left: 10px;width: 100px" onclick="sendMessage()" class="submit-button">
                發(fā)送
            </button>
            <button style="margin-left: 20px;width: 100px;background-color: red" onclick="clearChat()"
                    class="submit-button">清除記錄
            </button>
        </div>
    </div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
    // 聊天歷史記錄
    var messageHistory = [];

    // 添加AI信息
    function addAIMessage(message) {
        $("#chat-log").append(
            "<div class=\"chat-bubble ai-bubble\">\n" +
            "    <div class=\"bubble-content\">" + message + "</div>\n" +
            "</div>"
        )
    }

    // 添加人類信息
    function addUserMessage(message) {
        $("#chat-log").append(
            "<div class=\"chat-bubble user-bubble\">\n" +
            "    <div class=\"bubble-content\">" + message + "</div>\n" +
            "</div>"
        )
    }

    // 滑動(dòng)到底部
    function slideBottom() {
        let chatlog = document.getElementById("chat-log");
        chatlog.scrollTop = chatlog.scrollHeight;
    }

    // 調(diào)用api
    function chatApi(message) {
        slideBottom();
        data = {
            questions: message,
            history: messageHistory
        };
        $.ajax({
            url: "http://127.0.0.1:8081/assistant",
            type: "POST",
            contentType: "application/json",
            dataType: "json",
            data: JSON.stringify(data),
            success: function (res) {
                if (res.code === 200) {
                    let answer = res.answer;
                    answer = marked.parse(answer);
                    addAIMessage(answer);
                    messageHistory = res.history;
                } else {
                    addAIMessage("服務(wù)接口調(diào)用錯(cuò)誤。");
                }
            },
            error: function (e) {
                addAIMessage("服務(wù)接口調(diào)用異常。");
            }
        });
    }

    // 發(fā)送消息
    function sendMessage() {
        let userInput = $('#user-input');
        let userMessage = userInput.val();
        if (userMessage.trim() === '') {
            return;
        }
        userInput.val("");
        addUserMessage(userMessage);
        chatApi(userMessage);
    }

    // 清空聊天記錄
    function clearChat() {
        $("#chat-log").empty();
        messageHistory = [];
        addAIMessage("你好,請(qǐng)輸入你想問(wèn)的問(wèn)題。");
    }

    // 初始化
    function init() {
        addAIMessage("你好,請(qǐng)輸入你想問(wèn)的問(wèn)題。");
        var submit = $("#submit");
        var userInput = $("#user-input");
        var focus = false;
        // 監(jiān)聽輸入框焦點(diǎn)
        userInput.focus(function () {
            focus = true;
        }).blur(function () {
            focus = false;
        });
        // 回車監(jiān)聽事件
        document.addEventListener("keydown", function (event) {
            if (event.keyCode === 13) {
                console.log(focus);
                if (focus) {
                    submit.click();
                }
            }
        });
    }
    init();
</script>
</body>
</html>

運(yùn)行效果:

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維
openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

openrouter,機(jī)器學(xué)習(xí),服務(wù)器,運(yùn)維

到此,我們自己的大模型助手就基本做好了!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-841236.html

到了這里,關(guān)于無(wú)需 GPU 服務(wù)器,借助 OpenRouter 零成本搭建自己的大模型助手的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 智能批量剪輯系統(tǒng)源碼開發(fā)者如何減少服務(wù)器成本?

    智能批量剪輯系統(tǒng)源碼開發(fā)者如何減少服務(wù)器成本?

    智能混剪批量剪輯自研和接入第三方\\\"如阿里云\\\"接口的差別主要在于技術(shù)實(shí)現(xiàn)和功能定制。自研混剪系統(tǒng)需要團(tuán)隊(duì)投入大量時(shí)間和資源來(lái)研發(fā)和維護(hù),并且能夠根據(jù)用戶需求定制和優(yōu)化功能,并且較市面上的混剪工具來(lái)說(shuō)輸出內(nèi)容效果更好,剪輯的視頻效果自動(dòng)查重,目前我

    2024年02月11日
    瀏覽(30)
  • 【服務(wù)器】零成本搭建網(wǎng)站并內(nèi)網(wǎng)穿透實(shí)現(xiàn)公網(wǎng)訪問(wèn)

    【服務(wù)器】零成本搭建網(wǎng)站并內(nèi)網(wǎng)穿透實(shí)現(xiàn)公網(wǎng)訪問(wèn)

    在普通電腦用戶看來(lái),建立自己的網(wǎng)站總是一件高大上的事情,這個(gè)網(wǎng)站不僅可以成為展示自己的平臺(tái),還能成為商業(yè)的載體。在以往,建立一個(gè)像樣的網(wǎng)站,不僅需要過(guò)硬的編程知識(shí)做基礎(chǔ),還需要有足夠的資金租用服務(wù)器。但隨著軟件技術(shù)的快速發(fā)展,每個(gè)人都可以以很

    2024年02月16日
    瀏覽(32)
  • 手機(jī)搭建服務(wù)器教程,本人親測(cè)無(wú)需root

    手機(jī)搭建服務(wù)器教程,本人親測(cè)無(wú)需root

    注意啦:如果不想在這么麻煩下載可以移步到 八.Termux的備份和恢復(fù) 這一步 手機(jī)更新?lián)Q代速度很快,就算很久才換一次手機(jī),家里的舊手機(jī)是咋處理的呢? 可是當(dāng)你突然發(fā)現(xiàn) 別換盆,咱用手機(jī)弄一個(gè)服務(wù)器,弄一個(gè)家庭網(wǎng)盤都是可以的,絕對(duì)是不限速的,當(dāng)前前提取決于你

    2024年02月10日
    瀏覽(24)
  • 【OpenSSH】無(wú)需公網(wǎng)IP使用SSH遠(yuǎn)程連接服務(wù)器

    【OpenSSH】無(wú)需公網(wǎng)IP使用SSH遠(yuǎn)程連接服務(wù)器

    轉(zhuǎn)發(fā)自CSDN遠(yuǎn)程穿透的文章:【vscode遠(yuǎn)程開發(fā)】使用SSH遠(yuǎn)程連接服務(wù)器 「內(nèi)網(wǎng)穿透」 遠(yuǎn)程連接服務(wù)器工具有很多,比如XShell、putty等,可以通過(guò)ssh來(lái)遠(yuǎn)程連接服務(wù)器,但這用于寫代碼并不方便,可能需要現(xiàn)在本地寫好代碼后再將源代碼傳送到服務(wù)器運(yùn)行、服務(wù)器上的圖片也無(wú)

    2024年02月04日
    瀏覽(34)
  • 結(jié)合cpolar內(nèi)網(wǎng)工具,實(shí)現(xiàn)無(wú)需部署到公網(wǎng)服務(wù)器

    轉(zhuǎn)載自cpolar極點(diǎn)云文章:本地Linux 部署 Dashy 并遠(yuǎn)程訪問(wèn) Dashy 是一個(gè)開源的自托管的導(dǎo)航頁(yè)配置服務(wù),具有易于使用的可視化編輯器、狀態(tài)檢查、小工具和主題等功能。你可以將自己常用的一些網(wǎng)站聚合起來(lái)放在一起,形成自己的導(dǎo)航頁(yè)。一款功能超強(qiáng)大,顏值爆表的可定制

    2024年02月12日
    瀏覽(29)
  • 用Python手動(dòng)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的服務(wù)器,不借助任何框架在瀏覽器中輸出任意內(nèi)容

    用Python手動(dòng)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的服務(wù)器,不借助任何框架在瀏覽器中輸出任意內(nèi)容

    前言 嗨嘍~大家好呀,這里是魔王吶 ? ~! 在公司網(wǎng)站開發(fā)中,我們往往借助于Flask、Django等網(wǎng)站開發(fā)框架去提高網(wǎng)站開發(fā)效率。 那么在面試后端開發(fā)工程師的時(shí)候,面試官可能就會(huì)問(wèn)到網(wǎng)站開發(fā)的底層原理是什么? 我們不止僅僅會(huì)使用框架開發(fā),還需要知其所以然 今天領(lǐng)大

    2024年02月15日
    瀏覽(17)
  • 《樹莓派4B家庭服務(wù)器搭建指南》第二十期:在樹莓派運(yùn)行rsnapshot, 實(shí)現(xiàn)對(duì)服務(wù)器數(shù)據(jù)低成本增量本地備份

    《樹莓派4B家庭服務(wù)器搭建指南》第二十期:在樹莓派運(yùn)行rsnapshot, 實(shí)現(xiàn)對(duì)服務(wù)器數(shù)據(jù)低成本增量本地備份

    我的天翼云服務(wù)器有 /opt 和 /usr/share/nginx 兩個(gè)目錄, 用來(lái)存儲(chǔ)網(wǎng)站的內(nèi)容, 數(shù)據(jù)無(wú)價(jià), 為了避免珍貴的數(shù)據(jù)丟失,我決定使用樹莓派運(yùn)行 rsnapshot, 為網(wǎng)站內(nèi)容做定期備份。 rsnapshot是基于rsync的開源軟件, 原理簡(jiǎn)單,無(wú)后門, 無(wú)需強(qiáng)制加密, 備份后的數(shù)據(jù)所見(jiàn)即所得 rsnapshot通過(guò)硬鏈

    2024年02月12日
    瀏覽(18)
  • 0成本無(wú)VPS搭建私人導(dǎo)航、圖床、音樂(lè)服務(wù)器 | vercel freewha

    0成本無(wú)VPS搭建私人導(dǎo)航、圖床、音樂(lè)服務(wù)器 | vercel freewha

    目的:將一些小服務(wù)應(yīng)用部署到免費(fèi)的serverless/VPS上去 環(huán)境:0成本 實(shí)現(xiàn)方式:github + vercel/freewha 效果: 項(xiàng)目一:個(gè)人導(dǎo)航 項(xiàng)目二:個(gè)人博客 項(xiàng)目三:個(gè)人音樂(lè)服務(wù)器: 背景:上面的項(xiàng)目以前我都是部署在家里群暉上,或者VPS上,但是FRPC和VPS的流量,延時(shí)、運(yùn)維更新等問(wèn)題

    2024年02月06日
    瀏覽(31)
  • 論如何本地搭建個(gè)人hMailServer郵件服務(wù)遠(yuǎn)程發(fā)送郵件無(wú)需域名公網(wǎng)服務(wù)器?

    論如何本地搭建個(gè)人hMailServer郵件服務(wù)遠(yuǎn)程發(fā)送郵件無(wú)需域名公網(wǎng)服務(wù)器?

    ???? 博主貓頭虎(????)帶您 Go to New World??? ?? 博客首頁(yè) ——????貓頭虎的博客?? ?? 《面試題大全專欄》 ?? 文章圖文并茂??生動(dòng)形象??簡(jiǎn)單易學(xué)!歡迎大家來(lái)踩踩~?? ?? 《IDEA開發(fā)秘籍專欄》 ?? 學(xué)會(huì)IDEA常用操作,工作效率翻倍~?? ?? 《100天精通Golang(基礎(chǔ)

    2024年01月24日
    瀏覽(121)
  • 服務(wù)器GPU性能測(cè)試流程

    服務(wù)器GPU性能測(cè)試流程

    注意: 1、cuda-sample需要和cuda版本對(duì)應(yīng),否則會(huì)報(bào)錯(cuò) 2、只有進(jìn)行hpcg測(cè)試時(shí)才需要設(shè)置當(dāng)前環(huán)境變量為cuda-10,其它測(cè)試時(shí)設(shè)置cuda-12.0,否則在進(jìn)行浮點(diǎn)性能測(cè)試時(shí)會(huì)報(bào)錯(cuò) 1.環(huán)境變量要求cuda11.8 2.cuda-samples-11.8測(cè)試包 3.hpcg測(cè)試環(huán)境 4.intel oneAPI安裝 1.顯存帶寬 2.卡間帶寬 3.浮點(diǎn)性

    2024年02月04日
    瀏覽(24)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包