feat(ai): add Tzafon as a model provider#1309
Open
eddieogola wants to merge 5 commits intoinngest:mainfrom
Open
feat(ai): add Tzafon as a model provider#1309eddieogola wants to merge 5 commits intoinngest:mainfrom
eddieogola wants to merge 5 commits intoinngest:mainfrom
Conversation
Tzafon is an OpenAI-compatible LLM provider. This adds a `tzafon()` model creator that reuses the `openai-chat` format, following the same pattern as the existing DeepSeek integration. Changes: - New `src/models/tzafon.ts` model creator - Add `TZAFON_API_KEY` to envKeys enum - Export from models index Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e97240e 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 |
6 tasks
Tzafon rejects requests containing `tools` or `tool_choice` (HTTP 400). This changes the Tzafon model from reusing `openai-chat` format to using its own `"tzafon"` format (following the Grok pattern), enabling agent-kit to register a custom adapter that strips these fields. Changes: - New `src/adapters/tzafon.ts` adapter interface - Add `"tzafon"` to `AiAdapter.Format` union and adapters map - Update model creator to use `format: "tzafon"` - Export adapter type from adapters index Co-Authored-By: Claude Opus 4.6 <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
tzafon()model creator to@inngest/aifor Tzafon, an OpenAI-compatible LLM provider"tzafon"format (following the Grok pattern) since Tzafon rejectstools/tool_choiceparameters with HTTP 400TZAFON_API_KEYenv key and exports from indexesFiles changed
packages/ai/src/models/tzafon.tsformat: "tzafon"packages/ai/src/adapters/tzafon.tsAiAdapterpackages/ai/src/adapter.ts"tzafon"toFormatunion andAiAdaptersmappackages/ai/src/adapters/index.tsTzafonAiAdapterpackages/ai/src/models/index.tstzafonmodelpackages/ai/src/env.tsTzafonApiKey = "TZAFON_API_KEY"Why a custom format instead of reusing
openai-chat?Tzafon is OpenAI-compatible for chat completions but does not support tool/function calling. When
toolsis included in a request, the API returns:A custom
"tzafon"format allowsagent-kitto register a dedicated adapter that stripstoolsandtool_choicefrom requests (same pattern as Grok, which uses its own format to disable strict mode).Usage
Downstream PR
The corresponding
agent-kitadapter PR is inngest/agent-kit#289.Test plan
pnpm buildcompiles successfullypnpm test— all 41 existing tests passtzafon({ model: "tzafon.sm-1" })returns correct adapter shape withformat: "tzafon"https://api.tzafon.ai/v1🤖 Generated with Claude Code
Note
Adds Tzafon as a new OpenAI-compatible model provider to
@inngest/ai. Introduces a custom"tzafon"format (mirroring the Grok pattern) to allow downstream adapters to striptools/tool_choicefields that Tzafon rejects with HTTP 400. Includes the model creator, adapter interface, env key, changeset, and all necessary index exports.Written by Mendral for commit cc6b9f5.