MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / LLMProvider

Class LLMProvider

paperflow/providers/llm.py:30–52  ·  view source on GitHub ↗

Minimal interface every LLM backend must satisfy.

Source from the content-addressed store, hash-verified

28
29
30class LLMProvider(Protocol):
31 """Minimal interface every LLM backend must satisfy."""
32
33 name: str
34 model: str
35
36 def generate(
37 self,
38 prompt: str,
39 *,
40 system: Optional[str] = None,
41 temperature: float = 0.0,
42 max_tokens: int = 1024,
43 ) -> LLMResponse: ...
44
45 def stream_generate(
46 self,
47 prompt: str,
48 *,
49 system: Optional[str] = None,
50 temperature: float = 0.0,
51 max_tokens: int = 1024,
52 ) -> Iterator[str]: ...
53
54
55def _chunk_text(text: str, size: int = 24) -> Iterator[str]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected