feat: add Concurrent Inference support to llama.cpp client

This commit is contained in:
vegu-ai-tools
2026-05-19 00:22:05 +03:00
parent 3ca578ddf3
commit 008d36e7a2
2 changed files with 12 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
- "Frontend Tooling: Migrated the frontend from npm to pnpm for supply-chain hardening. pnpm is provisioned automatically through Corepack (bundled with Node.js), so there is no extra install step. A 7-day minimum-release-age cooldown prevents installing dependency versions less than a week old — keeping the project out of the blast radius of fast-moving npm supply-chain attacks — and dependency install/build scripts are now blocked unless explicitly allowlisted. pnpm 11 requires Node.js 22, so the install, update, and Docker build scripts now provision Node 22 automatically; the Linux and Windows installers download a portable Node runtime."
- "Scene Message List: Long scenes render more smoothly when the message history is modified. Operations that remove or rearrange messages (deleting a message, hiding from context, status updates that replace a previous status, etc.) now only re-render the affected slot instead of every message after the change point. As a side benefit, the collapsed state on context-investigation, director, and time-passage messages now survives when an earlier message in the scene is removed."
- "OpenAI Compatible Client: Added a Parameters config tab with individual toggles for `temperature`, `top_p`, and `presence_penalty`. When a parameter is toggled off it is omitted from the request payload entirely, which is needed for OpenAI-compatible backends that hard-error if the parameter is sent for the selected model. All three default to on so existing clients are unaffected."
- "llama.cpp Client: Added a Concurrent Inference toggle so batch operations can dispatch multiple requests in parallel against a single `llama-server`. Off by default; enable in the client config when the server is configured to handle parallel requests."
- "Autocomplete Hints: Dialogue, narrative, and contextual autocomplete now accept a free-form `{...}` hint block at the end of the input. Anything inside the curly braces is passed to the LLM as directional guidance for the continuation (tone, beats, sensory detail, character reactions, etc.) and the brace block itself is stripped from the field when the suggestion is accepted. Example: typing `\"Kaira!?\" he yelled {dark corridor, no response, ship shakes}` cues the model on what to weave into the completion without those tokens ending up in the scene text. Works in the scene input, character description / details / attributes, scene intro, and inline character / narrator / context-investigation message editing. Toggle via the new `Enable Hints` setting on the Creator agent's Autocomplete config (default on); trailing braces only, mid-text `{...}` is left alone."
- "Node Editor Log: Log entries now show a right-aligned `HH:MM:SS.mmm` timestamp derived from the node execution's `start_time`, making it easier to correlate log entries with what was happening in the scene."
fixes:

View File

@@ -12,6 +12,11 @@ from talemate.client.base import (
ParameterReroute,
)
from talemate.client.registry import register
from talemate.client.remote import (
ConcurrentInference,
ConcurrentInferenceMixin,
concurrent_inference_extra_fields,
)
from talemate.client.vision import VisionConfig, vision_extra_fields, OpenAIVisionMixin
from talemate.config.schema import Client as BaseClientConfig
from talemate.exceptions import GenerationProcessingError
@@ -25,12 +30,12 @@ class Defaults(CommonDefaults, pydantic.BaseModel):
max_token_length: int = 8192
class ClientConfig(VisionConfig, BaseClientConfig):
class ClientConfig(ConcurrentInference, VisionConfig, BaseClientConfig):
pass
@register()
class LlamaCppClient(OpenAIVisionMixin, ClientBase):
class LlamaCppClient(ConcurrentInferenceMixin, OpenAIVisionMixin, ClientBase):
"""
Client for ggml-org/llama.cpp `llama-server`.
@@ -53,7 +58,10 @@ class LlamaCppClient(OpenAIVisionMixin, ClientBase):
defaults: Defaults = Defaults()
self_hosted: bool = True
extra_fields: dict = pydantic.Field(
default_factory=lambda: vision_extra_fields()
default_factory=lambda: {
**vision_extra_fields(),
**concurrent_inference_extra_fields(),
}
)
@property