Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aisi-inspect committed Jun 9, 2024
1 parent 5d419e4 commit 89322d1
Show file tree
Hide file tree
Showing 18 changed files with 1,236 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8b4953a3
bdd3020b
5 changes: 5 additions & 0 deletions agents.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down
5 changes: 5 additions & 0 deletions datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down
7 changes: 6 additions & 1 deletion eval-logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -1071,7 +1076,7 @@ <h3 class="anchored" data-anchor-id="reading-logs">Reading Logs</h3>
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"descPosition":"bottom","selector":".lightbox","closeEffect":"zoom","loop":false,"openEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","closeEffect":"zoom","descPosition":"bottom","loop":false,"openEffect":"zoom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
5 changes: 5 additions & 0 deletions eval-suites.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down
9 changes: 9 additions & 0 deletions eval-tuning.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./extensions.html" rel="next">
<link href="./eval-suites.html" rel="prev">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
Expand Down Expand Up @@ -256,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -933,6 +939,9 @@ <h3 class="anchored" data-anchor-id="web-requests">Web Requests</h3>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./extensions.html" class="pagination-link" aria-label="Extensions">
<span class="nav-page-text"><span class="chapter-title">Extensions</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
</div> <!-- /content -->
Expand Down
39 changes: 22 additions & 17 deletions examples.html

Large diffs are not rendered by default.

1,070 changes: 1,070 additions & 0 deletions extensions.html

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -456,9 +461,10 @@ <h2 class="anchored" data-anchor-id="learning-more">Learning More</h2>
</ul>
<p>These sections discuss more advanced features and workflow. You don’t need to review them at the outset, but be sure to revisit them as you get more comfortable with the basics.</p>
<ul>
<li><p><a href="eval-logs.html">Eval Logs</a> describes how to get the most out of evaluation logs for developing, debugging, and analyzing evaluations.</p></li>
<li><p><a href="eval-logs.html">Eval Logs</a> explores how to get the most out of evaluation logs for developing, debugging, and analyzing evaluations.</p></li>
<li><p><a href="eval-tuning.html">Eval Tuning</a> delves into how to obtain maximum performance for evaluations. Inspect uses a highly parallel async architecture—here we cover how to tune this parallelism (e.g to stay under API rate limits or to not overburden local compute) for optimal throughput.</p></li>
<li><p><a href="eval-suites.html">Eval Suites</a> cover Inspect’s features for describing, running, and analysing larger sets of evaluation tasks.</p></li>
<li><p><a href="eval-suites.html">Eval Suites</a> covers Inspect’s features for describing, running, and analysing larger sets of evaluation tasks.</p></li>
<li><p><a href="extensions.html">Extensions</a> describes the various ways you can extend Inspect, including adding support for new Model APIs, tool execution environments, and storage platforms (for datasets, prompts, and logs).</p></li>
</ul>


Expand Down Expand Up @@ -989,7 +995,7 @@ <h2 class="anchored" data-anchor-id="learning-more">Learning More</h2>
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"descPosition":"bottom","closeEffect":"zoom","loop":false,"selector":".lightbox","openEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","closeEffect":"zoom","openEffect":"zoom","descPosition":"bottom","loop":false});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
7 changes: 6 additions & 1 deletion log-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -937,7 +942,7 @@ <h2 class="anchored" data-anchor-id="task-information">Task Information</h2>
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","selector":".lightbox","descPosition":"bottom","loop":false,"closeEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"loop":false,"selector":".lightbox","openEffect":"zoom","descPosition":"bottom","closeEffect":"zoom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
53 changes: 7 additions & 46 deletions models.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -288,11 +293,7 @@ <h2 id="toc-title">Table of contents</h2>
</ul></li>
<li><a href="#helper-models" id="toc-helper-models" class="nav-link" data-scroll-target="#helper-models">Helper Models</a></li>
<li><a href="#model-args" id="toc-model-args" class="nav-link" data-scroll-target="#model-args">Model Args</a></li>
<li><a href="#custom-models" id="toc-custom-models" class="nav-link" data-scroll-target="#custom-models">Custom Models</a>
<ul class="collapse">
<li><a href="#model-registration" id="toc-model-registration" class="nav-link" data-scroll-target="#model-registration">Model Registration</a></li>
<li><a href="#using-the-model" id="toc-using-the-model" class="nav-link" data-scroll-target="#using-the-model">Using the Model</a></li>
</ul></li>
<li><a href="#custom-models" id="toc-custom-models" class="nav-link" data-scroll-target="#custom-models">Custom Models</a></li>
</ul>
<div class="toc-actions"><ul><li><a href="https://github.com/UKGovernmentBEIS/inspect_ai/issues/new" class="toc-action"><i class="bi bi-github"></i>Report an issue</a></li></ul></div></nav>
</div>
Expand Down Expand Up @@ -771,49 +772,9 @@ <h2 class="anchored" data-anchor-id="model-args">Model Args</h2>
</section>
<section id="custom-models" class="level2">
<h2 class="anchored" data-anchor-id="custom-models">Custom Models</h2>
<p>You can add a model provider by deriving a new class from <code>ModelAPI</code> and adding the <code>@modelapi</code> decorator to it. For example:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="at">@modelapi</span>(name<span class="op">=</span><span class="st">"custom"</span>)</span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="kw">class</span> CustomModelAPI(ModelAPI):</span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a> <span class="kw">def</span> <span class="fu">__init__</span>(</span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a> <span class="va">self</span>, </span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a> model_name: <span class="bu">str</span>,</span>
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a> base_url: <span class="bu">str</span> <span class="op">|</span> <span class="va">None</span> <span class="op">=</span> <span class="va">None</span>,</span>
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a> config: GenerateConfig <span class="op">=</span> GenerateConfig(),</span>
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a> <span class="op">**</span>model_args: <span class="bu">dict</span>[<span class="bu">str</span>,Any]</span>
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true" tabindex="-1"></a> ) <span class="op">-&gt;</span> <span class="va">None</span>:</span>
<span id="cb21-10"><a href="#cb21-10" aria-hidden="true" tabindex="-1"></a> <span class="bu">super</span>().<span class="fu">__init__</span>(model_name, base_url, config)</span>
<span id="cb21-11"><a href="#cb21-11" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb21-12"><a href="#cb21-12" aria-hidden="true" tabindex="-1"></a> <span class="cf">async</span> <span class="kw">def</span> generate(</span>
<span id="cb21-13"><a href="#cb21-13" aria-hidden="true" tabindex="-1"></a> <span class="va">self</span>,</span>
<span id="cb21-14"><a href="#cb21-14" aria-hidden="true" tabindex="-1"></a> <span class="bu">input</span>: <span class="bu">list</span>[ChatMessage],</span>
<span id="cb21-15"><a href="#cb21-15" aria-hidden="true" tabindex="-1"></a> tools: <span class="bu">list</span>[ToolInfo],</span>
<span id="cb21-16"><a href="#cb21-16" aria-hidden="true" tabindex="-1"></a> tool_choice: ToolChoice,</span>
<span id="cb21-17"><a href="#cb21-17" aria-hidden="true" tabindex="-1"></a> config: GenerateConfig,</span>
<span id="cb21-18"><a href="#cb21-18" aria-hidden="true" tabindex="-1"></a> ) <span class="op">-&gt;</span> ModelOutput:</span>
<span id="cb21-19"><a href="#cb21-19" aria-hidden="true" tabindex="-1"></a> ...</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>The <code>__init__()</code> method <em>must</em> call the <code>super().__init__()</code> method, and typically instantiates the model client library.</p>
<p>The <code>generate()</code> method handles interacting with the model. In addition, there are some optional methods you can override to specify various behaviours and constraints (default max tokens and connections, identifying rate limit errors, etc.)</p>
<section id="model-registration" class="level3">
<h3 class="anchored" data-anchor-id="model-registration">Model Registration</h3>
<p>If you are publishing a custom model within a Python package, you should register an <code>inspect_ai</code> <a href="https://setuptools.pypa.io/en/latest/userguide/entry_point.html">setuptools entry point</a>. This will ensure that inspect loads your extension before it attempts to resolve a model name that uses your provider.</p>
<p>For example, if your package was named <code>custom_models</code> and your model provider was exported from a source file named <code>inspect_ai.py</code> at the root of your package, <code>pyproject.toml</code> that would look like this:</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode toml code-with-copy"><code class="sourceCode toml"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="kw">[project.entry-points.inspect_ai]</span></span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="dt">custom_models</span> <span class="op">=</span> <span class="st">"custom_models.inspect_ai"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="using-the-model" class="level3">
<h3 class="anchored" data-anchor-id="using-the-model">Using the Model</h3>
<p>Once you’ve created the class, decorated it with <code>@modelapi</code> as shown above, and registered it, then you can use it as follows:</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">inspect</span> eval ctf.py <span class="at">--model</span> custom/my-model</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Where <code>my-model</code> is the name of some model supported by your provider (this will be passed to <code>__init()__</code> in the <code>model_name</code> argument).</p>
<p>You can also reference it from within Python calls to <code>get_model()</code> or <code>eval()</code>:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="co"># get a model instance</span></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a>model <span class="op">=</span> get_model(<span class="st">"custom/my-model"</span>)</span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a><span class="co"># run an eval with the model</span></span>
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true" tabindex="-1"></a><span class="bu">eval</span>(math, model <span class="op">=</span> <span class="st">"custom/my-model"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>If you want to support another model hosting service or local model source, you can add a custom model API. See the documentation on <a href="./extensions.html#sec-model-api-extensions">Model API Extensions</a> for additional details.</p>


</section>
</section>

</main> <!-- /main -->
Expand Down
5 changes: 5 additions & 0 deletions scorers.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
<div class="sidebar-item-container">
<a href="./eval-tuning.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Eval Tuning</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./extensions.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Extensions</span></a>
</div>
</li>
</ul>
</li>
Expand Down
Loading

0 comments on commit 89322d1

Please sign in to comment.