examples: add Tuning Engines OpenAI-compatible endpoint

CE
6mo ago
+186-0

Summary

  • add a runnable with-tuning-engines example alongside the existing provider examples
  • configure @ai-sdk/openai with a custom baseURL and TUNING_ENGINES_API_KEY
  • update the examples index to include the new example

Why

We are an AI infrastructure team using VoltAgent with Tuning Engines. VoltAgent remains the agent runtime for tools, memory, and server behavior; Tuning Engines provides a governed OpenAI-compatible endpoint for model access, policy checks, audit logs, traces, and usage/cost reporting. Since the examples already include provider/gateway setups such as OpenRouter, this gives teams using Tuning Engines a starter that matches the existing examples structure. It would mean a lot to us if this is useful, and I am happy to adjust the example to fit your conventions.

Validation

  • git diff --check
  • attempted dependency install for the example; the repo-wide pnpm workspace install failed locally because the machine ran out of disk while fetching workspace dependencies, so I did not complete a TypeScript build in this environment

Summary by cubic

Adds a runnable with-tuning-engines example that routes VoltAgent model calls through a governed OpenAI-compatible endpoint, with startup validation and logging. This enables policy checks, traces, and usage/cost reporting without changing agent code.

  • New Features
    • New example at examples/with-tuning-engines using @ai-sdk/openai with custom baseURL and TUNING_ENGINES_API_KEY; optional TUNING_ENGINES_MODEL (default gpt-4o); .env.example added; linked in the examples index.
    • Runs a VoltAgent server via @voltagent/server-hono with LibSQL memory (@voltagent/libsql) and structured logging via @voltagent/logger.
    • Startup hardening: throws if TUNING_ENGINES_API_KEY is missing; dev script uses tsx with .env.
    • Demo performs one text generation on boot and logs response text and usage.

Summary by CodeRabbit

  • New Features

    • Added a new "Tuning Engines" example showing VoltAgent integration with a governed OpenAI-compatible endpoint, selectable model, local memory, logging, and a runnable dev/start workflow.
  • Documentation

    • Included full example docs, environment variable placeholders, installation and dev/start instructions, usage notes, and project structure guidance.