Skip to main content

llama-index llms mlx integration

Project description

LlamaIndex Llms Integration: MLX

Overview


Integrate with MLX LLMs from the mlx-lm library

Installation


pip install llama-index-llms-mlx

Example


from llama_index.llms.mlx import MLXLLM

llm = MLXLLM(
    model_name="microsoft/phi-2",
    context_window=3900,
    max_new_tokens=256,
    generate_kwargs={"temp": 0.7, "top_p": 0.95},
)

response = llm.complete("What is the meaning of life?")
print(str(response))

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

llama_index_llms_mlx-0.3.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

llama_index_llms_mlx-0.3.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_mlx-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_llms_mlx-0.3.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0

File hashes

Hashes for llama_index_llms_mlx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c2ca16de760de5fabf1451fd8060fa9c2557c8e03ec9ef1d5298c1f28764d8be
MD5 a1a257d78ea72425f96897c1753a75ed
BLAKE2b-256 1d0c2cb76f42b60584c1b2e1e41d6fdbd44b95339656a0d5f0286e614f5a458b

See more details on using hashes here.

File details

Details for the file llama_index_llms_mlx-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_mlx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f713b13277dba84ade78b13b9a4ef3ec9a37bc6201fdb78312b9599eeffa6f27
MD5 4452b134976d7710980503e73ad46f57
BLAKE2b-256 b224af6ada619929c4d08869d85654b422a16e4f9a18976c37959ef1d11275e0

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