A hands-on starter guide for experimenting with a small open-weight LLM on your Mac. Written for Apple Silicon (M-series). Everything here runs locally, offline, and costs nothing to run.
| What you're doing | What it changes | Tool | Difficulty |
|---|
A hands-on starter guide for experimenting with a small open-weight LLM on your Mac. Written for Apple Silicon (M-series). Everything here runs locally, offline, and costs nothing to run.
| What you're doing | What it changes | Tool | Difficulty |
|---|
| package com.soverby.test; | |
| import org.junit.Test; | |
| import java.util.Optional; | |
| import java.util.function.Function; | |
| import static org.assertj.core.api.Java6Assertions.assertThat; | |
| public class NullableChain { |
| package com.accolade.test; | |
| import java.util.UUID; | |
| public class TestUUID { | |
| public static void main(String[] args) { | |
| // Valid UUID | |
| UUID uuid1 = UUID.fromString("123e4567-e89b-12d3-a456-426655440000"); | |
| // Not a valid UUID, UUID will left pad zeros |
| import lombok.Data; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.function.Consumer; | |
| import java.util.function.Supplier; | |
| public class ConsumerSupplierExample { | |
| public static void main(String[] args) { |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.function.Function; | |
| import java.util.function.Supplier; | |
| public class FormingClosure { | |
| Supplier<List<String>> supplier; | |
| public static void main(String[] args) { |
| import java.util.Date; | |
| import java.util.Optional; | |
| public class FunctionWithCheckedException { | |
| @FunctionalInterface | |
| public interface SomeAppropriateSemantic<T, R> { | |
| public R semantic(T t) throws CustomException; | |
| }; |
| import java.util.Date; | |
| import java.util.function.Function; | |
| public class MultiParameterFunction { | |
| // Bad | |
| @FunctionalInterface | |
| public interface TriFunction<T, U, V, R> { | |
| public R customMethod(T t, U u, V v); | |
| } |
| import java.util.function.BiFunction; | |
| import java.util.function.Consumer; | |
| import java.util.function.Supplier; | |
| public class JavaLambdaSyntax { | |
| private Consumer<String> stringConsumer; | |
| private Supplier<String> stringSupplier; | |
| private BiFunction<String, String, String> stringBiFunction; |
| public class OptionalChainingComposed { | |
| public static void main(String[] args) { | |
| OptionalChainingComposed optionalChaining = new OptionalChainingComposed(); | |
| optionalChaining.happyPath(); | |
| optionalChaining.nullInput(); | |
| } | |
| public void happyPath() { | |
| nonNullPipeline("happyPath") |
| public class OptionalChaining { | |
| public static void main(String[] args) { | |
| OptionalChaining optionalChaining = new OptionalChaining(); | |
| optionalChaining.happyPath(); | |
| optionalChaining.nullInput(); | |
| optionalChaining.thereBeNullsHereOne(); | |
| optionalChaining.thereBeNullsHereTwo(); | |
| } | |
| // Happy path with a pipeline that doesn't return nulls |