最近很火的mcp感觉非常有前景,python-sdk在这里。 快速开始 uv init -p 3.10 test-mcp cd test-mcp uv add "mcp[cli]" # server.py from mcp.server.fastmcp import FastMCP # Create an MCP server mcp = FastMCP("Demo") # Add an addition tool @mcp.tool() def add(a: int, b: int) ->
安装 rust 因为很多工具都是rust写的,所以需要先安装rust,参考这个网页 Linux export RUSTUP_DIST_SERVER="https://rsproxy.cn" export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh Windows 需要先安装vs_BuildTools,然
Xinference Xinference 是一个开源的 LLM 服务框架,它提供了一套完整的 LLM 服务,包括模型加载、模型推理、模型管理、模型部署等。 为了方便部署,这里采用docker运行 docker
简介 NuShell 是一个用rust写的跨平台的shell。 NuShell最重要的一点是引入了结构化数据的概念,命令之间传递的不再是纯文本,而List/R
uv python version management uv在管理依赖上虽不如poetry用得爽,但是人家还管理pyenv和pipx类似的功能,还是挺好用的。 比如今天安装labelImg时
问题 最近试了试 yolo11,直接安装 poetry add ultralytics 这样下来的是 cpu 版本的 torch,在执行下面的代码时,会报torch编译时没有使能cuda model = YOLO("yolo11n.pt") model.to("cuda") 解
claude 总结的msgpack,写得挺好的! I’ll help explain how MessagePack handles integer and double (floating point) number representations. import struct import binascii def demonstrate_msgpack_numbers(): # Integer representations def pack_fixnum(n): # -32 to 127 return bytes([n & 0xff]) if n >= 0 else bytes([n & 0xff]) def pack_uint8(n): # 0 to 255 return bytes([0xcc, n & 0xff]) def
在命令行中输入 docker 命令会涉及多少个代理阶段呢?答案是3个 docker -> docker daemon docker是一个客户端,它可以通过网络访问多个daemon,不一定是本机。d
当我们本地需要运行一组服务器时,还需要使用https时,我们就需要手动地签发好多证书。 有没有一种可能,我们可以在本地跑一个像 Lets Encrypt 的服务? 还真
介绍 曾经有一段时间想用 pipenv ,但后来因种种原因放弃了,后面就一直使用 requirements.txt, 直到最近用了 pyproject.toml + flit 的方案,但总是感觉不太好
使用pyo3调用rust的函数,感觉比pybind11还要简单, 因为rust编译更简单,还有模板工程。 初始化 以下来自官方文档 # (replace string_sum with the desired package name)
在 bash 中 ctrl-u/ctrl-k 是很常用的快捷键,但是 powershell 里没有, notepad $PROFILE 在其中添加以下两行 Set-PSReadLineKeyHandler -Key Ctrl+u -Function BackwardDeleteLine Set-PSReadLineKeyHandler -Key Ctrl+k -Function ForwardDeleteLine 参见这里 和这里
cargo install appimanager appimanager add -n <name> -i <icon> <app-image-file> 如果还想要用到图标,可以把app-image-file先解压了 ./<app-image-file> --appimage-extract 这会在app-image-file旁边建一个squas
Pycharm global config 按两下Shift, 在Searching anything中找到Registry...,将python.debug.asyncio.rep
Ollama介绍 Ollama设计上很像是docker,有一个常驻服务,有一个客户端用来运行命令。 存储也是和docker相似,有很多的层。其中
刚了解下langchain,简单写个 AI助手的langchain版本 Code 安装依赖 pip install langchain langchain-community pyjwt python-dotenv 申请大模型帐号 到这里申请一个智谱AI的帐号,注册就
国内镜像 https://hf-mirror.com/ 具体步骤 创建conda环境,如果不记得,可以参考这里 conda create --name hfd python=3.12.5 conda activate hfd conda install huggingface_hub export HF_ENDPOINT=https://hf-mirror.com # bash $env:HF_ENDPOINT = "https://hf-mirror.com" # pwsh huggingface-cli download --resume-download gpt2 --local-dir gpt2 # 下载模型,gpt2为模型
gpt4free pip install g4f code from typing import List, Any import sys from g4f.client import Client import asyncio if sys.platform == "win32": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) def fetch_ai(client: Client, messages: List[Any]) -> str: chunks = [] print("AI: ", end="") stream = client.chat.completions.create( model="gpt-4", messages=messages, stream=True, ) for msg in stream: chunk = msg.choices[0].delta.content if chunk: chunks.append(chunk) print(chunk, end="", flush=True) else: print("") return "".join(chunks) def main(): client = Client() print
git仓库准备 下载我的博客最新版 解压后,到代码根目录执行 git init 删除 themes/LoveIt 文件夹 git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt 删除 content/posts 中的所有子文件和子文件夹,但要保留 content/posts 文件 修改 conf
fnm env --use-on-cd | Out-String | Invoke-Expression fnm completions --shell power-shell | Out-String | Invoke-Expression $env:FNM_NODE_DIST_MIRROR="https://npmmirror.com/dist"