Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support local model with inference-engine mlx #475

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

OKHand-Zy
Copy link

Enhancement: support local and custom models #165

This is a modified version of the code that I've made functional, although the code quality may not be ideal. It supports running local path models using mlx for both CLI and ChatAPI. However, I've encountered an issue where the response quality from the CLI is subpar. I would appreciate any suggestions on how to improve or optimize the code for better results.

Changes:

  • Added a "How to use local models" section to the README.
  • Added the --add-local-model args.
  • Implemented init_exo_env to configure local model cards and the local model store.
  • Added bypass logic for local models using if...else statements.

@blindcrone
Copy link
Contributor

I like the idea here, but think rather than rely on a folder structure this should use config files or command line arguments to specify paths to model implementations and populate things like the model card list at runtime. I'm considering refactoring the inference engine to take model implementations by default and use the shard downloader as one of a few possible routes to get weights, and I think automatically instantiating and parsing a default directory structure for this purpose creates a lot of potential for issues down the line

@OKHand-Zy
Copy link
Author

OKHand-Zy commented Nov 22, 2024

@blindcrone
Recently, while implementing the HTTP functionality for the local model, I realized what you meant. I've switched to using aiohttp to establish an HTTP service on each node. When needed, I'll check which node has the necessary data and use an internal network to download it in chunks (similar to how exo does it). Afterward, I'll rely on the inference_engine in the command to use the model, instead of configuring it through a config file. I'm wondering if this aligns with your thoughts? If there's a better approach, I'm open to suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants