docs: make Chinese README the default
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/a-ghorbani/pocketpal-ai) · [上游 README](https://github.com/a-ghorbani/pocketpal-ai/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="src/assets/pocketpal-dark-v2.png" alt="PocketPal AI logo" width="120" />
|
||||
|
||||
# PocketPal AI
|
||||
|
||||
**A private AI assistant that runs entirely on your phone.**
|
||||
**一款完全在手机上运行的私人 AI 助手。**
|
||||
|
||||
Chat with language models, give them a voice, and let them use tools — all on-device. No account, no cloud, no internet required.
|
||||
与语言模型聊天、为它们赋予语音,并让它们使用工具 —— 全部在设备本地完成。无需账号、无需云端、无需联网。
|
||||
|
||||
<a href="https://pocketpal.dev/"><strong>pocketpal.dev</strong></a> ·
|
||||
<a href="#get-the-app">Get the app</a> ·
|
||||
<a href="https://pocketpal.dev/leaderboard">Leaderboard</a> ·
|
||||
<a href="#get-the-app">获取应用</a> ·
|
||||
<a href="https://pocketpal.dev/leaderboard">排行榜</a> ·
|
||||
<a href="https://palshub.ai/">PalsHub</a> ·
|
||||
<a href="https://github.com/a-ghorbani/pocketpal-ai/discussions">Discussions</a>
|
||||
<a href="https://github.com/a-ghorbani/pocketpal-ai/discussions">讨论区</a>
|
||||
|
||||
<br/>
|
||||
|
||||
@@ -29,163 +35,163 @@ Chat with language models, give them a voice, and let them use tools — all on-
|
||||
|
||||
---
|
||||
|
||||
## Why PocketPal AI?
|
||||
## 为什么选择 PocketPal AI?
|
||||
|
||||
Most AI apps are a thin window onto someone else's server — every message you type gets shipped off, logged, and analyzed somewhere you can't see. PocketPal flips that around: **the AI lives on your phone, and your conversations never leave it.**
|
||||
大多数 AI 应用只是别人服务器上的一层薄窗口 —— 你输入的每条消息都会被发送到你看不到的地方,被记录和分析。PocketPal 颠覆了这一模式:**AI 运行在你的手机上,你的对话永远不会离开设备。**
|
||||
|
||||
- **🔒 Private by default** — every prompt, response, and document stays on your device. Nothing is uploaded or stored on external servers.
|
||||
- **✈️ Works offline** — download a model once and it just works, with no connection and no account. On a plane, on a trail, anywhere.
|
||||
- **📱 Runs on hardware you already own** — real language models, voices, and tools, tuned to make the most of your phone's CPU, GPU, and NPU.
|
||||
- **🆓 Free and open source** — no subscription, no "pro" tier to unlock the AI. MIT-licensed and built in the open.
|
||||
- **🔒 默认私密** —— 每条提示词、回复和文档都保留在你的设备上。不会上传到外部服务器,也不会存储在外部服务器上。
|
||||
- **✈️ 离线可用** —— 下载一次模型即可使用,无需连接网络,也无需账号。在飞机上、在徒步小径上,任何地方都行。
|
||||
- **📱 在你已有的硬件上运行** —— 真正的语言模型、语音和工具,针对你手机的 CPU、GPU 和 NPU 进行优化,充分发挥硬件潜力。
|
||||
- **🆓 免费且开源** —— 无需订阅,也没有需要解锁 AI 的「专业版」层级。采用 MIT 许可证,在开放环境中构建。
|
||||
|
||||
> **Privacy note:** The only data that ever leaves your device is what you explicitly choose to share — benchmark results (if you opt into the leaderboard) and feedback you submit through the app.
|
||||
> **隐私说明:** 唯一会离开设备的数据,是你明确选择分享的内容 —— 基准测试结果(如果你选择加入排行榜)以及通过应用提交的反馈。
|
||||
|
||||
## Contents
|
||||
## 目录
|
||||
|
||||
- [Features](#features)
|
||||
- [Get the app](#get-the-app)
|
||||
- [How it works](#how-it-works)
|
||||
- [Using the app](#using-the-app)
|
||||
- [For developers](#for-developers)
|
||||
- [Contributing](#contributing)
|
||||
- [Roadmap](#roadmap)
|
||||
- [Community & support](#community--support)
|
||||
- [License](#license)
|
||||
- [功能](#features)
|
||||
- [获取应用](#get-the-app)
|
||||
- [工作原理](#how-it-works)
|
||||
- [使用应用](#using-the-app)
|
||||
- [面向开发者](#for-developers)
|
||||
- [参与贡献](#contributing)
|
||||
- [路线图](#roadmap)
|
||||
- [社区与支持](#community--support)
|
||||
- [许可证](#license)
|
||||
|
||||
## Features
|
||||
## 功能
|
||||
|
||||
- **🧠 On-device chat** — run GGUF language models (Gemma, Qwen, Phi, Llama, and more) fully offline.
|
||||
- **🗣️ Text-to-speech** — give your assistant a voice with on-device neural TTS (Kokoro and other engines), no cloud calls.
|
||||
- **🎭 Pals** — create personalized assistants with their own model, system prompt, and personality (Assistant and Roleplay types).
|
||||
- **🛍️ [PalsHub](https://palshub.ai/)** — discover and install community Pals, including premium ones via in-app checkout.
|
||||
- **🛠️ Talents & tools** — let capable Pals call built-in tools (calculator, date/time, rich HTML rendering) inside a tool-use loop.
|
||||
- **📥 Hugging Face integration** — search and download GGUF models, including gated ones, directly from the HF Hub with your access token.
|
||||
- **📊 Benchmarking** — measure tokens/sec and memory, and optionally compare on the [AI Phone Leaderboard](https://pocketpal.dev/leaderboard).
|
||||
- **⚡ Hardware acceleration** — CPU, GPU (Metal on iOS, OpenCL/Adreno on Android), and NPU (Qualcomm Hexagon) inference paths, with graceful fallback.
|
||||
- **🌍 Localized** — available in 11 languages, on phones and tablets, including full iPad support.
|
||||
- **🧠 设备端聊天** —— 完全离线运行 GGUF 语言模型(Gemma、Qwen、Phi、Llama 等)。
|
||||
- **🗣️ 文本转语音(Text-to-speech)** —— 通过设备端神经 TTS(Kokoro 及其他引擎)为你的助手赋予语音,无需云端调用。
|
||||
- **🎭 Pals** —— 创建个性化助手,拥有各自的模型、系统提示词和个性(Assistant 与 Roleplay 类型)。
|
||||
- **🛍️ [PalsHub](https://palshub.ai/)**** —— 发现并安装社区 Pals,包括通过应用内结账购买的优质 Pals。
|
||||
- **🛠️ Talents 与工具** —— 让能力强的 Pals 在工具调用循环中调用内置工具(计算器、日期/时间、富 HTML 渲染)。
|
||||
- **📥 Hugging Face 集成** —— 直接从 HF Hub 搜索并下载 GGUF 模型(包括受限模型),使用你的访问令牌(access token)。
|
||||
- **📊 基准测试** —— 测量 tokens/sec 和内存占用,并可选择在 [AI Phone Leaderboard](https://pocketpal.dev/leaderboard). 上进行对比。
|
||||
- **⚡ 硬件加速** —— CPU、GPU(iOS 上的 Metal、Android 上的 OpenCL/Adreno)和 NPU(Qualcomm Hexagon)推理路径,并具备优雅降级。
|
||||
- **🌍 本地化** —— 支持 11 种语言,适用于手机和平板,包括完整的 iPad 支持。
|
||||
|
||||
## Get the app
|
||||
## 获取应用
|
||||
|
||||
| Platform | |
|
||||
| 平台 | |
|
||||
| --- | --- |
|
||||
| **iOS / iPadOS** | [](https://apps.apple.com/us/app/pocketpal-ai/id6502579498) |
|
||||
| **Android** | [](https://play.google.com/store/apps/details?id=com.pocketpalai) |
|
||||
|
||||
**Three steps to your first chat:**
|
||||
**开启首次聊天的三个步骤:**
|
||||
|
||||
1. **Install** PocketPal from the App Store or Google Play.
|
||||
2. **Download a model** — tap the menu (☰) → **Models**, pick one that fits your phone, and download (or add one from Hugging Face).
|
||||
3. **Load it and start chatting** — that's it, you're running AI fully offline.
|
||||
1. **安装** —— 从 App Store 或 Google Play 安装 PocketPal。
|
||||
2. **下载模型** —— 点击菜单(☰)→ **Models**,选择适合你手机的模型并下载(或从 Hugging Face 添加一个)。
|
||||
3. **加载并开始聊天** —— 就这么简单,你已在完全离线状态下运行 AI。
|
||||
|
||||
## How it works
|
||||
## 工作原理
|
||||
|
||||
You don't need to know any of this to use PocketPal — but if you're curious how a phone runs real AI offline, here's the short version.
|
||||
使用 PocketPal 无需了解这些 —— 但如果你好奇手机如何离线运行真正的 AI,这里是简要说明。
|
||||
|
||||
PocketPal is a four-layer stack, from the silicon up to the chat UI. Each layer has one job, and the dependency direction is strictly top-down — the JS app talks to native bridges, bridges talk to inference engines, engines target hardware backends.
|
||||
PocketPal 是一个四层技术栈,从芯片到聊天 UI 逐层构建。每一层各司其职,依赖方向严格自上而下 —— JS 应用与原生桥接层通信,桥接层与推理引擎通信,引擎面向硬件后端。
|
||||
|
||||
<div align="center">
|
||||
<img src="assets/images and logos/stack-diagram-dark.png" alt="PocketPal AI on-device stack — UI & Tool Use → Bridging → Engine → Hardware" width="100%">
|
||||
</div>
|
||||
|
||||
| Layer | What runs here |
|
||||
| 层级 | 运行内容 |
|
||||
| --- | --- |
|
||||
| **UI & Tool Use** | The React Native app (UI via React Native Paper, state via MobX, chat history in WatermelonDB). The **`AgentRunner`** drives each chat turn — streaming tokens, dispatching **Talents** (tools) when the model calls them, and feeding results back for follow-up reasoning. **Pals** are configurable personas; **PalsHub** is the in-app marketplace for sharing and buying them. |
|
||||
| **Bridging** | Native modules that connect JavaScript to the engines. [`llama.rn`](https://github.com/mybigday/llama.rn) bridges LLM inference over JSI; [`react-native-speech`](https://github.com/a-ghorbani/react-native-speech) and `onnxruntime-react-native` bridge text-to-speech. |
|
||||
| **Engine** | The inference engines. **llama.cpp** runs language models in the quantized **GGUF** format. **ONNX Runtime** runs TTS voice models in the **ONNX** format. |
|
||||
| **Hardware** | Where the math actually happens. PocketPal targets **CPU** (universal fallback), **GPU** (Metal on iOS, OpenCL on Qualcomm Adreno for Android), and **NPU** (Qualcomm Hexagon) — falling back gracefully and offloading partial layers when a full backend isn't available. |
|
||||
| **UI & Tool Use** | React Native 应用(UI 使用 React Native Paper,状态管理使用 MobX,聊天历史存储在 WatermelonDB)。**`AgentRunner`** 驱动每一轮聊天 —— 流式输出 token、在模型调用时调度 **Talents**(工具),并将结果反馈以进行后续推理。**Pals** 是可配置的角色;**PalsHub** 是应用内用于分享和购买 Pals 的市场。 |
|
||||
| **Bridging** | 将 JavaScript 连接到引擎的原生模块。[`llama.rn`](https://github.com/mybigday/llama.rn) 通过 JSI 桥接 LLM 推理;[`react-native-speech`](https://github.com/a-ghorbani/react-native-speech) 和 `onnxruntime-react-native` 桥接文本转语音。 |
|
||||
| **Engine** | 推理引擎。**llama.cpp** 以量化 **GGUF** 格式运行语言模型。**ONNX Runtime** 以 **ONNX** 格式运行 TTS 语音模型。 |
|
||||
| **Hardware** | 实际进行数学运算的地方。PocketPal 面向 **CPU**(通用降级方案)、**GPU**(iOS 上的 Metal、Android 上 Qualcomm Adreno 的 OpenCL)和 **NPU**(Qualcomm Hexagon)—— 在完整后端不可用时优雅降级,并卸载部分层。 |
|
||||
|
||||
## Using the app
|
||||
## 使用应用
|
||||
|
||||
<details>
|
||||
<summary><strong>📥 Download & load a model</strong></summary>
|
||||
<summary><strong>📥 下载并加载模型</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
1. Open the app and tap the **Menu** (☰), then go to **Models**.
|
||||
2. Pick a model from the list and tap **Download**, or tap **+** to add one from Hugging Face or local storage.
|
||||
3. From Hugging Face, search GGUF models and choose a quantization that fits your device's memory and storage — download now or bookmark for later.
|
||||
4. After downloading, tap **Load** (or use the chevron icon left of the chat input to load right from the chat screen).
|
||||
1. 打开应用,点击 **Menu**(☰),然后进入 **Models**。
|
||||
2. 从列表中选择一个模型并点击 **Download**,或点击 **+** 从 Hugging Face 或本地存储添加一个。
|
||||
3. 在 Hugging Face 中搜索 GGUF 模型,选择适合你设备内存和存储的量化版本 —— 立即下载或稍后收藏。
|
||||
4. 下载完成后,点击 **Load**(或使用聊天输入框左侧的 chevron 图标,直接从聊天界面加载)。
|
||||
|
||||
<img src="assets/images and logos/Download_models.png" alt="Download Models" width="100%">
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>💬 Chat</strong></summary>
|
||||
<summary><strong>💬 聊天</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
1. Make sure a model is loaded.
|
||||
2. Open the **Chat** page and start talking.
|
||||
3. The screen stays awake during inference and deactivates when idle.
|
||||
4. **Copy** a full response with the copy icon, or long-press a paragraph to copy just that.
|
||||
5. **Edit** any of your messages with a long-press — the AI regenerates from your change. Hit **retry** for a fresh answer, optionally with a different model.
|
||||
1. 确保已加载模型。
|
||||
2. 打开 **Chat** 页面并开始对话。
|
||||
3. 推理期间屏幕保持常亮,空闲时自动关闭。
|
||||
4. 使用复制图标 **Copy** 复制完整回复,或长按某段文字仅复制该段。
|
||||
5. 长按可 **Edit** 编辑你的任意消息 —— AI 会从你的修改处重新生成。点击 **retry** 获取全新回答,也可选择不同模型。
|
||||
|
||||
<img src="assets/images and logos/Chat.png" alt="Chat" width="83%">
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>🎭 Pals & PalsHub</strong></summary>
|
||||
<summary><strong>🎭 Pals 与 PalsHub</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
Create personalized assistants:
|
||||
- **Assistant Pal** — pick a default model, set a system prompt (write it yourself or have the app generate one), and customize the chat input color.
|
||||
- **Roleplay Pal** — everything above, plus location, the AI's role, and other contextual parameters.
|
||||
创建个性化助手:
|
||||
- **Assistant Pal** —— 选择默认模型,设置系统提示词(自行编写或让应用生成),并自定义聊天输入框颜色。
|
||||
- **Roleplay Pal** —— 包含上述全部功能,另加地点、AI 角色及其他上下文参数。
|
||||
|
||||
Switch personas with the Pal picker on the chat page. Browse **[PalsHub](https://palshub.ai/)** in-app to discover community Pals, including premium ones via in-app checkout (US iOS & Android).
|
||||
在聊天页面使用 Pal 选择器切换角色(Persona)。在应用内浏览 **[PalsHub](https://palshub.ai/)****,发现社区 Pal,包括通过应用内购买(in-app checkout)获取的高级版(美国 iOS 和 Android)。
|
||||
|
||||
<img src="assets/images and logos/Pals.png" alt="Assistant Pal" width="100%">
|
||||
<p><em>Creating a cocktail-recipe assistant</em></p>
|
||||
<p><em>正在创建鸡尾酒配方助手</em></p>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>📊 Benchmark your device</strong></summary>
|
||||
<summary><strong>📊 为你的设备跑分</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
1. Open the **Benchmark** page.
|
||||
2. Run performance tests to compare speed and efficiency across models.
|
||||
3. Review tokens/sec and memory usage.
|
||||
4. Optionally share your results to the [AI Phone Leaderboard](https://pocketpal.dev/leaderboard).
|
||||
1. 打开 **Benchmark** 页面。
|
||||
2. 运行性能测试,比较不同模型的速度与效率。
|
||||
3. 查看 tokens/sec 和内存占用。
|
||||
4. 可选:将结果分享到 [AI Phone Leaderboard](https://pocketpal.dev/leaderboard).
|
||||
|
||||
<img src="assets/images and logos/Benchmark.png" alt="Benchmark" width="100%">
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>🔑 Set up a Hugging Face token (for gated models)</strong></summary>
|
||||
<summary><strong>🔑 设置 Hugging Face 令牌(用于受限模型)</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
1. Create an access token in your Hugging Face account ([docs](https://huggingface.co/docs/hub/en/security-tokens)).
|
||||
2. In PocketPal, go to **Settings → Set Token**, paste it, and save.
|
||||
1. 在你的 Hugging Face 账户中创建访问令牌([文档](https://huggingface.co/docs/hub/en/security-tokens)).
|
||||
2. 在 PocketPal 中,前往 **Settings → Set Token**,粘贴并保存。
|
||||
|
||||
<img src="assets/images and logos/Token_in_pocketpal.png" alt="Token setup" width="66%">
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>💌 Send feedback</strong></summary>
|
||||
<summary><strong>💌 发送反馈</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
Go to **App Info → "Sharing your thoughts"**, type your feedback — feature requests, suggestions, anything — and submit.
|
||||
前往 **App Info → "Sharing your thoughts"**,输入你的反馈——功能请求、建议,任何内容——然后提交。
|
||||
|
||||
<img src="assets/images and logos/Send_Feedback.png" alt="Send feedback" width="50%">
|
||||
</details>
|
||||
|
||||
## For developers
|
||||
## 面向开发者
|
||||
|
||||
PocketPal is a standard React Native app. If you can build a React Native project, you can build PocketPal.
|
||||
PocketPal 是一个标准的 React Native 应用。如果你能构建 React Native 项目,你就能构建 PocketPal。
|
||||
|
||||
### Prerequisites
|
||||
### 前置要求
|
||||
|
||||
- **Node.js** — version is pinned in [`.nvmrc`](.nvmrc) (currently `22.21.0`); run `nvm use` to match it. Older Node will fail the `engines` check.
|
||||
- **Yarn 1 (Classic)** — `packageManager` is pinned to `yarn@1.22.22`.
|
||||
- **Xcode** + **CocoaPods**, and **Ruby + Bundler** (for iOS / Fastlane tooling).
|
||||
- **Android Studio** + Android SDK/NDK.
|
||||
- **Node.js** — 版本固定在 [`.nvmrc`](.nvmrc)(当前为 `22.21.0`);运行 `nvm use` 以匹配该版本。较旧的 Node 版本将无法通过 `engines` 检查。
|
||||
- **Yarn 1 (Classic)** — `packageManager` 固定为 `yarn@1.22.22`。
|
||||
- **Xcode** + **CocoaPods**,以及 **Ruby + Bundler**(用于 iOS / Fastlane 工具链)。
|
||||
- **Android Studio** + Android SDK/NDK。
|
||||
|
||||
See the [React Native environment setup](https://reactnative.dev/docs/set-up-your-environment) for platform details.
|
||||
平台相关细节请参阅 [React Native 环境配置](https://reactnative.dev/docs/set-up-your-environment)。
|
||||
|
||||
### Clone, install & run
|
||||
### 克隆、安装与运行
|
||||
|
||||
```bash
|
||||
git clone https://github.com/a-ghorbani/pocketpal-ai
|
||||
@@ -200,11 +206,11 @@ yarn ios # build + run on iOS simulator
|
||||
yarn android # build + run on Android emulator
|
||||
```
|
||||
|
||||
Core on-device chat works without any backend keys; only PalsHub/auth features need additional configuration.
|
||||
核心端侧聊天无需任何后端密钥;仅 PalsHub/认证相关功能需要额外配置。
|
||||
|
||||
> **Native-change rule:** if you change `package.json`, a native module, `ios/`, `android/`, the Podfile, or `build.gradle`, re-run `pod install` and rebuild both platforms — a JS reload won't pick up native changes.
|
||||
> **原生代码变更规则:** 如果你修改了 `package.json`、某个原生模块、`ios/`、`android/`、Podfile 或 `build.gradle`,请重新运行 `pod install` 并在两个平台上重新构建——仅 JS 热重载无法应用原生变更。
|
||||
|
||||
### Quality gates
|
||||
### 质量门禁
|
||||
|
||||
```bash
|
||||
yarn lint # ESLint
|
||||
@@ -213,10 +219,10 @@ yarn test # Jest
|
||||
yarn l10n:validate # validate locale JSON (placeholders, integrity)
|
||||
```
|
||||
|
||||
Run `yarn lint && yarn typecheck && yarn test` before opening a PR. Commits are validated by Commitlint ([Conventional Commits](https://www.conventionalcommits.org/)) via a Husky hook.
|
||||
在提交 PR 之前运行 `yarn lint && yarn typecheck && yarn test`。提交信息由 Commitlint([Conventional Commits](https://www.conventionalcommits.org/)))通过 Husky 钩子进行校验。
|
||||
|
||||
<details>
|
||||
<summary><strong>Repository layout</strong></summary>
|
||||
<summary><strong>仓库结构</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
@@ -239,91 +245,91 @@ src/
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Tech stack</strong></summary>
|
||||
<summary><strong>技术栈</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
Versions are pinned in [`package.json`](package.json); the highlights:
|
||||
版本固定在 [`package.json`](package.json);要点如下:
|
||||
|
||||
| Area | Choice |
|
||||
| 领域 | 选择 |
|
||||
| --- | --- |
|
||||
| Framework | React Native `0.82.1`, React `19.1.1` (New Architecture) |
|
||||
| Language | TypeScript `5.0.4` |
|
||||
| UI | React Native Paper `5.14.5`, React Navigation |
|
||||
| State | MobX `6` (`mobx`, `mobx-react`, `mobx-persist-store`) |
|
||||
| Persistence | WatermelonDB (chat history), AsyncStorage (settings), Keychain (secrets) |
|
||||
| 框架 | React Native `0.82.1`,React `19.1.1`(New Architecture) |
|
||||
| 语言 | TypeScript `5.0.4` |
|
||||
| UI | React Native Paper `5.14.5`,React Navigation |
|
||||
| 状态 | MobX `6`(`mobx`、`mobx-react`、`mobx-persist-store`) |
|
||||
| 持久化 | WatermelonDB(聊天历史)、AsyncStorage(设置)、Keychain(密钥) |
|
||||
| LLM | `llama.rn` `0.12.4` → llama.cpp · GGUF |
|
||||
| TTS | `react-native-speech` `2.3.1` + `onnxruntime-react-native` `1.23.2` · ONNX |
|
||||
| Tooling | Yarn 1 (Classic), ESLint, Prettier, Jest, Husky + Commitlint |
|
||||
| 工具链 | Yarn 1 (Classic)、ESLint、Prettier、Jest、Husky + Commitlint |
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Extending PocketPal</strong></summary>
|
||||
<summary><strong>扩展 PocketPal</strong></summary>
|
||||
|
||||
<br/>
|
||||
|
||||
A **Talent** is a tool the model can call mid-conversation. Engines are registered in a `TalentRegistry`, exposed to the model as tool schemas; the `AgentRunner` detects a call, runs the engine, and returns the result for the next turn.
|
||||
**Talent** 是模型在对话过程中可调用的工具。引擎在 `TalentRegistry` 中注册,并以工具模式(tool schema)暴露给模型;`AgentRunner` 检测到调用后执行引擎,并将结果返回给下一轮对话。
|
||||
|
||||
| Talent | Engine | Does |
|
||||
| Talent | 引擎 | 功能 |
|
||||
| --- | --- | --- |
|
||||
| `calculate` | `CalculateEngine` | Arithmetic / expression evaluation |
|
||||
| `datetime` | `DatetimeEngine` | Current date / time |
|
||||
| `render_html` | `RenderHtmlEngine` | Renders model-produced HTML in chat |
|
||||
| `calculate` | `CalculateEngine` | 算术 / 表达式求值 |
|
||||
| `datetime` | `DatetimeEngine` | 当前日期 / 时间 |
|
||||
| `render_html` | `RenderHtmlEngine` | 在聊天中渲染模型生成的 HTML |
|
||||
|
||||
Good first contributions:
|
||||
- A new **Talent** — implement a `TalentEngine` and register it in `src/services/talents/`.
|
||||
- A new **TTS engine** — add it under `src/services/tts/engines/`.
|
||||
- A new **locale** — add a JSON file in `src/locales/` (or translate on [Weblate](https://hosted.weblate.org/projects/pocketpal-ai/)).
|
||||
适合首次贡献的方向:
|
||||
- 新增 **Talent** — 实现一个 `TalentEngine` 并在 `src/services/talents/` 中注册。
|
||||
- 新增 **TTS 引擎** — 在 `src/services/tts/engines/` 下添加。
|
||||
- 新增 **语言区域** — 在 `src/locales/` 中添加 JSON 文件(或在 [Weblate](https://hosted.weblate.org/projects/pocketpal-ai/)). 上翻译)。
|
||||
|
||||
</details>
|
||||
|
||||
## Contributing
|
||||
## 参与贡献
|
||||
|
||||
Contributions are welcome — bug reports, fixes, features, translations, and docs all help.
|
||||
欢迎贡献——错误报告、修复、功能、翻译和文档都有帮助。
|
||||
|
||||
1. Fork and branch: `git checkout -b feature/your-feature-name`
|
||||
2. Make your changes; run on a device/emulator (`yarn ios` / `yarn android`). Re-run `pod install` + rebuild if you touched native code.
|
||||
3. Gate locally: `yarn lint && yarn typecheck && yarn test`
|
||||
4. Commit with [Conventional Commits](https://www.conventionalcommits.org/): `git commit -m "feat: add new talent"`
|
||||
5. Push and open a pull request.
|
||||
1. Fork 并创建分支:`git checkout -b feature/your-feature-name`
|
||||
2. 进行修改;在真机/模拟器上运行(`yarn ios` / `yarn android`)。如果涉及原生代码,请重新运行 `pod install` 并重新构建。
|
||||
3. 本地门禁:`yarn lint && yarn typecheck && yarn test`
|
||||
4. 使用 [Conventional Commits](https://www.conventionalcommits.org/): `git commit -m "feat: add new talent"` 规范提交。
|
||||
5. 推送并开启 pull request。
|
||||
|
||||
Please read the [Contributing Guidelines](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) first. Want to translate PocketPal into your language? Join us on [Weblate](https://hosted.weblate.org/projects/pocketpal-ai/).
|
||||
请先阅读 [Contributing Guidelines](CONTRIBUTING.md) 和 [Code of Conduct](CODE_OF_CONDUCT.md)。想将 PocketPal 翻译成你的语言?欢迎加入 [Weblate](https://hosted.weblate.org/projects/pocketpal-ai/).
|
||||
|
||||
## Roadmap
|
||||
## 路线图
|
||||
|
||||
- **Tool use expansion** — grow the Talents catalog and deepen the agentic loop so Pals can do more, fully on-device.
|
||||
- **工具调用扩展** — 扩充 Talents 目录并深化 agentic 循环,让 Pal 能在端侧完成更多任务。
|
||||
|
||||
Have an idea or found a bug? [Open an issue](https://github.com/a-ghorbani/pocketpal-ai/issues/new/choose) or start a [discussion](https://github.com/a-ghorbani/pocketpal-ai/discussions).
|
||||
有想法或发现了 bug?[提交 issue](https://github.com/a-ghorbani/pocketpal-ai/issues/new/choose) 或发起 [discussion](https://github.com/a-ghorbani/pocketpal-ai/discussions).
|
||||
|
||||
## Community & support
|
||||
## 社区与支持
|
||||
|
||||
- 💬 **Questions & ideas** — [GitHub Discussions](https://github.com/a-ghorbani/pocketpal-ai/discussions)
|
||||
- 🐛 **Bugs & requests** — [GitHub Issues](https://github.com/a-ghorbani/pocketpal-ai/issues/new/choose)
|
||||
- 🌐 **Website** — [pocketpal.dev](https://pocketpal.dev/)
|
||||
- ❤️ **Support development** — PocketPal is free and ad-free; [sponsoring](https://github.com/sponsors/a-ghorbani) helps keep it that way.
|
||||
- 💬 **问题与想法** — [GitHub Discussions](https://github.com/a-ghorbani/pocketpal-ai/discussions)
|
||||
- 🐛 **Bug 与功能请求** — [GitHub Issues](https://github.com/a-ghorbani/pocketpal-ai/issues/new/choose)
|
||||
- 🌐 **官网** — [pocketpal.dev](https://pocketpal.dev/)
|
||||
- ❤️ **支持开发** — PocketPal 免费且无广告;[赞助](https://github.com/sponsors/a-ghorbani) 有助于保持这一状态。
|
||||
|
||||
## License
|
||||
## 许可证
|
||||
|
||||
Licensed under the [MIT License](LICENSE).
|
||||
根据 [MIT License](LICENSE) 授权。
|
||||
|
||||
## Acknowledgements
|
||||
## 致谢
|
||||
|
||||
PocketPal AI stands on the shoulders of the open-source community, including:
|
||||
PocketPal AI 建立在开源社区的基础之上,包括:
|
||||
|
||||
- **[llama.cpp](https://github.com/ggerganov/llama.cpp)** — efficient on-device LLM inference.
|
||||
- **[llama.rn](https://github.com/mybigday/llama.rn)** — llama.cpp bindings for React Native.
|
||||
- **[react-native-speech](https://github.com/a-ghorbani/react-native-speech)** — React Native TTS bridge powering on-device voices.
|
||||
- **[ONNX Runtime](https://onnxruntime.ai/)** — cross-platform inference engine powering on-device TTS.
|
||||
- **[React Native](https://reactnative.dev/)**, **[MobX](https://mobx.js.org/)**, **[React Native Paper](https://callstack.github.io/react-native-paper/)**, **[React Navigation](https://reactnavigation.org/)**, **[WatermelonDB](https://github.com/Nozbe/WatermelonDB)**, and many other open-source libraries that make this project possible.
|
||||
- **[llama.cpp](https://github.com/ggerganov/llama.cpp)** — 高效的端侧 LLM 推理。
|
||||
- **[llama.rn](https://github.com/mybigday/llama.rn)** — 面向 React Native 的 llama.cpp 绑定。
|
||||
- **[react-native-speech](https://github.com/a-ghorbani/react-native-speech)** — 为端侧语音提供支持的 React Native TTS 桥接。
|
||||
- **[ONNX Runtime](https://onnxruntime.ai/)** — 为端侧 TTS 提供支持的跨平台推理引擎。
|
||||
- **[React Native](https://reactnative.dev/)**, **[MobX](https://mobx.js.org/)**, **[React Native Paper](https://callstack.github.io/react-native-paper/)**, **[React Navigation](https://reactnavigation.org/)**, **[WatermelonDB](https://github.com/Nozbe/WatermelonDB)**, 以及许多其他使本项目成为可能的开源库。
|
||||
|
||||
<div align="center">
|
||||
<br/>
|
||||
|
||||
Made with ❤️ for people who want AI that stays on their phone.
|
||||
用 ❤️ 为希望 AI 常驻手机的用户打造。
|
||||
|
||||
<br/>
|
||||
|
||||
<sub>If PocketPal is useful to you, consider giving it a ⭐ — it helps others find the project.</sub>
|
||||
<sub>如果 PocketPal 对你有帮助,不妨点个 ⭐ —— 这能帮助更多人发现该项目。</sub>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user