苹果私有计算云的开源实现
Open Source Implementation of Apple's Private Compute Cloud

原始链接: https://github.com/openpcc/openpcc

## OpenPCC:可证明隐私的AI推理 OpenPCC是一个开源框架,能够实现**可证明隐私的AI推理**,类似于苹果的Private Cloud Compute,但具有完全的透明度和自我托管能力。它允许用户使用AI模型——开源和定制模型——而无需泄露敏感数据,例如提示或输出。 隐私通过**加密流、硬件证明和不可链接的请求**来强制执行。OpenPCC旨在建立一个社区管理的AI数据隐私标准。 该项目提供了一个Go客户端和一个C库(Python和JavaScript客户端正在开发中),以及用于测试的内存服务。开发者可以使用提供的示例和配置选项轻松集成OpenPCC,并通过API密钥和定义的透明度策略连接到生产服务。 开发利用`mage`工具来运行测试和服务,提供简化的本地开发体验。更多详细信息请参阅[OpenPCC白皮书](https://github.com/openpcc/openpcc/blob/main/whitepaper/openpcc.pdf)。

## OpenPCC:开源私有计算云 这次Hacker News讨论围绕OpenPCC ([github.com/openpcc](https://github.com/openpcc)),这是一个受苹果私有计算云(PCC)启发,开源实现的方案。该项目旨在提供一个安全的计算环境,确保即使是基础设施提供商也无法访问输入数据或提示。 讨论的关键点包括提供的隐私保障——具体来说,虽然推理提供者*可以*访问明文,但其他方无法访问。有人提出了物理攻击可能破坏硬件安全的问题,回复强调了不可定向性功能以及对受信任执行环境(TEEs)的依赖。 对话还涉及实现真正“可证明”隐私的实用性,以及超越简单聊天机器人推理的潜在用例,例如匿名化来自可穿戴设备的数据。 核心争论在于OpenPCC是否是苹果PCC的真实实现,还是仅仅是受其概念*启发*的实现。该项目的Apache 2.0许可证和对透明度的承诺受到赞扬。
相关文章

原文

OpenPCC is an open-source framework for provably private AI inference, inspired by Apple’s Private Cloud Compute but fully open, auditable, and deployable on your own infrastructure. It allows anyone to run open or custom AI models without exposing prompts, outputs, or logs - enforcing privacy with encrypted streaming, hardware attestation, and unlinkable requests.

OpenPCC is designed to become a transparent, community-governed standard for AI data privacy.

Read the OpenPCC Whitepaper: https://github.com/openpcc/openpcc/blob/main/whitepaper/openpcc.pdf

This repo contains the code for an OpenPCC compliant go client as well as a c library that is used as the basis of python and javascript clients. In addition, it contains a number of in-memory services that can be used to exercise the client.

see cmd/test-client/main.go for a local dev example. To connect to a prod service, it would look something like this:

import (
    "context"
    "fmt"
    "net/http"
    "os"
    "strings"

    "github.com/openpcc/openpcc"
    "github.com/openpcc/openpcc/inttest"
    "github.com/openpcc/openpcc/transparency"
)

func makePCCRequest() error {
    ctx := context.Background()

    identityPolicy := transparency.IdentityPolicy{
		OIDCSubjectRegex: "^https://github.com/confidentsecurity/T/.github/workflows.*",
		OIDCIssuerRegex:  "https://token.actions.githubusercontent.com",
    }

    cfg := openpcc.DefaultConfig()
    cfg.APIURL = "https://app.confident.security"
    cfg.APIKey = "{Your API Key here}"
    cfg.TransparencyVerifier = transparency.DefaultVerifierConfig()
    cfg.TransparencyIdentityPolicy = &identityPolicy

    client, err := openpcc.NewFromConfig(ctx, cfg)
    if err != nil {
        return fmt.Errorf("failed to create openpcc client: %w", err)
    }

    // Inference requests use OpenAI API generate format
    body := "{\"model\":\"qwen3:1.7b\",\"prompt\":\"why is the sky blue?\"}"
    // nosemgrep: problem-based-packs.insecure-transport.go-stdlib.http-customized-request.http-customized-request
    req, err := http.NewRequest("POST", "http://confsec.invalid/v1/completions", strings.NewReader(body))
    if err != nil {
        return err
    }
    // add a tag to the request to route request to compute nodes that are running the specified model
    req.Header.Add("X-Confsec-Node-Tags", "qwen3:1.7b")

    resp, err := client.RoundTrip(req)
    if err != nil {
        return err
    }

    return nil
}

Dev commands are run using the go tool mage

you can run it just from the go.mod tool install with go tool mage [cmd], or you can install mage itself to save the key presses: go install github.com/magefile/mage@latest

mage will print a list of commands (see /magefiles/* for the source of the commands)

To exercise the library in development, use mage runMemServices to run all the in-memory OpenPCC services. Then use mage runClient to make a test request into the system.

联系我们 contact @ memedata.com