Fluid Forge
Get Started
See it run
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
Demos
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
GitHub
Get Started
See it run
  • Local (DuckDB)
  • Source-Aligned (Postgres → DuckDB)
  • AI Forge + Data Models
  • GCP (BigQuery)
  • Snowflake Team Collaboration
  • Declarative Airflow
  • Orchestration Export
  • Jenkins CI/CD
  • Universal Pipeline
  • 11-Stage Production Pipeline
  • Catalog Forge End-to-End
CLI Reference
  • Overview
  • Quickstart
  • Examples
  • Your own CI
  • Your own scaffolding
  • Custom validator
  • Apply hook
  • Reference
Demos
  • Overview
  • Architecture
  • GCP (BigQuery)
  • AWS (S3 + Athena)
  • Snowflake
  • Local (DuckDB)
  • Custom Providers
  • Roadmap
GitHub
GitHub
  • Introduction

    • Home
    • Getting Started
    • Snowflake Quickstart
    • See it run
    • Forge Data Model
    • Vision & Roadmap
    • Playground
    • FAQ
  • Concepts

    • Concepts
    • Builds, Exposes, Bindings
    • What is a contract?
    • Quality, SLAs & Lineage
    • Governance & Policy
    • Agent Policy (LLM/AI governance)
    • Providers vs Platforms
    • Fluid Forge vs alternatives
  • Data Products

    • Product Types — SDP, ADP, CDP
  • Walkthroughs

    • Walkthrough: Local Development
    • Source-Aligned: Postgres → DuckDB → Parquet
    • AI Forge And Data-Model Journeys
    • Walkthrough: Deploy to Google Cloud Platform
    • Walkthrough: Snowflake Team Collaboration
    • Declarative Airflow DAG Generation - The FLUID Way
    • Generating Orchestration Code from Contracts
    • Jenkins CI/CD for FLUID Data Products
    • Universal Pipeline
    • The 11-Stage Pipeline
    • End-to-End Walkthrough: Catalog → Contract → Transformation
  • CLI Reference

    • CLI Reference
    • fluid init
    • fluid demo
    • fluid forge
    • fluid skills
    • fluid status
    • fluid validate
    • fluid plan
    • fluid apply
    • fluid generate
    • fluid generate artifacts
    • fluid validate-artifacts
    • fluid verify-signature
    • fluid generate-airflow
    • fluid generate-pipeline
    • fluid viz-graph
    • fluid odps
    • fluid odps-bitol
    • fluid odcs
    • fluid export
    • fluid export-opds
    • fluid publish
    • fluid datamesh-manager
    • fluid market
    • fluid import
    • fluid policy
    • fluid policy check
    • fluid policy compile
    • fluid policy apply
    • fluid contract-tests
    • fluid contract-validation
    • fluid diff
    • fluid test
    • fluid verify
    • fluid product-new
    • fluid product-add
    • fluid workspace
    • fluid ide
    • fluid ai
    • fluid memory
    • fluid mcp
    • fluid scaffold-ci
    • fluid scaffold-composer
    • fluid scaffold-ide
    • fluid docs
    • fluid config
    • fluid split
    • fluid bundle
    • fluid auth
    • fluid doctor
    • fluid providers
    • fluid provider-init
    • fluid roadmap
    • fluid version
    • fluid runs
    • fluid retention
    • fluid secrets
    • fluid stats
    • fluid contract
    • fluid ship
    • fluid rollback
    • fluid schedule-sync
    • Catalog adapters

      • Source Catalog Integration (V1.5)
      • BigQuery Catalog
      • Snowflake Horizon Catalog
      • Databricks Unity Catalog
      • Google Dataplex Catalog
      • AWS Glue Data Catalog
      • DataHub Catalog
      • Data Mesh Manager Catalog
    • CLI by task

      • CLI by task
      • Add quality rules
      • Add agent governance
      • Debug a failed pipeline run
      • Switch clouds with one line
  • Recipes

    • Recipes
    • Recipe — add a quality rule
    • Recipe — switch clouds with one line
    • Recipe — tag PII in your schema
  • SDK & Plugins

    • SDK & Plugins
    • Quickstart — your first plugin
    • Examples

      • Runnable examples
      • Example: hello-scaffold — the minimal viable plugin
      • Example: gitlab-ci-scaffold — generate a complete CI project
      • Example: steward-validator — a custom governance rule
      • Example: prod-key-guard — apply-time invariant check
    • Journeys

      • Journeys
      • Your own CI/CD

        • You have your own CI/CD setup, no problem
        • GitLab CI — the bundle template
        • GitHub Actions — the bundle template
        • Jenkins — the bundle template
        • CircleCI — the bundle template
      • You have a strict project layout, no problem
      • You have governance rules, no problem
      • You want a check at apply time, no problem
    • Reference

      • Reference
      • Roles reference
      • Entry points reference
      • Trust model
      • Packaging
      • Companion packages
  • Providers

    • Providers
    • Provider Architecture
    • GCP Provider
    • AWS Provider
    • Snowflake Provider
    • Local Provider
    • Creating Custom Providers
    • Provider Roadmap
  • Advanced

    • Blueprints
    • Governance & Compliance
    • Airflow Integration
    • Built-in And Custom Forge Guidance
    • FLUID Forge Contract GPT Packet
    • Forge Discovery Guide
    • Forge Memory Guide
    • LLM Providers
    • Capability Warnings
    • LiteLLM Backend (opt-in)
    • MCP Server
    • Credential Resolver — Security Model
    • Cost Tracking
    • Agentic Primitives
    • Typed Errors
    • Typed CLI Errors
    • Authoring Forge Tools
    • Source-Aligned Acquisition
    • API Stability — fluid_build.api
    • Guided fluid forge UX
    • V1.5 Catalog Integration — Architecture Deep-Dive
    • V1.5 + V2 Hardening — Release Notes
  • Project

    • Contributing to Fluid Forge
    • Fluid Forge Docs Baseline: CLI 0.8.3
    • Fluid Forge Docs Baseline: CLI 0.8.0
    • Fluid Forge Docs Baseline: CLI 0.7.11
    • Fluid Forge Docs Baseline: CLI 0.7.9
    • Fluid Forge v0.7.1 - Multi-Provider Export Release

LiteLLM Backend (opt-in)

The upcoming 0.7.3 release ships an opt-in LiteLLMProvider that routes every LLM call through LiteLLM instead of Forge's native per-provider HTTP shapes. Enable it for unified routing, accurate per-call cost attribution, and access to LiteLLM's broader provider catalog.

Where this fits

LiteLLM is a routing-layer alternative to the native provider stack documented at LLM Providers. Both stacks share the same LlmProvider base class — switching between them is a one-env-var flip.

Enabling

pip install 'data-product-forge[litellm]'

export FLUID_LLM_BACKEND=litellm
fluid forge --domain retail

That's it. The dispatcher in cli/forge_copilot_llm_providers.py::get_llm_provider short-circuits to LiteLLMProvider when the env var is set; call_llm and call_llm_streaming route through it transparently.

What changes

AspectNative stackLiteLLM stack
Provider listAnthropic / OpenAI / Gemini / Azure / Ollama (5 hand-rolled)100+ providers via LiteLLM's catalog
Cost attributionHeuristic estimator (token counts × price/token table)LiteLLM's per-call usage.cost field — accurate to the cent
StreamingNative SSE per providerLiteLLM's unified streaming wrapper
Tool useNative per-provider tool-use shapesLiteLLM's unified tools parameter
Prompt cachingNative (Anthropic only)Whatever LiteLLM passes through
Token-usage captureSSE wire decoder per providerLiteLLM's usage callback

Configuration

Env varPurpose
FLUID_LLM_BACKEND=litellmActivate the LiteLLM stack
FLUID_LLM_MODELModel name. Use LiteLLM's model-name conventions (e.g. claude-3-5-sonnet-20241022, gpt-4.1-mini, gemini/gemini-2.5-pro).
FLUID_LITELLM_MODEL_PREFIXOverride the prefix LiteLLM uses for niche providers — e.g. azure/, bedrock/.
OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEYProvider keys, same as the native stack.
LITELLM_*Any LiteLLM-specific env var (LiteLLM reads these directly; Forge doesn't filter them).

Cost attribution

The native stack estimates cost from input/output token counts via an internal price table that gets stale every time providers change pricing. LiteLLM's usage.cost field is the authoritative per-call cost the LLM API itself reports, so:

# Internal — RunCostTracker.record_call signature gained usd_override
tracker.record_call(
    provider="anthropic",
    model="claude-3-5-sonnet-20241022",
    input_tokens=8420,
    output_tokens=1800,
    usd_override=0.0286,   # passed in from LiteLLM's reported cost
)

fluid stats (page) and the per-run cost.json show the LiteLLM-reported figure when FLUID_LLM_BACKEND=litellm. Older runs (or runs on the native stack) keep using the heuristic estimate.

Capability warnings

The capability catalog at fluid_build/copilot/agents/capability_catalog.py covers the native-stack provider/model combinations. When you switch to LiteLLM, the catalog still applies (LiteLLM is just a router) but the warnings reflect the underlying model — litellm + claude-sonnet-4-6 warns identically to anthropic + claude-sonnet-4-6.

If you point LiteLLM at a model not in the catalog, the run-start banner says "model X is not in the capability catalog" and the run continues with conservative defaults. See Capability Warnings.

When to use LiteLLM vs. native

Use LiteLLM whenUse native when
You need a provider not in the native 5 (Bedrock, Vertex direct, Cohere, Mistral cloud, etc.)You're on Anthropic / OpenAI / Gemini / Ollama and want fewest dependencies
You want per-call cost accurate to the cent (LiteLLM passes through provider billing)You're cost-budgeting at the run level — heuristic is good enough
You're already running LiteLLM as a routing proxy in production and want Forge to use the same pathYou want zero new runtime deps
You want to A/B test models without code changes—

The two stacks coexist safely — you can flip FLUID_LLM_BACKEND per run without touching contracts or config.

Caveats

  • LiteLLM is an extra at install time (pip install 'data-product-forge[litellm]'). Without it, setting FLUID_LLM_BACKEND=litellm raises MissingExtraError at run start.
  • Tool-use behaviour matches LiteLLM's wrapper, not the native shape. If you've been depending on Anthropic's exact tool-use response shape (rare), switching to LiteLLM may surface differences.
  • The agent-layer typed errors (RateLimitError, ContextOverflowError, etc. — see Typed Errors) still fire under LiteLLM; the classifier handles both wire shapes.

See also

  • LLM Providers — the native stack
  • Capability Warnings — what the capability catalog enforces under both stacks
  • Cost Tracking — how cost figures land in .fluid/agents/<run-id>/cost.json
  • fluid stats — aggregating cost across runs
Edit this page on GitHub
Last Updated: 5/17/26, 6:10 PM
Contributors: fas89, Claude Opus 4.7 (1M context)
Prev
Capability Warnings
Next
MCP Server