This release is a pre-release and may not be stable for production use.
Local AI inference: chat, vision, audio, embeddings, reranking, speech, transcription. One shared library, no server, no Python ML stack.
Local AI inference for Python. Chat, vision, audio, embeddings, reranking, speech and transcription in one wheel: no server, no ML stack, no GPU needed.
jinfer is jinfer, the JVM inference engine, for Python: libjinfer, the engine, every ported model architecture and its native kernels compiled into one shared library with a C API, which the wheel carries. A GGUF model runs in your process, on the CPU, from one load call, and comes back as a typed object with only the methods the file supports. toknroll is the only dependency, for the tokenizer.
pip install jinfer import jinfer model = jinfer.load("LiquidAI/LFM2.5-350M-GGUF:Q8_0") # a LanguageModel; the file decides reply = model.chat("Why is the sky blue?", max_tokens=200) # already generating for text in reply: # stream it ... print(text, end="", flush=True) reply.text, reply.usage.prompt_ms # ... or just read it @dataclass class Person: name: str born: int person = model.chat("Ada Lovelace, born 1815.", schema=Person).parsed # a Person, guaranteed def weather(city: str) -> dict: """Current weather for a city.""" return {"celsius": 18} conversation = model.conversation(system="Be brief.", tools=[weather]) print(conversation.chat("Weather in Zurich?").text) # runs weather, then answers branch = conversation.fork(); conversation.rewind() # free: nothing is recomputed Why jinfer Three lines to a reply, and the reply is an object. load, chat, .text; no messages list to assemble for a first question, no ["choices"][0]["message"]["content"] to dig through, no server to start first. Everything local in one package. Chat, vision, audio in, embeddings, reranking, speech synthesis and transcription, each a method on the class the model file calls for, from one 19 MB wheel; no torch, no transformers, no daemon. Structured output that cannot come back malformed. schema=Person takes a dataclass, a TypedDict, a Pydantic class, list[T], Literal or Enum, the engine enforces it while decoding, and reply.parsed is the Python value; there is nothing to validate and retry. Tools are functions. The signature is the schema and the docstring the description; a conversation runs the calls itself, between the words of the streamed answer. The engine keeps the conversation. A turn costs only its new tokens, fork and rewind recompute nothing, prepare warms a prompt before the user types, and a prompt cache file keeps it across processes. Stopping is not losing. Close a reply early and its partial text, usage and finish reason stay readable, in a conversation too. Typed errors, keyword options, model defaults. InvalidArgument is a ValueError, NotFound a FileNotFoundError; a typo in an option is a TypeError at the call; an option left out takes the model file's value, never the library's. One engine, three faces. The same code serves Java, this package, and jinfer.h, twenty-nine C functions any language calls. jinfer ollama transformers llama-cpp-python Install pip install, no ML stack the Ollama app, a running server, pip install ollama transformers plus torch, gigabytes compiles llama.cpp, or a per-backend wheel index Lines to a first reply 3 3, plus two shell commands 4 4 Where the text is .text .message.content [0]["generated_text"][-1]["content"] ["choices"][0]["message"]["content"] Stop early close; partial text, usage and finish reason stay break; nothing stays custom stopping criteria break; nothing stays Conversation state an object; engine cache visible; fork, rewind your list, re-sent each turn your list, recomputed each turn your list, last prefix reused Structured output any Python type, parsed object back, enforced JSON schema in, validate yourself none built in JSON schema in, dict back, enforced Tools functions; the conversation runs the loop functions; you run the loop functions; you parse and loop hand-written JSON; you parse and loop Embeddings, reranking (n, dim) float32 array; one call list of lists; none pooling by hand; cross-encoder by hand list of lists; none Speech, transcription both, streaming, timed words neither both, no streaming neither Extra process none required none none GPU no yes yes yes, chosen at install Model breadth the architectures jinfer ports the Ollama library everything on the Hub every GGUF llama.cpp loads Where it trails, so you can decide: the CPU only, the architectures listed below rather than every GGUF, WAV or PCM into transcribe, and eight options on purpose, the rest left to the model file. The comparison, use case by use case, has every snippet.
Any GGUF of a ported architecture, in Q4_0, Q4_1, Q5_0, Q5_1, Q4_K, Q5_K, Q6_K, Q8_0, MXFP4, NVFP4, Q1_0, TQ1_0, TQ2_0, F32, F16 or BF16; Q8_0 is the recommended balance of quality and speed.
The jinfer README keeps the authoritative table, with links to each family.
Models are hub references (owner/repo:QUANT, downloaded once and cached) or local paths. load returns the class the file calls for, LanguageModel, Embedder, Reranker, Speaker or Transcriber, each with only the methods that apply. Every call returns a plain typed object; nothing is a dict you have to know the shape of, and nothing in the API mentions tokens, JSON or OpenAI field names.
Errors are jinfer.JinferError subclasses: InvalidArgument (also a ValueError), NotFound (also a FileNotFoundError), Cancelled; each has .code. jinfer.OpenAI(ref) is a migration aid: code written for the OpenAI SDK's chat.completions.create and embeddings.create runs in-process, unchanged.
The wheel is the C library too: jinfer.h, toknroll.h, libjinfer and a pkg-config file live in the installed package, and the package says where.
On Linux and macOS, compile with Python's standard library, preserving each output line as one compiler argument:
import subprocess flags = subprocess.check_output( ["jinfer-config", "--cflags", "--libs"], text=True, ).splitlines() subprocess.run(["cc", "chat.c", *flags], check=True) jinfer-config is the wheel's console script, in the venv's bin, with --cflags, --libs, --pkgconfigdir and --version, as numpy-config and python3-config have them. Compiler arguments are unquoted, one per line; keep spaces within each line rather than splitting on whitespace.
For pkg-config, point it at the installed package:
PKG_CONFIG_PATH="$(jinfer-config --pkgconfigdir)" pkg-config --cflags --libs jinfer pkg-config emits shell-escaped flags; in a Python build script, parse that output with shlex.split() rather than splitlines().
On Windows the flags are cl's, /I and /LIBPATH with jinfer.lib, one per line, and jinfer.dll sits beside the import library. The C API is jinfer.h; nothing else is a tool here, jbang jinfer@qxoticai is.
libjinfer carries its own toknroll: a model's tokenizer lives in jinfer's runtime, and model.tokenizer is a toknroll.Tokenizer served by libjinfer. The toknroll wheel is a dependency for that class alone, pinned to the exact toknroll inside libjinfer; the class checks the library's version when it binds, so a mismatched environment fails at import jinfer naming both versions rather than later. jinfer.configure and JINFER_OPTIONS configure the model's tokenizers too, -Dtoknroll.* options included, as they configure everything in libjinfer. toknroll.configure and TOKNROLL_OPTIONS configure libtoknroll only, which jinfer never loads. Using both wheels in one process is fine: toknroll.load(...) starts libtoknroll, a second runtime with its own heap and threads, the two never interact, the order they start in does not matter, and every tokenizer remembers the library serving it. A knob both need, such as a GGUF pre-tokenizer registration, is given to both.
One script a use case, in examples/, each runnable as it is with the model it names, downloaded on the first run:
A companion is a second file a model needs, named at load: jinfer.load(ref, companions={"media": " "}) for a vision model's projector, {"voice": " "} for a speaker's voice. The architectures the library carries are jinfer's ports, listed in the jinfer documentation.
make python in jinfer/jinfer-native stages the freshly built library into the package, then pip install python/. JINFER_LIBRARY=/path/to/libjinfer.so points the package at any build. pydantic is optional. The C API the package binds is jinfer.h, with toknroll.h for the tokenizer, usable from any language with a foreign function interface.
Apache 2.0, by Quixotic AI, for the package and the library's own code. The library in the wheel is built with Oracle GraalVM and carries its Native Image runtime under the GraalVM Free Terms and Conditions, spelled out in the wheel's NOTICE: use it as you like, commercially too; a product sold for a fee that bundles a copy of it is not covered by those terms, and takes a build with GraalVM CE, see the libjinfer README.
llm inference chat embeddings reranking speech transcription gguf local-ai
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




