feat: add Tzafon model provider#289
Open
eddieogola wants to merge 6 commits into
Open
Conversation
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 detectedLatest commit: 65541d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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>
4 tasks
- 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>
# 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tzafonmodel creator from@inngest/ai, making Tzafon a first-class model provider in AgentKitAuthorization: Bearerauth that is model-aware about tool callingtools/tool_choiceonly for models that reject themFiles changed
packages/agent-kit/src/models.tstzafonto the re-export from@inngest/aipackages/agent-kit/src/adapters/tzafon.tstools/tool_choiceforsm-*models onlypackages/agent-kit/src/adapters/index.tspackages/agent-kit/src/model.tstzafonformat handler (Bearer auth)docs/src/content/docs/reference/model-tzafon.mdxdocs/src/content/docs/concepts/models.mdxdocs/astro.config.mjsUsage
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) accepttools/tool_choiceand emit realtool_calls— they can invoke AgentKit tools.sm-*models (e.g.tzafon.sm-1) are deployed without a tool-call parser and rejecttools/tool_choicewith:The adapter follows the Grok pattern (wraps the OpenAI parsers with format-specific tweaks) and strips
tools/tool_choiceonly for thesm-*family, passing them through unchanged for models that support them.Dependency
Test plan
@inngest/aito the version containingtzafonpnpm buildcompiles successfullypnpm testpassestzafon()is importable from@inngest/agent-kitsm-*requests striptools/tool_choice, andnorthstar-*requests retain them🤖 Generated with Claude Code