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
Built Distribution
File details
Details for the file llama_index_llms_mlx-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_llms_mlx-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e304c02c997ff338018ea1fda9bc8d14bdbd8db2f65cc4977e292f382d28598 |
|
MD5 | b63980ffed87d8073c86680a0e009142 |
|
BLAKE2b-256 | 59f227a46586299f617eefe6fecf7afcf73c60592959768628b3aa2e14c9050e |
File details
Details for the file llama_index_llms_mlx-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_llms_mlx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 251b6d26842a233099eac25e58667d6a14bb07997500b41ee4b2b14f149d76d3 |
|
MD5 | 3c233001bf82ab087118fe237a911ddf |
|
BLAKE2b-256 | ddb48119179eb39482d90e30bd9ca42791947a7752e76890d9cabf63e542cc8a |