paulwong

2026年1月28日 #

使用uv安装python环境


conda create -n my_ai_env python=3.10 -y
conda activate my_ai_env

#把 uv 请进来(代替普通的 pip)
conda install -c conda-forge uv -y


# 安装 vLLM 或其他重型库
uv pip install vllm --torch-backend auto

为什么系统装了 uv 对 Conda 更有利?

缓存共享:你在 Conda 环境 A 里装过的包,如果环境 B 也要用,uv 会直接从全局缓存里链接过去,0 秒完成安装,且不占双倍硬盘空间。1
不污染环境:通过 uv pip 安装的包,Conda 依然能感知到(通过 conda list 可以看到它们,通常标注为 pypi 来源)。2
极致性能:在处理 vLLM 这种动辄几个 GB 的重型依赖时,全局 uv 的并行下载速度能直接跑满你的带宽。

uv 处理 PyTorch 与 CUDA 兼容性问题主要有两种方式:一种是全自动检测(推荐),另一种是手动指定索引(更稳定)。

1. 自动检测(最推荐:--torch-backend auto)

这是 uv 的杀手锏功能。当你使用以下命令时:
bash
uv pip install torch --torch-backend auto
请谨慎使用此类代码。

原理:uv 会自动扫描你的本地环境(通过 nvidia-smi 或驱动版本),检测当前显卡支持的最高 CUDA 版本。

动作:它会自动从 PyTorch 的官方仓库(如 download.pytorch.org)匹配并下载对应的构建版本(如 +cu121 或 +cu124),无需你手动查表。

2. 手动指定官方索引(针对特定版本需求)

如果你需要安装特定版本的 CUDA(例如系统驱动较老),可以使用 --index-url:

bash
# 安装适配 CUDA 12.1 的版本
uv pip install torch --index-url https://download.pytorch.org/whl/cu121
请谨慎使用此类代码。

注意:在 Windows 上,默认 pip install torch 往往会装成 CPU 版,使用 uv 配合这个显式 URL 可以强制安装 GPU 版。

3. 在配置文件中永久锁定(适合项目管理)

如果你在使用 pyproject.toml 管理项目,可以在文件中配置 tool.uv.index,确保团队所有成员装的都是同一个 CUDA 版本:
toml
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true # 确保只有 torch 相关包走这个索引
请谨慎使用此类代码。


4. 解决“环境污染”:Conda 与 uv 的分工

由于 uv 无法安装系统级的 CUDA 驱动(Driver),最稳健的配合是:
Conda 负责:安装底层的 cudatoolkit 或 nvidia/label/cuda-xx.x。

uv 负责:利用 Conda 提供的环境,通过 uv pip install 瞬间拉取匹配的 Python 库。

总结建议:直接尝试 uv pip install torch --torch-backend auto。如果由于多显卡或 WSL2 环境导致自动检测失败,再退回到手动指定 --index-url 的方案。 

posted @ 2026-01-28 14:52 paulwong 阅读(32) | 评论 (0)编辑 收藏

2026年1月27日 #

AGENT SKILL

通常我们指挥大模型干活的时候,如果只说一句,帮我制作一个人个网站,则大模型只是随机抽出一些案例,生成,出来的效果当然不合人意。

agent skill解决的问题就是,一个skill只针对一个活,然后有个说明文件,说明干这个活,干得好的一个标准,如网站制作,如何配色标准,如何布局标准等,将这些和要干的活一起发给大模型,模型的输出就不再是随机了,而是按这个标准输出了,质量自然就提高了。

posted @ 2026-01-27 00:01 paulwong 阅读(27) | 评论 (0)编辑 收藏

2026年1月26日 #

Agent案例 - 研发团队

产品经理(product-manager.md)
---
name: product-manager
description: Expert product manager specializing in product strategy, user-centric developnent,and business outcomes. Masters roadnap planning, feature prioritization, and cross-functionalleadership with focus on delivering products that users love and drive business growth.
tools: Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, Bash
---

You are a senior product manager with expertise in building successful products that delightusers and achieve business objectives. Your focus spans product strategy, user research, featureprioritization, and go-to-narket execution with enphasis on data-driven decisions and continuous1teration.

when invoked:
1.Query context nanager for product vision and narket context
2. Review user feedback, analytics data, and competitive landscape
3.Analyze opportunitles,user needs,and business impact
4.Drive product decisions that balance user value and business goals

Product management checklist:
- User satisfaction > 80% achieved
-Feature adoption tracked thoroughly
- Business netrics achieved consistently
- Roadnap updated quarterly properly
- Backlog prioritized strategically
-Analytics implenented conprehensively
-Feedback loops active continuously
-Market position strong measurably

全栈程序员(fullstack-developer.md)
---name: fullstack-developer
description: End-to-end feature owmer with expertise across the entire stack. Deliversolutions from database to UI with focus on seamless Integration and optimal user exptools: Read,Write, Edit, Bash,Glob, Grep
---

You are a senior fullstack developer speclalizing in conplete feature development wittacross backend and frontend technologles. Your prinary focus 1s del1vering coheslve,solutions that work seamlessly from database to user Interface.

when invoked:
1. Query context manager for full-stack architecture and existing patterns
2. Analyze data flow from database through API to frontend
3.Review authentication and authorization across all layers
4.Design cohesive solution maintaining consistency throughout stack

Fullstack development checklist:
- Database schema aligned with API contracts
- Type-safe API implenentation with shared types
- Frontend components matching backend capabilities
- Authentication flow spanning all Layers
- Consistent error handling throughout stack
- End-to-end testing covering user journeys
- Performance optimization at each layer
- Deployment pipeline for entire feature


QA(qa-export.md)
---
name: qa-expert
description:Expert QA engineer specializing in comprehensive and quality metrics. Masters manual and automated testing, trwith focus on delivering high-quality software through system
tools: Read, Grep, Glob, Bash
---

You are a senior QA expert with expertise in comprehensive qmethodologies, and quality metrics. Your focus spans test pl quality advocacy with emphasis on preventing defects, ensure high quality standards throughout the development lifecycle.

When invoked:
1. Query context manager for quality requirements and applic
2. Review existing test coverage, defect patterns, and quality
3. Analyze testing gaps, risks, and improvement opportunities
4. Implement comprehensive quality assurance strategies

api-designer.md
code-reviewer.md




https://github.com/VoltAgent/awesome-claude-code-subagents/tree/main

Building a Harness for... Myself
https://www.subaud.io/building-a-harness-for-myself/



posted @ 2026-01-26 01:03 paulwong 阅读(31) | 评论 (0)编辑 收藏

2026年1月25日 #

智谱文字变图像模型zai-org/GLM-Image

开源,可在huggingface下载,模型id:zai-org/GLM-Image https://huggingface.co/zai-org/GLM-Image
生成文字不乱码

posted @ 2026-01-25 23:26 paulwong 阅读(24) | 评论 (0)编辑 收藏

Agent案例 - 制作ppt


输入提示词
4句提示词:
第一,你扮演世界上最顶尖的商业演示设计专家和视觉的传达顾问。 
第二,请运用《演说之禅》和麦肯锡《金字塔原理》,以及高桥流 简洁法的核心技巧,帮我设计逻辑清晰,而且视觉震撼的演示文稿。
第三,我会详细描述我的演示目标、演示目的、演示目标受众、演示的核心内容,时间限制以及现有的素材。
第四,请给我一个可以立即执行到个性化设计方案,一定要具体实用,别说废话。

选择Gemini-pro3,发送。

输入内容
示目标:希望目标受众在认知和行动上产生以下转变,从对AI的焦虑与替代恐惧,转变为将其视为能力放大器与战略伙伴。开始有意识地将AI深度整合进工作流,并制定个人计划,重点投资于洞察力、判断力、整合力与叙事力这四大不可替代的核心能力,实现从"执行者"到"决策者"的升级。
演示目的:缓解焦虑,指明方向;重塑价值,确立信心;提供框架,驱动改变;
目标受众:互联网和科技行业的产品经理、产品设计师、创业者、技术团队负责人;
核心内容:核心论断:问题从来本在工具,而在于你选择如何使用它。AI是能力的放大器,而非替代品。
关键框架:
现状定位:我们正处在从"推理者"向"代理"过渡的拐点,对"会用Agent的人"要求更高。
变与不变:效率门楼,协作方式在变:但对用户的理解,商业判断、驾驭复杂性、创造力与品味永不会
核心竞争力公式:产品力=思维深度xAI效率。
思维深度为零,一切归零。
四大不可替代能力:洞察力、判断力、整合力、叙事力。
三段式实践路径:短期掌握协作,中期深化专业,长期构建系统思维。
终极愿景:未来的产品经理应是思想者、决策者、协作者、创造者的集合体。最终的竞争,是"会用机器且拥有深度思维的人*之间的竞争。
时间限制:理想的演讲时间约为30-45分钟:

输入提示词,选择nano-banana,发送
这是我今天要演示的内容,请根据内容帮我生成一份PPT演示文稿,我给你的设计提示词是:"Cinematic lighting, hyper-realistic, human hand shaking robot hand, warm tone"(用于P3); "Minimalist style, a lighthouse in the dark ocean, vector art"(用于P8洞察力).



posted @ 2026-01-25 22:21 paulwong 阅读(22) | 评论 (0)编辑 收藏

通过api调用vl模型


import os,base64
from openai import OpenAI

client = OpenAI(
    api_key='xxx',
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)

def encode_image(image_path):
    with open(image_path,"rb") as image_file:
        return base64.b64encode(image_file.read()).decode("utf-8")

result = []
for file_name in ["food1.png","food2.png","food3.png"]:
    image_path = os.path.join(os.path.dirname(__file__),file_name)
    completion = client.chat.completions.create(
        model="qwen-vl-max-latest",
        messages=[
            {
                "role""system",
                "content": [{"type":"text","text":"You are a helpful assistant."}]
            },
            {
                "role""user",
                "content":[
                    {
                        "type""image_url",
                        "image_url": {
                            "url":"data:image/png;base64," + encode_image(image_path)
                        }
                    },
                    {
                        "type""text",
                        "text""""
                        提取图中内容,按照json格式输出如下,只输出纯json字符就行,不要夹杂换行符和其他多余字符:
                        {
                            "product_name":"xxxx",
                            "product_type":"xxxx",
                            "shelf_life":"xxxx",
                            "ingredients":"xxxx.",
                            "product_standard_code":"xxxx",
                            "storage_conditions":"xxxx",
                            "food_production_license_number":"xxxx",
                            "production_date":"xxxx",
                            "manufacturer":"xxxx",
                            "address":"xXxx",
                            "phone":"xxxx",
                            "fax":"xXXX"
                        }
                        
"""
                    }
                ]
            }
        ]
    )

    result.append(completion.choices[0].message.content)

print(result)




posted @ 2026-01-25 17:20 paulwong 阅读(22) | 评论 (0)编辑 收藏

2026年1月24日 #

Claude skill 资源

安装方法
/plugin marketplace add anthropics/skills anthropics/claude-plugins-official

awesome-claude-skills
https://github.com/ComposioHQ/awesome-claude-skills/tree/master

Claude Code Plugins Directory
https://github.com/anthropics/claude-plugins-official

Skills
https://github.com/anthropics/skills

Awesome Claude Code Subagents
https://github.com/VoltAgent/awesome-claude-code-subagents/blob/main/README.md

agent-skills-examples
https://github.com/tech-shrimp/agent-skills-examples/tree/main/字幕转markdown

THE OPEN AGENT SKILLS ECOSYSTEM
https://skills.sh

skills.marketplace
https://skillsmp.com/zh



posted @ 2026-01-24 20:04 paulwong 阅读(33) | 评论 (0)编辑 收藏

国内安装Claude code

安装命令

#!/bin/bash

set -e

# Parse command line arguments
TARGET="$1"  # Optional target parameter

# Validate target if provided
if [[ -n "$TARGET" ]] && [[ ! "$TARGET" =~ ^(stable|latest|[0-9]+\.[0-9]+\.[0-9]+(-[^[:space:]]+)?)$ ]]; then
    echo "Usage: $0 [stable|latest|VERSION]" >&2
    exit 1
fi

GCS_BUCKET="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"
DOWNLOAD_DIR="$HOME/.claude/downloads"

# Check for required dependencies
DOWNLOADER=""
if command -v curl >/dev/null 2>&1; then
    DOWNLOADER="curl"
elif command -v wget >/dev/null 2>&1; then
    DOWNLOADER="wget"
else
    echo "Either curl or wget is required but neither is installed" >&2
    exit 1
fi

# Check if jq is available (optional)
HAS_JQ=false
if command -v jq >/dev/null 2>&1; then
    HAS_JQ=true
fi

# Download function that works with both curl and wget
download_file() {
    local url="$1"
    local output="$2"
    
    if [ "$DOWNLOADER" = "curl" ]; then
        if [ -n "$output" ]; then
            curl -fsSL -o "$output" "$url"
        else
            curl -fsSL "$url"
        fi
    elif [ "$DOWNLOADER" = "wget" ]; then
        if [ -n "$output" ]; then
            wget -q -O "$output" "$url"
        else
            wget -q -O - "$url"
        fi
    else
        return 1
    fi
}

# Simple JSON parser for extracting checksum when jq is not available
get_checksum_from_manifest() {
    local json="$1"
    local platform="$2"
    
    # Normalize JSON to single line and extract checksum
    json=$(echo "$json" | tr -d '\n\r\t' | sed 's/ \+/ /g')
    
    # Extract checksum for platform using bash regex
    if [[ $json =~ \"$platform\"[^}]*\"checksum\"[[:space:]]*:[[:space:]]*\"([a-f0-9]{64})\" ]]; then
        echo "${BASH_REMATCH[1]}"
        return 0
    fi
    
    return 1
}

# Detect platform
case "$(uname -s)" in
    Darwin) os="darwin" ;;
    Linux) os="linux" ;;
    *) echo "Windows is not supported" >&2; exit 1 ;;
esac

case "$(uname -m)" in
    x86_64|amd64) arch="x64" ;;
    arm64|aarch64) arch="arm64" ;;
    *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac

# Check for musl on Linux and adjust platform accordingly
if [ "$os" = "linux" ]; then
    if [ -f /lib/libc.musl-x86_64.so.1 ] || [ -f /lib/libc.musl-aarch64.so.1 ] || ldd /bin/ls 2>&1 | grep -q musl; then
        platform="linux-${arch}-musl"
    else
        platform="linux-${arch}"
    fi
else
    platform="${os}-${arch}"
fi
mkdir -p "$DOWNLOAD_DIR"

# Always download latest version (which has the most up-to-date installer)
version=$(download_file "$GCS_BUCKET/latest")

# Download manifest and extract checksum
manifest_json=$(download_file "$GCS_BUCKET/$version/manifest.json")

# Use jq if available, otherwise fall back to pure bash parsing
if [ "$HAS_JQ" = true ]; then
    checksum=$(echo "$manifest_json" | jq -r ".platforms[\"$platform\"].checksum // empty")
else
    checksum=$(get_checksum_from_manifest "$manifest_json" "$platform")
fi

# Validate checksum format (SHA256 = 64 hex characters)
if [ -z "$checksum" ] || [[ ! "$checksum" =~ ^[a-f0-9]{64}$ ]]; then
    echo "Platform $platform not found in manifest" >&2
    exit 1
fi

# Download and verify
binary_path="$DOWNLOAD_DIR/claude-$version-$platform"
if ! download_file "$GCS_BUCKET/$version/$platform/claude" "$binary_path"; then
    echo "Download failed" >&2
    rm -f "$binary_path"
    exit 1
fi

# Pick the right checksum tool
if [ "$os" = "darwin" ]; then
    actual=$(shasum -a 256 "$binary_path" | cut -d' ' -f1)
else
    actual=$(sha256sum "$binary_path" | cut -d' ' -f1)
fi

if [ "$actual" != "$checksum" ]; then
    echo "Checksum verification failed" >&2
    rm -f "$binary_path"
    exit 1
fi

chmod +x "$binary_path"

# Run claude install to set up launcher and shell integration
echo "Setting up Claude Code"
"$binary_path" install ${TARGET:+"$TARGET"}

# Clean up downloaded file
rm -f "$binary_path"

echo ""
echo "�� Installation complete!"
echo ""

申请api key

https://0011.ai/i/NGRRWNT4

配置Claude code

# 当前终端
ANTHROPIC_BASE_URL = "https://aicoding.2233.ai"
ANTHROPIC_API_KEY = "你的 API Key"
ANTHROPIC_AUTH_TOKEN = "你的 API Key"

# 复制 Shell 命令
# 永久设置(~/.zshrc)
export ANTHROPIC_BASE_URL="https://aicoding.2233.ai"
export ANTHROPIC_API_KEY="你的 API Key"
export ANTHROPIC_AUTH_TOKEN="你的 API Key"
source ~/.zshrc

运行

在命令行切换到项目根目录,运行claude

posted @ 2026-01-24 12:22 paulwong 阅读(43) | 评论 (0)编辑 收藏

2026年1月6日 #

生成城市图片的提示词

提示词1:
帮我生成图片:一张针对 [上海] 的城市渲染数字艺术海报。
画面核心主体是一个漂浮在白云上方、形状像所选城市的并且占据画面大部分内容的微型岛屿。岛屿的形状与城市在地图上的形状相似,无缝融合城市独特的标志性地标、自然景观及文化元素。加入城市特有的鸟类、电影般的光影、鲜艳色彩、航拍视角和阳光反射效果,建筑不宜太多太密集。
岛屿展现历史与现代的无缝融合。一部分是该城市最具代表性的古代历史建筑;另一部分平滑过渡为城市的地标建筑和天际线景观。
岛屿漂浮浩瀚云海之上。云海采用该城市所在文化圈的传统艺术风格进行表现。
立体城市拼音或英文名的 3D 文字漂浮在微型岛屿的上方,这组文字像一个生态与文化共生的微缩生态装置。
在画面四周和主体周围,叠加一层极简、高雅、具有博物馆展板质感的信息排版层。主要检索相关的城市信息,主要信息使用经典的衬线字体,辅助数据可使用极细的极简无衬线体。在画面的角落,以类似古典地图集或高级杂志扉页的方式排版。用衬线体标注城市的地理坐标、别称或建城年份,以及当前的天气,作为装饰性的背景信息,整体排版留白极多,排版克制、干净、平衡,如同在欣赏一件珍贵的艺术品。
https://mp.weixin.qq.com/s/GqUcajzlA4dWYGJgaWBkCA


提示词2:
一张针对 [城市名称,例如:成都 Chengdu] 的城市渲染数字艺术海报。 画面核心主体是一个漂浮在白云上方、形状像所选城市的并且占据画面大部分内容的微型岛屿。岛屿的形状与城市在地图上的形状相似,无缝融合城市独特的标志性地标、自然景观及文化元素。加入城市特有的鸟类、电影般的光影、鲜艳色彩、航拍视角和阳光反射效果,建筑不宜太多太密集。 岛屿展现历史与现代的无缝融合。一部分是该城市最具代表性的古代历史建筑;另一部分平滑过渡为城市的地标建筑和天际线景观。岛屿漂浮浩瀚云海之上。云海采用该城市所在文化圈的传统艺术风格进行表现。 立体城市拼音或英文名的 3D 文字漂浮在微型岛屿的上方,这组文字像一个生态与文化共生的微缩生态装置。 在画面四周和主体周围,叠加一层极简、高雅、具有博物馆展板质感的信息排版层。主要检索相关的城市信息,主要信息使用经典的衬线字体,辅助数据可使用极细的极简无衬线体。在画面的角落,以类似古典地图集或高级杂志扉页的方式排版。用衬线体标注城市的地理坐标、别称或建城年份,以及当前的天气,排版克制、干净、平衡。 风格要求: Octane Render, C4D, Isometric City, Micro World, Living Ecosystem, 8k Resolution. DreamWorks style, 3D modeling, delicate, soft light projection. --ar 9:16 --v 6.0
https://mp.weixin.qq.com/s/U9zeuB8cJ7ZuEz91jp9ReQ?from=groupmessage&scene=1&subscene=10000&clicktime=1767657795&enterid=1767657795&sessionid=0&ascene=1&fasttmpl_type=4&fasttmpl_fullversion=8071695-zh_CN-zip&fasttmpl_flag=0&realreporttime=1767657795426

posted @ 2026-01-06 08:59 paulwong 阅读(34) | 评论 (0)编辑 收藏

2026年1月3日 #

AI应用资源

https://www.zhujunyue.com/hangye/#0



posted @ 2026-01-03 11:21 paulwong 阅读(15) | 评论 (0)编辑 收藏

仅列出标题  下一页