Native Swift / MLX / 4D
Local inference. Built for your Mac.
Bring local AI into your application with Swama. Run models on Apple Silicon, serve chat and embeddings over HTTP, and connect from 4D or your own client.

Apple Silicon · macOS 15.4+ · Model weights downloaded separately
Choose your starting point
One engine. Two ways in.
Make it part of your app
Install the component and its dependencies. Let 4D manage model downloads, registration and the background server.
Explore the component → 02 / Start with HTTPTalk directly to the server
Use the included command-line tool without 4D. Download a model, start on localhost and send a request with curl.
Send a first request →Before you begin
Made for Apple Silicon.
| You bring | What to know |
|---|---|
| An Apple Silicon Mac | macOS 15.4 or newer. These native builds do not support Intel Macs, Windows or Linux. |
| A compatible MLX model | Choose a model that fits your memory and task. Check its license and instructions. Weights are not included in the download. |
| 4D 20+ for integration | Install the Swama component and its declared dependencies. Direct CLI/HTTP use does not require 4D or Xcode. |
Ready to run
Download. Keep the whole engine.
Verified component release
Swama for 4D 20.1.6
Includes the source-built Swama CLI 2.5.1, MLX kernels and required runtime resources. Developer ID signed and Apple notarization Accepted.
The DMG has a validated stapled notarization ticket. The ZIP contains the same signed component.
Copy the complete swama.4dbase folder from the disk image or ZIP. For 4D, follow the component installation guide. For standalone use, open Resources/bin/macOS inside that folder.
Prefer a source-build CLI artifact? See the native build guide. Those standalone Actions packages are ad-hoc signed, unlike the signed component download above.
From download to conversation
Your first local request.
This path uses the CLI directly, without starting 4D. If the component is already managing a server on port 8080, use that server instead of starting another one.
Choose and download a model
Shell / macOSReplace the folder path with your extracted download. The qwen3 alias downloads a chat model; allow time and disk space for the weights.
cd "/path/to/swama.4dbase/Resources/bin/macOS"
shasum -a 256 --check SHA256SUMS
./swama --version
./swama pull qwen3Start the engine on localhost
Shell / macOS./swama serve --host 127.0.0.1 --port 8080Leave it running. In another terminal, wait until model discovery returns HTTP 200. This confirms HTTP readiness, not that model inference has already completed.
curl --fail http://127.0.0.1:8080/v1/modelsStart a conversation
Shell / macOScurl --fail http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3",
"messages": [{"role": "user", "content": "Hello from my Mac."}],
"max_tokens": 128,
"stream": false
}'The first inference may take longer while the model loads. For streaming, use curl -N and set "stream": true. Stop a foreground server with Control-C.
Connect with tools you know
A familiar API. A local address.
Point AI Kit's OpenAI client at your running server. Use a model identifier returned by /v1/models; the 4D guide's custom model is not the CLI's qwen3 alias.
var $AIClient : cs.AIKit.OpenAI
$AIClient:=cs.AIKit.OpenAI.new()
$AIClient.baseURL:="http://127.0.0.1:8080/v1"| Capability | Endpoint | What to know |
|---|---|---|
| Model discovery | /v1/models | Supported |
| Chat completions | /v1/chat/completions | Vision and function-tool calling depend on the selected model. |
| Embeddings | /v1/embeddings | A separate embedding model is required. |
| Responses | /v1/responses | Partial OpenAI compatibility; not a full replacement. |
| Audio | /v1/audio/transcriptions, /v1/audio/speech | Suitable audio models are required. |
| Images, moderation, files | Generation, moderation and uploads | Not provided by this integration. |
Tool calls are returned to your client, not executed by the server. Follow the selected model's instructions; no blanket 4-bit-only restriction or manual config.json edit is prescribed.