定制 ndrstmr/steg-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ndrstmr/steg-bundle

Composer 安装命令:

composer require ndrstmr/steg-bundle

包简介

Symfony Bundle for Steg — auto-configuration, profiler panel, and DI integration

README 文档

README

Important

Dieses Paket ist umgezogen. Entwicklung und Releases laufen jetzt im Monorepo public-sector-dev-crew/lotse-fleet (Verzeichnis packages/steg-bundle). Dieses Repository ist eingefroren und wird archiviert.

  • Neuer Composer-Name: lotse/steg-bundle (vormals ndrstmr/steg-bundle)
  • Umstellen: composer remove ndrstmr/steg-bundle && composer require lotse/steg-bundle
  • Der PHP-Namespace Steg\Bundle\ bleibt unverändert — nur die require-Zeile ändert sich.
  • Packagist: https://packagist.org/packages/lotse/steg-bundle

steg-bundle

Symfony Bundle for Steg — auto-configuration, profiler panel, and DI integration.

CI License: EUPL-1.2

Requirements

  • PHP 8.2+
  • Symfony 7.0+ or 8.0+
  • ndrstmr/steg ^1.0.1 (v1.0.0 has an incompatible StegClient and is not supported)

Installation

composer require ndrstmr/steg-bundle

Symfony Flex will register the bundle automatically. Without Flex, add it manually:

// config/bundles.php
return [
    // ...
    Steg\Bundle\StegBundle::class => ['all' => true],
];

Configuration

Create config/packages/steg.yaml:

steg:
    connections:
        vllm_local:
            dsn: '%env(STEG_VLLM_DSN)%'   # e.g. vllm://gpu-server:8000/v1?model=llama-3.3-70b-awq
            timeout: 120
        ollama_dev:
            dsn: 'ollama://localhost:11434?model=qwen2.5:7b'
            timeout: 60
        mock:
            dsn: 'mock://default'
    default_connection: vllm_local

DSN format

Scheme Example
vllm:// vllm://gpu-server:8000/v1?model=llama-3.3-70b-awq
ollama:// ollama://localhost:11434?model=qwen2.5:7b
mock:// mock://default

Alternative: explicit base_url

steg:
    connections:
        vllm_local:
            base_url: '%env(VLLM_BASE_URL)%'
            model: '%env(VLLM_MODEL_NAME)%'
            api_key: '%env(VLLM_API_KEY)%'
            timeout: 120

Usage

Autowiring (default connection)

use Steg\Client\InferenceClientInterface;
use Steg\Model\ChatMessage;

final class MyService
{
    public function __construct(
        private readonly InferenceClientInterface $steg,
    ) {}

    public function translate(string $text): string
    {
        $response = $this->steg->complete([
            ChatMessage::system('You are a translation assistant.'),
            ChatMessage::user($text),
        ]);

        return $response->content;
    }
}

Named connections via #[Autowire]

use Steg\Client\InferenceClientInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

final class MyService
{
    public function __construct(
        #[Autowire(service: 'steg.client.vllm_local')]
        private readonly InferenceClientInterface $vllm,

        #[Autowire(service: 'steg.client.ollama_dev')]
        private readonly InferenceClientInterface $ollama,
    ) {}
}

Available service IDs

Service ID Description
steg.client.{name} Named connection client
steg.client Alias for the default connection
Steg\Client\InferenceClientInterface Alias for the default connection

Symfony Profiler

When StegDataCollector is wired, the Symfony Profiler shows a Steg panel with:

  • Request count and total duration
  • Prompt and completion token usage
  • Per-request timeline (connection, model, duration, tokens, response preview)

To enable profiling, decorate your client services with ProfilingClient in the DI configuration.

License

EUPL-1.2 — see LICENSE.

Built by 👾 public sector dev crew

Notice

This repository was developed with the assistance of AI code agents (Claude Code, Anthropic). The code was created as part of a development sprint and is not cleared for production use without prior review. Use at your own risk.

License: European Union Public Licence v. 1.2 (EUPL-1.2) — Copyright © 2026 Andreas Teumer

ndrstmr/steg-bundle 适用场景与选型建议

ndrstmr/steg-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「php」 「bundle」 「inference」 「ai」 「llm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ndrstmr/steg-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ndrstmr/steg-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 ndrstmr/steg-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 48
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 42
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2026-05-06