AIProxy Bootstrap

repository·main·Indexed 41 days ago

https://github.com/toddham/aiproxybootstrap

A collection of Swift-based starter and playground applications for bootstrapping AI experiences using AIProxy. Includes templates for providers such as OpenAI, Anthropic, Groq, DeepL, Replicate, Stability AI, and Together AI, as well as feature-rich demo apps like FilmFinder and AIColorPalette.

Tokens
906
Snippets
1
Records
5
Agent score
2%

What's inside AIProxy Bootstrap

  1. Run the AIColorPalette demo with custom AIProxy settings

    main

    To run the AIColorPalette sample app using your own AIProxy configuration, you must perform two steps: bypass device checks in Xcode and provide your specific AIProxy partial key.

    1. Bypass Device Checks: Set the AIPROXY_DEVICE_CHECK_BYPASS environment variable in your Xcode build settings.
    2. Configure Partial Key: Open AIColorPalette/AIProxyIntegration.swift and replace the partialKey placeholder with the value provided in your AIProxy dashboard (the value generated when you submit your OpenAI key).
    # In AIColorPalette/AIProxyIntegration.swift
    let partialKey = "YOUR_AI_PROXY_PARTIAL_KEY"
  2. Explore AIProxy Playground apps

    main

    The Playground apps are more complex, feature-rich applications that demonstrate multi-service orchestration or specific use cases. Note that some require Xcode 16:

    • FilmFinder: Movie recommendations using Groq and TMDB (Requires Xcode 16).
    • PuLIDDemo: Image generation using PuLID on Replicate (Requires Xcode 16).
    • AIColorPalette: OpenAI color palette generator using image input (Requires Xcode 16).
    • Chat: Basic OpenAI chat interface with streaming and stream-stop capabilities.
    • Image Classifier: OpenAI-powered plant identification with Wikipedia linking.
    • Transriber: OpenAI-powered audio transcription via device microphone.
    • Translator: English to Spanish translation with OpenAI text-to-speech.
    • Trivia Game: GPT-powered trivia using JSON responses for multiple-choice questions.
    • Stickers: OpenAI prompt-to-sticker generation with Vision-based foreground/background extraction.
    • EmojiPuzzleMaker: Generates emoji puzzles using Anthropic's Claude 3.5 Sonnet API.
  3. Build and run AIProxy starter apps

    main

    To use these starter apps, you must configure your AIProxy credentials and environment settings. Follow these steps:

    1. Configure Constants: Open the AppConstants.swift file in your chosen sample app and replace the placeholder values with the snippet provided in your AIProxy dashboard.
    2. Update Bundler Identifier: Change the app's bundler identifier to match the App ID you created in the AIProxy dashboard.
    3. Configure Simulator Environment: To allow the iOS simulator to communicate with the AIProxy backend, you must add an environment variable in Xcode:
      • Press cmd-shift-comma to open the Edit Schemes menu.
      • Select Run in the sidebar.
      • Select the Arguments tab in the top navigation.
      • In the Environment Variables section, add a new variable:
        • Name: AIPROXY_DEVICE_CHECK_BYPASS
        • Value: The value displayed on your AIProxy dashboard's key details screen.
  4. Explore AIProxy Quickstart apps

    main

    The repository includes several Quickstart apps organized by service provider. These apps use AIProxySwift to implement API calls and serve as templates for specific integrations:

    • AIProxyAnthropic: Generates a message using Anthropic.
    • AIProxyDeepL: Translates input text to Spanish.
    • AIProxyOpenAI: Demonstrates Chat, DALL-E, and Vision capabilities.
    • AIProxyReplicate: Implements Stable Diffusion XL.
    • AIProxyGroq: Provides examples for Chat Completion and Streaming Chat Completion.
    • AIProxyStability: Generates images using Stability AI.
    • AIProxyTogetherAI: Demonstrates Chat, Streaming Chat, and JSON responses using Together AI.