Skip to content

feat: add Tzafon model provider#289

Open
eddieogola wants to merge 6 commits into
inngest:mainfrom
eddieogola:feat/add-tzafon-model-provider
Open

feat: add Tzafon model provider#289
eddieogola wants to merge 6 commits into
inngest:mainfrom
eddieogola:feat/add-tzafon-model-provider

Conversation

@eddieogola

@eddieogola eddieogola commented Feb 13, 2026

Copy link
Copy Markdown

Summary

  • Re-exports tzafon model creator from @inngest/ai, making Tzafon a first-class model provider in AgentKit
  • Adds a custom Tzafon adapter for Authorization: Bearer auth that is model-aware about tool calling
  • Tool/function calling on Tzafon is model-dependent, so the adapter strips tools/tool_choice only for models that reject them

Files changed

File Change
packages/agent-kit/src/models.ts Add tzafon to the re-export from @inngest/ai
packages/agent-kit/src/adapters/tzafon.ts New adapter — wraps OpenAI parsers, strips tools/tool_choice for sm-* models only
packages/agent-kit/src/adapters/index.ts Register Tzafon adapter
packages/agent-kit/src/model.ts Add tzafon format handler (Bearer auth)
docs/src/content/docs/reference/model-tzafon.mdx Reference page for the Tzafon model
docs/src/content/docs/concepts/models.mdx Add Tzafon to the models/config/env tabs
docs/astro.config.mjs Add Tzafon to the reference sidebar

Usage

import { createAgent, createNetwork, tzafon } from "@inngest/agent-kit";

const agent = createAgent({
  name: "assistant",
  system: "You are a helpful assistant.",
  model: tzafon({ model: "tzafon.northstar-cua-fast-1.6" }),
});

Tool calling is model-dependent

Tzafon exposes an OpenAI-compatible chat completions API, but tool/function calling support varies by model (verified against the live API):

  • northstar-* models (e.g. tzafon.northstar-cua-fast, tzafon.northstar-cua-fast-1.6) accept tools/tool_choice and emit real tool_calls — they can invoke AgentKit tools.

  • sm-* models (e.g. tzafon.sm-1) are deployed without a tool-call parser and reject tools/tool_choice with:

    HTTP 400: "auto" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set
    

The adapter follows the Grok pattern (wraps the OpenAI parsers with format-specific tweaks) and strips tools/tool_choice only for the sm-* family, passing them through unchanged for models that support them.

Dependency

This PR depends on inngest/inngest-js#1309, which adds the tzafon() model creator and "tzafon" format to @inngest/ai. That PR must be merged and released first, then @inngest/ai should be bumped in packages/agent-kit/package.json before this PR can be merged.

Test plan

  • Merge upstream dependency inngest/inngest-js#1309 first
  • Bump @inngest/ai to the version containing tzafon
  • pnpm build compiles successfully
  • pnpm test passes
  • Verify tzafon() is importable from @inngest/agent-kit
  • Verify sm-* requests strip tools/tool_choice, and northstar-* requests retain them

🤖 Generated with Claude Code

Re-export `tzafon` model creator from `@inngest/ai`, enabling Tzafon
as a first-class model provider in AgentKit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Feb 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65541d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@inngest/agent-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Tzafon rejects requests containing `tools` or `tool_choice` (HTTP 400).
This adds a custom adapter following the Grok pattern that wraps the
OpenAI parsers but strips these unsupported fields.

Changes:
- New `src/adapters/tzafon.ts` — strips tools/tool_choice from requests
- Register Tzafon adapter in `src/adapters/index.ts`
- Add Tzafon format handler in `src/model.ts` (Bearer auth)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New reference page: docs/reference/model-tzafon.mdx
- Add Tzafon to models concept page (examples, model list, env var)
- Add navigation entry in docs.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eddieogola eddieogola marked this pull request as draft February 28, 2026 10:41
@eddieogola eddieogola marked this pull request as ready for review February 28, 2026 10:41
@eddieogola eddieogola marked this pull request as draft March 31, 2026 19:49
@eddieogola eddieogola marked this pull request as ready for review March 31, 2026 19:50
eddieogola and others added 2 commits July 10, 2026 19:34
# Conflicts:
#	docs/docs.json
#	docs/src/content/docs/concepts/models.mdx
#	docs/src/content/docs/reference/model-tzafon.mdx
Tool calling on Tzafon is model-dependent, not globally unsupported: the
`northstar-*` models accept `tools`/`tool_choice` and emit real tool calls,
while the `sm-*` models are deployed without a tool-call parser and 400 on
those fields.

Previously the adapter stripped `tools`/`tool_choice` for every Tzafon model,
which silently disabled tool calling on the northstar models. Strip only for
the `sm-*` family (verified against the live API); pass tools through for
everything else. Update the reference doc accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant