Next Gen UI Embedded Llama Stack Server Inference
This module is part of the Next Gen UI Agent project.
Support for LLM inference using Embedded Llama Stack server.
Provides
LlamaStackEmbeddedAsyncAgentInferenceto use LLM hosted in embedded Llama Stack server, started from provided Llama Stack config file.init_inference_from_envmethod to init Llama Stack inference (remote or embedded) based on environment variablesINFERENCE_MODEL- LLM model to use - inference is not created if undefined (default value can be provided as method parameter)LLAMA_STACK_HOST- remote LlamaStack host - if defined then it is used with LLAMA_STACK_PORT to create remote LlamaStack inferenceLLAMA_STACK_PORT- remote LlamaStack port - optional, defaults to5001LLAMA_STACK_URL- remote LlamaStack url - ifLLAMA_STACK_HOSTis not defined, but this url is defined, then it is used to create remote LlamaStack inferenceLLAMA_STACK_CONFIG_FILE- path to embedded LlamaStack server config file, used only if no remote LlamaStack is configured (default value can be provided as method parameter)
examples/llamastack-ollama.yamlexample of the LlamaStack config file to use LLM from Ollama running on localhost (with model also taken fromINFERENCE_MODELenv variable).
Installation
pip install -U next_gen_ui_llama_stack_embedded
Example
Instantiation of LlamaStackEmbeddedAsyncAgentInference
from next_gen_ui_llama_stack_embedded import LlamaStackEmbeddedAsyncAgentInference
config_file = "example/llamastack-ollama.yaml"
model = "llama3.2:latest"
inference = LlamaStackEmbeddedAsyncAgentInference(config_file, model)
# init UI Agent using inference
Inference initialization from environment variables
from next_gen_ui_llama_stack_embedded import init_inference_from_env
# default model used if env variable is not defined
INFERENCE_MODEL_DEFAULT = "granite3.3:2b"
inference = init_inference_from_env(default_model=INFERENCE_MODEL_DEFAULT)
if (inference):
# init UI Agent using inference
else:
print("Inference not initialized because not configured in env variables")
Links
Metadata
Release files for next-gen-ui-llama-stack-embedded 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| next_gen_ui_llama_stack_embedded-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / next_gen_ui_llama_stack_embedded-0.4.0-py3-none-any.whl
| Download URL | next_gen_ui_llama_stack_embedded-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0db98b460dd8b220399420f00ab8a9b8997d79a6d8aa517bffe4f8510d5af7c
|
|
BLAKE2b-256 checksum How to use checksums |
1db6ae93e4a722196defd11553642524c00df6a877001710c52096efb3a35b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for next-gen-ui-llama-stack-embedded 0.4.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.