Skip to content

Add Telnyx model provider#3040

Open
Oliver-Zimmerman wants to merge 13 commits into
langgenius:mainfrom
team-telnyx:feat/telnyx-model-provider
Open

Add Telnyx model provider#3040
Oliver-Zimmerman wants to merge 13 commits into
langgenius:mainfrom
team-telnyx:feat/telnyx-model-provider

Conversation

@Oliver-Zimmerman
Copy link
Copy Markdown

@Oliver-Zimmerman Oliver-Zimmerman commented May 11, 2026

Summary

Adds a Telnyx model provider plugin for Dify Official Plugins under models/telnyx.

This provider adds predefined Telnyx support for:

  • LLM/chat completions via POST /v2/ai/chat/completions
  • text embeddings via POST /v2/ai/openai/embeddings
  • speech-to-text via POST /v2/ai/audio/transcriptions
  • text-to-speech via Telnyx TTS

The predefined model lists were checked against Telnyx's authenticated read-only model/voice endpoints before opening this draft:

  • LLM repo/live match: 18 / 18
  • Embedding repo/live match: 3 / 3
  • Selected TTS voices all exist in the live voice catalog: 12 / 3329

Local Dify install/runtime smoke has been completed; screenshots are posted in #3040 (comment).

Change Type

  • Documentation / non-plugin change
  • Non-LLM plugin (tools, extensions, datasource, etc.)
  • LLM plugin

Screenshots / Videos

Before After
Telnyx was not available as an official model provider. Telnyx plugin installs locally, credentials validate, and a Telnyx model returns a successful response through Dify.

LLM Plugin Checklist

Areas affected by this change (check all that apply)
  • Message flow (system messages, user ↔ assistant turn-taking)
  • Tool interaction flow (multi-round usage, Agent App and Agent Node)
  • Multimodal input (images, PDFs, audio, video, etc.)
  • Multimodal output (images, audio, video, etc.)
  • Structured output (JSON, XML, etc.)
  • Token consumption metrics
  • Other LLM functionality (reasoning, grounding, prompt caching, etc.)
  • New models / model parameter fixes

Version

  • Bumped top-level version in manifest.yaml (not the one under meta)
  • dify_plugin>=0.3.0,<0.6.0 is declared in pyproject.toml and locked in uv.lock (or kept in requirements.txt for legacy plugins without uv.lock) — SDK docs

Testing

  • Local deployment — Dify version: 1.14.1
  • SaaS (cloud.dify.ai)

Validation completed so far:

cd models/telnyx
uv run --python 3.12 python -m pytest tests -q
uv run --python 3.12 python -m compileall -q models provider tests main.py

Result:

8 passed, 2 warnings
YAML parse and AIModelEntity validation OK (24 model YAMLs)

Package smoke with the Dify plugin daemon CLI release asset:

cd dify-official-plugins
/tmp/dify-plugin-cli/dify-plugin plugin package models/telnyx --output_path /tmp/telnyx.difypkg
shasum -a 256 /tmp/telnyx.difypkg

Result:

plugin packaged successfully
/tmp/telnyx.difypkg
sha256: 97e9c58b28239ee9bd73af2b63a7e8240bff84c5f2478715b85a5fa1ae6da7f0

Live read-only inventory checks completed with a Telnyx API key, without logging secrets:

LLM repo/live match: True 18 18
Embedding repo/live match: True 3 3
TTS selected voices all live: True 12 of 3329

Runtime smoke completed:

  • installed the generated .difypkg into a local Dify environment;
  • configured Telnyx credentials in Dify;
  • ran a minimal LLM smoke through Dify's model provider layer;
  • added screenshots for plugin installation, provider configuration, and a successful chat response in Add Telnyx model provider #3040 (comment).

Optional embedding/TTS/STT UI smokes are still available as follow-up coverage if maintainers want the full provider surface exercised visually.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Telnyx model provider plugin, which adds support for LLM chat completions, text embeddings, text-to-speech, and speech-to-text services. The implementation includes shared HTTP utility classes, specific model providers, a wide range of predefined model configurations (including GPT-4o, Claude, and Llama models), and a comprehensive test suite. Review feedback highlighted critical issues in the LLM implementation, specifically regarding incorrect tool mapping logic in the request payload and a streaming response handler that failed to capture tool calls when text content was missing from a chunk.

Comment thread models/telnyx/models/llm/llm.py Outdated
Comment thread models/telnyx/models/llm/llm.py
@Oliver-Zimmerman
Copy link
Copy Markdown
Author

Oliver-Zimmerman commented May 14, 2026

Screenshots / Runtime smoke

Tested against a local Dify deployment using the packaged PR plugin.

Validation performed:

  • Built /tmp/telnyx.difypkg from models/telnyx
  • Installed the local package into Dify
  • Configured Telnyx provider credentials with the API key masked by Dify
  • Ran a chat completion through Dify using the Telnyx provider

The successful LLM smoke below uses moonshotai/Kimi-K2.6 through the Telnyx provider.

1. Telnyx plugin installed

Telnyx plugin installed

2. Telnyx provider configured

Telnyx provider configured

3. Telnyx LLM chat success

Telnyx LLM chat success

@Oliver-Zimmerman Oliver-Zimmerman marked this pull request as ready for review May 14, 2026 15:45
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 14, 2026
@Oliver-Zimmerman
Copy link
Copy Markdown
Author

@RockChinQ Would be great to have this reviewd / merged.

@Oliver-Zimmerman
Copy link
Copy Markdown
Author

@crazywoola would love to get this integrated.

@Oliver-Zimmerman Oliver-Zimmerman deployed to models/telnyx May 21, 2026 08:25 — with GitHub Actions Active
@Oliver-Zimmerman
Copy link
Copy Markdown
Author

@orangeclk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant