Skip to main content

ailia LLM

Project description

ailia LLM Python API

!! CAUTION !! “ailia” IS NOT OPEN SOURCE SOFTWARE (OSS). As long as user complies with the conditions stated in License Document, user may use the Software for free of charge, but the Software is basically paid software.

About ailia LLM

ailia LLM is a library for running LLMs on edge devices. It provides bindings for C++ and Unity.

Install from pip

You can install the ailia LLM free evaluation package with the following command.

pip3 install ailia_llm

Install from package

You can install the ailia LLM from Package with the following command.

python3 bootstrap.py
pip3 install ./

Usage

import ailia_llm

import os
import urllib.request

model_file_path = "gemma-2-2b-it-Q4_K_M.gguf"
if not os.path.exists(model_file_path):
	urllib.request.urlretrieve(
		"https://storage.googleapis.com/ailia-models/gemma/gemma-2-2b-it-Q4_K_M.gguf",
		model_file_path
	)

model = ailia_llm.AiliaLLM()
model.open(model_file_path)

messages = []
messages.append({"role": "system", "content": "語尾に「わん」をつけてください。"})
messages.append({"role": "user", "content": "あなたの名前は何ですか?"})

stream = model.generate(messages)

text = ""
for delta_text in stream:
	text = text + delta_text
print(text)

if model.context_full():
	raise Exception("Context full")

messages.append({"role": "assistant", "content": text})

API specification

https://github.com/axinc-ai/ailia-sdk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ailia_llm-1.3.1.0.tar.gz (10.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ailia_llm-1.3.1.0-py3-none-any.whl (10.9 MB view details)

Uploaded Python 3

File details

Details for the file ailia_llm-1.3.1.0.tar.gz.

File metadata

  • Download URL: ailia_llm-1.3.1.0.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ailia_llm-1.3.1.0.tar.gz
Algorithm Hash digest
SHA256 c2d230ccb7ffdcca46368b72f22fda01700e0dfe908fdc25cbb4d489915de974
MD5 3ea2244b7e859b4128e38d99800b8cf0
BLAKE2b-256 c5ec121312eb4eb40b2364586aea3569cff457e6037986e8afa90369677815ba

See more details on using hashes here.

File details

Details for the file ailia_llm-1.3.1.0-py3-none-any.whl.

File metadata

  • Download URL: ailia_llm-1.3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ailia_llm-1.3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8c55b62e8bb29115a500e2db76890faa230fb27c40fab789fff2f18f8b7c45b
MD5 aba0757fcda5c2a0edd0733be3ccd2a1
BLAKE2b-256 1aeba1d0966137e26753b6eea421dac3a5585e5c60a942abdc65bb57148b60f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page