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.2.0.0.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

ailia_llm-1.2.0.0-py3-none-any.whl (5.2 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ailia_llm-1.2.0.0.tar.gz
Algorithm Hash digest
SHA256 f50e04454938a4dbb55e0d1f169793b1181af528938d7178f3f61ac859842c99
MD5 13849e217352f84e185d4504b20faa23
BLAKE2b-256 9a68ff84830188174ceeabc76abc8f436b598fa54376db536b14979fd498a479

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ailia_llm-1.2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6da8d515211469356d0b293299b5eb395f25e3dd3ce72c29b895eabb7d5bbdbe
MD5 c7e14cbcc1fe99f4edb2dad9759615f9
BLAKE2b-256 71bdd2abc5f9873f0edf48994da11c15103b736bada1497566875df8536c1e35

See more details on using hashes here.

Supported by

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