Promptim: an experimental library for prompt optimization
Promptim is an open-source, experimental library that automates prompt engineering: given an initial prompt, a LangSmith dataset and custom evaluators, it runs an optimization loop where a metaprompt proposes edits based on scored train-set results, and keeps a new prompt only if it improves dev-split metrics, repeated N times. Optional human feedback via LangSmith annotation queues covers cases without good automated metrics. Unlike DSPy, which optimizes whole compound AI systems and includes fine-tuning and few-shot methods, Promptim focuses narrowly on rewriting a single prompt with a human kept in the loop.
Related posts
- You can’t vibe code a prompt
incident.io mediumAdeptLetting an LLM iteratively rewrite a prompt until evals pass produces overfitted, brittle prompts. In incident.io's Slack-message relevance classifier, Claude fixed one failing case but broke others. Given the whole eval suite, Claude Code hit 100% only by bloating the prompt 7× and hardcoding every test case, which reverted to the original failures once that section was removed. The recommended approach is to write prompts by hand with structurally similar but non-overlapping examples, and use LLMs for generating evals and examples, judging outputs, linting prompts for contradictions, and grading production interactions.
- Tricks to fix stubborn prompts
incident.io mediumAdeptSix practical techniques fix prompts that resist the usual remedies. Split tasks that combine classification and explanation into separate, cheaper and parallelizable calls. Read the full prompt for contradictions, such as a user message saying a message "is related" that overrode the system instructions. Structure prompts with clear headers and the goal up front, have an LLM review prompts for hidden assumptions, and mark the most important rules explicitly. Try other models using your own evals rather than benchmarks; one suite went from 50% failing to 100% passing by switching from GPT-4o to Sonnet. Pre-process inputs, for example replacing merged_at timestamps with time_since_merged so the model doesn't have to calculate durations.
- How we used DSPy to turn AI evaluations into better responses in Dash chat
Dropbox Tech mediumAdeptDropbox improved its Dash chat agent with a two-stage DSPy loop. First, LLM-as-judge evaluators were calibrated against a small set of human-labeled chat traces scored on five dimensions, with reasoning notes and failure codes. The calibrated judges then drove GEPA-based optimization of the agent's system prompt, using offline counterfactual replay of historical internal chats. Launch results included 26% fewer incomplete answers, 13% fewer missed key aspects, 5.4% lower token usage and 9.8% shorter completions. The team stresses guardrails: small targeted prompt edits plus automated checks on prompt structure, caching behavior and size.
- CoderForge-Preview: SOTA open dataset for training efficient coding agents
Together AI hardMasterCoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench. The trajectories were generated with Qwen3-Coder-480B in OpenHands Docker environments, filtered by rejection sampling and permissive-license audits, and cost about $130K to produce at a ~90% prompt cache hit rate. Fine-tuning Qwen3-32B on the passing trajectories, using Ulysses sequence parallelism, multipacking and token-level loss normalization at 128K context, reaches 59.4% pass@1 on SWE-Bench Verified, and a 4B model reaches 43.0%. Ablations show a repetition penalty helps only early checkpoints, so later checkpoints should be run without one.
- Open-source LLMs as LangChain Agents
Hugging Face mediumAdeptOpen-source LLMs can now serve as reasoning engines for tool-using ReAct agents, with Mixtral-8x7B outperforming GPT-3.5 out of the box on a mixed benchmark drawn from HotpotQA, GSM8K and GAIA, graded by GPT-4-as-a-judge. The ReAct loop works by prompting for a Thought plus a JSON tool call or a Final Answer, then parsing the output, running the tool and appending the Observation to the prompt. Agents are built in LangChain with the new ChatHuggingFace wrapper. Llama2-70b and Zephyr-7b perform poorly. About 10% of Mixtral's GAIA failures come from malformed tool arguments, so fine-tuning for function calling is the recommended next step. Giving models a calculator lifts zero-shot GSM8K scores, though only 20 questions were tested.