Skip to main content

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))

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.6.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_mlx-0.6.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_index_llms_mlx-0.6.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_mlx-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f9260600935c270e685987d3093d47fa8cef226ba12c1ccf5d77b83695ea4dab
MD5 1d2b0c0391ef64d413ef7e9cb246fc1c
BLAKE2b-256 77d7112968da9a39c94f7e610f037ba03812dd25a1d1d89eb4ec576dfc902981

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_llms_mlx-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_mlx-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0c23ef774b661bcc6352c46f876ebdc638807037f6b121626070e9e91e40cf8
MD5 d9a97c9de42a44c844de0616c0d8f778
BLAKE2b-256 5dfe80ee8b2605e8788a91383d76f3fbe57523669296f4942944f9b5d8cdad4a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page