Skip to content

feat: add support for KlusterAI provider and update documentation#1

Open
troels-im wants to merge 2 commits into
mainfrom
feature/klusterai-integration
Open

feat: add support for KlusterAI provider and update documentation#1
troels-im wants to merge 2 commits into
mainfrom
feature/klusterai-integration

Conversation

@troels-im

Copy link
Copy Markdown
  • Introduced support for KlusterAI chat completion models.
  • Added necessary API key handling, cost calculations, and configuration.
  • Created comprehensive tests for KlusterAI functionality to ensure reliability.
  • Updated README and sidebars with KlusterAI information and usage examples.
  • Cleaned up formatting across multiple files to enhance readability.

Title

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

REPLACE DOCKER COMPOSE WITH

version: "3.11"
services:
  litellm:
    build:
      context: .
      dockerfile: docker/Dockerfile.non_root
    #      args:
    #        target: runtime
    #########################################
    ## Uncomment these lines to start proxy with a config.yaml file ##
    # volumes:
    #  - ./config.yaml:/app/config.yaml <<- this is missing in the docker-compose file currently
    # command:
    #  - "--config=/app/config.yaml"
    ##############################################
    ports:
      - "4000:4000" # Map the container port to the host, change the host port if necessary
    environment:
      DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
      STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI
    env_file:
      - .env # Load local .env file
    depends_on:
      - db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first
    healthcheck: # Defines the health check configuration for the container
      test: [
          "CMD",
          "curl",
          "-f",
          "http://localhost:4000/health/liveliness || exit 1",
        ] # Command to execute for health check
      interval: 30s # Perform health check every 30 seconds
      timeout: 10s # Health check command times out after 10 seconds
      retries: 3 # Retry up to 3 times if health check fails
      start_period: 40s # Wait 40 seconds after container start before beginning health checks

  db:
    image: postgres:16
    restart: always
    environment:
      POSTGRES_DB: litellm
      POSTGRES_USER: llmproxy
      POSTGRES_PASSWORD: dbpassword9090
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data # Persists Postgres data across container restarts
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
      interval: 1s
      timeout: 5s
      retries: 10

  prometheus:
    image: prom/prometheus
    volumes:
      - prometheus_data:/prometheus
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"
    command:
      - "--config.file=/etc/prometheus/prometheus.yml"
      - "--storage.tsdb.path=/prometheus"
      - "--storage.tsdb.retention.time=15d"
    restart: always

volumes:
  prometheus_data:
    driver: local
  postgres_data:
    name: litellm_postgres_data # Named volume for Postgres data persistence

- Introduced support for KlusterAI chat completion models.
- Added necessary API key handling, cost calculations, and configuration.
- Created comprehensive tests for KlusterAI functionality to ensure reliability.
- Updated README and sidebars with KlusterAI information and usage examples.
- Cleaned up formatting across multiple files to enhance readability.
- Consolidated cost calculation for prompt and completion tokens in cost_calculator.py.
- Removed unused klusterai model pricing data from model_prices_and_context_window_backup.json.
- Streamlined the completion_cost function for better maintainability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant