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.4.1.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.4.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_llms_mlx-0.4.1.tar.gz
Algorithm Hash digest
SHA256 fd5ecdf7b327de94b5fd3526aaa6bb69e1125946587073bf51044ca3e9e24857
MD5 ddc970a270c068ff6cd7d0d9068a7712
BLAKE2b-256 2eb8b9f073331458ba6e6713f228a4805b5caa453c709653687c2823c42240a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_mlx-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d749f7c0e1f631e5cb69885e066400e141a644d750bc9efd4eb513241e11c765
MD5 e2077f1e9a49ee14ffa5dc6878a1bf63
BLAKE2b-256 9cb0b3509c08bb8ba4cab5987d2e77bcc1390f1134fcab031e1bd9db5a4283a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page