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}'

Download files

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

Source Distribution

agentfly-0.7.2.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

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

agentfly-0.7.2-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file agentfly-0.7.2.tar.gz.

File metadata

  • Download URL: agentfly-0.7.2.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentfly-0.7.2.tar.gz
Algorithm Hash digest
SHA256 b46f11365145098ad13672848445d7799b6994b33d2b858c97bb751fd03c6aa0
MD5 3b741c67f73ec681b7de363eaeb26f6a
BLAKE2b-256 3d215340580af8e60089f43006ab6681b852227d6e8758f9bd2f537a96236334

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentfly-0.7.2.tar.gz:

Publisher: publish.yml on laomou/agentfly

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

File details

Details for the file agentfly-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: agentfly-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentfly-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa9f6262041261970bc3177fa7170473608343d33a0a2b8121ec469774af713
MD5 e3ab8e0d44a06d083ee078a5d9aca366
BLAKE2b-256 98b9cdcc6bc7baa00a9ad736fb47c1434b9b7edf5f85bd11572ef09b8d2adf9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentfly-0.7.2-py3-none-any.whl:

Publisher: publish.yml on laomou/agentfly

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page