[PR #424] [CLOSED] feat: Add @langchain/baseten provider package #450

Closed
opened 2026-06-05 17:23:08 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/424
Author: @maahir30
Created: 4/3/2026
Status: Closed

Base: mainHead: baseten-integration


📝 Commits (1)

  • 22aeb49 initial draft of baseten pkg

📊 Changes

10 files changed (+1247 additions, -0 deletions)

View changed files

libs/providers/baseten/package.json (+73 -0)
libs/providers/baseten/src/baseten.int.test.ts (+65 -0)
libs/providers/baseten/src/baseten.test.ts (+633 -0)
libs/providers/baseten/src/baseten.ts (+227 -0)
libs/providers/baseten/src/index.ts (+32 -0)
libs/providers/baseten/src/types.ts (+105 -0)
libs/providers/baseten/tsconfig.json (+8 -0)
libs/providers/baseten/tsdown.config.ts (+26 -0)
libs/providers/baseten/vitest.config.ts (+41 -0)
📝 pnpm-lock.yaml (+37 -0)

📄 Description

Adds a new @langchain/baseten package — a LangChain chat model provider for Baseten's OpenAI-compatible inference API. This is a TypeScript port of the official Python langchain-baseten package.

  • Introduces ChatBaseten, extending ChatOpenAI and pointing it at Baseten's https://inference.baseten.co/v1 endpoint
  • Ports TensorRT-LLM streaming fixes from Python: tool-call chunk normalization (normalizeToolCallChunks) and cumulative usage metadata stripping
  • Adds dedicated model URL support (modelUrl) with automatic normalization of /predict, /sync, and /sync/v1 endpoint formats (via normalizeModelUrl)
  • Tags all responses with model_provider: "baseten" in response_metadata and ls_provider: "baseten" for LangSmith tracing
  • Reasoning content (additional_kwargs.reasoning_content) flows through via the parent @langchain/openai completions converters — verified with pass-through tests
  • Defaults streamUsage: true to match the Python package behavior
  • Includes 38 unit tests and 3 integration tests (direct invoke, streaming, createDeepAgent end-to-end)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/424 **Author:** [@maahir30](https://github.com/maahir30) **Created:** 4/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `baseten-integration` --- ### 📝 Commits (1) - [`22aeb49`](https://github.com/langchain-ai/deepagentsjs/commit/22aeb49ae8f32933e312b215f87b9445584cb2bd) initial draft of baseten pkg ### 📊 Changes **10 files changed** (+1247 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `libs/providers/baseten/package.json` (+73 -0) ➕ `libs/providers/baseten/src/baseten.int.test.ts` (+65 -0) ➕ `libs/providers/baseten/src/baseten.test.ts` (+633 -0) ➕ `libs/providers/baseten/src/baseten.ts` (+227 -0) ➕ `libs/providers/baseten/src/index.ts` (+32 -0) ➕ `libs/providers/baseten/src/types.ts` (+105 -0) ➕ `libs/providers/baseten/tsconfig.json` (+8 -0) ➕ `libs/providers/baseten/tsdown.config.ts` (+26 -0) ➕ `libs/providers/baseten/vitest.config.ts` (+41 -0) 📝 `pnpm-lock.yaml` (+37 -0) </details> ### 📄 Description Adds a new `@langchain/baseten` package — a LangChain chat model provider for [Baseten's](https://www.baseten.co/) OpenAI-compatible inference API. This is a TypeScript port of the official Python [`langchain-baseten`](https://github.com/basetenlabs/langchain-baseten) package. - Introduces `ChatBaseten`, extending `ChatOpenAI` and pointing it at Baseten's `https://inference.baseten.co/v1` endpoint - Ports TensorRT-LLM streaming fixes from Python: tool-call chunk normalization (`normalizeToolCallChunks`) and cumulative usage metadata stripping - Adds dedicated model URL support (`modelUrl`) with automatic normalization of `/predict`, `/sync`, and `/sync/v1` endpoint formats (via `normalizeModelUrl`) - Tags all responses with `model_provider: "baseten"` in `response_metadata` and `ls_provider: "baseten"` for LangSmith tracing - Reasoning content (`additional_kwargs.reasoning_content`) flows through via the parent `@langchain/openai` completions converters — verified with pass-through tests - Defaults `streamUsage: true` to match the Python package behavior - Includes 38 unit tests and 3 integration tests (direct invoke, streaming, `createDeepAgent` end-to-end) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:08 -04:00
yindo closed this issue 2026-06-05 17:23:08 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#450