LLM-powered Verifiable Credential query generator for iOS.
Download the GGUF model file (1.6GB):
- Model:
gemma-2-2b-it-dcql-q4.gguf - Place it in:
Documents/directory of the app container
How to copy the model:
- Build and run the app in Xcode (it will fail to load model, that's OK)
- In Xcode: Window → Devices and Simulators → Select your device/simulator
- Find the app, click the gear icon → Download Container
- Extract the
.xcappdatafile → CreateAppData/Documents/folder if needed - Copy
gemma-2-2b-it-dcql-q4.gguftoAppData/Documents/ - Upload the modified container back to the device/simulator
- Restart the app
# Open in Xcode
open vc-llm.xcodeproj
# Build and run (Cmd+R)- VCRetriever: Semantic search for relevant credentials using embeddings
- LlamaDCQLService: llama.cpp-based DCQL query generation
- LlamaDCQLGenerator: Swift wrapper for llama.cpp inference
- FormViewModel: UI state management with streaming output
- User enters natural language query (e.g., "Show my driver's license")
- VCRetriever finds top-3 relevant credentials using semantic similarity
- LlamaDCQLGenerator creates DCQL query using the LLM (with streaming output)
- User can view/present the generated Verifiable Presentation
- Xcode 15+
- iOS 17+
- ~2GB storage for model file
vc-llm/
├── LlamaDCQLService.swift # Main service
├── LlamaDCQLGenerator.swift # llama.cpp wrapper
├── LibLlama.swift # llama.cpp bindings
├── VCRetriever.swift # Semantic search
├── VPDCQLBridge.swift # Rust vp-dcql wrapper
├── RustBridge.h # Bridging header
└── Views/Main/FormView.swift # Main UI
Frameworks/
└── llama.framework # llama.cpp framework
RustLib/
├── libvp_dcql.a # Rust static library
└── vp_dcql.h # C header
vc_pool/ # Sample credentials
The app integrates the Rust vp-dcql library from vc-dcql-bbs for BBS-based Verifiable Presentation generation.
Usage:
let vp = try VPDCQLBridge.createPresentation(
dcqlQuery: dcqlQuery, // JSON string
signedCredential: signedVC,
challenge: challenge
)Note: Requires physical device (aarch64-apple-ios). Simulator not yet supported.