Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Feb 3, 2025
1 parent b8719c8 commit 4bbb642
Show file tree
Hide file tree
Showing 34 changed files with 72 additions and 77 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# lcpp
# llama

lcpp is a dart implementation of llama.cpp used by the mobile artificial intelligence distribution (maid)
llama is a dart implementation of llama.cpp used by the mobile artificial intelligence distribution (maid)
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The Android Gradle Plugin builds the native code with the Android NDK.

group 'com.example.lcpp'
group 'com.example.llama'
version '1.0'

buildscript {
Expand All @@ -26,7 +26,7 @@ apply plugin: 'com.android.library'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.example.lcpp'
namespace 'com.example.llama'
}

// Bumping the plugin compileSdk version requires all clients of this plugin
Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'lcpp'
rootProject.name = 'llama'
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lcpp">
package="com.example.llama">
</manifest>
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lcpp_example
# llama_example

Demonstrates how to use the lcpp plugin.
Demonstrates how to use the llama plugin.

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (flutterVersionName == null) {
}

android {
namespace "com.example.lcpp_example"
namespace "com.example.llama_example"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

Expand All @@ -42,7 +42,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.lcpp_example"
applicationId "com.example.llama_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="lcpp_example"
android:label="llama_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.lcpp_example
package com.example.llama_example

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>lcpp_example</string>
<string>llama_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'dart:async';

import 'package:file_picker/file_picker.dart';
import 'package:lcpp/lcpp.dart';
import 'package:llama/llama.dart';

void main() {
runApp(const MaidLlmApp());
Expand Down
4 changes: 2 additions & 2 deletions example/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "lcpp_example")
set(BINARY_NAME "llama_example")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.lcpp")
set(APPLICATION_ID "com.example.llama")

# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
Expand Down
2 changes: 1 addition & 1 deletion example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
lcpp
llama
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
4 changes: 2 additions & 2 deletions example/linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) {
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "lcpp_example");
gtk_header_bar_set_title(header_bar, "llama_example");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "lcpp_example");
gtk_window_set_title(window, "llama_example");
}

gtk_window_set_default_size(window, 1280, 720);
Expand Down
10 changes: 5 additions & 5 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ PODS:
- file_picker (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- lcpp (0.0.1):
- llama (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- lcpp (from `Flutter/ephemeral/.symlinks/plugins/lcpp/macos`)
- llama (from `Flutter/ephemeral/.symlinks/plugins/llama/macos`)

EXTERNAL SOURCES:
file_picker:
:path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos
FlutterMacOS:
:path: Flutter/ephemeral
lcpp:
:path: Flutter/ephemeral/.symlinks/plugins/lcpp/macos
llama:
:path: Flutter/ephemeral/.symlinks/plugins/llama/macos

SPEC CHECKSUMS:
file_picker: e716a70a9fe5fd9e09ebc922d7541464289443af
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
lcpp: 00b58ece86653604067b1024980311c938f15cb7
llama: 1929932d9096ccd647e8158f0aaf02f5085bf6a1

PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3

Expand Down
12 changes: 6 additions & 6 deletions example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* lcpp_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = lcpp_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* llama_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = llama_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -144,7 +144,7 @@
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* lcpp_example.app */,
33CC10ED2044A3C60003C045 /* llama_example.app */,
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
);
name = Products;
Expand Down Expand Up @@ -249,7 +249,7 @@
);
name = Runner;
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* lcpp_example.app */;
productReference = 33CC10ED2044A3C60003C045 /* llama_example.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -482,7 +482,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.maidLlmExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/lcpp_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/lcpp_example";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/llama_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/llama_example";
};
name = Debug;
};
Expand All @@ -497,7 +497,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.maidLlmExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/lcpp_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/lcpp_example";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/llama_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/llama_example";
};
name = Release;
};
Expand All @@ -512,7 +512,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.maidLlmExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/lcpp_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/lcpp_example";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/llama_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/llama_example";
};
name = Profile;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "lcpp_example.app"
BuildableName = "llama_example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "lcpp_example.app"
BuildableName = "llama_example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand Down Expand Up @@ -65,7 +65,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "lcpp_example.app"
BuildableName = "llama_example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand All @@ -82,7 +82,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "lcpp_example.app"
BuildableName = "llama_example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
Expand Down
2 changes: 1 addition & 1 deletion example/macos/Runner/Configs/AppInfo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// 'flutter create' template.

// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = lcpp_example
PRODUCT_NAME = llama_example

// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.maidLlmExample
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
lcpp:
llama:
dependency: "direct main"
description:
path: ".."
Expand Down
11 changes: 3 additions & 8 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: lcpp_example
description: "Demonstrates how to use the lcpp plugin."
name: llama_example
description: "Demonstrates how to use the llama plugin."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
Expand Down Expand Up @@ -31,12 +31,7 @@ dependencies:
flutter:
sdk: flutter

lcpp:
# When depending on this package from a real application you should use:
# lcpp: ^x.y.z
# See https://dart.dev/tools/pub/dependencies#version-constraints
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
llama:
path: ../

# The following adds the Cupertino Icons font to your application.
Expand Down
4 changes: 2 additions & 2 deletions example/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(lcpp_example LANGUAGES CXX)
project(llama_example LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "lcpp_example")
set(BINARY_NAME "llama_example")

# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
Expand Down
2 changes: 1 addition & 1 deletion example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
lcpp
llama
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
8 changes: 4 additions & 4 deletions example/windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "com.example" "\0"
VALUE "FileDescription", "lcpp_example" "\0"
VALUE "FileDescription", "llama_example" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "lcpp_example" "\0"
VALUE "InternalName", "llama_example" "\0"
VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "lcpp_example.exe" "\0"
VALUE "ProductName", "lcpp_example" "\0"
VALUE "OriginalFilename", "llama_example.exe" "\0"
VALUE "ProductName", "llama_example" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
END
END
Expand Down
2 changes: 1 addition & 1 deletion example/windows/runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
if (!window.Create(L"lcpp_example", origin, size)) {
if (!window.Create(L"llama_example", origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);
Expand Down
6 changes: 3 additions & 3 deletions ios/lcpp.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint lcpp.podspec` to validate before publishing.
# Run `pod lib lint llama.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'lcpp'
s.name = 'llama'
s.version = '0.0.1'
s.summary = 'A Flutter FFI plugin for interfacing with llama_cpp.'
s.description = <<-DESC
A new Flutter FFI plugin project.
DESC
s.homepage = 'https://github.com/Mobile-Artificial-Intelligence/dart_lcpp'
s.homepage = 'https://github.com/Mobile-Artificial-Intelligence/dart_llama'
s.license = { :file => '../LICENSE' }
s.author = { 'Dane Madsen' => '[email protected]' }
s.dependency 'Flutter'
Expand Down
6 changes: 3 additions & 3 deletions lib/src/bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
import 'dart:ffi' as ffi;

/// llama.cpp binding
class lcpp {
class llama {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;

/// The symbols are looked up in [dynamicLibrary].
lcpp(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup;
llama(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup;

/// The symbols are looked up with [lookup].
lcpp.fromLookup(
llama.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chat_message.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../lcpp.dart';
part of '../llama.dart';

class ChatMessage {
final String role;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/context_params.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ignore_for_file: constant_identifier_names
part of '../lcpp.dart';
part of '../llama.dart';

class ContextParams {
// text context, 0 = from model
Expand Down
Loading

0 comments on commit 4bbb642

Please sign in to comment.