Λογότυπο Inference Optimisation

Inference Optimisation

ΟργανισμόςΔημοφιλής
sybil-solutions
inference-optimisation

Hill-climb the serving speed of a local LLM on any hardware (NVIDIA, AMD, Intel, Apple, unified-memory laptops, multi-GPU) and any quantization (GGUF, EXL2/EXL3, AWQ/GPTQ, FP8, MLX, BF16): single-user and concurrent decode tok/s, speculative decoding, prefill tok/s, KV cache size, startup time and TTFT, under a memory cap and with full-context stability. Computes the theoretical ceiling first, runs noise-controlled A/B experiments, keeps a ledger, and qualifies the winner before publishing it. Use when asked to optimise, tune, speed up, benchmark or hill-climb a model server (vLLM, SGLang, llama.cpp, ExLlama/TabbyAPI, MLX, TensorRT-LLM...), to find the maximum possible tok/s on a machine, or to publish a tuned recipe. Triggers: hill climb, tok/s, decode speed, prefill speed, MTP, EAGLE, draft model, speculative decoding, KV cache, TTFT, startup time, theoretical maximum.

Επισκόπηση

Εκδότηςsybil-solutions
Αποθετήριοinference-optimisation-skill
Όνομα δεξιότηταςinference-optimisation
Αστέρια
3K
Διακλαδώσεις
286
Συνοδευτικά αρχεία
12
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Συνοδευτικά αρχεία: 12

    Αρχεία script, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό sybil-solutions. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Inference Optimisation στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/sybil-solutions/inference-optimisation-skill/tree/main/skills/inference-optimisation
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sybil-solutions/inference-optimisation-skill.git /tmp/inference-optimisation-skill
mkdir -p .claude/skills
cp -r /tmp/inference-optimisation-skill/skills/inference-optimisation .claude/skills/inference-optimisation
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Inference Optimisation σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Inference Optimisation μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Inference Optimisation δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Inference optimisation (hill-climbing a model server)

You improve how fast a model server runs on one machine, with evidence. The loop is:

  1. Measure the baseline.
  2. Calculate the ceiling.
  3. Change one thing.
  4. Measure it against controls.
  5. Keep it or reject it, and write down why.
  6. Repeat until the remaining gap needs work out of scope, then qualify and publish.

Detailed references, read when needed:

  • references/ceilings.md: how to compute theoretical maxima. It includes a worked example.
  • references/methodology.md: measurement pitfalls and statistics.
  • references/levers.md: levers by area, ordered by typical payoff, with measured evidence.
  • references/gotchas.md: engine- and hardware-specific traps.
  • references/publishing.md: qualification gates, pinning, poster and report.
  • scripts/: an engine-agnostic harness. It has a bench, ceiling calculator, memory watchdog, serialized queue and ledger.

0. Before touching anything

  • Write down the targets and constraints the user gave. Ask only if one is missing and it changes what you do.
    • Metrics that matter: c1 decode, cN decode, prefill at several lengths, TTFT, startup.
    • Memory cap.
    • Context length that must stay stable.
    • Which quality changes are allowed: lossless only, or labelled lossy trades such as int8 prefill.
  • Inventory the machine:
    • accelerator, memory type and size, and whether memory is unified;
    • driver, engine version, model, quantization, current launch command.
  • Measure, don't trust spec sheets:
    • real memory bandwidth (device copy);
    • real matmul throughput (large GEMM);
    • clocks under load.
  • Read any existing experiment log for this machine and model. Never rerun a rejected experiment without a new reason.
  • Create the working directory:
    • PLAN.md: a timestamped log of every experiment, with numbers, verdict and reason.
    • THEORY.md: the ceilings.
    • ledger.jsonl: one line per run, from the harness.
    • configs/: one JSON per run.
    • best-config.json.

1. Ceilings first

Compute the theoretical maximum for each metric before optimising (scripts/ceiling.py, references/ceilings.md):

  • Decode is memory-bandwidth bound. Count the bytes read per emitted token:
    • dense weights;
    • active experts: top-k ÷ experts × expert bytes;
    • LM head;
    • KV read at the working context.
    • Divide by measured bandwidth.
    • Speculative decoding divides the target's bytes by the accepted length. It also adds the draft's bytes, and the draft's LM head is often the biggest part.
  • Prefill is compute bound. FLOPs per token ≈ 2 × active params, plus attention at about 4 × layers × hidden × position. Divide by ~50% of measured peak for a practical ceiling.
  • TTFT floor: one forward pass plus tokenize and schedule.
  • Startup floor: weight read from disk or page cache plus allocation, assuming JIT and graph caches persist.
  • KV: bytes per token per layer × the layers that actually have KV (hybrid models have few). That gives how many full-length sequences fit under the memory cap.

Report progress as a percentage of the practical ceiling. If the user's target is above the ceiling, say so early, with the arithmetic.

2. Ground rules (non-negotiable)

  1. One change per experiment. Give each its own config file. Derive new configs from the current best.
  2. Control for noise. Run-to-run noise is typically ±5–10%.
    • Take ≥6 decode samples per run and use the median.
    • Run controls on both sides of each candidate: control, candidate, control.
    • Accept only if the candidate beats both neighbouring controls on its target metric and regresses nothing by more than ~3%.
    • Repeat any single surprising win.
  3. Keep the environment fixed. Stay on AC power, on a fixed performance profile, with an idle host and no other GPU jobs.
    • Make the harness refuse to run otherwise.
    • Record the state at the end of each run, and void the run if it changed.
    • Restore any profile you changed when you finish, and tell the user.
  4. Run one GPU job at a time. Serialize them with a lock (scripts/queue.sh).
    • Never use pkill -f/pgrep -f patterns that can match your own shell.
    • Detach long queues (setsid nohup … &) so they survive agent restarts.
  5. Enforce the memory cap with a watchdog that kills the run.
    • On unified memory, GPU allocations do not show in cgroup counters or MemAvailable. Measure driver residency (e.g. drm-resident-* in /proc/<pid>/fdinfo, nvidia-smi, or ioreg/vm_stat on Apple) plus process anonymous memory.
  6. Stability gates. A config is only "best" after it passes:
    • a long-context retrieval run, with needles in a ~50% then ~100% context document, found exactly;
    • a soak with concurrent full-length requests, if the KV pool is sized for N users;
    • a greedy output equivalence check, if the change claims to be lossless.
  7. Never force-kill a server mid-batch. Abort requests, wait for the drain, then stop with a timeout. A forced stop mid-prefill has caused GPU driver faults.
  8. Verify outputs, not just speed. Flag degenerate or looping output, failed requests and an idle GPU. A suspiciously fast result is usually broken output.
  9. Log everything in PLAN.md, including failures and why they failed. Negative results are the most reusable output.
  10. Secrets: never ask twice for a credential the user already saved. Never print it, and never copy it or its path into anything published.

3. The loop

baseline → profile → pick the lever with the largest (ceiling gap × likelihood) → config → A/B with controls
   ↑                                                                                         ↓
   └──────── update best-config + PLAN.md + ledger ←──── accept / reject with reason ←───────┘

Lever order

Cheapest first; see references/levers.md for evidence.

  1. Persistent JIT, compile and graph caches (startup −50–70%). Also use eager safetensors loading instead of mmap where it is slow.
  2. Decode graphs (CUDA/XPU graphs): often 2× c1 on their own.
  3. Speculative decoding:
    • Choose the method (built-in MTP, EAGLE, a draft model, n-gram).
    • Sweep draft length per concurrency and context; the best length differs.
    • Prune the draft LM head's vocabulary.
    • Keep sampling on the GPU.
    • Make sure verify runs with decode-style attention.
  4. Concurrency and KV sizing:
    • Set max running requests and the KV pool to N × context.
    • For hybrid SSM/GDN models, size the state slots. They, not KV, often cap concurrency.
    • Explicitly enable prefix caching and confirm cached_tokens > 0.
  5. Prefill:
    • Tune chunk size; it trades throughput against decode stalls.
    • Use a faster attention library.
    • Use int8/fp8 prefill GEMMs as a labelled quality trade.
    • Avoid padding cliffs in grouped MoE GEMMs.
  6. Kernel thread and tile sizes: defaults are often tuned for a bigger card.
  7. Kernel work: profile, read the ISA, fix the dominant kernel. Do this only after config levers plateau.

When a lever fails

  • If kernel-count reductions (fusion) give nothing under graphs, the time is inside the main kernels. Stop fusing.
  • If higher acceptance doesn't give higher tok/s, the draft costs too much. Measure per-step time.
  • If a weird result appears, suspect the measurement first: tokens counted per streamed chunk, prompt length not measured with the real tokenizer, cache hits, thermal state, or the battery.

Plateau

Declare a plateau when three consecutive levers land inside noise. Write a STATUS section in PLAN.md with:

  • best numbers vs baseline vs ceiling;
  • what limits further gains, with evidence;
  • a ranked list of the remaining levers and their estimated cost.

Then keep the loop alive at a slower cadence if the user said "don't stop", or hand back.

4. Qualify and publish

See references/publishing.md.

  • Pin weights by revision, engine by image digest or source commit, and kernels by commit. Build the published artifact from those pins in a clean checkout, never from a dirty tree.
  • Run the acceptance gates on the clean build: load, chat, reasoning, tools round-trip, a long-context needle, and speed.
  • Then A/B the clean build against your best image to prove they match.
  • Report which numbers come from which harness. Gate numbers (e.g. thinking on, first 30 s) and hill-climb numbers (thinking off, medians) are not comparable.

5. Reporting to the user

  • Start with a table: metric, baseline, now, ceiling, how it was measured (median of N, cold or warm, which harness).
  • Then: what got the gains, why it stops here, the known limitations, and the system state you changed (power profile, running servers, uncommitted code, branches that must not be deleted).
  • Say plainly what was not verified.
  • When asked to free the GPU: drain, stop the server, confirm no processes and an idle clock, and end any loop.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Inference Optimisation;

Hill-climb the serving speed of a local LLM on any hardware (NVIDIA, AMD, Intel, Apple, unified-memory laptops, multi-GPU) and any quantization (GGUF, EXL2/EXL3, AWQ/GPTQ, FP8, MLX, BF16): single-user and concurrent decode tok/s, speculative decoding, prefill tok/s, KV cache size, startup time and TTFT, under a memory cap and with full-context stability. Computes the theoretical ceiling first, runs noise-controlled A/B experiments, keeps a ledger, and qualifies the winner before publishing it. Use when asked to optimise, tune, speed up, benchmark or hill-climb a model server (vLLM, SGLang,...

Γιατί να χρησιμοποιήσετε τη δεξιότητα Inference Optimisation στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Inference Optimisation είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Inference Optimisation στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/sybil-solutions/inference-optimisation-skill/tree/main/skills/inference-optimisation. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Inference Optimisation;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Inference Optimisation;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Inference Optimisation με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Inference Optimisation;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό sybil-solutions με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇