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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llama_index_llms_mlx-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6d30640a790352139296fc489aa212e18bdda4441aa237bbc37ff34f71e63a78
MD5 8077e5467741dc9c037b28eccfed6b26
BLAKE2b-256 ee83af7091d6636cd53dcf325271e097d1b3389d6ab72870d0e0025f9c993527

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_mlx-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64d9929b2787a05e8ac56d30d2314d91a438455b5a0196c935b7c55975f7b6fe
MD5 717560a5cf193097d162be24401bf8d2
BLAKE2b-256 174a17d3df0f378cc531f3b0d1b019a7cd31315d3cbe3a75e7e94a8e21da5e80

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