Skip to content

withDefaultDevice() #15

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

Merged
merged 2 commits into from
Aug 17, 2025
Merged

withDefaultDevice() #15

merged 2 commits into from
Aug 17, 2025

Conversation

atdrendel
Copy link
Contributor

Expose SHLLM.withDefaultDevice(_:_:) to allow clients to run inference on the CPU or GPU.

@Copilot Copilot AI review requested due to automatic review settings August 17, 2025 23:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a public interface to allow clients to specify whether inference should run on CPU or GPU by exposing SHLLM.withDefaultDevice(_:_:) methods. This provides device selection flexibility that was previously unavailable to API consumers.

Key changes:

  • Added synchronous and asynchronous versions of withDefaultDevice methods to the SHLLM enum
  • Exported MLX.DeviceType enum to make device selection available to clients
  • Added comprehensive test coverage for both CPU and GPU inference scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Sources/SHLLM/SHLLM.swift Implements the core withDefaultDevice methods and exports DeviceType enum
Tests/SHLLMTests/SHLLMTests.swift Adds test functions to verify CPU and GPU inference functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shareup shareup deleted a comment from Copilot AI Aug 17, 2025
@atdrendel atdrendel merged commit 2dafb02 into main Aug 17, 2025
1 check passed
@atdrendel atdrendel deleted the set-device branch August 17, 2025 23:23
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.

1 participant