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

Implement CLI Client for FastMLX #24

Open
6 tasks
Blaizzy opened this issue Aug 2, 2024 · 0 comments
Open
6 tasks

Implement CLI Client for FastMLX #24

Blaizzy opened this issue Aug 2, 2024 · 0 comments

Comments

@Blaizzy
Copy link
Collaborator

Blaizzy commented Aug 2, 2024

Description

We need to implement a command-line interface (CLI) for downloading and managing models in FastMLX. This CLI should offer commands similar to those in Ollama, providing a user-friendly way to interact with FastMLX from the terminal.

Proposed Commands

  • fastmlx run <model_name>: Test the selected model in the terminal
  • fastmlx pull <model_name>: Download a specified model
  • fastmlx rm <model_name>: Remove a specified model
  • fastmlx list: List all downloaded models

Implementation Details

1. Create a new Python file for the CLI client

  • File name: cli.py
  • Location: In the root of the FastMLX package

2. Update fastmlx.py

  • Add necessary endpoints to support CLI operations
  • Ensure the API can handle model management requests

3. CLI Client Features

  • Use argparse for command-line argument parsing
  • Implement async HTTP requests to interact with the FastMLX API
  • Use rich library for improved terminal output

4. Error Handling

  • Implement proper error handling for network issues, API errors, etc.
  • Provide clear error messages to the user

5. Documentation

  • Update the README.md with instructions on how to use the CLI
  • Add inline comments and docstrings for better code maintainability

Acceptance Criteria

  • All proposed commands are implemented and working as expected
  • CLI client can communicate with the FastMLX API successfully
  • Error handling is robust and user-friendly
  • Code is well-documented and follows the project's coding standards
  • README.md is updated with CLI usage instructions
  • Manual testing has been performed for all commands

Additional Notes

  • Consider adding a progress bar for model download/removal operations
  • Explore the possibility of adding a fastmlx update command for updating models in the future

Related Issues/PRs

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

No branches or pull requests

1 participant