{"id":17258260,"url":"https://github.com/fmxexpress/ai-model-studio","last_synced_at":"2025-04-12T14:13:02.532Z","repository":{"id":231153834,"uuid":"761306204","full_name":"FMXExpress/AI-Model-Studio","owner":"FMXExpress","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-02T17:24:30.000Z","size":13344,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-07T05:44:52.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FMXExpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T16:14:27.000Z","updated_at":"2025-02-06T17:22:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a9321bb-af83-4734-a444-b24d7a534726","html_url":"https://github.com/FMXExpress/AI-Model-Studio","commit_stats":null,"previous_names":["fmxexpress/ai-model-studio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Model-Studio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Model-Studio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Model-Studio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FMXExpress%2FAI-Model-Studio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FMXExpress","download_url":"https://codeload.github.com/FMXExpress/AI-Model-Studio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578864,"owners_count":21127713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T07:19:54.348Z","updated_at":"2025-04-12T14:13:02.515Z","avatar_url":"https://github.com/FMXExpress.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Model Studio\n\n**AI Model Studio** is a **cross-platform FireMonkey (FMX)** application (Windows, Linux, macOS) that provides a seamless interface to run AI models locally—via **Docker** images from [Replicate.com](https://replicate.com)—or remotely using Replicate’s cloud API. Whether you’re generating text, images, video, or audio, AI Model Studio gives you a single, straightforward app to experiment with a wide variety of models.\n\n---\n\n## Cross-Platform FireMonkey\n\n- **Written in Delphi FMX** for a native look-and-feel on Windows, Linux, and macOS.  \n- Unified code base that compiles to each platform with minimal changes.  \n- Leverages [Embarcadero’s FireMonkey framework](https://www.embarcadero.com/products/delphi) for rich GUI controls, media handling, and cross-platform support.\n\n---\n\n## Architecture Overview\n\n### 1. Model Orchestration\n\n1. **Model Selection**  \n   - AI Model Studio categorizes AI models (text, image, video, audio, etc.) published on Replicate.com.  \n   - Users can pick a specific model or category from the UI.\n\n2. **Toggle: Local vs. Remote**  \n   - **Local**:  \n     - The app pulls a Docker image (if not already present) corresponding to the selected AI model from Replicate.  \n     - It then runs the container, which exposes a REST API on the local machine.  \n     - AI Model Studio sends inference requests to `http://localhost:\u003cport\u003e` (or similar) where the container listens.  \n   - **Remote**:  \n     - The app uses Replicate’s standard API endpoints, requiring a valid API key.  \n     - This allows quick testing or usage without needing Docker installed locally (beyond the optional local usage).\n\n### 2. Docker Integration\n\n- **Docker Container Pull \u0026 Run**  \n  - On Windows, **Docker for Windows** needs to be installed and running in the background.  \n  - On Linux and macOS, standard Docker Engine (via CLI) suffices.  \n  - AI Model Studio programmatically checks for the needed Docker image, pulls it if missing, and starts it.  \n- **Container Lifecycle Management**  \n  - The application can stop and remove containers when switching models or when the user explicitly ends the session.  \n  - Logging and status notifications keep the user informed of Docker commands, pull progress, and runtime events.\n\n### 3. REST Communication\n\n1. **Local Inference (Docker)**  \n   - Once the container is active, it provides an API that mirrors Replicate’s inference endpoints.  \n   - Delphi’s built-in REST client libraries handle the HTTP POST requests, sending the prompt/parameters and retrieving outputs.\n\n2. **Remote Inference (Replicate.com)**  \n   - For remote usage, the application sets the base endpoint to Replicate’s servers and includes the user’s API key.  \n   - The same request/response structure is used, but no local Docker container is involved.\n\n### 4. Core Application Components\n\n- **Docker Command Execution**:  \n  - Often done via simple command-line calls (e.g., `docker pull`, `docker run`), which the app executes in the background.  \n  - On Windows, these are typically ShellExecute or command prompt calls wrapped in Delphi code.  \n  - On macOS and Linux, the commands are similar, but the path or environment might differ slightly.\n\n- **REST Client \u0026 Response Handling**:  \n  - A Delphi REST client component (or direct HTTP calls) communicates with either localhost or Replicate’s URL.  \n  - Handles JSON payloads for prompts, as well as media files if the model requires images/video.\n\n### 5. Output Visualization\n\n- **Text Generation**  \n  - Results appear in a memo or large edit control inside the FMX form.  \n- **Image / Video Frames**  \n  - Images are displayed in `TImage` components, with the app downloading and converting them to a compatible FMX bitmap.  \n- **Audio**  \n  - If the model returns audio data, it is stored locally, and the UI can provide playback options or a file link.\n\n### 6. Extensibility\n\n- **New Models**  \n  - By defining the Docker image name, model parameters, and input prompts, additional Replicate-based models can be integrated with minimal code changes.  \n- **Additional Features**  \n  - Since the application’s structure is modular, developers can add more advanced configurations, logging, or specialized controls for custom models.\n\n---\n\n## License\n\nThis project is released under the [MIT License](LICENSE) (or whichever license is defined in this repository). Please check the `LICENSE` file for details.\n\n---\n\n## Contributing\n\nWe welcome contributions of all kinds—whether it’s adding support for new models, improving Docker orchestration, or enhancing the user interface.\n\n1. **Fork** the repository  \n2. Create a feature branch (`git checkout -b feature/my-new-feature`)  \n3. Commit your changes (`git commit -am 'Add a new feature'`)  \n4. Push to the branch (`git push origin feature/my-new-feature`)  \n5. Create a new Pull Request\n\nFor major changes, please open an issue first to discuss what you would like to change.\n\n---\n\n### Acknowledgments\n\n- **Delphi \u0026 FireMonkey**: For a unified cross-platform GUI framework.  \n- **Replicate**: For hosting and distributing AI models via Docker images and providing a robust cloud inference API.  \n\nEnjoy exploring local and remote AI models with **AI Model Studio**!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmxexpress%2Fai-model-studio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmxexpress%2Fai-model-studio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmxexpress%2Fai-model-studio/lists"}