ollama
Use Ollama local inference for text generation, classification, and analysis via local GPU models.
- License 许可
- Apache-2.0
- 所属仓库
- ncmlabs/forge
- 最近更新
- 2026-10-16
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ollama
- timeout
- 120
- description
- Use Ollama local inference for text generation, classification, and analysis via local GPU models.
- capabilities
- [ { "name": "generate", "inputs": [ "Text", "Text" ], "output": "Text" }, { "name": "classify", "inputs": [ "Text", "Text", "Text" ], "output": "Text" }, { "name": "analyze", "inputs": [ "Text", "Text" ], "output": "Text" } ]
- allowed-tools
- [ "Bash(ollama:*)" ]
03 SKILL.md 正文
Ollama Local Inference Skill
Use this skill when FORGE needs local LLM inference without external API calls. Ollama runs on the local GPU server (RTX 3090) and provides zero-cost text generation, classification, and analysis.
Default operating pattern:
- Select the model based on task complexity (fast, balanced, or high).
- Pipe the prompt to
ollama runvia stdin for multi-line prompts. - Capture stdout as the complete response.
- Parse or post-process the text output as needed.
Ollama is not a coding agent. It does not edit files, manage sessions, or run tools. Use it for inference tasks: classification, summarisation, text generation, and structured analysis.
Model Selection
Choose the model based on the task:
| Routing tier | Model | Use case |
|---|---|---|
fast |
gpt-oss:latest |
Short answers, quick classification, low-latency checks |
balanced |
qwen3-coder:latest |
Code analysis, structured classification, moderate reasoning |
high |
qwen3.5:27b |
Complex reasoning, long-form analysis, nuanced generation |
When the caller does not specify a model, default to qwen3-coder:latest.
Capabilities
generate(prompt, model)
General-purpose text generation.
Preferred command:
printf '%s\n' "$PROMPT" | ollama run "$MODEL"
For short single-line prompts:
ollama run "$MODEL" "$PROMPT"
Expected behavior:
- stdout contains the full generated text
- no side effects (no file writes, no network calls)
- exit code 0 on success
classify(text, categories, model)
Classify input text into one of the provided categories.
Preferred command:
printf 'Classify the following text into exactly one of these categories: %s\n\nText: %s\n\nRespond with only the category name.' "$CATEGORIES" "$TEXT" | ollama run "$MODEL"
Expected behavior:
- output is a single category name from the provided list
- use
qwen3-coder:latestorgpt-oss:latestfor fast classification - useful for urgency detection, intent classification, and triage
analyze(prompt, model)
Longer-form analysis such as code review summaries, log analysis, or document review.
Preferred command:
printf '%s\n' "$PROMPT" | ollama run "$MODEL"
Expected behavior:
- output is structured prose (findings, recommendations, risks)
- prefer
qwen3.5:27bfor complex analysis tasks - prefer
qwen3-coder:latestfor code-specific analysis
Session Adapter Mapping
| FORGE session field | Ollama CLI |
|---|---|
prompt |
stdin pipe or positional arg |
agent = "ollama" |
ollama run |
model |
model name arg (e.g., qwen3-coder:latest) |
tools |
N/A |
workdir |
process working directory |
timeout |
managed by FORGE wrapper |
budget |
N/A (local inference, no cost) |
resume |
N/A |
output_mode |
N/A (always plain text) |
AgentResult Mapping
| Ollama output | AgentResult field |
|---|---|
| stdout (full text) | output |
| exit code 0 | success (no error) |
| non-zero exit code | error |
| N/A | session_id (not supported) |
| N/A | tokens_in (not exposed by CLI) |
| N/A | tokens_out (not exposed by CLI) |
| 0.00 | cost_usd (local, always zero) |
Limitation: ollama run does not expose token usage or timing metadata in its CLI output. If token tracking is needed, use the OpenAI-compatible API endpoint (http://<host>:11434/v1) instead of the CLI.
Safety Rules
- Ollama is inference-only. Never expect it to edit files or execute commands.
- Always validate that the target model is pulled before invoking (
ollama list). - Prefer stdin piping for prompts containing quotes, newlines, or special characters.
- Set FORGE-level timeouts to guard against slow generation on large models.
- Do not send sensitive data through Ollama unless the server is on a trusted network.
- Cap confidence at 0.80 for Ollama outputs (local models are less capable than frontier APIs).
04 同仓库更多 Skills
greeter
Greet a person by name.
git_analysis
Deep agentic analysis of git repository health and trends
write-forge
Writing, checking or running FORGE `.forge` programs — the authoring loop, the CLI's JSON envelope and exit codes, and the syntax and checker mistakes that break agents. Use when a task asks for a FORGE program or `.forge` file, names FORGE tasks/flows/agents/pools/wardens, or when the project has a forge.project.toml.
slack
Slack operations via the Web API — messages, channels, threads, reactions, and approvals.
github
GitHub operations via the gh CLI — issues, PRs, branches, and CI checks.
codex
Use Codex CLI as a bounded coding agent for repo exploration, implementation, review, and session resume.