Skip to content

Comments

Integrate llama.cpp in Aprapipes and a module ImageToTextXForm which can describe an image#345

Open
kushaljain-apra wants to merge 25 commits intomainfrom
ks/llama_integration
Open

Integrate llama.cpp in Aprapipes and a module ImageToTextXForm which can describe an image#345
kushaljain-apra wants to merge 25 commits intomainfrom
ks/llama_integration

Conversation

@kushaljain-apra
Copy link
Contributor

@kushaljain-apra kushaljain-apra commented Apr 17, 2024

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #[Issue]

Description

  • added vcpkg port for llama.cpp
  • added support for llm and encoder models through Llm Model and Encoder Model Abstract Classes
  • added Llava and Clip Encoder Models for ImageToTextXForm
  • added Model Strategy Class to implement different model strategies
  • added a module ImageToTextXForm which uses Llava model to describe an image

Alternative(s) considered

Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type

Type Choose one: (Feature)

Screenshots (if applicable)

Checklist

  • I have read the Contribution Guidelines
  • I have written Unit Tests
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach

@kushaljain-apra kushaljain-apra changed the title Integrate llama.cpp in Aprapipes and a module SceneDescriptorXForm which can describe an image Integrate llama.cpp in Aprapipes and a module ImageToTextXForm which can describe an image May 6, 2024
Copy link
Collaborator

@joiskash joiskash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left a few comments please address them, thanks!

kushaljain-apra and others added 12 commits May 16, 2025 07:53
* Introduced comprehensive documentation for the LLM framework design in ApraPipes, detailing architectural decisions, core design principles, and future extensions.
* Added a guide for integrating llama.cpp and whisper.cpp using the vcpkg package manager, covering portfile structure, build configuration, and platform-specific handling.
* Enhanced clarity on model management, pipeline integration, and resource management strategies within the framework.
* Introduced a new document detailing the integration issues between whisper.cpp and llama.cpp due to conflicting GGML library versions.
* Described the root causes, reproduction steps, error symptoms, and current workarounds.
* Outlined long-term solutions and the impact on projects requiring both libraries.
* Provided links to related issues and repositories for further reference.
* Introduced a new section detailing available models for the LLM framework, starting with LLaVA-1.6-Mistral-7B.
* Included model descriptions, supported use cases, and various model variants with their specifications.
* Provided guidance on selecting model variants based on hardware capabilities and precision requirements.
* Introduced new SVG and PNG files for the LLM Framework, providing visual representations of the architecture and components.
* Added an Excalidraw file for detailed design elements and layout.
* Enhanced documentation with visual aids to improve understanding of the framework's structure and functionality.
…tants

* Updated ClipEncoderProps to include a numThreads parameter for improved threading control.
* Modified serialization methods to account for the new numThreads property.
* Introduced default constants for model configuration in ModelStrategy, enhancing clarity and maintainability.
* Adjusted ClipEncoder implementation to utilize the new threading parameter during inference.
* Added validation in ImageToTextXForm to prevent changes to GPU layers post-initialization.
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.

3 participants