Offline local-LLM helper (llama.cpp + GGUF) with Python API and CLI.
Project description
offlineai-local
Small Python package to run a local GGUF model (via llama-server) with:
- Python API:
get_answer(prompt, instruction="") - CLI:
offlineai ask ... - Bootstrap and bundle helpers to avoid copying many loose files.
Publish to PyPI (Windows, D drive only)
- Tao token tren
https://pypi.org/manage/account/token/. - Mo PowerShell trong
D:\AI_LOCAL_SYSTEM. - Gan token:
$env:PYPI_TOKEN = "pypi-xxxxxxxxxxxxxxxx"
- Build + upload:
.\publish_to_pypi.ps1
Neu muon build wheel moi truoc khi upload:
.\publish_to_pypi.ps1 -BuildWheel
Jupyter localhost test from pip
Trong notebook:
%pip install offlineai-local
Khoi tao data local (1 lan):
from offlineai import bootstrap_from_zip
bootstrap_from_zip(r"D:\path\offlineai_bundle.zip")
Hoi:
from offlineai import get_answer
get_answer("Ban co the noi tieng Viet khong?")
get_answer(
"Viet ham Python doc JSON an toan",
"chi dua code python khong giai thich",
)
Quick start
- Install package:
pip install .
- Put runtime/model in one of these:
%USERPROFILE%\.offlineai\runtimeand%USERPROFILE%\.offlineai\models- or bootstrap from a project folder / bundle zip
- Check:
offlineai doctor
- Ask:
offlineai ask "ban co the noi tieng viet khong"
offlineai ask "viet ham python doc json an toan" --code-only
Bootstrap from current project folder
If your project already has runtime/ and models/:
offlineai bootstrap-dir D:\AI_LOCAL_SYSTEM
Create a single portable bundle zip
offlineai pack --source D:\AI_LOCAL_SYSTEM --output D:\AI_LOCAL_SYSTEM\offlineai_bundle.zip
Then on a new machine:
pip install offlineai-local-0.1.0-py3-none-any.whl
offlineai bootstrap-zip D:\path\offlineai_bundle.zip
offlineai doctor
Notes
- This package does not train anything before each use.
- It calls local model directly (API-style).
- Model quality is high for size, but no model guarantees 100% correctness for all questions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file offlineai_local-0.1.0-py3-none-any.whl.
File metadata
- Download URL: offlineai_local-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10644d89098db3d89d51008ba21e5d10e829899eb7e1444143da7a45afe20ba4
|
|
| MD5 |
f181f0a69cfda03b9c47f77025abde44
|
|
| BLAKE2b-256 |
f3fef9c93717cc9ef084b9bf1a1eb6c8573f15eab2b4fd211b0a74615455c32f
|