Skip to main content

Simple LLM continous batching engine implementation with support for optimized macos-inference

Project description

macos-serving

This repository contains a minimal continuous batching LLM engine. The current implementation is a straightforward PyTorch prototype focused on exercising the serving loop and request scheduler.

Current Capabilities

  • Runs a single dense model configuration: Qwen 0.6B.
  • Demonstrates continuous batching to keep GPU execution saturated under streaming request load.

Vision

  • Transition the backend to Metal-accelerated kernels purpose-built for Apple silicon.
  • Broaden model coverage and support quantized variants suited for on-device serving.
  • Introduce production-grade observability, adaptive batching heuristics, and deployment tooling tailored for macOS.

Quick Start

  1. Make sure you have uv installed
uvx macos-serving --model_path Qwen/Qwen3-0.6B

This command will install all required dependencies and run an API on port 4444 by default.

After server goes up you can go to http://localhost:4444 some simple chat page will be exposed there that you can use to test out inference process. Additionally you can use exposed API as openai compatible server and do something like this

from openai import OpenAI
client = OpenAI(base_url="http://localhost:4444/v1", api_key="")
messages = [
    {"role": "system", "content": "You are helpful assistant, answer user questions"},
    {"role": "user", "content": "Who was Shakesphere? Tell me in detail"},
]
response = client.chat.completions.create(messages=messages, model="w/e")
print(response)

For now this is just an experimental-exploration project in future there is a plan to further optimize it and play around with metal kernes.

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

macos_serving-0.1.0.tar.gz (62.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

macos_serving-0.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file macos_serving-0.1.0.tar.gz.

File metadata

  • Download URL: macos_serving-0.1.0.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for macos_serving-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad8b203013a2a5dcd984da206eb8d3d720abfdd99a5b2f3a2e8e624ab01304b8
MD5 c3e5b4786d29e0b0d096cd35c1555a1f
BLAKE2b-256 c814559a1efa9313522652ef8f92e61a7fbd3e7097329f6c0efeea1c3201620d

See more details on using hashes here.

File details

Details for the file macos_serving-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for macos_serving-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d662dd6428213cd85a538755b06890f0d9b775fcc21ceabf83be789a33be5db7
MD5 554b6e06e9f2217611684fc86a661519
BLAKE2b-256 57b37f193b61fbc8031c685c1fb3d146b3b778593cccde2e2c1f6c466f298ee8

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