Skip to main content

llm-toolforge

用于大模型工具调用的框架,同时提供 HTTP API(同步、流式、异步)和MCP Server两种接入方式。

安装

任选一种方式安装:

从 PyPI 安装(推荐)

pip install llm-toolforge

从源码安装(开发)

pip install -e .

验证

toolforge --help

使用

从零开始

  1. 创建项目
toolforge new project my-app   # 创建 ./my-app/ 并生成项目初始文件
# 或者
toolforge new project .        # 在当前目录初始化项目(目录已存在时使用)
  1. 创建工具
toolforge new tool <name> 

默认工具代码是获取当前时间,可以根据示例代码进行修改。详细说明见工具开发指南

  1. 编辑配置文件 配置文件位于项目根目录下的 config.yaml,默认配置即可运行。各字段含义见文件内注释。

  2. 启动 在项目根目录执行,可以在页面http://localhost:12345进行测试。

toolforge run 

使用示例工程

  1. 安装环境
cd examples
pip install -r requirements.txt
  1. 编辑 config.yaml,按注释填写配置

  2. 运行

toolforge run

打开页面http://localhost:12345进行测试。

部署

toolforge new project 会在项目目录下生成 Dockerfile

docker build -t llm-toolforge-example:v0.1.0 .

docker run --rm \
  -v "$(pwd)/config.yaml:/app/config.yaml" \
  -e SERVICE_NAME=llm-toolforge-example \
  -p 12345:12345 \
  -p 12346:12346 \ 
  llm-toolforge-example:v0.1.0

运行自动化测试

参与框架开发时,先在项目根目录安装源码及测试依赖:

python -m pip install -e ".[test]"

以后每次修改代码后,在项目根目录运行:

python -m pytest

环境变量

少量字段可由环境变量覆盖(优先级高于 config.yaml):

变量 覆盖字段
SERVICE_NAME service.name
SERVICE_VERSION service.version

K8s 多实例部署时推荐通过 Deployment 注入 SERVICE_NAME,避免镜像里写死。


Download files

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

Source Distribution

llm_toolforge-0.7.0.tar.gz (6.4 MB view details)

Uploaded Source

Built Distribution

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

llm_toolforge-0.7.0-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

Details for the file llm_toolforge-0.7.0.tar.gz.

File metadata

  • Download URL: llm_toolforge-0.7.0.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for llm_toolforge-0.7.0.tar.gz
Algorithm Hash digest
SHA256 f9d0283d8777c0f1440d1f6f87bcda1da1e6b7817316424d5b9014ce96dc9c62
MD5 0331af70d332bb1d41717e9b3e8afdde
BLAKE2b-256 92ede9b1a75d7158ce288332eaa332d6485b67029c5dd77fcd9dec32cc47fc12

See more details on using hashes here.

File details

Details for the file llm_toolforge-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: llm_toolforge-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for llm_toolforge-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4886ac085d0cbbcd0d28fb21a6ec92d15b45a3050a33a3bb1b5f4dcac1303a9b
MD5 89e21f21b34dbc0de4571e446bfd6762
BLAKE2b-256 4af8fa4644f82bb499945895556a325aa1319cd956f1368a2e2c1c37297521be

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.1

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

This release

0.7.0 This release

2 files

0.6.3

2 files

0.6.0

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

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