Skip to main content

PromptForge

Генератор system-промтов для LLM-агентов с экспортом в JSON для API

PyPI version Python versions Tests License Downloads

English | Русский


PromptForge — инструмент для создания, валидации и экспорта system-промтов LLM-агентов в готовые JSON-payload для API (OpenAI, Anthropic, универсальный формат).

Ключевые возможности

  • 🎯 Интерактивный мастер — пошаговое создание конфигурации агента
  • 🔒 Детерминированный рендер — одинаковый конфиг → одинаковый sha256 и версия промта
  • ✅ Валидация конфигурации до генерации
  • 🔧 Подстановка переменных {{key}} в тексте промта
  • 📦 Три формата экспорта: OpenAI, Anthropic, универсальный raw
  • 💬 Few-shot примеры — inline в system-промт или отдельными сообщениями
  • 🛡️ Атомарная запись файлов
  • 🎓 Интеграция с Django через management command

Установка

pip install promptforge-llm

# С дополнительными зависимостями
pip install promptforge-llm[yaml]       # поддержка YAML-конфигов
pip install promptforge-llm[tokens]     # точная оценка токенов через tiktoken
pip install promptforge-llm[all]        # все опциональные зависимости

Быстрый старт

# Создать конфигурацию агента (интерактивный мастер)
promptforge init -o agent.config.json

# Проверить конфигурацию
promptforge validate -c agent.config.json

# Посмотреть сгенерированный system-промт
promptforge preview -c agent.config.json

# Собрать JSON-payload для OpenAI
promptforge build -c agent.config.json -f openai -o build/agent.json

# Собрать JSON-payload для Anthropic
promptforge build -c agent.config.json -f anthropic -o build/agent.claude.json

Использование в коде

from promptforge import AgentConfig, PromptBuilder, export
from openai import OpenAI

# Загрузить конфигурацию
config = AgentConfig.from_file("agent.config.json")

# Собрать промт с подстановкой переменных
built = PromptBuilder(config, variables={"django_version": "5.1"}).build()

# Экспортировать в формат OpenAI
payload = export(built, "openai")

# Использовать с API
response = OpenAI().chat.completions.create(**payload)
print(response.choices[0].message.content)

Цитирование

Если вы используете PromptForge в научной работе или проекте, будем признательны за ссылку:

@software{promptforge2026,
  author = {Your Name},
  title = {PromptForge: System Prompt Generator for LLM Agents},
  year = {2026},
  publisher = {PyPI},
  url = {https://pypi.org/project/promptforge-llm/},
  version = {1.0.0}
}

Лицензия

Проект распространяется под лицензией MIT.

Copyright: Copyright (c) 2026 Alex Jurow (mandalay-rp)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

Metadata

Release files for promptforge-llm 1.0.1

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

Source distribution (sdist)

Source distribution for promptforge-llm 1.0.1
File Size Uploaded Provenance Actions
promptforge_llm-1.0.1.tar.gz 19.7 kB Without provenance Details for promptforge_llm-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for promptforge-llm 1.0.1
File Interpreter ABI Platform Actions
promptforge_llm-1.0.1-py3-none-any.whl Python 3 none any Details for promptforge_llm-1.0.1-py3-none-any.whl

Total release size: 43.6 kB

Release files / promptforge_llm-1.0.1.tar.gz

Download URL promptforge_llm-1.0.1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8778962b0aeaab24d2a4280aae982e8783a1ebe4a29135d75cf458197647e869
BLAKE2b-256 checksum
How to use checksums
c88777a34d81f87a5f6c897f718fb45020a83d5cd0e31ad3d009323d5b4a45d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / promptforge_llm-1.0.1-py3-none-any.whl

Download URL promptforge_llm-1.0.1-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d09df49ef9dc1a9567b20370ff79edba468d31a6ca2d3c2c4d837a449b0fc59
BLAKE2b-256 checksum
How to use checksums
c35f69f12a0113b006aec6005c87f7cce4ab3162c5ebdc9187dc96f3fc774542
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for promptforge-llm 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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