Skip to main content

AgentFly — AI Agent 客制化配置中心

统一管理多 AI Agent 配置,一键启动。

pip install agentfly

# 一键安装 Tab 补全
agentfly completion --install
source ~/.bashrc

快速开始

# 1. 添加 Provider(自动探测接口类型 + 拉取模型列表)
agentfly provider add deepseek --api-key '${DEEPSEEK_API_KEY}'

# 2. 测试所有模型(流式输出: 延迟 + TTFT + 吞吐)
agentfly test deepseek                              # Provider 所有模型
agentfly test deepseek deepseek-v4-pro              # 指定模型
agentfly test                                       # 全部 Provider
agentfly test deepseek -p 8 -t 15                   # 8 并发 + 15s 超时
agentfly test deepseek --refresh                    # 强制重探接口类型

# 3. 启动 AI Agent
agentfly launch claude                              # 默认配置
agentfly launch claude --provider deepseek          # 指定 Provider
agentfly launch claude --model deepseek-v4-pro      # 指定模型
agentfly launch claude --provider deepseek -- --continue  # 透传 Agent 参数

命令

命令 作用
agentfly launch 启动 AI Agent,自动注入环境变量
agentfly test 测试模型延迟 / TTFT / 吞吐
agentfly provider 管理服务提供商 (add/list/show/reload/remove)
agentfly doctor 配置健康检查
agentfly completion 安装命令补全 (--install 一键安装)

支持的 Agent

claude · cline · codex · droid · opencode · openclaw · pi

支持的 Provider

内置厂商(自动填 BASE_URL):

任意 OpenAI / Anthropic 兼容端点:

agentfly provider add --api-base http://10.0.0.1:3000 --api-key '${MY_KEY}'
agentfly provider add my-proxy --api-base http://10.0.0.1:3000 --models "model-a,model-b"

配置

# ~/.config/agentfly/config.yaml
providers:
  deepseek:
    name: deepseek
    api_key: ${DEEPSEEK_API_KEY}
    endpoints:
      openai: https://api.deepseek.com
      anthropic: https://api.deepseek.com/anthropic   # 不同接口可用不同 URL
    models:
      deepseek-v4-pro: ''
      deepseek-v4-flash: ''
    default_model: deepseek-v4-pro

  my-proxy:
    name: custom
    api_key: ${MY_KEY}
    endpoints:
      openai: https://my-gateway.com
      anthropic: https://my-gateway.com
    models:
      claude-opus-4-6: anthropic          # test 探测出的接口类型 (空=未探测)
      deepseek-chat: anthropic,openai      # 两个都通, 速度快的在前
      gpt-5.5: openai
    default_model: claude-opus-4-6

endpoints 是「api_type → Base URL」映射(openai/anthropic 可指向不同 URL)。 models 是「模型名 → api_type」映射:agentfly test 对每个模型探测所有已配接口 (anthropic 优先),把跑通的写回 api_type (多个用逗号分隔, 速度快的在前),Total/TTFT/TPS 显示最快接口。后续测试按缓存顺序探测;--refresh 清空缓存强制重探。

Agent 环境变量从 GitHub 远程配置自动获取,无需手动配置。 离线时使用包内默认配置降级。

安全

API Key 支持环境变量引用 ${VAR},禁止明文存储:

agentfly provider add deepseek --api-key '${DEEPSEEK_API_KEY}'

Metadata

Release files for agentfly 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentfly 0.7.2
File Size Uploaded
agentfly-0.7.2.tar.gz 48.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentfly 0.7.2
File Interpreter ABI Platform
agentfly-0.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 96.0 kB

Release files / agentfly-0.7.2.tar.gz

Download URL agentfly-0.7.2.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b46f11365145098ad13672848445d7799b6994b33d2b858c97bb751fd03c6aa0
BLAKE2b-256 checksum
How to use checksums
3d215340580af8e60089f43006ab6681b852227d6e8758f9bd2f537a96236334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release files / agentfly-0.7.2-py3-none-any.whl

Download URL agentfly-0.7.2-py3-none-any.whl
Size 47.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fa9f6262041261970bc3177fa7170473608343d33a0a2b8121ec469774af713
BLAKE2b-256 checksum
How to use checksums
98b9cdcc6bc7baa00a9ad736fb47c1434b9b7edf5f85bd11572ef09b8d2adf9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.2 This release

2 release files

0.7.1

2 release 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