Skip to main content

fp-webui — 五块卵石 Web 界面

PyPI Python License

简介

fp-webui 是五块卵石(Five Pebbles)Agent 框架的 Web 图形界面。基于 FastAPI + Uvicorn 构建,提供浏览器端的 Agent 交互体验,支持实时流式对话、会话管理、配置调整等。

通过 pip install fp-agent[webui]pip install fp-webui 安装。


特性

  • 浏览器端对话 — 现代化的 Web 聊天界面,无需安装终端
  • 流式响应 — Server-Sent Events (SSE) 实时推送 LLM 输出
  • 多会话管理 — 创建/切换/删除会话,历史记录永久保存
  • Markdown 渲染 — 代码语法高亮、表格、数学公式完美展示
  • 深色/浅色主题 — 一键切换,护眼模式
  • 配置面板 — 浏览器内调整 LLM 参数、切换模型
  • 文件上传 — 支持拖拽上传文件作为上下文

安装

pip install fp-webui

要求 Python >= 3.11。


快速启动

命令行启动

fp-webui

或使用主包:

pip install fp-agent[webui]
fp --webui

指定主机和端口

fp-webui --host 0.0.0.0 --port 8080

启动输出

╭─ Five Pebbles WebUI ─────────────────────╮
│                                           │
│  地址: http://localhost:7860              │
│  共享: http://192.168.1.100:7860          │
│                                           │
│  按 Ctrl+C 停止服务                       │
╰───────────────────────────────────────────╯

访问界面

打开浏览器访问 http://localhost:7860

┌─────────────────────────────────────────┐
│  🤖 五块卵石                    [⚙] [🌙] │
├─────────────────────────────────────────┤
│                                         │
│  ┌─────────────────────────────────┐   │
│  │ 你好!我是五块卵石,有什么可以    │   │
│  │ 帮你的?                        │   │
│  └─────────────────────────────────┘   │
│                                         │
│  ┌─────────────────────────────────┐   │
│  │ 请用 Python 写一个 Web 服务器   │   │
│  │ [发送]                         │   │
│  └─────────────────────────────────┘   │
│                                         │
│  [会话: default] [新建] [历史]          │
└─────────────────────────────────────────┘

API 接口(非 Web 页面场景)

fp-webui 同时暴露了 RESTful API,方便集成到其他前端或自动化工具中:

端点 方法 说明
/api/chat POST 发送消息并获取流式响应 (SSE)
/api/sessions GET 获取会话列表
/api/sessions POST 创建新会话
/api/sessions/{id} DELETE 删除会话
/api/config GET 获取当前配置
/api/config PUT 更新配置
/api/models GET 获取可用模型列表
/health GET 健康检查

调用示例

curl -N http://localhost:7860/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "你好", "session_id": "default", "stream": true}'

配置

通过命令行参数或环境变量配置:

# 命令行参数
fp-webui --host 127.0.0.1 --port 7860 --reload

# 环境变量
export FP_WEBUI_HOST=0.0.0.0
export FP_WEBUI_PORT=7860
export FP_WEBUI_THEME=dark
fp-webui

配置文件(YAML):

webui:
  host: "0.0.0.0"
  port: 7860
  theme: "dark"              # dark / light
  session_storage: "file"    # file / memory
  max_upload_size_mb: 10
  cors_origins: ["*"]

依赖

依赖 版本 用途
fp-core >= 0.1.0 Agent 核心引擎
fastapi >= 0.122.0 Web 框架
uvicorn >= 0.38.0 ASGI 服务器

许可

MIT © zpb

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fp_webui-0.1.10.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fp_webui-0.1.10-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file fp_webui-0.1.10.tar.gz.

File metadata

  • Download URL: fp_webui-0.1.10.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fp_webui-0.1.10.tar.gz
Algorithm Hash digest
SHA256 0c22be573b0cbb11331d9a74190ffdae0c4c726b80e5e32dd9ae88f731e401c2
MD5 64cc751b3b4744333659c2634a3df163
BLAKE2b-256 f03f2d3e063c2bc0c382e95523907872e62677d470fe28bf5e7af1a3ee5a8ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fp_webui-0.1.10.tar.gz:

Publisher: release.yml on zpb911km/fp-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fp_webui-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: fp_webui-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fp_webui-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 cdfe47b6afb41075d94c17ac41cbd268a909e839e755b99faa2aa9f058d581c3
MD5 ba8397e7fa620c18c19623c017eb0f6d
BLAKE2b-256 7cd691f9b3aa0224bfe11e65688b76a997299735684de62af3764e89c166941e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fp_webui-0.1.10-py3-none-any.whl:

Publisher: release.yml on zpb911km/fp-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

This release

0.1.10 This release

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page