Skip to content

inference-gateway/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Inference Gateway Examples

License Examples Docker Kubernetes SDKs A2A MCP Status

Examples for deploying, configuring, and using the Inference Gateway across different environments and use cases.


⚠️ Early Development Notice: This project is in its early stages of development. Some deployment examples may not work as expected or are currently in draft mode. We are actively working on completing and testing all examples using design-first principles. Please be patient as we continue to improve the documentation and examples.

Note: The examples in each individual project repository are more accurate and likely to be working. This monolithic examples repository is still a work in progress (WIP). For the most reliable examples, please check the individual project repositories.

If you encounter issues, feel free to open an issue or contribute to help us improve.

Monitoring Examples

Choose your preferred deployment method:

Docker (Recommended for Development)

cd quickstart/docker
task

Kubernetes (Recommended for Production)

cd quickstart/kubernetes
task setup  # Interactive setup with automatic cluster creation

Don't have a cluster? Use task setup for interactive cluster creation with k3d.

From main examples directory? Use task quickstart:k8s as a shortcut.

πŸ“ Repository Structure


examples/
β”œβ”€β”€ quickstart/ # Get started quickly
β”‚ β”œβ”€β”€ docker/ # Docker deployment
β”‚ └── kubernetes/ # Kubernetes deployment
β”œβ”€β”€ sdks/ # SDK usage examples
β”‚ β”œβ”€β”€ go/ # Go SDK examples
β”‚ β”œβ”€β”€ python/ # Python SDK examples
β”‚ β”œβ”€β”€ typescript/ # TypeScript SDK examples
β”‚ └── rust/ # Rust SDK examples
β”œβ”€β”€ a2a/ # Agent-to-Agent examples
β”‚ β”œβ”€β”€ getting-started/ # Basic A2A setup
β”‚ β”œβ”€β”€ google-calendar/ # Calendar agent example
β”‚ └── custom-agents/ # Custom agent examples
β”œβ”€β”€ mcp/ # Model Context Protocol examples
β”‚ β”œβ”€β”€ servers/ # MCP server implementations
β”‚ └── clients/ # MCP client examples
β”œβ”€β”€ monitoring/ # Observability examples
β”‚ β”œβ”€β”€ prometheus/ # Metrics collection
β”‚ β”œβ”€β”€ grafana/ # Dashboards
β”‚ └── tracing/ # Distributed tracing
β”œβ”€β”€ security/ # Security configurations
β”‚ β”œβ”€β”€ authentication/ # Auth setups
β”‚ β”œβ”€β”€ tls/ # TLS/SSL examples
β”‚ └── rbac/ # Role-based access
└── tutorials/ # Step-by-step guides
β”œβ”€β”€ first-request/ # Your first API call
β”œβ”€β”€ model-routing/ # Advanced routing
β”œβ”€β”€ rate-limiting/ # Rate limiting setup
└── custom-providers/ # Adding new providers

🎯 Choose Your Path

I want to...

Get started quickly

β†’ Go to quickstart/ for Docker or Kubernetes deployment

Use SDKs in my application

β†’ Check sdks/ for language-specific examples

Create AI agents

β†’ Visit a2a/ for Agent-to-Agent examples

Integrate with MCP

β†’ See mcp/ for Model Context Protocol examples

Deploy to production

β†’ Review deployment/ for advanced deployment scenarios

Monitor and observe

β†’ Check monitoring/ for observability setups

Secure my deployment

β†’ Explore security/ for security configurations

Learn step by step

β†’ Follow tutorials/ for guided learning

πŸ›  Prerequisites

General Requirements

  • Task: Install Task for running examples
  • Git: For cloning repositories
  • curl: For testing API endpoints

Deployment-Specific

  • Docker: For container-based examples
  • kubectl: For Kubernetes examples
  • Node.js: For UI and TypeScript examples
  • Go: For Go SDK examples
  • Python: For Python SDK examples
  • Rust: For Rust SDK examples

API Keys

You'll need at least one API key from supported providers:

  • OpenAI (OPENAI_API_KEY)
  • Anthropic (ANTHROPIC_API_KEY)
  • Groq (GROQ_API_KEY)
  • DeepSeek (DEEPSEEK_API_KEY)
  • Cohere (COHERE_API_KEY)
  • or local Ollama (OLLAMA_API_URL)

πŸ“– Example Categories

πŸš€ Quickstart Examples

Perfect for getting up and running immediately:

  • Docker: Single command deployment
  • Kubernetes: Production-ready cluster deployment

πŸ’» SDK Examples

Language-specific client implementations:

  • Go: Native Go applications
  • Python: Data science and AI workflows
  • TypeScript: Web applications and Node.js services
  • Rust: High-performance applications

πŸ€– A2A Examples

Agent-to-Agent protocol implementations:

  • Getting Started: Basic agent setup
  • Google Calendar: Real-world integration
  • Custom Agents: Build your own agents

πŸ”Œ MCP Examples

Model Context Protocol integrations:

  • Servers: Custom MCP server implementations
  • Clients: MCP client integrations

πŸš€ Deployment Examples

Production deployment scenarios:

  • Helm: Kubernetes package management
  • Terraform: Infrastructure as Code
  • Docker Compose: Multi-service orchestration
  • Cloud: AWS, GCP, Azure specific deployments

Monitoring Examples

Observability and monitoring:

  • Prometheus: Metrics collection
  • Grafana: Visualization dashboards
  • Tracing: Request tracing setup

πŸ”’ Security Examples

Security and authentication:

  • Authentication: User authentication setups
  • TLS: SSL/TLS configuration
  • RBAC: Role-based access control

πŸ“š Tutorial Examples

Guided learning experiences:

  • First Request: Making your first API call
  • Model Routing: Advanced request routing
  • Rate Limiting: Implementing rate limits
  • Custom Providers: Adding new AI providers

🌟 Getting Started

Method 1: Quick Navigation (Recommended)

# From the main examples directory
task quickstart:k8s    # Kubernetes with interactive setup
task quickstart:docker # Docker deployment

Method 2: Direct Navigation

  1. Choose your deployment method:

    # For development
    cd quickstart/docker && task
    
    # For production
    cd quickstart/kubernetes && task setup
  2. Test your deployment:

    # Health check
    curl http://localhost:8080/health
    
    # List models
    curl http://localhost:8080/v1/models
  3. Explore examples:

    # Try SDK examples
    cd sdks/python && task
    
    # Build a UI
    cd ui/nextjs && task
    
    # Create agents
    cd a2a/getting-started && task

🀝 Contributing

Found an issue or want to add an example? We welcome contributions!

  1. Fork the repository
  2. Create a feature branch
  3. Add your example with proper documentation
  4. Follow the existing structure and Taskfile patterns
  5. Submit a pull request

Example Guidelines

  • Use Taskfile.yml for automation (no shell scripts)
  • Include comprehensive README.md
  • Add .env.example for configuration
  • Follow language-specific best practices
  • Include error handling and troubleshooting

πŸ“– Additional Resources

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A collection of examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published