llm-agent
Skill8 starsChanged 5 months agoMITView on GitHub
Build a chat, reasoning, or tool-calling agent on top of Runware-hosted LLMs. Use when the user says "make an agent that can call my functions", "let the model use these tools", "wire up an LLM over my API", "chat assistant with function calling", "give the model access to my database/search", or wants multi-step reasoning that runs the user's own code. Covers the OpenAI-compatible chat-completions + tool-calling loop, not the imageInference task shape.
In this repository32 other files it gives its agents.
- add-audio-to-videoSkill
- animate-imageSkill
- bring-your-own-modelSkill
- character-consistencySkill
- cinematic-videoSkill
- composite-sceneSkill
- controlled-generationSkill
- dialogue-audioSkill
- edit-imageSkill
- edit-videoSkill
- game-assets-2dSkill
- image-to-3d-assetSkill
- logos-and-vectorsSkill
- multi-shot-videoSkill
- musicSkill
- photoreal-stillsSkill
- product-ad-videoSkill
- product-photographySkill
- reframe-videoSkill
- replace-in-videoSkill
- restore-and-upscaleSkill
- runware-modelsSkill
- runware-promptingSkill
- runware-runSkill
- talking-avatarSkill
- text-in-imageSkill
- train-style-modelSkill
- ugc-adSkill
- video-upscaleSkill
- vision-understandingSkill
- voice-cloningSkill
- voiceoverSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 69
Every assistant tool-call message and its matching tool reply are both in history, with tool_call_ids paired correctly.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LLM agent
Build a conversational or agentic LLM over your own functions using Runware-hosted models. The model reasons, decides when to call the tools you define, reads what they return, and answers with that data in hand. Runware exposes an OpenAI-compatible endpoint, so this is the standard chat-completions + tool-calling format, not the imageInference task shape the image skills use.
Inputs to collect
- The job: plain chat/reasoning, or tool-calling over the user's own functions.
- The tools (if agentic): each function's name, what it does, its arguments, and how the user runs it. The model never touches the systems directly. It only sees the schemas you hand it and the JSON they return.
- The system prompt: the agent's role and how eagerly it should act ("gather context before acting" vs "act immediately").
- Constraints: latency/cost target, context-window needs, whether reasoning depth matters.
Models
Address by AIR. Confirm each is live and inspect its schema via runware-models + runware-run before calling. Never hardcode a stale pick.
- Default flagship: Gemini 3.1 Pro (
google:gemini@3.1-pro). Strongest reasoning and instruction-following, ~1M-token context. Best general agent brain. - GPT-5.5 (
openai:gpt@5.5). Frontier reasoning for complex coding, long-context work, and tool-using professional tasks. - Claude Opus 4.8 (
anthropic:claude@opus-4.8). Premium reasoning and long-horizon tool use. - Claude Sonnet 4.6 (
anthropic:claude@sonnet-4.6). Fast, cheaper Claude tier for high-volume or latency-sensitive agents. - DeepSeek V4 Flash (
deepseek:v4@flash). Fast, cost-efficient open reasoner with ~1M-token context, dual thinking modes, strong on coding and agent tasks.
Route by sub-task, not by brand: pick reasoning depth and context window for the job, then drop to a faster tier for cheap or high-volume calls. All five carry io:text-to-text.
Workflow
This is text, not media, so it runs over the OpenAI-compatible endpoint, not imageInference.
- Point an OpenAI client at Runware. Base URL
https://api.runware.ai/v1, your Runware API key, and setmodelto the AIR (or slug). Existing OpenAI agent code and frameworks work unchanged. See the platform endpoint docs athttps://runware.ai/docs/tools/compatible-apis#openai-chat-completions. - Describe each tool as a JSON schema under
tools:{ "type": "function", "function": { name, description, parameters } }. Constrain arguments tightly (enum,required). - Send the conversation (
messageswithsystem+user) plustools. Settool_choice(defaultauto). - Run the loop. Read
response.choices[0].message. Iffinish_reasonistool_calls, the assistantcontentis null and calls live inmessage.tool_calls. For each call: parsefunction.arguments(a JSON string, not an object), run the function, and append onetoolmessage whosetool_call_idmatches the call'sid. Append the assistant message too. Repeat until the model returns no tool calls (finish_reason: "stop"). - Bound the loop. Cap iterations and stop with a clear error at the cap. Do not rely on the model to always finish on its own.
See references/examples.md for worked request/response recipes: a basic chat completion, a single tool-call loop, and parallel tool calls in OpenAI chat-completions format.
Technique
- One call answers one question. A loop answers a task. The model often calls more tools after seeing the first results. The whole protocol is: send the conversation, append whatever comes back, repeat until no more tool calls. The round that a single call can't reach is the model reading earlier results and choosing a new action from them.
- Three details carry the round-trip. A
tool_callsfinish means there is no text to show yet.argumentsis a JSON-encoded string you must parse. Yourtoolreply'stool_call_idmust equal the call'sid, and that pairing is how the model matches your result to its request. - Echo every tool call back into history. Append both the assistant message that requested the call and your
toolreply. Dropping the assistant message breaks thetool_call_idpairing and the next request errors. - Return errors as tool results, not exceptions. On a tool failure send
{ "error": "..." }back as thetoolmessage so the model can read it and adjust. A thrown exception just ends the loop. - Parallel tool calls come back in one message. When the model needs several independent pieces of information, it returns multiple entries in one
tool_callsarray instead of one round at a time. The loop already handles this: iterate every entry, append onetoolmessage per call. Because each result is matched by its owntool_call_id, you can run independent calls concurrently and append results in any order. - Set the action threshold in the system prompt. Whether the model gathers context before acting or acts immediately is shaped by lines like "inspect health and logs before taking action." Tighten or loosen that to match the autonomy you want.
- Design tools the model can use well. Name and description are a tool's entire interface. Name functions like API endpoints (
get_service_health,search_logs), nothandlerordoStuff. Treat the description as instructions for choosing between tools mid-conversation. Return compact JSON objects with named fields, not prose or large blobs. Keep the set small: a handful of well-scoped tools beats a large overlapping catalog.
Parameters that matter
model: the AIR (or slug). Confirm it'slivefirst.messages: the conversation. Keep stable parts (system prompt + tool defs) as a fixed prefix to maximize Runware's prompt cache. Watchusage.prompt_tokens_details.cached_tokensclimb across rounds on long conversations.tools: array of function schemas.enumandrequiredare the difference between a clean call and a malformed one.tool_choice:"auto"(default, model decides),"none"(text only, no tools),"required"(must call at least one tool), or{ "type": "function", "function": { "name": "..." } }(must call the named one, useful when the action is decided and you only need arguments filled). Naming a function guarantees that call but the model may still issue others it judges necessary. Expose only that one tool if you need exactly one call.temperature,max_completion_tokens: standard OpenAI knobs. Lower temperature for decisive tool-use agents.- Confirm the exact supported fields against the live model schema via
runware-run. Never guess.
Quality bar
- The loop is bounded (iteration cap with a clear error), not open-ended.
- Every assistant tool-call message and its matching
toolreply are both in history, withtool_call_ids paired correctly. argumentsis parsed (and ideally validated) before the function runs. Tool failures return{ "error": ... }, not exceptions.- Tools are tightly scoped: clear names,
enum/requiredon arguments, compact JSON results. - The model is
liveand supportsio:text-to-text(verified against its card, not assumed).
Related skills
runware-run, runware-models, runware-prompting; vision-understanding (image/video understanding with the same LLMs over the same endpoint).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

