Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[bot] Instrument SGLang offline engine (574,007 weekly downloads)

未关闭
#786 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
ai

调研方向

Start with py/src/braintrust/integrations/cohere/patchers.py and inspect py/src/braintrust/integrations/, py/src/braintrust/wrappers/, py/pyproject.toml, and py/noxfile.py for existing integration patterns. Read SGLang's Offline Engine API documentation first; done means the listed generate, async_generate, encode, and rerank paths, including streaming and VLM inputs, produce Braintrust spans with project registration and validation coverage.

由索引模型根据 Issue 内容生成。

描述

<!-- library-gap-audit: sglang-offline-engine -->

Summary

sglang is a high-performance LLM/multimodal serving framework with RadixAttention, continuous batching, and speculative decoding, positioned alongside vllm (already tracked as a separate open instrumentation gap in this repo) as one of the two dominant open-source inference engines. This repository has zero instrumentation for it.

  • Current version 0.5.20 (released 2026-09-18), under very active development
  • Not present in py/pyproject.toml [tool.braintrust.matrix], no noxfile.py session, no directory under py/src/braintrust/integrations/ or py/src/braintrust/wrappers/
  • Repo-wide grep for sglang under py/ returns zero matches

What is missing

SGLang's in-process Offline Engine API (sglang.Engine, docs: https://docs.sglang.io/docs/basic_usage/offline_engine_api) is the primary way Python applications call it directly (as opposed to going through its OpenAI-compatible HTTP server, which a user could separately point the already-instrumented openai client at). None of these produce a Braintrust span today:

  • Engine.generate() — synchronous text/chat generation, non-streaming and streaming variants
  • Engine.async_generate() — asyncio generation entrypoint, non-streaming and streaming variants; this is the method the framework's own example server-wrapping code (examples/runtime/engine/custom_server.py) uses to build custom serving layers
  • Engine.encode() — embedding execution (e.g. BERT-base/e5-mistral style models) for retrieval/similarity use cases
  • Engine.rerank() — query/document relevance scoring, analogous to the cohere.rerank span type this repo already instruments (py/src/braintrust/integrations/cohere/patchers.py)

This engine also supports vision-language model (VLM) inference via the same generate()/async_generate() surface with image inputs.

Weekly downloads

Weekly downloads: 574,007 (as of 2026-09-21; https://pypistats.org/api/packages/sglang/recent)

Braintrust docs status

not_found — checked https://www.braintrust.dev/docs/integrations/ai-providers and https://www.braintrust.dev/docs/guides/traces/integrations; neither mentions SGLang. (vllm, the closest analog, is also absent from both pages and is tracked separately.)

Upstream sources

Local repo files inspected

  • py/src/braintrust/integrations/ — no sglang/ directory
  • py/src/braintrust/wrappers/ — no SGLang wrapper
  • py/pyproject.toml [tool.braintrust.matrix] — no sglang entry
  • py/noxfile.py — no test_sglang session
  • Repo-wide case-insensitive grep for sglang under py/ — zero matches
主要语言
Python
星标
19
派生
17
平均合并
1 天 5 小时
30 天内合并 PR
61

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

braintrustdata/braintrust-sdk-python 的其他 Issue

查看 braintrustdata/braintrust-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。