pal-code 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pal/__init__.py +29 -0
- pal/__main__.py +3 -0
- pal/access_manager/__init__.py +16 -0
- pal/access_manager/components/__init__.py +14 -0
- pal/access_manager/components/access_control.py +41 -0
- pal/access_manager/components/base.py +39 -0
- pal/access_manager/components/intervention.py +31 -0
- pal/access_manager/components/privilege_registry.py +30 -0
- pal/access_manager/pipeline.py +68 -0
- pal/access_manager/utils/__init__.py +2 -0
- pal/agent_constraints/__init__.py +3 -0
- pal/agent_constraints/components/AGENT_OUTPUT.md +13 -0
- pal/agent_constraints/components/__init__.py +3 -0
- pal/agent_constraints/components/constraints.py +22 -0
- pal/agent_constraints/pipeline.py +22 -0
- pal/agent_constraints/utils/__init__.py +2 -0
- pal/agents/__init__.py +12 -0
- pal/agents/coding.py +14 -0
- pal/agents/docs.py +15 -0
- pal/chat/__init__.py +4 -0
- pal/chat/demo.py +231 -0
- pal/chat/providers.py +23 -0
- pal/chat/service.py +591 -0
- pal/chat/services/__init__.py +26 -0
- pal/chat/services/base.py +142 -0
- pal/chat/services/data.py +142 -0
- pal/chat/services/media.py +123 -0
- pal/chat/services/web.py +60 -0
- pal/chat/sessions.py +108 -0
- pal/chat/tools.py +446 -0
- pal/chat/uploads.py +81 -0
- pal/cli.py +502 -0
- pal/compression/__init__.py +12 -0
- pal/compression/components/__init__.py +64 -0
- pal/compression/components/adverbs.py +20 -0
- pal/compression/components/hedges.py +54 -0
- pal/compression/components/interjections.py +20 -0
- pal/compression/components/minifier.py +56 -0
- pal/compression/components/output_compressor.py +13 -0
- pal/compression/components/pleonasms.py +54 -0
- pal/compression/components/punctuations.py +36 -0
- pal/compression/components/stopwords.py +62 -0
- pal/compression/history.py +346 -0
- pal/compression/pipeline.py +58 -0
- pal/compression/utils/__init__.py +30 -0
- pal/compression/utils/negations.py +18 -0
- pal/compression/utils/nltk_setup.py +20 -0
- pal/compression/utils/pronouns.py +27 -0
- pal/compression/utils/proselint_setup.py +9 -0
- pal/compression/utils/spacy_setup.py +22 -0
- pal/config/default.yaml +163 -0
- pal/config.py +504 -0
- pal/context_manager/__init__.py +7 -0
- pal/context_manager/chat_context.py +117 -0
- pal/context_manager/components/__init__.py +5 -0
- pal/context_manager/components/assembler.py +75 -0
- pal/context_manager/components/context_cache.py +45 -0
- pal/context_manager/components/kv_bridge.py +16 -0
- pal/context_manager/components/pager.py +48 -0
- pal/context_manager/components/simple_context_manager.py +56 -0
- pal/context_manager/components/turns.py +88 -0
- pal/context_manager/pipeline.py +27 -0
- pal/context_manager/utils/__init__.py +18 -0
- pal/context_manager/utils/hashing.py +5 -0
- pal/context_manager/utils/relevance.py +59 -0
- pal/context_manager/utils/storage.py +37 -0
- pal/documents/__init__.py +4 -0
- pal/documents/components/__init__.py +0 -0
- pal/documents/components/chunker.py +79 -0
- pal/documents/components/index.py +155 -0
- pal/documents/utils/__init__.py +1 -0
- pal/errors.py +40 -0
- pal/input_converters/__init__.py +8 -0
- pal/input_converters/components/__init__.py +0 -0
- pal/input_converters/components/base.py +38 -0
- pal/input_converters/components/pandoc_converter.py +87 -0
- pal/input_converters/components/pdf_converter.py +46 -0
- pal/input_converters/components/pptx_converter.py +52 -0
- pal/input_converters/components/xlsx_converter.py +38 -0
- pal/input_converters/pipeline.py +72 -0
- pal/input_converters/utils/__init__.py +1 -0
- pal/input_converters/workspace.py +56 -0
- pal/input_savers/INPUT_RULES.md +2 -0
- pal/input_savers/__init__.py +5 -0
- pal/input_savers/components/__init__.py +0 -0
- pal/input_savers/components/base.py +40 -0
- pal/input_savers/components/methods.py +41 -0
- pal/input_savers/components/verifier.py +39 -0
- pal/input_savers/pipeline.py +154 -0
- pal/input_savers/utils/__init__.py +0 -0
- pal/input_savers/utils/guards.py +94 -0
- pal/knowledge_graph/__init__.py +10 -0
- pal/knowledge_graph/components/__init__.py +0 -0
- pal/knowledge_graph/components/base.py +50 -0
- pal/knowledge_graph/components/builder.py +54 -0
- pal/knowledge_graph/components/retriever.py +100 -0
- pal/knowledge_graph/components/workspace.py +116 -0
- pal/knowledge_graph/pipeline.py +215 -0
- pal/knowledge_graph/utils/__init__.py +1 -0
- pal/latency_tracker/__init__.py +3 -0
- pal/latency_tracker/pipeline.py +86 -0
- pal/llm_scheduler/__init__.py +11 -0
- pal/llm_scheduler/api.py +137 -0
- pal/llm_scheduler/code.py +28 -0
- pal/llm_scheduler/core.py +92 -0
- pal/llm_scheduler/local.py +215 -0
- pal/llm_scheduler/pipeline.py +42 -0
- pal/llm_scheduler/types.py +92 -0
- pal/llm_wrapper/__init__.py +34 -0
- pal/llm_wrapper/adapter.py +316 -0
- pal/llm_wrapper/components/__init__.py +23 -0
- pal/llm_wrapper/components/adapter_types.py +90 -0
- pal/llm_wrapper/components/base.py +195 -0
- pal/llm_wrapper/components/features.py +104 -0
- pal/llm_wrapper/components/litellm_wrapper.py +215 -0
- pal/llm_wrapper/components/openrouter_wrapper.py +114 -0
- pal/llm_wrapper/modes.py +73 -0
- pal/llm_wrapper/pipeline.py +61 -0
- pal/llm_wrapper/utils/__init__.py +4 -0
- pal/llm_wrapper/utils/registry.py +49 -0
- pal/llm_wrapper/utils/token_counting.py +10 -0
- pal/local_llm/__init__.py +5 -0
- pal/local_llm/components/__init__.py +0 -0
- pal/local_llm/components/huggingface_local.py +217 -0
- pal/local_llm/components/local_llm.py +60 -0
- pal/logging_setup.py +18 -0
- pal/memory/__init__.py +7 -0
- pal/memory/components/__init__.py +6 -0
- pal/memory/components/lru_k.py +56 -0
- pal/memory/components/manager.py +98 -0
- pal/memory/components/note.py +54 -0
- pal/memory/components/storage_manager.py +60 -0
- pal/memory/pipeline.py +122 -0
- pal/memory/utils/__init__.py +3 -0
- pal/memory/utils/keyword_overlap.py +3 -0
- pal/memory_tracker/__init__.py +3 -0
- pal/memory_tracker/components/__init__.py +0 -0
- pal/memory_tracker/components/process.py +56 -0
- pal/memory_tracker/pipeline.py +44 -0
- pal/metrics/__init__.py +4 -0
- pal/metrics/components/__init__.py +4 -0
- pal/metrics/components/collector.py +140 -0
- pal/metrics/components/exporter.py +28 -0
- pal/metrics/pipeline.py +49 -0
- pal/metrics/utils/__init__.py +2 -0
- pal/notes_manager/__init__.py +5 -0
- pal/notes_manager/components/__init__.py +0 -0
- pal/notes_manager/components/privacy.py +14 -0
- pal/notes_manager/components/recall.py +31 -0
- pal/notes_manager/components/tidy.py +28 -0
- pal/notes_manager/pipeline.py +138 -0
- pal/orchestrator/__init__.py +26 -0
- pal/orchestrator/components/__init__.py +26 -0
- pal/orchestrator/components/agent.py +105 -0
- pal/orchestrator/components/cgroup_manager.py +209 -0
- pal/orchestrator/components/context_interrupt.py +220 -0
- pal/orchestrator/components/limits.py +9 -0
- pal/orchestrator/components/scheduler.py +69 -0
- pal/orchestrator/components/syscall_scheduler.py +200 -0
- pal/orchestrator/pipeline.py +228 -0
- pal/orchestrator/utils/__init__.py +4 -0
- pal/orchestrator/utils/device.py +164 -0
- pal/orchestrator/utils/protocol.py +32 -0
- pal/os_kernel/__init__.py +5 -0
- pal/os_kernel/filesystem.py +80 -0
- pal/os_kernel/network.py +146 -0
- pal/os_kernel/pipeline.py +175 -0
- pal/os_kernel/sysinfo.py +36 -0
- pal/paths.py +59 -0
- pal/pipeline.py +177 -0
- pal/py.typed +0 -0
- pal/redact.py +19 -0
- pal/sdk/__init__.py +33 -0
- pal/sdk/adapters.py +43 -0
- pal/sdk/agent.py +99 -0
- pal/sdk/components/__init__.py +14 -0
- pal/sdk/components/autogen_adapter.py +65 -0
- pal/sdk/components/autogen_client.py +98 -0
- pal/sdk/components/framework_adapter_base.py +69 -0
- pal/sdk/components/metagpt_adapter.py +46 -0
- pal/sdk/components/open_interpreter_adapter.py +47 -0
- pal/sdk/components/tool_catalog.py +44 -0
- pal/sdk/os_api.py +84 -0
- pal/sdk/patterns.py +129 -0
- pal/sdk/pipeline.py +240 -0
- pal/sdk/queries.py +68 -0
- pal/sdk/savers.py +88 -0
- pal/sdk/utils/__init__.py +2 -0
- pal/storage_manager/__init__.py +17 -0
- pal/storage_manager/components/__init__.py +19 -0
- pal/storage_manager/components/base.py +50 -0
- pal/storage_manager/components/local_file_backend.py +84 -0
- pal/storage_manager/components/storage_queue.py +91 -0
- pal/storage_manager/components/vector_store_backend.py +122 -0
- pal/storage_manager/pipeline.py +153 -0
- pal/storage_manager/utils/__init__.py +4 -0
- pal/storage_manager/utils/memory_adapter.py +60 -0
- pal/storage_manager/utils/sdk.py +93 -0
- pal/studio/__init__.py +0 -0
- pal/studio/builder.py +166 -0
- pal/studio/catalog.py +90 -0
- pal/studio/checks.py +129 -0
- pal/studio/clients.py +6 -0
- pal/studio/editor.py +137 -0
- pal/studio/files.py +6 -0
- pal/studio/models.py +6 -0
- pal/studio/plan.py +149 -0
- pal/studio/planner.py +205 -0
- pal/studio/policy.py +69 -0
- pal/studio/routes.py +254 -0
- pal/studio/runs.py +210 -0
- pal/task_router/__init__.py +11 -0
- pal/task_router/components/__init__.py +0 -0
- pal/task_router/components/answerer.py +37 -0
- pal/task_router/components/base.py +34 -0
- pal/task_router/components/classifier.py +40 -0
- pal/task_router/components/gates.py +23 -0
- pal/task_router/pipeline.py +61 -0
- pal/task_router/utils/__init__.py +1 -0
- pal/terminal/__init__.py +1 -0
- pal/terminal/backend.py +141 -0
- pal/terminal/bench.py +173 -0
- pal/terminal/cli.py +826 -0
- pal/terminal/clients.py +170 -0
- pal/terminal/commands.py +401 -0
- pal/terminal/decide.py +242 -0
- pal/terminal/files.py +55 -0
- pal/terminal/flow_cli.py +439 -0
- pal/terminal/hardware.py +199 -0
- pal/terminal/history.py +88 -0
- pal/terminal/keys.py +83 -0
- pal/terminal/local_models.py +261 -0
- pal/terminal/logo.py +117 -0
- pal/terminal/models.py +99 -0
- pal/terminal/policy.py +54 -0
- pal/terminal/project.py +413 -0
- pal/terminal/review.py +65 -0
- pal/terminal/security.py +239 -0
- pal/terminal/session.py +503 -0
- pal/terminal/setup.py +354 -0
- pal/terminal/syntax.py +98 -0
- pal/terminal/theme.py +37 -0
- pal/terminal/ui.py +647 -0
- pal/terminal/voice.py +137 -0
- pal/terminal/workflow.py +624 -0
- pal/token_tracker/__init__.py +3 -0
- pal/token_tracker/pipeline.py +54 -0
- pal/tokens.py +21 -0
- pal/tool_catalog.py +107 -0
- pal/tool_manager/__init__.py +17 -0
- pal/tool_manager/builtin.py +82 -0
- pal/tool_manager/components/__init__.py +19 -0
- pal/tool_manager/components/base.py +53 -0
- pal/tool_manager/components/conflict_resolver.py +27 -0
- pal/tool_manager/components/param_validator.py +41 -0
- pal/tool_manager/components/tool_call_queue.py +111 -0
- pal/tool_manager/components/tool_registry.py +60 -0
- pal/tool_manager/pipeline.py +80 -0
- pal/tool_manager/utils/__init__.py +3 -0
- pal/web/__init__.py +3 -0
- pal/web/app.py +276 -0
- pal/web/static/editor.js +219 -0
- pal/web/static/fonts/LICENSE-Inter.txt +3 -0
- pal/web/static/fonts/inter-400.woff2 +0 -0
- pal/web/static/fonts/inter-500.woff2 +0 -0
- pal/web/static/fonts/inter-600.woff2 +0 -0
- pal/web/static/fonts/inter-700.woff2 +0 -0
- pal/web/static/inter.css +5 -0
- pal/web/static/pal-logo-256.png +0 -0
- pal/web/static/pal-logo-32.png +0 -0
- pal/web/static/pal-logo-64.png +0 -0
- pal/web/static/studio.css +306 -0
- pal/web/static/studio.js +533 -0
- pal/web/static/voice.js +76 -0
- pal/web/templates/index.html +368 -0
- pal/web/templates/studio.html +120 -0
- pal_code-0.1.0.dist-info/METADATA +379 -0
- pal_code-0.1.0.dist-info/RECORD +282 -0
- pal_code-0.1.0.dist-info/WHEEL +5 -0
- pal_code-0.1.0.dist-info/entry_points.txt +2 -0
- pal_code-0.1.0.dist-info/licenses/LICENSE +21 -0
- pal_code-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import nltk
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class NltkSetup:
|
|
7
|
+
REQUIRED_PACKAGES: tuple[str, ...] = (
|
|
8
|
+
"punkt",
|
|
9
|
+
"punkt_tab",
|
|
10
|
+
"averaged_perceptron_tagger",
|
|
11
|
+
"averaged_perceptron_tagger_eng",
|
|
12
|
+
"stopwords",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
def _download_package(self, package: str) -> None:
|
|
16
|
+
nltk.download(package, quiet=True)
|
|
17
|
+
|
|
18
|
+
def download_all(self) -> None:
|
|
19
|
+
for package in self.REQUIRED_PACKAGES:
|
|
20
|
+
self._download_package(package)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Pronouns:
|
|
5
|
+
TAGS: set[str] = {"PRP", "PRP$", "WP", "WP$"}
|
|
6
|
+
|
|
7
|
+
WORDS: set[str] = {
|
|
8
|
+
"i", "me", "my", "mine", "myself",
|
|
9
|
+
"you", "your", "yours", "yourself", "yourselves",
|
|
10
|
+
"he", "him", "his", "himself",
|
|
11
|
+
"she", "her", "hers", "herself",
|
|
12
|
+
"it", "its", "itself",
|
|
13
|
+
"we", "us", "our", "ours", "ourselves",
|
|
14
|
+
"they", "them", "their", "theirs", "themselves",
|
|
15
|
+
"who", "whom", "whose", "which", "that",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def _matches_tag(self, tag: str | None) -> bool:
|
|
19
|
+
return tag is not None and tag in self.TAGS
|
|
20
|
+
|
|
21
|
+
def _matches_word(self, word: str) -> bool:
|
|
22
|
+
return word.lower() in self.WORDS
|
|
23
|
+
|
|
24
|
+
def is_pronoun(self, word: str, tag: str | None = None) -> bool:
|
|
25
|
+
if self._matches_tag(tag):
|
|
26
|
+
return True
|
|
27
|
+
return self._matches_word(word)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import spacy
|
|
4
|
+
from spacy.cli import download
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SpacySetup:
|
|
8
|
+
MODEL: str = "en_core_web_sm"
|
|
9
|
+
|
|
10
|
+
def _is_model_available(self) -> bool:
|
|
11
|
+
return spacy.util.is_package(self.MODEL)
|
|
12
|
+
|
|
13
|
+
def _download_model(self) -> None:
|
|
14
|
+
download(self.MODEL)
|
|
15
|
+
|
|
16
|
+
def ensure_model(self) -> None:
|
|
17
|
+
if not self._is_model_available():
|
|
18
|
+
self._download_model()
|
|
19
|
+
|
|
20
|
+
def load_model(self):
|
|
21
|
+
self.ensure_model()
|
|
22
|
+
return spacy.load(self.MODEL)
|
pal/config/default.yaml
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Pal defaults. Override any key with your own file (pal serve --config my.yaml, or the
|
|
2
|
+
# PAL_CONFIG env var) or with env vars: PAL__SERVER__PORT=8080, PAL__MEMORY__ENABLED=false.
|
|
3
|
+
|
|
4
|
+
# Local LLM: never shown to the user as a chat model. It routes tasks, applies the input savers and
|
|
5
|
+
# verifies them, and answers easy tasks itself.
|
|
6
|
+
local_llm:
|
|
7
|
+
enabled: true # false on a computer without a GPU: no local model; routing, input trimming and checking are off
|
|
8
|
+
backend: ollama
|
|
9
|
+
model: llama3
|
|
10
|
+
host: http://localhost:11434
|
|
11
|
+
|
|
12
|
+
# Optional separate model for the verification step. null = reuse local_llm.
|
|
13
|
+
verifier_llm: null
|
|
14
|
+
|
|
15
|
+
# "rules": one local-LLM pass driven by input_rules. "steps": the five methods below, one at a time.
|
|
16
|
+
input_mode: rules
|
|
17
|
+
input_rules: input_savers/INPUT_RULES.md
|
|
18
|
+
input_methods:
|
|
19
|
+
- remove_articles
|
|
20
|
+
- remove_punctuation
|
|
21
|
+
- remove_fillers
|
|
22
|
+
- abbreviate
|
|
23
|
+
- collapse_whitespace
|
|
24
|
+
|
|
25
|
+
# Output saver: sent to the API model in the system prompt on every request.
|
|
26
|
+
output_config: agent_constraints/components/AGENT_OUTPUT.md
|
|
27
|
+
base_system_prompt: "You are a helpful assistant."
|
|
28
|
+
|
|
29
|
+
# heuristic = estimate tokens locally (no network). provider = ask the model's tokenizer endpoint:
|
|
30
|
+
# exact, but adds a network round trip for every count.
|
|
31
|
+
token_counter: heuristic
|
|
32
|
+
|
|
33
|
+
# Where memory, documents and indexed projects live. null = ~/.pal (or PAL_HOME).
|
|
34
|
+
storage_dir: null
|
|
35
|
+
|
|
36
|
+
# Easy tasks are answered by the local LLM itself. Attachments, code and long text always go to the API.
|
|
37
|
+
task_routing:
|
|
38
|
+
enabled: true
|
|
39
|
+
default: auto # auto | local | api
|
|
40
|
+
max_local_chars: 400
|
|
41
|
+
max_local_lines: 6
|
|
42
|
+
history_messages: 6
|
|
43
|
+
|
|
44
|
+
# Attach a zip of source code: indexed once, locally (graphify, AST only). Each request then carries
|
|
45
|
+
# only the graph excerpts relevant to the question.
|
|
46
|
+
knowledge_graph:
|
|
47
|
+
enabled: true
|
|
48
|
+
dir: null
|
|
49
|
+
budget_tokens: 1500
|
|
50
|
+
max_slice_lines: 40
|
|
51
|
+
min_code_file_chars: 8000
|
|
52
|
+
max_zip_files: 3000
|
|
53
|
+
max_zip_mb: 50
|
|
54
|
+
|
|
55
|
+
# Context paging: the last hot_turns turns are always sent; older turns come back only if relevant.
|
|
56
|
+
context:
|
|
57
|
+
enabled: true
|
|
58
|
+
hot_turns: 6
|
|
59
|
+
recall_turns: 2
|
|
60
|
+
recall_threshold: 0.35
|
|
61
|
+
max_history_tokens: 6000
|
|
62
|
+
|
|
63
|
+
# Cross-session memory: your messages are stored on this machine and relevant ones from earlier
|
|
64
|
+
# sessions are added to a request. Turn off to store nothing.
|
|
65
|
+
memory:
|
|
66
|
+
enabled: true
|
|
67
|
+
dir: null
|
|
68
|
+
profile: default
|
|
69
|
+
recall_notes: 3
|
|
70
|
+
min_score: 0.3
|
|
71
|
+
budget_tokens: 300
|
|
72
|
+
min_chars: 25
|
|
73
|
+
block_limit: 200
|
|
74
|
+
|
|
75
|
+
# The Studio (a bot plans a product and builds it). Ollama's own default context window is small and it silently cuts a longer prompt, so these
|
|
76
|
+
# are sent with every local model call. A bigger window needs more memory.
|
|
77
|
+
studio:
|
|
78
|
+
num_ctx: 16384
|
|
79
|
+
planner_num_ctx: 8192
|
|
80
|
+
max_runs: 6
|
|
81
|
+
|
|
82
|
+
# Attached documents (PDF, Word, ...) are indexed once. Small ones are sent in full on the upload
|
|
83
|
+
# turn; big ones as a preview plus an outline. Later turns get only the relevant chunks.
|
|
84
|
+
documents:
|
|
85
|
+
enabled: true
|
|
86
|
+
inline_max_tokens: 2500
|
|
87
|
+
preview_tokens: 800
|
|
88
|
+
chunk_tokens: 350
|
|
89
|
+
retrieve_chunks: 3
|
|
90
|
+
budget_tokens: 1200
|
|
91
|
+
min_score: 0.15
|
|
92
|
+
max_file_chars: 500000 # bigger attachments are rejected (after conversion to markdown)
|
|
93
|
+
|
|
94
|
+
# Tools the API model may call (calculator, document and source lookup). Read-only.
|
|
95
|
+
tools:
|
|
96
|
+
network: false # allow wikipedia and arxiv lookups (the query text is sent to those sites)
|
|
97
|
+
# Third-party service tools from the AIOS paper. Off by default: your query leaves this machine, most need a key, some cost money.
|
|
98
|
+
# Names: google_search (through SerpApi: SERPAPI_API_KEY), wolfram_alpha (WOLFRAM_APP_ID), currency_convert and moon_phase (no key),
|
|
99
|
+
# words_api (RAPIDAPI_KEY), image_caption, visual_question_answering, text_to_image, text_to_audio, speech_to_text (HF_TOKEN).
|
|
100
|
+
# Or: [all]. See docs/TOOLS.md.
|
|
101
|
+
services: []
|
|
102
|
+
hf_models: {} # e.g. {text_to_image: "owner/model"}: which Hugging Face model a media tool uses
|
|
103
|
+
rapidapi_hosts: {} # e.g. {words_api: "your-listing.p.rapidapi.com"}: if your RapidAPI subscription shows another host
|
|
104
|
+
save_files: true # let an agent that has save_file write new files to its workspace
|
|
105
|
+
enabled: true
|
|
106
|
+
max_rounds: 3
|
|
107
|
+
max_result_tokens: 800
|
|
108
|
+
direct_answers: true # pure arithmetic and "what time is it" are answered with no model call
|
|
109
|
+
|
|
110
|
+
# Agent application layer: coding and documentation agents. Each reads its own key from the environment
|
|
111
|
+
# (GEMINI_API_KEY_CODING, GEMINI_API_KEY_DOCS, or a shared GEMINI_API_KEY). All token savers still apply.
|
|
112
|
+
agents:
|
|
113
|
+
enabled: true
|
|
114
|
+
model: gemini-3.5-flash
|
|
115
|
+
|
|
116
|
+
# Scheduling. API model: strictly first come, first served, one line per API key (with one key, chat and every agent share
|
|
117
|
+
# one line). Local model: preemptive priority: agent preparation first, then chat, then other (background) work; first
|
|
118
|
+
# come first served inside each class. File conversion and code-graph building run in code, a few at a time.
|
|
119
|
+
scheduler:
|
|
120
|
+
enabled: true
|
|
121
|
+
local_max_pauses: 2 # a local job is paused at most this often, then it runs to the end
|
|
122
|
+
other_stale_seconds: 600 # a background job that waited this long is dropped
|
|
123
|
+
code_workers: 2
|
|
124
|
+
max_queue: 100
|
|
125
|
+
api_min_interval: # seconds between API call starts, per provider (free tiers allow few per minute)
|
|
126
|
+
gemini: 4.0
|
|
127
|
+
api_retry_429: 2 # on a rate-limit error: wait, then retry this many times
|
|
128
|
+
api_backoff_seconds: 5.0
|
|
129
|
+
free_model_interval: 3.0 # seconds between calls to an OpenRouter ":free" model
|
|
130
|
+
|
|
131
|
+
# Fallback: if your own provider is rate-limited or down, answer with a second model instead. Needs the fallback provider's key
|
|
132
|
+
# in the environment (OPENROUTER_API_KEY) and a model name; leave model empty to keep it off.
|
|
133
|
+
fallback:
|
|
134
|
+
enabled: false
|
|
135
|
+
provider: openrouter
|
|
136
|
+
model: "" # e.g. an OpenRouter model whose name ends in :free (check openrouter.ai/models)
|
|
137
|
+
for_agents: true
|
|
138
|
+
|
|
139
|
+
# Non-LLM queries (file operations, network requests, system facts) go to the OS kernel (Ubuntu/Linux), never to a
|
|
140
|
+
# model. Files stay inside a per-agent workspace; private network addresses are blocked.
|
|
141
|
+
os_kernel:
|
|
142
|
+
enabled: true
|
|
143
|
+
workspace_dir: null # null = ~/.pal/workspaces
|
|
144
|
+
max_read_bytes: 1000000
|
|
145
|
+
max_write_bytes: 5000000
|
|
146
|
+
max_binary_bytes: 20000000 # largest image or audio file, uploaded or downloaded
|
|
147
|
+
allow_private_network: false
|
|
148
|
+
net_timeout_seconds: 10.0
|
|
149
|
+
net_max_bytes: 1000000
|
|
150
|
+
allowed_hosts: [] # empty = any public host
|
|
151
|
+
|
|
152
|
+
metrics:
|
|
153
|
+
enabled: true
|
|
154
|
+
max_records: 1000
|
|
155
|
+
|
|
156
|
+
server:
|
|
157
|
+
host: 127.0.0.1 # keep on localhost unless you put authentication in front
|
|
158
|
+
port: 5000
|
|
159
|
+
threads: 8
|
|
160
|
+
max_upload_mb: 20
|
|
161
|
+
max_sessions: 200
|
|
162
|
+
session_ttl_minutes: 240
|
|
163
|
+
log_level: INFO
|