import{s as Bo,o as Zo,n as V}from"../chunks/scheduler.3d32dc09.js";import{S as Qo,i as Wo,e as i,s as o,c as g,h as So,a as m,d as s,b as a,f as k,g as u,j as p,k as _,l as c,m as l,n as M,t as h,o as f,p as y}from"../chunks/index.f9718211.js";import{T as Vo}from"../chunks/Tip.6cf8c24b.js";import{C as Ro,H as N,E as zo}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.51c38499.js";import{D as A,E as G}from"../chunks/ExampleCodeBlock.9d054956.js";import{C as I}from"../chunks/CodeBlock.ab331c21.js";function Xo(U){let r,b=`Smolagents is an experimental API which is subject to change at any time. Results returned by the agents
can vary as the APIs or underlying models are prone to change.`;return{c(){r=i("p"),r.textContent=b},l(T){r=m(T,"P",{"data-svelte-h":!0}),p(r)!=="svelte-19v5hvw"&&(r.textContent=b)},m(T,d){l(T,r,d)},p:V,d(T){T&&s(r)}}}function Fo(U){let r,b="Example:",T,d,w;return d=new I({props:{code:"Y2xhc3MlMjBDdXN0b21Nb2RlbChNb2RlbCklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBnZW5lcmF0ZShzZWxmJTJDJTIwbWVzc2FnZXMlMkMlMjAqKmt3YXJncyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBJbXBsZW1lbnRhdGlvbiUyMHNwZWNpZmljJTIwdG8lMjB5b3VyJTIwbW9kZWwlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwYXNz",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomModel</span>(<span class="hljs-title class_ inherited__">Model</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">generate</span>(<span class="hljs-params">self, messages, **kwargs</span>):
        <span class="hljs-comment"># Implementation specific to your model</span>
        <span class="hljs-keyword">pass</span>`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Go(U){let r,b="Example:",T,d,w;return d=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2UlM0QlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0Q1MDAwJTJDJTBBKSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyRXhwbGFpbiUyMHF1YW50dW0lMjBtZWNoYW5pY3MlMjBpbiUyMHNpbXBsZSUyMHRlcm1zLiUyMiU3RCU1RCUwQXJlc3BvbnNlJTIwJTNEJTIwZW5naW5lKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJFTkQlMjIlNUQpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = TransformersModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    device=<span class="hljs-string">&quot;cuda&quot;</span>,
<span class="hljs-meta">... </span>    max_new_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Ho(U){let r,b="Example:",T,d,w;return d=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBwcm92aWRlciUzRCUyMm5lYml1cyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRva2VuJTNEJTIyeW91cl9oZl90b2tlbl9oZXJlJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDUwMDAlMkMlMEEpJTBBbWVzc2FnZXMlMjAlM0QlMjAlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJFeHBsYWluJTIwcXVhbnR1bSUyMG1lY2hhbmljcyUyMGluJTIwc2ltcGxlJTIwdGVybXMuJTIyJTdEJTVEJTBBcmVzcG9uc2UlMjAlM0QlMjBlbmdpbmUobWVzc2FnZXMlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMkVORCUyMiU1RCklMEFwcmludChyZXNwb25zZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = InferenceClientModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    provider=<span class="hljs-string">&quot;nebius&quot;</span>,
<span class="hljs-meta">... </span>    token=<span class="hljs-string">&quot;your_hf_token_here&quot;</span>,
<span class="hljs-meta">... </span>    max_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Po(U){let r,b="Example:",T,d,w;return d=new I({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMFdlYlNlYXJjaFRvb2wlMkMlMjBMaXRlTExNUm91dGVyTW9kZWwlMEFvcy5lbnZpcm9uJTVCJTIyT1BFTkFJX0FQSV9LRVklMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFvcy5lbnZpcm9uJTVCJTIyQVdTX0FDQ0VTU19LRVlfSUQlMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFvcy5lbnZpcm9uJTVCJTIyQVdTX1NFQ1JFVF9BQ0NFU1NfS0VZJTIyJTVEJTIwJTNEJTIwJTIyJTIyJTBBb3MuZW52aXJvbiU1QiUyMkFXU19SRUdJT04lMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFsbG1fbG9hZGJhbGFuY2VyX21vZGVsX2xpc3QlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtb2RlbF9uYW1lJTIyJTNBJTIwJTIybW9kZWwtZ3JvdXAtMSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxpdGVsbG1fcGFyYW1zJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJncHQtNG8tbWluaSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmFwaV9rZXklMjIlM0ElMjBvcy5nZXRlbnYoJTIyT1BFTkFJX0FQSV9LRVklMjIpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMCUyMm1vZGVsLWdyb3VwLTElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsaXRlbGxtX3BhcmFtcyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyYmVkcm9jayUyRmFudGhyb3BpYy5jbGF1ZGUtMy1zb25uZXQtMjAyNDAyMjktdjElM0EwJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYXdzX2FjY2Vzc19rZXlfaWQlMjIlM0ElMjBvcy5nZXRlbnYoJTIyQVdTX0FDQ0VTU19LRVlfSUQlMjIpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYXdzX3NlY3JldF9hY2Nlc3Nfa2V5JTIyJTNBJTIwb3MuZ2V0ZW52KCUyMkFXU19TRUNSRVRfQUNDRVNTX0tFWSUyMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJhd3NfcmVnaW9uX25hbWUlMjIlM0ElMjBvcy5nZXRlbnYoJTIyQVdTX1JFR0lPTiUyMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElNUQlMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Sb3V0ZXJNb2RlbCglMEElMjAlMjAlMjBtb2RlbF9pZCUzRCUyMm1vZGVsLWdyb3VwLTElMjIlMkMlMEElMjAlMjAlMjBtb2RlbF9saXN0JTNEbGxtX2xvYWRiYWxhbmNlcl9tb2RlbF9saXN0JTJDJTBBJTIwJTIwJTIwY2xpZW50X2t3YXJncyUzRCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvdXRpbmdfc3RyYXRlZ3klMjIlM0ElMjJzaW1wbGUtc2h1ZmZsZSUyMiUwQSUyMCUyMCUyMCU3RCUwQSklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QldlYlNlYXJjaFRvb2woKSU1RCUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBYWdlbnQucnVuKCUyMkhvdyUyMG1hbnklMjBzZWNvbmRzJTIwd291bGQlMjBpdCUyMHRha2UlMjBmb3IlMjBhJTIwbGVvcGFyZCUyMGF0JTIwZnVsbCUyMHNwZWVkJTIwdG8lMjBydW4lMjB0aHJvdWdoJTIwUG9udCUyMGRlcyUyMEFydHMlM0YlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> os
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, WebSearchTool, LiteLLMRouterModel
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_ACCESS_KEY_ID&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_SECRET_ACCESS_KEY&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_REGION&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>llm_loadbalancer_model_list = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;litellm_params&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;gpt-4o-mini&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>),
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;litellm_params&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;bedrock/anthropic.claude-3-sonnet-20240229-v1:0&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_access_key_id&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_ACCESS_KEY_ID&quot;</span>),
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_secret_access_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_SECRET_ACCESS_KEY&quot;</span>),
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_region_name&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_REGION&quot;</span>),
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">&gt;&gt;&gt; </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LiteLLMRouterModel(
<span class="hljs-meta">... </span>   model_id=<span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>   model_list=llm_loadbalancer_model_list,
<span class="hljs-meta">... </span>   client_kwargs={
<span class="hljs-meta">... </span>       <span class="hljs-string">&quot;routing_strategy&quot;</span>:<span class="hljs-string">&quot;simple-shuffle&quot;</span>
<span class="hljs-meta">... </span>   }
<span class="hljs-meta">&gt;&gt;&gt; </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent = CodeAgent(tools=[WebSearchTool()], model=model)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent.run(<span class="hljs-string">&quot;How many seconds would it take for a leopard at full speed to run through Pont des Arts?&quot;</span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Yo(U){let r,b="Creating a model instance with default settings:",T,d,w;return d=new I({props:{code:"YmVkcm9ja19tb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCd1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-1368o2k"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Do(U){let r,b="Creating a model instance with a custom boto3 client:",T,d,w;return d=new I({props:{code:"aW1wb3J0JTIwYm90bzMlMEFjbGllbnQlMjAlM0QlMjBib3RvMy5jbGllbnQoJ2JlZHJvY2stcnVudGltZSclMkMlMjByZWdpb25fbmFtZSUzRCd1cy13ZXN0LTInKSUwQWJlZHJvY2tfbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QndXMuYW1hem9uLm5vdmEtcHJvLXYxJTNBMCclMkMlMEElMjAlMjAlMjAlMjBjbGllbnQlM0RjbGllbnQlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> boto3
<span class="hljs-meta">&gt;&gt;&gt; </span>client = boto3.client(<span class="hljs-string">&#x27;bedrock-runtime&#x27;</span>, region_name=<span class="hljs-string">&#x27;us-west-2&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    client=client
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11isg5i"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Oo(U){let r,b="Creating a model instance with client_kwargs for internal client creation:",T,d,w;return d=new I({props:{code:"YmVkcm9ja19tb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCd1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJyUyQyUwQSUyMCUyMCUyMCUyMGNsaWVudF9rd2FyZ3MlM0QlN0IncmVnaW9uX25hbWUnJTNBJTIwJ3VzLXdlc3QtMiclMkMlMjAnZW5kcG9pbnRfdXJsJyUzQSUyMCdodHRwcyUzQSUyRiUyRmN1c3RvbS1lbmRwb2ludC5jb20nJTdEJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    client_kwargs={<span class="hljs-string">&#x27;region_name&#x27;</span>: <span class="hljs-string">&#x27;us-west-2&#x27;</span>, <span class="hljs-string">&#x27;endpoint_url&#x27;</span>: <span class="hljs-string">&#x27;https://custom-endpoint.com&#x27;</span>}
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-1s85quz"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Ko(U){let r,b="Creating a model instance with inference and guardrail configurations:",T,d,w;return d=new I({props:{code:"YWRkaXRpb25hbF9hcGlfY29uZmlnJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIyaW5mZXJlbmNlQ29uZmlnJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWF4VG9rZW5zJTIyJTNBJTIwMzAwMCUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMmd1YXJkcmFpbENvbmZpZyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmd1YXJkcmFpbElkZW50aWZpZXIlMjIlM0ElMjAlMjJpZGVudGlmeTElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxWZXJzaW9uJTIyJTNBJTIwJ3YxJyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSU3RCUwQWJlZHJvY2tfbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QnYW50aHJvcGljLmNsYXVkZS0zLWhhaWt1LTIwMjQwMzA3LXYxJTNBMCclMkMlMEElMjAlMjAlMjAlMjAqKmFkZGl0aW9uYWxfYXBpX2NvbmZpZyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>additional_api_config = {
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;inferenceConfig&quot;</span>: {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;maxTokens&quot;</span>: <span class="hljs-number">3000</span>
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;guardrailConfig&quot;</span>: {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;guardrailIdentifier&quot;</span>: <span class="hljs-string">&quot;identify1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;guardrailVersion&quot;</span>: <span class="hljs-string">&#x27;v1&#x27;</span>
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;anthropic.claude-3-haiku-20240307-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    **additional_api_config
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-4kd7m4"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function ea(U){let r,b="Example:",T,d,w;return d=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwTUxYTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJtbHgtY29tbXVuaXR5JTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QtNGJpdCUyMiUyQyUwQSUyMCUyMCUyMCUyMG1heF90b2tlbnMlM0QxMDAwMCUyQyUwQSklMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkV4cGxhaW4lMjBxdWFudHVtJTIwbWVjaGFuaWNzJTIwaW4lMjBzaW1wbGUlMjB0ZXJtcy4lMjIlMEElMjAlMjAlMjAlMjAlN0QlMEElNUQlMEFyZXNwb25zZSUyMCUzRCUyMGVuZ2luZShtZXNzYWdlcyUyQyUyMHN0b3Bfc2VxdWVuY2VzJTNEJTVCJTIyRU5EJTIyJTVEKSUwQXByaW50KHJlc3BvbnNlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = MLXModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;mlx-community/Qwen2.5-Coder-32B-Instruct-4bit&quot;</span>,
<span class="hljs-meta">... </span>    max_tokens=<span class="hljs-number">10000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function ta(U){let r,b,T,d,w,n,J,hs,H,fs,Me,xl=`To learn more about agents and tools make sure to read the <a href="../index">introductory guide</a>. This page
contains the API docs for the underlying classes.`,ys,he,Ts,fe,Al=`All model classes in smolagents support passing additional keyword arguments (like <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time.
These parameters are automatically forwarded to the underlying model’s completion calls, allowing you to configure model behavior such as creativity, response length, and sampling strategies.`,ws,ye,Js,Te,ql="The <code>Model</code> class serves as the foundation for all model implementations, providing the core interface that custom models must implement to work with agents.",bs,C,we,Zn,Wt,El="Base class for all language model implementations.",Qn,St,Nl=`This abstract class defines the core interface that all model implementations must follow
to work with agents. It provides common functionality for message handling, tool integration,
and model configuration while allowing subclasses to implement their specific generation logic.`,Wn,Vt,Ll=`Note:
This is an abstract base class. Subclasses must implement the <code>generate()</code> method
to provide actual model inference capabilities.`,Sn,P,Vn,Y,Je,Rn,Rt,Bl="Process the input messages and return the model’s response.",zn,D,be,Xn,zt,Zl="Sometimes APIs do not return the tool call as a specific object, so we need to parse it.",Fn,O,je,Gn,Xt,Ql="Converts the model into a JSON-compatible dictionary.",js,_e,_s,Ie,Wl="The <code>ApiModel</code> class serves as the foundation for all API-based model implementations, providing common functionality for external API interactions, rate limiting, and client management that API-specific models inherit.",Is,L,ve,Hn,Ft,Sl="Base class for API-based language models.",Pn,Gt,Vl=`This class serves as a foundation for implementing models that interact with
external APIs. It handles the common functionality for managing model IDs,
custom role mappings, and API client connections.`,Yn,K,Ue,Dn,Ht,Rl="Create the API client for the specific service.",vs,Ce,Us,$e,zl="For convenience, we have added a <code>TransformersModel</code> that implements the points above by building a local <code>transformers</code> pipeline for the model_id given at initialization.",Cs,ke,$s,xe,ks,Ae,Xl="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_new_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",xs,qe,As,ee,Fl="<p>You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install &#39;smolagents[transformers]&#39;</code> if it’s not the case.</p>",qs,q,Ee,On,Pt,Gl="A class that uses Hugging Face’s Transformers library for language model interaction.",Kn,Yt,Hl="This model allows you to load and use Hugging Face’s models locally using the Transformers library. It supports features like stop sequences and grammar customization.",el,Ne,Pl="<p>You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install &#39;smolagents[transformers]&#39;</code> if it’s not the case.</p>",tl,te,Es,Le,Ns,Be,Yl='The <code>InferenceClientModel</code> wraps huggingface_hub’s <a href="https://huggingface.co/docs/huggingface_hub/main/en/guides/inference" rel="nofollow">InferenceClient</a> for the execution of the LLM. It supports all <a href="https://huggingface.co/docs/inference-providers/index" rel="nofollow">Inference Providers</a> available on the Hub: Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.',Ls,Ze,Dl="You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument:",Bs,Qe,Zs,We,Qs,Se,Ol="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",Ws,Ve,Ss,x,Re,sl,Dt,Kl="A class to interact with Hugging Face’s Inference Providers for language model interaction.",nl,Ot,eo="This model allows you to communicate with Hugging Face’s models using Inference Providers. It can be used in both serverless mode, with a dedicated endpoint, or even with a local URL, supporting features like stop sequences and grammar customization.",ll,Kt,to="Providers include Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.",ol,se,al,ne,ze,rl,es,so="Create the Hugging Face client.",Vs,Xe,Rs,Fe,no=`The <code>LiteLLMModel</code> leverages <a href="https://www.litellm.ai/" rel="nofollow">LiteLLM</a> to support 100+ LLMs from various providers.
You can pass kwargs upon model initialization that will then be used whenever using the model, for instance below we pass <code>temperature</code>. You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument.`,zs,Ge,Xs,W,He,il,ts,lo='Model to use <a href="https://docs.litellm.ai/docs/#litellm-python-sdk" rel="nofollow">LiteLLM Python SDK</a> to access hundreds of LLMs.',ml,le,Pe,cl,ss,oo="Create the LiteLLM client.",Fs,Ye,Gs,De,ao=`The <code>LiteLLMRouterModel</code> is a wrapper around the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Router</a> that leverages
advanced routing strategies: load-balancing across multiple deployments, prioritizing critical requests via queueing,
and implementing basic reliability measures such as cooldowns, fallbacks, and exponential backoff retries.`,Hs,Oe,Ps,B,Ke,dl,ns,ro='Router‑based client for interacting with the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Python SDK Router</a>.',pl,ls,io=`This class provides a high-level interface for distributing requests among multiple language models using
the LiteLLM SDK’s routing capabilities. It is responsible for initializing and configuring the router client,
applying custom role conversions, and managing message formatting to ensure seamless integration with various LLMs.`,gl,oe,Ys,et,Ds,tt,mo=`This class lets you call any OpenAIServer compatible model.
Here’s how you can set it (you can customise the <code>api_base</code> url to point to another server):`,Os,st,Ks,nt,co="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",en,lt,tn,R,ot,ul,os,po="This model connects to an OpenAI-compatible API server.",sn,at,nn,rt,go="<code>AzureOpenAIServerModel</code> allows you to connect to any Azure OpenAI deployment.",ln,it,uo="Below you can find an example of how to set it up, note that you can omit the <code>azure_endpoint</code>, <code>api_key</code>, and <code>api_version</code> arguments, provided you’ve set the corresponding environment variables — <code>AZURE_OPENAI_ENDPOINT</code>, <code>AZURE_OPENAI_API_KEY</code>, and <code>OPENAI_API_VERSION</code>.",on,mt,Mo='Pay attention to the lack of an <code>AZURE_</code> prefix for <code>OPENAI_API_VERSION</code>, this is due to the way the underlying <a href="https://github.com/openai/openai-python" rel="nofollow">openai</a> package is designed.',an,ct,rn,z,dt,Ml,as,ho="This model connects to an Azure OpenAI deployment.",mn,pt,cn,gt,fo="<code>AmazonBedrockServerModel</code> helps you connect to Amazon Bedrock and run your agent with any available models.",dn,ut,yo="Below is an example setup. This class also offers additional options for customization.",pn,Mt,gn,j,ht,hl,rs,To="A model class for interacting with Amazon Bedrock Server models through the Bedrock API.",fl,is,wo=`This class provides an interface to interact with various Bedrock language models,
allowing for customized model inference, guardrail configuration, message handling,
and other parameters allowed by boto3 API.`,yl,ms,Jo="Authentication:",Tl,cs,bo="Amazon Bedrock supports multiple authentication methods:",wl,ds,jo=`<li>Default AWS credentials:
Use the default AWS credential chain (e.g., IAM roles, IAM users).</li> <li>API Key Authentication (requires <code>boto3 &gt;= 1.39.0</code>):
Set the API key using the <code>AWS_BEARER_TOKEN_BEDROCK</code> environment variable.</li>`,Jl,ft,_o=`<p>API key support requires <code>boto3 &gt;= 1.39.0</code>.
For users not relying on API key authentication, the minimum supported version is <code>boto3 &gt;= 1.36.18</code>.</p>`,bl,ps,Io="Examples:",jl,ae,_l,re,Il,ie,vl,me,un,yt,Mn,Tt,hn,wt,fn,ce,vo="<p>You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install &#39;smolagents[mlx-lm]&#39;</code> if it’s not the case.</p>",yn,Z,Jt,Ul,gs,Uo="A class to interact with models loaded using MLX on Apple silicon.",Cl,bt,Co="<p>You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install &#39;smolagents[mlx-lm]&#39;</code> if it’s not the case.</p>",$l,de,Tn,jt,wn,_t,$o='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',Jn,It,bn,pe,ko="<p>You must have <code>vllm</code> installed on your machine. Please run <code>pip install &#39;smolagents[vllm]&#39;</code> if it’s not the case.</p>",jn,X,vt,kl,us,xo='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',_n,Ut,In,Ct,Ao="You’re free to create and use your own models to power your agent.",vn,$t,qo=`You could subclass the base <code>Model</code> class to create a model for your agent.
The main criteria is to subclass the <code>generate</code> method, with these two criteria:`,Un,kt,Eo='<li>It follows the <a href="./chat_templating">messages format</a> (<code>List[Dict[str, str]]</code>) for its input <code>messages</code>, and it returns an object with a <code>.content</code> attribute.</li> <li>It stops generating outputs at the sequences passed in the argument <code>stop_sequences</code>.</li>',Cn,xt,No=`For defining your LLM, you can make a <code>CustomModel</code> class that inherits from the base <code>Model</code> class.
It should have a generate method that takes a list of <a href="./chat_templating">messages</a> and returns an object with a .content attribute containing the text. The <code>generate</code> method also needs to accept a <code>stop_sequences</code> argument that indicates when to stop generating.`,$n,At,kn,qt,Lo='Additionally, <code>generate</code> can also take a <code>grammar</code> argument to allow <a href="https://huggingface.co/docs/text-generation-inference/conceptual/guidance" rel="nofollow">constrained generation</a> in order to force properly-formatted agent outputs.',xn,Et,An,Ms,qn;return w=new Ro({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),J=new N({props:{title:"Models",local:"models",headingTag:"h1"}}),H=new Vo({props:{warning:!0,$$slots:{default:[Xo]},$$scope:{ctx:U}}}),he=new N({props:{title:"Models",local:"models",headingTag:"h2"}}),ye=new N({props:{title:"Base Model",local:"smolagents.Model",headingTag:"h3"}}),we=new A({props:{name:"class smolagents.Model",anchor:"smolagents.Model",parameters:[{name:"flatten_messages_as_text",val:": bool = False"},{name:"tool_name_key",val:": str = 'name'"},{name:"tool_arguments_key",val:": str = 'arguments'"},{name:"model_id",val:": str | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Model.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten complex message content into plain text format.`,name:"flatten_messages_as_text"},{anchor:"smolagents.Model.tool_name_key",description:`<strong>tool_name_key</strong> (<code>str</code>, default <code>&quot;name&quot;</code>) &#x2014;
The key used to extract tool names from model responses.`,name:"tool_name_key"},{anchor:"smolagents.Model.tool_arguments_key",description:`<strong>tool_arguments_key</strong> (<code>str</code>, default <code>&quot;arguments&quot;</code>) &#x2014;
The key used to extract tool arguments from model responses.`,name:"tool_arguments_key"},{anchor:"smolagents.Model.model_id",description:`<strong>model_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Identifier for the specific model being used.`,name:"model_id"},{anchor:"smolagents.Model.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying model completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L390"}}),P=new G({props:{anchor:"smolagents.Model.example",$$slots:{default:[Fo]},$$scope:{ctx:U}}}),Je=new A({props:{name:"generate",anchor:"smolagents.Model.generate",parameters:[{name:"messages",val:": list"},{name:"stop_sequences",val:": list[str] | None = None"},{name:"response_format",val:": dict[str, str] | None = None"},{name:"tools_to_call_from",val:": list[smolagents.tools.Tool] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Model.generate.messages",description:`<strong>messages</strong> (<code>list[dict[str, str | list[dict]]] | list[ChatMessage]</code>) &#x2014;
A list of message dictionaries to be processed. Each dictionary should have the structure <code>{&quot;role&quot;: &quot;user/system&quot;, &quot;content&quot;: &quot;message content&quot;}</code>.`,name:"messages"},{anchor:"smolagents.Model.generate.stop_sequences",description:`<strong>stop_sequences</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of strings that will stop the generation if encountered in the model&#x2019;s output.`,name:"stop_sequences"},{anchor:"smolagents.Model.generate.response_format",description:`<strong>response_format</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
The response format to use in the model&#x2019;s response.`,name:"response_format"},{anchor:"smolagents.Model.generate.tools_to_call_from",description:`<strong>tools_to_call_from</strong> (<code>List[Tool]</code>, <em>optional</em>) &#x2014;
A list of tools that the model can use to generate responses.`,name:"tools_to_call_from"},{anchor:"smolagents.Model.generate.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to be passed to the underlying model.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L487",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A chat message object containing the model’s response.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ChatMessage</code></p>
`}}),be=new A({props:{name:"parse_tool_calls",anchor:"smolagents.Model.parse_tool_calls",parameters:[{name:"message",val:": ChatMessage"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L517"}}),je=new A({props:{name:"to_dict",anchor:"smolagents.Model.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L530"}}),_e=new N({props:{title:"API Model",local:"smolagents.ApiModel",headingTag:"h3"}}),ve=new A({props:{name:"class smolagents.ApiModel",anchor:"smolagents.ApiModel",parameters:[{name:"model_id",val:": str"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"client",val:": typing.Optional[typing.Any] = None"},{name:"requests_per_minute",val:": float | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.ApiModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The identifier for the model to be used with the API.`,name:"model_id"},{anchor:"smolagents.ApiModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str</code>], <strong>optional</strong>) &#x2014;
Mapping to convert  between internal role names and API-specific role names. Defaults to None.`,name:"custom_role_conversions"},{anchor:"smolagents.ApiModel.client",description:`<strong>client</strong> (<code>Any</code>, <strong>optional</strong>) &#x2014;
Pre-configured API client instance. If not provided, a default client will be created. Defaults to None.`,name:"client"},{anchor:"smolagents.ApiModel.requests_per_minute",description:`<strong>requests_per_minute</strong> (<code>float</code>, <strong>optional</strong>) &#x2014;
Rate limit in requests per minute.`,name:"requests_per_minute"},{anchor:"smolagents.ApiModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying model completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1055"}}),Ue=new A({props:{name:"create_client",anchor:"smolagents.ApiModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1089"}}),Ce=new N({props:{title:"TransformersModel",local:"smolagents.TransformersModel",headingTag:"h3"}}),ke=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUcmFuc2Zvcm1lcnNNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwobW9kZWxfaWQlM0QlMjJIdWdnaW5nRmFjZVRCJTJGU21vbExNLTEzNU0tSW5zdHJ1Y3QlMjIpJTBBJTBBcHJpbnQobW9kZWwoJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyT2shJTIyJTdEJTVEJTdEJTVEJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJncmVhdCUyMiU1RCkp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> TransformersModel

model = TransformersModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}]}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),xe=new I({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),qe=new I({props:{code:"bW9kZWwlMjAlM0QlMjBUcmFuc2Zvcm1lcnNNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMkh1Z2dpbmdGYWNlVEIlMkZTbW9sTE0tMTM1TS1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC43JTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0QxMDAwJTBBKQ==",highlighted:`model = TransformersModel(
    model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>,
    temperature=<span class="hljs-number">0.7</span>,
    max_new_tokens=<span class="hljs-number">1000</span>
)`,wrap:!1}}),Ee=new A({props:{name:"class smolagents.TransformersModel",anchor:"smolagents.TransformersModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"device_map",val:": str | None = None"},{name:"torch_dtype",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"model_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"max_new_tokens",val:": int = 4096"},{name:"max_tokens",val:": int | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.TransformersModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The Hugging Face model ID to be used for inference. This can be a path or model identifier from the Hugging Face model hub.
For example, <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>.`,name:"model_id"},{anchor:"smolagents.TransformersModel.device_map",description:`<strong>device_map</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The device_map to initialize your model with.`,name:"device_map"},{anchor:"smolagents.TransformersModel.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The torch_dtype to initialize your model with.`,name:"torch_dtype"},{anchor:"smolagents.TransformersModel.trust_remote_code",description:`<strong>trust_remote_code</strong> (bool, default <code>False</code>) &#x2014;
Some models on the Hub require running remote code: for this model, you would have to set this flag to True.`,name:"trust_remote_code"},{anchor:"smolagents.TransformersModel.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to <code>AutoModel.from_pretrained</code> (like revision, model_args, config, etc.).`,name:"model_kwargs"},{anchor:"smolagents.TransformersModel.max_new_tokens",description:`<strong>max_new_tokens</strong> (<code>int</code>, default <code>4096</code>) &#x2014;
Maximum number of new tokens to generate, ignoring the number of tokens in the prompt.`,name:"max_new_tokens"},{anchor:"smolagents.TransformersModel.max_tokens",description:`<strong>max_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Alias for <code>max_new_tokens</code>. If provided, this value takes precedence.`,name:"max_tokens"},{anchor:"smolagents.TransformersModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Transformers model generate call, such as <code>device</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L782",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),te=new G({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[Go]},$$scope:{ctx:U}}}),Le=new N({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),Qe=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIySGVsbG8lMkMlMjBob3clMjBhcmUlMjB5b3UlM0YlMjIlN0QlNUQlN0QlMEElNUQlMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKHByb3ZpZGVyJTNEJTIybm92aXRhJTIyJTJDJTIwcmVxdWVzdHNfcGVyX21pbnV0ZSUzRDYwKSUwQXByaW50KG1vZGVsKG1lc3NhZ2VzKSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> InferenceClientModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = InferenceClientModel(provider=<span class="hljs-string">&quot;novita&quot;</span>, requests_per_minute=<span class="hljs-number">60</span>)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),We=new I({props:{code:"T2YlMjBjb3Vyc2UhJTIwSWYlMjB5b3UlMjBjaGFuZ2UlMjB5b3VyJTIwbWluZCUyQyUyMGZlZWwlMjBmcmVlJTIwdG8lMjByZWFjaCUyMG91dC4lMjBUYWtlJTIwY2FyZSE=",highlighted:"&gt;&gt;&gt; Of course! If you change your mind, feel free to reach out. Take care!",wrap:!1}}),Ve=new I({props:{code:"bW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCglMEElMjAlMjAlMjAlMjBwcm92aWRlciUzRCUyMm5vdml0YSUyMiUyQyUwQSUyMCUyMCUyMCUyMHJlcXVlc3RzX3Blcl9taW51dGUlM0Q2MCUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDUwMCUwQSk=",highlighted:`model = InferenceClientModel(
    provider=<span class="hljs-string">&quot;novita&quot;</span>,
    requests_per_minute=<span class="hljs-number">60</span>,
    temperature=<span class="hljs-number">0.8</span>,
    max_tokens=<span class="hljs-number">500</span>
)`,wrap:!1}}),Re=new A({props:{name:"class smolagents.InferenceClientModel",anchor:"smolagents.InferenceClientModel",parameters:[{name:"model_id",val:": str = 'Qwen/Qwen2.5-Coder-32B-Instruct'"},{name:"provider",val:": str | None = None"},{name:"token",val:": str | None = None"},{name:"timeout",val:": int = 120"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"api_key",val:": str | None = None"},{name:"bill_to",val:": str | None = None"},{name:"base_url",val:": str | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.InferenceClientModel.model_id",description:`<strong>model_id</strong> (<code>str</code>, <em>optional</em>, default <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>) &#x2014;
The Hugging Face model ID to be used for inference.
This can be a model identifier from the Hugging Face model hub or a URL to a deployed Inference Endpoint.
Currently, it defaults to <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>, but this may change in the future.`,name:"model_id"},{anchor:"smolagents.InferenceClientModel.provider",description:`<strong>provider</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the provider to use for inference. A list of supported providers can be found in the <a href="https://huggingface.co/docs/inference-providers/index#partners" rel="nofollow">Inference Providers documentation</a>.
Defaults to &#x201C;auto&#x201D; i.e. the first of the providers available for the model, sorted by the user&#x2019;s order <a href="https://hf.co/settings/inference-providers" rel="nofollow">here</a>.
If <code>base_url</code> is passed, then <code>provider</code> is not used.`,name:"provider"},{anchor:"smolagents.InferenceClientModel.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token used by the Hugging Face API for authentication. This token need to be authorized &#x2018;Make calls to the serverless Inference Providers&#x2019;.
If the model is gated (like Llama-3 models), the token also needs &#x2018;Read access to contents of all public gated repos you can access&#x2019;.
If not provided, the class will try to use environment variable &#x2018;HF_TOKEN&#x2019;, else use the token stored in the Hugging Face CLI configuration.`,name:"token"},{anchor:"smolagents.InferenceClientModel.timeout",description:`<strong>timeout</strong> (<code>int</code>, <em>optional</em>, defaults to 120) &#x2014;
Timeout for the API request, in seconds.`,name:"timeout"},{anchor:"smolagents.InferenceClientModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the Hugging Face InferenceClient.`,name:"client_kwargs"},{anchor:"smolagents.InferenceClientModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.InferenceClientModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token to use for authentication. This is a duplicated argument from <code>token</code> to make <a href="/docs/smolagents/v1.22.0/en/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>token</code> is set. Defaults to None.`,name:"api_key"},{anchor:"smolagents.InferenceClientModel.bill_to",description:`<strong>bill_to</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The billing account to use for the requests. By default the requests are billed on the user&#x2019;s account. Requests can only be billed to
an organization the user is a member of, and which has subscribed to Enterprise Hub.`,name:"bill_to"},{anchor:"smolagents.InferenceClientModel.base_url",description:`<strong>base_url</strong> (<code>str</code>, <code>optional</code>) &#x2014;
Base URL to run inference. This is a duplicated argument from <code>model</code> to make <a href="/docs/smolagents/v1.22.0/en/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>model</code> is set. Defaults to None.`,name:"base_url"},{anchor:"smolagents.InferenceClientModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Hugging Face InferenceClient completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1341",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),se=new G({props:{anchor:"smolagents.InferenceClientModel.example",$$slots:{default:[Ho]},$$scope:{ctx:U}}}),ze=new A({props:{name:"create_client",anchor:"smolagents.InferenceClientModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1432"}}),Xe=new N({props:{title:"LiteLLMModel",local:"smolagents.LiteLLMModel",headingTag:"h3"}}),Ge=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNTW9kZWwlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyJTdEJTVEJTdEJTBBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNTW9kZWwobW9kZWxfaWQlM0QlMjJhbnRocm9waWMlMkZjbGF1ZGUtMy01LXNvbm5ldC1sYXRlc3QlMjIlMkMlMjB0ZW1wZXJhdHVyZSUzRDAuMiUyQyUyMG1heF90b2tlbnMlM0QxMCUyQyUyMHJlcXVlc3RzX3Blcl9taW51dGUlM0Q2MCklMEFwcmludChtb2RlbChtZXNzYWdlcykp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = LiteLLMModel(model_id=<span class="hljs-string">&quot;anthropic/claude-3-5-sonnet-latest&quot;</span>, temperature=<span class="hljs-number">0.2</span>, max_tokens=<span class="hljs-number">10</span>, requests_per_minute=<span class="hljs-number">60</span>)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),He=new A({props:{name:"class smolagents.LiteLLMModel",anchor:"smolagents.LiteLLMModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"api_base",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.LiteLLMModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on the server (e.g. &#x201C;gpt-3.5-turbo&#x201D;).`,name:"model_id"},{anchor:"smolagents.LiteLLMModel.api_base",description:`<strong>api_base</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The base URL of the provider API to call the model.`,name:"api_base"},{anchor:"smolagents.LiteLLMModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication.`,name:"api_key"},{anchor:"smolagents.LiteLLMModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.LiteLLMModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to flatten messages as text.
Defaults to <code>True</code> for models that start with &#x201C;ollama&#x201D;, &#x201C;groq&#x201D;, &#x201C;cerebras&#x201D;.`,name:"flatten_messages_as_text"},{anchor:"smolagents.LiteLLMModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying LiteLLM completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1098"}}),Pe=new A({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1148"}}),Ye=new N({props:{title:"LiteLLMRouterModel",local:"smolagents.LiteLLMRouterModel",headingTag:"h3"}}),Oe=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNUm91dGVyTW9kZWwlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyJTdEJTVEJTdEJTBBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNUm91dGVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJsbGFtYS0zLjMtNzBiJTIyJTJDJTBBJTIwJTIwJTIwJTIwbW9kZWxfbGlzdCUzRCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsX25hbWUlMjIlM0ElMjAlMjJsbGFtYS0zLjMtNzBiJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybGl0ZWxsbV9wYXJhbXMlMjIlM0ElMjAlN0IlMjJtb2RlbCUyMiUzQSUyMCUyMmdyb3ElMkZsbGFtYS0zLjMtNzBiJTIyJTJDJTIwJTIyYXBpX2tleSUyMiUzQSUyMG9zLmdldGVudiglMjJHUk9RX0FQSV9LRVklMjIpJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMCUyMmxsYW1hLTMuMy03MGIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsaXRlbGxtX3BhcmFtcyUyMiUzQSUyMCU3QiUyMm1vZGVsJTIyJTNBJTIwJTIyY2VyZWJyYXMlMkZsbGFtYS0zLjMtNzBiJTIyJTJDJTIwJTIyYXBpX2tleSUyMiUzQSUyMG9zLmdldGVudiglMjJDRVJFQlJBU19BUElfS0VZJTIyKSU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMGNsaWVudF9rd2FyZ3MlM0QlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb3V0aW5nX3N0cmF0ZWd5JTIyJTNBJTIwJTIyc2ltcGxlLXNodWZmbGUlMjIlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEEpJTBBcHJpbnQobW9kZWwobWVzc2FnZXMpKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMRouterModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = LiteLLMRouterModel(
    model_id=<span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
    model_list=[
        {
            <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
            <span class="hljs-string">&quot;litellm_params&quot;</span>: {<span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;groq/llama-3.3-70b&quot;</span>, <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;GROQ_API_KEY&quot;</span>)},
        },
        {
            <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
            <span class="hljs-string">&quot;litellm_params&quot;</span>: {<span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;cerebras/llama-3.3-70b&quot;</span>, <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;CEREBRAS_API_KEY&quot;</span>)},
        },
    ],
    client_kwargs={
        <span class="hljs-string">&quot;routing_strategy&quot;</span>: <span class="hljs-string">&quot;simple-shuffle&quot;</span>,
    },
)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),Ke=new A({props:{name:"class smolagents.LiteLLMRouterModel",anchor:"smolagents.LiteLLMRouterModel",parameters:[{name:"model_id",val:": str"},{name:"model_list",val:": list"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.LiteLLMRouterModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
Identifier for the model group to use from the model list (e.g., &#x201C;model-group-1&#x201D;).`,name:"model_id"},{anchor:"smolagents.LiteLLMRouterModel.model_list",description:`<strong>model_list</strong> (<code>list[dict[str, Any]]</code>) &#x2014;
Model configurations to be used for routing.
Each configuration should include the model group name and any necessary parameters.
For more details, refer to the <a href="https://docs.litellm.ai/docs/routing#quick-start" rel="nofollow">LiteLLM Routing</a> documentation.`,name:"model_list"},{anchor:"smolagents.LiteLLMRouterModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional configuration parameters for the Router client. For more details, see the
<a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Routing Configurations</a>.`,name:"client_kwargs"},{anchor:"smolagents.LiteLLMRouterModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.LiteLLMRouterModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to flatten messages as text.
Defaults to <code>True</code> for models that start with &#x201C;ollama&#x201D;, &#x201C;groq&#x201D;, &#x201C;cerebras&#x201D;.`,name:"flatten_messages_as_text"},{anchor:"smolagents.LiteLLMRouterModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying LiteLLM Router completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1248"}}),oe=new G({props:{anchor:"smolagents.LiteLLMRouterModel.example",$$slots:{default:[Po]},$$scope:{ctx:U}}}),et=new N({props:{title:"OpenAIServerModel",local:"smolagents.OpenAIServerModel",headingTag:"h3"}}),st=new I({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyME9wZW5BSVNlcnZlck1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC00byUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9iYXNlJTNEJTIyaHR0cHMlM0ElMkYlMkZhcGkub3BlbmFpLmNvbSUyRnYxJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> OpenAIServerModel

model = OpenAIServerModel(
    model_id=<span class="hljs-string">&quot;gpt-4o&quot;</span>,
    api_base=<span class="hljs-string">&quot;https://api.openai.com/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>],
)`,wrap:!1}}),lt=new I({props:{code:"bW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC00byUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9iYXNlJTNEJTIyaHR0cHMlM0ElMkYlMkZhcGkub3BlbmFpLmNvbSUyRnYxJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC43JTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjB0b3BfcCUzRDAuOSUyQyUwQSk=",highlighted:`model = OpenAIServerModel(
    model_id=<span class="hljs-string">&quot;gpt-4o&quot;</span>,
    api_base=<span class="hljs-string">&quot;https://api.openai.com/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>],
    temperature=<span class="hljs-number">0.7</span>,
    max_tokens=<span class="hljs-number">1000</span>,
    top_p=<span class="hljs-number">0.9</span>,
)`,wrap:!1}}),ot=new A({props:{name:"class smolagents.OpenAIServerModel",anchor:"smolagents.OpenAIServerModel",parameters:[{name:"model_id",val:": str"},{name:"api_base",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"organization",val:": str | None = None"},{name:"project",val:": str | None = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.OpenAIServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on the server (e.g. &#x201C;gpt-3.5-turbo&#x201D;).`,name:"model_id"},{anchor:"smolagents.OpenAIServerModel.api_base",description:`<strong>api_base</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The base URL of the OpenAI-compatible API server.`,name:"api_base"},{anchor:"smolagents.OpenAIServerModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication.`,name:"api_key"},{anchor:"smolagents.OpenAIServerModel.organization",description:`<strong>organization</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The organization to use for the API request.`,name:"organization"},{anchor:"smolagents.OpenAIServerModel.project",description:`<strong>project</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The project to use for the API request.`,name:"project"},{anchor:"smolagents.OpenAIServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the OpenAI client (like organization, project, max_retries etc.).`,name:"client_kwargs"},{anchor:"smolagents.OpenAIServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.OpenAIServerModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten messages as text.`,name:"flatten_messages_as_text"},{anchor:"smolagents.OpenAIServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying OpenAI API completion call, for instance <code>temperature</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1523"}}),at=new N({props:{title:"AzureOpenAIServerModel",local:"smolagents.AzureOpenAIServerModel",headingTag:"h3"}}),ct=new I({props:{code:"aW1wb3J0JTIwb3MlMEElMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMjAlM0QlMjBvcy5lbnZpcm9uLmdldCglMjJBWlVSRV9PUEVOQUlfTU9ERUwlMjIpJTJDJTBBJTIwJTIwJTIwJTIwYXp1cmVfZW5kcG9pbnQlM0Rvcy5lbnZpcm9uLmdldCglMjJBWlVSRV9PUEVOQUlfRU5EUE9JTlQlMjIpJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24uZ2V0KCUyMkFaVVJFX09QRU5BSV9BUElfS0VZJTIyKSUyQyUwQSUyMCUyMCUyMCUyMGFwaV92ZXJzaW9uJTNEb3MuZW52aXJvbi5nZXQoJTIyT1BFTkFJX0FQSV9WRVJTSU9OJTIyKSUyMCUyMCUyMCUyMCUwQSk=",highlighted:`<span class="hljs-keyword">import</span> os

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AzureOpenAIServerModel

model = AzureOpenAIServerModel(
    model_id = os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_MODEL&quot;</span>),
    azure_endpoint=os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_ENDPOINT&quot;</span>),
    api_key=os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_API_KEY&quot;</span>),
    api_version=os.environ.get(<span class="hljs-string">&quot;OPENAI_API_VERSION&quot;</span>)    
)`,wrap:!1}}),dt=new A({props:{name:"class smolagents.AzureOpenAIServerModel",anchor:"smolagents.AzureOpenAIServerModel",parameters:[{name:"model_id",val:": str"},{name:"azure_endpoint",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"api_version",val:": str | None = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.AzureOpenAIServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model deployment name to use when connecting (e.g. &#x201C;gpt-4o-mini&#x201D;).`,name:"model_id"},{anchor:"smolagents.AzureOpenAIServerModel.azure_endpoint",description:`<strong>azure_endpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The Azure endpoint, including the resource, e.g. <code>https://example-resource.azure.openai.com/</code>. If not provided, it will be inferred from the <code>AZURE_OPENAI_ENDPOINT</code> environment variable.`,name:"azure_endpoint"},{anchor:"smolagents.AzureOpenAIServerModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication. If not provided, it will be inferred from the <code>AZURE_OPENAI_API_KEY</code> environment variable.`,name:"api_key"},{anchor:"smolagents.AzureOpenAIServerModel.api_version",description:`<strong>api_version</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API version to use. If not provided, it will be inferred from the <code>OPENAI_API_VERSION</code> environment variable.`,name:"api_version"},{anchor:"smolagents.AzureOpenAIServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the AzureOpenAI client (like organization, project, max_retries etc.).`,name:"client_kwargs"},{anchor:"smolagents.AzureOpenAIServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.AzureOpenAIServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Azure OpenAI API completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1668"}}),pt=new N({props:{title:"AmazonBedrockServerModel",local:"smolagents.AmazonBedrockServerModel",headingTag:"h3"}}),Mt=new I({props:{code:"aW1wb3J0JTIwb3MlMEElMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQW1hem9uQmVkcm9ja1NlcnZlck1vZGVsKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTIwJTNEJTIwb3MuZW52aXJvbi5nZXQoJTIyQU1BWk9OX0JFRFJPQ0tfTU9ERUxfSUQlMjIpJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> os

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AmazonBedrockServerModel

model = AmazonBedrockServerModel(
    model_id = os.environ.get(<span class="hljs-string">&quot;AMAZON_BEDROCK_MODEL_ID&quot;</span>),
)`,wrap:!1}}),ht=new A({props:{name:"class smolagents.AmazonBedrockServerModel",anchor:"smolagents.AmazonBedrockServerModel",parameters:[{name:"model_id",val:": str"},{name:"client",val:" = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.AmazonBedrockServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on Bedrock (e.g. &#x201C;us.amazon.nova-pro-v1:0&#x201D;).`,name:"model_id"},{anchor:"smolagents.AmazonBedrockServerModel.client",description:`<strong>client</strong> (<code>boto3.client</code>, <em>optional</em>) &#x2014;
A custom boto3 client for AWS interactions. If not provided, a default client will be created.`,name:"client"},{anchor:"smolagents.AmazonBedrockServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (dict[str, Any], <em>optional</em>) &#x2014;
Keyword arguments used to configure the boto3 client if it needs to be created internally.
Examples include <code>region_name</code>, <code>config</code>, or <code>endpoint_url</code>.`,name:"client_kwargs"},{anchor:"smolagents.AmazonBedrockServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.
Defaults to converting all roles to &#x201C;user&#x201D; role to enable using all the Bedrock models.`,name:"custom_role_conversions"},{anchor:"smolagents.AmazonBedrockServerModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten messages as text.`,name:"flatten_messages_as_text"},{anchor:"smolagents.AmazonBedrockServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Amazon Bedrock model converse call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L1728"}}),ae=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example",$$slots:{default:[Yo]},$$scope:{ctx:U}}}),re=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-2",$$slots:{default:[Do]},$$scope:{ctx:U}}}),ie=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-3",$$slots:{default:[Oo]},$$scope:{ctx:U}}}),me=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-4",$$slots:{default:[Ko]},$$scope:{ctx:U}}}),yt=new N({props:{title:"MLXModel",local:"smolagents.MLXModel",headingTag:"h3"}}),Tt=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBNTFhNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwTUxYTW9kZWwobW9kZWxfaWQlM0QlMjJIdWdnaW5nRmFjZVRCJTJGU21vbExNLTEzNU0tSW5zdHJ1Y3QlMjIpJTBBJTBBcHJpbnQobW9kZWwoJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyT2shJTIyJTdEJTVEJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJncmVhdCUyMiU1RCkp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> MLXModel

model = MLXModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),wt=new I({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),Jt=new A({props:{name:"class smolagents.MLXModel",anchor:"smolagents.MLXModel",parameters:[{name:"model_id",val:": str"},{name:"trust_remote_code",val:": bool = False"},{name:"load_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"apply_chat_template_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.MLXModel.model_id",description:`<strong>model_id</strong> (str) &#x2014;
The Hugging Face model ID to be used for inference. This can be a path or model identifier from the Hugging Face model hub.`,name:"model_id"},{anchor:"smolagents.MLXModel.tool_name_key",description:`<strong>tool_name_key</strong> (str) &#x2014;
The key, which can usually be found in the model&#x2019;s chat template, for retrieving a tool name.`,name:"tool_name_key"},{anchor:"smolagents.MLXModel.tool_arguments_key",description:`<strong>tool_arguments_key</strong> (str) &#x2014;
The key, which can usually be found in the model&#x2019;s chat template, for retrieving tool arguments.`,name:"tool_arguments_key"},{anchor:"smolagents.MLXModel.trust_remote_code",description:`<strong>trust_remote_code</strong> (bool, default <code>False</code>) &#x2014;
Some models on the Hub require running remote code: for this model, you would have to set this flag to True.`,name:"trust_remote_code"},{anchor:"smolagents.MLXModel.load_kwargs",description:`<strong>load_kwargs</strong> (dict[str, Any], <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the <code>mlx.lm.load</code> method when loading the model and tokenizer.`,name:"load_kwargs"},{anchor:"smolagents.MLXModel.apply_chat_template_kwargs",description:`<strong>apply_chat_template_kwargs</strong> (dict, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the <code>apply_chat_template</code> method of the tokenizer.`,name:"apply_chat_template_kwargs"},{anchor:"smolagents.MLXModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying MLX model stream_generate call, for instance <code>max_tokens</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L675"}}),de=new G({props:{anchor:"smolagents.MLXModel.example",$$slots:{default:[ea]},$$scope:{ctx:U}}}),jt=new N({props:{title:"VLLMModel",local:"smolagents.VLLMModel",headingTag:"h3"}}),It=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBWTExNTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFZMTE1Nb2RlbChtb2RlbF9pZCUzRCUyMkh1Z2dpbmdGYWNlVEIlMkZTbW9sTE0tMTM1TS1JbnN0cnVjdCUyMiklMEElMEFwcmludChtb2RlbCglNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJPayElMjIlN0QlNUQlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMmdyZWF0JTIyJTVEKSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> VLLMModel

model = VLLMModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),vt=new A({props:{name:"class smolagents.VLLMModel",anchor:"smolagents.VLLMModel",parameters:[{name:"model_id",val:""},{name:"model_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.VLLMModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The Hugging Face model ID to be used for inference.
This can be a path or model identifier from the Hugging Face model hub.`,name:"model_id"},{anchor:"smolagents.VLLMModel.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to forward to the vLLM LLM instantiation, such as <code>revision</code>, <code>max_model_len</code>, etc.`,name:"model_kwargs"},{anchor:"smolagents.VLLMModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying vLLM model generate call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/models.py#L567"}}),Ut=new N({props:{title:"Custom Model",local:"custom-model",headingTag:"h3"}}),At=new I({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTJDJTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBNb2RlbCUwQSUwQWxvZ2luKCUyMiUzQ1lPVVJfSFVHR0lOR0ZBQ0VIVUJfQVBJX1RPS0VOJTNFJTIyKSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMy03MEItSW5zdHJ1Y3QlMjIlMEElMEFjbGllbnQlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnQobW9kZWwlM0Rtb2RlbF9pZCklMEElMEFjbGFzcyUyMEN1c3RvbU1vZGVsKE1vZGVsKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGdlbmVyYXRlKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJUYXNrJTIyJTVEKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LmNoYXRfY29tcGxldGlvbihtZXNzYWdlcyUyQyUyMHN0b3AlM0RzdG9wX3NlcXVlbmNlcyUyQyUyMG1heF90b2tlbnMlM0QxMDI0KSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGFuc3dlciUyMCUzRCUyMHJlc3BvbnNlLmNob2ljZXMlNUIwJTVELm1lc3NhZ2UlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBhbnN3ZXIlMEElMEFjdXN0b21fbW9kZWwlMjAlM0QlMjBDdXN0b21Nb2RlbCgp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login, InferenceClient

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Model

login(<span class="hljs-string">&quot;&lt;YOUR_HUGGINGFACEHUB_API_TOKEN&gt;&quot;</span>)

model_id = <span class="hljs-string">&quot;meta-llama/Llama-3.3-70B-Instruct&quot;</span>

client = InferenceClient(model=model_id)

<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomModel</span>(<span class="hljs-title class_ inherited__">Model</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">generate</span>(<span class="hljs-params">messages, stop_sequences=[<span class="hljs-string">&quot;Task&quot;</span>]</span>):
        response = client.chat_completion(messages, stop=stop_sequences, max_tokens=<span class="hljs-number">1024</span>)
        answer = response.choices[<span class="hljs-number">0</span>].message
        <span class="hljs-keyword">return</span> answer

custom_model = CustomModel()`,wrap:!1}}),Et=new zo({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/reference/models.md"}}),{c(){r=i("meta"),b=o(),T=i("p"),d=o(),g(w.$$.fragment),n=o(),g(J.$$.fragment),hs=o(),g(H.$$.fragment),fs=o(),Me=i("p"),Me.innerHTML=xl,ys=o(),g(he.$$.fragment),Ts=o(),fe=i("p"),fe.innerHTML=Al,ws=o(),g(ye.$$.fragment),Js=o(),Te=i("p"),Te.innerHTML=ql,bs=o(),C=i("div"),g(we.$$.fragment),Zn=o(),Wt=i("p"),Wt.textContent=El,Qn=o(),St=i("p"),St.textContent=Nl,Wn=o(),Vt=i("p"),Vt.innerHTML=Ll,Sn=o(),g(P.$$.fragment),Vn=o(),Y=i("div"),g(Je.$$.fragment),Rn=o(),Rt=i("p"),Rt.textContent=Bl,zn=o(),D=i("div"),g(be.$$.fragment),Xn=o(),zt=i("p"),zt.textContent=Zl,Fn=o(),O=i("div"),g(je.$$.fragment),Gn=o(),Xt=i("p"),Xt.textContent=Ql,js=o(),g(_e.$$.fragment),_s=o(),Ie=i("p"),Ie.innerHTML=Wl,Is=o(),L=i("div"),g(ve.$$.fragment),Hn=o(),Ft=i("p"),Ft.textContent=Sl,Pn=o(),Gt=i("p"),Gt.textContent=Vl,Yn=o(),K=i("div"),g(Ue.$$.fragment),Dn=o(),Ht=i("p"),Ht.textContent=Rl,vs=o(),g(Ce.$$.fragment),Us=o(),$e=i("p"),$e.innerHTML=zl,Cs=o(),g(ke.$$.fragment),$s=o(),g(xe.$$.fragment),ks=o(),Ae=i("p"),Ae.innerHTML=Xl,xs=o(),g(qe.$$.fragment),As=o(),ee=i("blockquote"),ee.innerHTML=Fl,qs=o(),q=i("div"),g(Ee.$$.fragment),On=o(),Pt=i("p"),Pt.textContent=Gl,Kn=o(),Yt=i("p"),Yt.textContent=Hl,el=o(),Ne=i("blockquote"),Ne.innerHTML=Pl,tl=o(),g(te.$$.fragment),Es=o(),g(Le.$$.fragment),Ns=o(),Be=i("p"),Be.innerHTML=Yl,Ls=o(),Ze=i("p"),Ze.innerHTML=Dl,Bs=o(),g(Qe.$$.fragment),Zs=o(),g(We.$$.fragment),Qs=o(),Se=i("p"),Se.innerHTML=Ol,Ws=o(),g(Ve.$$.fragment),Ss=o(),x=i("div"),g(Re.$$.fragment),sl=o(),Dt=i("p"),Dt.textContent=Kl,nl=o(),Ot=i("p"),Ot.textContent=eo,ll=o(),Kt=i("p"),Kt.textContent=to,ol=o(),g(se.$$.fragment),al=o(),ne=i("div"),g(ze.$$.fragment),rl=o(),es=i("p"),es.textContent=so,Vs=o(),g(Xe.$$.fragment),Rs=o(),Fe=i("p"),Fe.innerHTML=no,zs=o(),g(Ge.$$.fragment),Xs=o(),W=i("div"),g(He.$$.fragment),il=o(),ts=i("p"),ts.innerHTML=lo,ml=o(),le=i("div"),g(Pe.$$.fragment),cl=o(),ss=i("p"),ss.textContent=oo,Fs=o(),g(Ye.$$.fragment),Gs=o(),De=i("p"),De.innerHTML=ao,Hs=o(),g(Oe.$$.fragment),Ps=o(),B=i("div"),g(Ke.$$.fragment),dl=o(),ns=i("p"),ns.innerHTML=ro,pl=o(),ls=i("p"),ls.textContent=io,gl=o(),g(oe.$$.fragment),Ys=o(),g(et.$$.fragment),Ds=o(),tt=i("p"),tt.innerHTML=mo,Os=o(),g(st.$$.fragment),Ks=o(),nt=i("p"),nt.innerHTML=co,en=o(),g(lt.$$.fragment),tn=o(),R=i("div"),g(ot.$$.fragment),ul=o(),os=i("p"),os.textContent=po,sn=o(),g(at.$$.fragment),nn=o(),rt=i("p"),rt.innerHTML=go,ln=o(),it=i("p"),it.innerHTML=uo,on=o(),mt=i("p"),mt.innerHTML=Mo,an=o(),g(ct.$$.fragment),rn=o(),z=i("div"),g(dt.$$.fragment),Ml=o(),as=i("p"),as.textContent=ho,mn=o(),g(pt.$$.fragment),cn=o(),gt=i("p"),gt.innerHTML=fo,dn=o(),ut=i("p"),ut.textContent=yo,pn=o(),g(Mt.$$.fragment),gn=o(),j=i("div"),g(ht.$$.fragment),hl=o(),rs=i("p"),rs.textContent=To,fl=o(),is=i("p"),is.textContent=wo,yl=o(),ms=i("p"),ms.textContent=Jo,Tl=o(),cs=i("p"),cs.textContent=bo,wl=o(),ds=i("ul"),ds.innerHTML=jo,Jl=o(),ft=i("blockquote"),ft.innerHTML=_o,bl=o(),ps=i("p"),ps.textContent=Io,jl=o(),g(ae.$$.fragment),_l=o(),g(re.$$.fragment),Il=o(),g(ie.$$.fragment),vl=o(),g(me.$$.fragment),un=o(),g(yt.$$.fragment),Mn=o(),g(Tt.$$.fragment),hn=o(),g(wt.$$.fragment),fn=o(),ce=i("blockquote"),ce.innerHTML=vo,yn=o(),Z=i("div"),g(Jt.$$.fragment),Ul=o(),gs=i("p"),gs.textContent=Uo,Cl=o(),bt=i("blockquote"),bt.innerHTML=Co,$l=o(),g(de.$$.fragment),Tn=o(),g(jt.$$.fragment),wn=o(),_t=i("p"),_t.innerHTML=$o,Jn=o(),g(It.$$.fragment),bn=o(),pe=i("blockquote"),pe.innerHTML=ko,jn=o(),X=i("div"),g(vt.$$.fragment),kl=o(),us=i("p"),us.innerHTML=xo,_n=o(),g(Ut.$$.fragment),In=o(),Ct=i("p"),Ct.textContent=Ao,vn=o(),$t=i("p"),$t.innerHTML=qo,Un=o(),kt=i("ol"),kt.innerHTML=Eo,Cn=o(),xt=i("p"),xt.innerHTML=No,$n=o(),g(At.$$.fragment),kn=o(),qt=i("p"),qt.innerHTML=Lo,xn=o(),g(Et.$$.fragment),An=o(),Ms=i("p"),this.h()},l(e){const t=So("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(s),b=a(e),T=m(e,"P",{}),k(T).forEach(s),d=a(e),u(w.$$.fragment,e),n=a(e),u(J.$$.fragment,e),hs=a(e),u(H.$$.fragment,e),fs=a(e),Me=m(e,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-17nnzxz"&&(Me.innerHTML=xl),ys=a(e),u(he.$$.fragment,e),Ts=a(e),fe=m(e,"P",{"data-svelte-h":!0}),p(fe)!=="svelte-19xyef7"&&(fe.innerHTML=Al),ws=a(e),u(ye.$$.fragment,e),Js=a(e),Te=m(e,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-oebo46"&&(Te.innerHTML=ql),bs=a(e),C=m(e,"DIV",{class:!0});var $=k(C);u(we.$$.fragment,$),Zn=a($),Wt=m($,"P",{"data-svelte-h":!0}),p(Wt)!=="svelte-akdo2d"&&(Wt.textContent=El),Qn=a($),St=m($,"P",{"data-svelte-h":!0}),p(St)!=="svelte-fzlv7p"&&(St.textContent=Nl),Wn=a($),Vt=m($,"P",{"data-svelte-h":!0}),p(Vt)!=="svelte-1nh53b7"&&(Vt.innerHTML=Ll),Sn=a($),u(P.$$.fragment,$),Vn=a($),Y=m($,"DIV",{class:!0});var Nt=k(Y);u(Je.$$.fragment,Nt),Rn=a(Nt),Rt=m(Nt,"P",{"data-svelte-h":!0}),p(Rt)!=="svelte-w01v3a"&&(Rt.textContent=Bl),Nt.forEach(s),zn=a($),D=m($,"DIV",{class:!0});var Lt=k(D);u(be.$$.fragment,Lt),Xn=a(Lt),zt=m(Lt,"P",{"data-svelte-h":!0}),p(zt)!=="svelte-xj9yar"&&(zt.textContent=Zl),Lt.forEach(s),Fn=a($),O=m($,"DIV",{class:!0});var Bt=k(O);u(je.$$.fragment,Bt),Gn=a(Bt),Xt=m(Bt,"P",{"data-svelte-h":!0}),p(Xt)!=="svelte-138117q"&&(Xt.textContent=Ql),Bt.forEach(s),$.forEach(s),js=a(e),u(_e.$$.fragment,e),_s=a(e),Ie=m(e,"P",{"data-svelte-h":!0}),p(Ie)!=="svelte-pbx5jd"&&(Ie.innerHTML=Wl),Is=a(e),L=m(e,"DIV",{class:!0});var S=k(L);u(ve.$$.fragment,S),Hn=a(S),Ft=m(S,"P",{"data-svelte-h":!0}),p(Ft)!=="svelte-mqlsp2"&&(Ft.textContent=Sl),Pn=a(S),Gt=m(S,"P",{"data-svelte-h":!0}),p(Gt)!=="svelte-1pa0fc1"&&(Gt.textContent=Vl),Yn=a(S),K=m(S,"DIV",{class:!0});var Zt=k(K);u(Ue.$$.fragment,Zt),Dn=a(Zt),Ht=m(Zt,"P",{"data-svelte-h":!0}),p(Ht)!=="svelte-8ki1kt"&&(Ht.textContent=Rl),Zt.forEach(s),S.forEach(s),vs=a(e),u(Ce.$$.fragment,e),Us=a(e),$e=m(e,"P",{"data-svelte-h":!0}),p($e)!=="svelte-ulv590"&&($e.innerHTML=zl),Cs=a(e),u(ke.$$.fragment,e),$s=a(e),u(xe.$$.fragment,e),ks=a(e),Ae=m(e,"P",{"data-svelte-h":!0}),p(Ae)!=="svelte-g5vlul"&&(Ae.innerHTML=Xl),xs=a(e),u(qe.$$.fragment,e),As=a(e),ee=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(ee)!=="svelte-103z9yw"&&(ee.innerHTML=Fl),qs=a(e),q=m(e,"DIV",{class:!0});var Q=k(q);u(Ee.$$.fragment,Q),On=a(Q),Pt=m(Q,"P",{"data-svelte-h":!0}),p(Pt)!=="svelte-1ex1ahr"&&(Pt.textContent=Gl),Kn=a(Q),Yt=m(Q,"P",{"data-svelte-h":!0}),p(Yt)!=="svelte-1140acn"&&(Yt.textContent=Hl),el=a(Q),Ne=m(Q,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(Ne)!=="svelte-103z9yw"&&(Ne.innerHTML=Pl),tl=a(Q),u(te.$$.fragment,Q),Q.forEach(s),Es=a(e),u(Le.$$.fragment,e),Ns=a(e),Be=m(e,"P",{"data-svelte-h":!0}),p(Be)!=="svelte-iu01g0"&&(Be.innerHTML=Yl),Ls=a(e),Ze=m(e,"P",{"data-svelte-h":!0}),p(Ze)!=="svelte-kvj8ld"&&(Ze.innerHTML=Dl),Bs=a(e),u(Qe.$$.fragment,e),Zs=a(e),u(We.$$.fragment,e),Qs=a(e),Se=m(e,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-1hlk7ls"&&(Se.innerHTML=Ol),Ws=a(e),u(Ve.$$.fragment,e),Ss=a(e),x=m(e,"DIV",{class:!0});var E=k(x);u(Re.$$.fragment,E),sl=a(E),Dt=m(E,"P",{"data-svelte-h":!0}),p(Dt)!=="svelte-axkcn3"&&(Dt.textContent=Kl),nl=a(E),Ot=m(E,"P",{"data-svelte-h":!0}),p(Ot)!=="svelte-bducrc"&&(Ot.textContent=eo),ll=a(E),Kt=m(E,"P",{"data-svelte-h":!0}),p(Kt)!=="svelte-12eu297"&&(Kt.textContent=to),ol=a(E),u(se.$$.fragment,E),al=a(E),ne=m(E,"DIV",{class:!0});var Qt=k(ne);u(ze.$$.fragment,Qt),rl=a(Qt),es=m(Qt,"P",{"data-svelte-h":!0}),p(es)!=="svelte-ym2f5u"&&(es.textContent=so),Qt.forEach(s),E.forEach(s),Vs=a(e),u(Xe.$$.fragment,e),Rs=a(e),Fe=m(e,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-1m09ddd"&&(Fe.innerHTML=no),zs=a(e),u(Ge.$$.fragment,e),Xs=a(e),W=m(e,"DIV",{class:!0});var F=k(W);u(He.$$.fragment,F),il=a(F),ts=m(F,"P",{"data-svelte-h":!0}),p(ts)!=="svelte-5g97zk"&&(ts.innerHTML=lo),ml=a(F),le=m(F,"DIV",{class:!0});var En=k(le);u(Pe.$$.fragment,En),cl=a(En),ss=m(En,"P",{"data-svelte-h":!0}),p(ss)!=="svelte-12r14rd"&&(ss.textContent=oo),En.forEach(s),F.forEach(s),Fs=a(e),u(Ye.$$.fragment,e),Gs=a(e),De=m(e,"P",{"data-svelte-h":!0}),p(De)!=="svelte-cark4"&&(De.innerHTML=ao),Hs=a(e),u(Oe.$$.fragment,e),Ps=a(e),B=m(e,"DIV",{class:!0});var ge=k(B);u(Ke.$$.fragment,ge),dl=a(ge),ns=m(ge,"P",{"data-svelte-h":!0}),p(ns)!=="svelte-2o2pf3"&&(ns.innerHTML=ro),pl=a(ge),ls=m(ge,"P",{"data-svelte-h":!0}),p(ls)!=="svelte-1cq7nyu"&&(ls.textContent=io),gl=a(ge),u(oe.$$.fragment,ge),ge.forEach(s),Ys=a(e),u(et.$$.fragment,e),Ds=a(e),tt=m(e,"P",{"data-svelte-h":!0}),p(tt)!=="svelte-juyrd0"&&(tt.innerHTML=mo),Os=a(e),u(st.$$.fragment,e),Ks=a(e),nt=m(e,"P",{"data-svelte-h":!0}),p(nt)!=="svelte-1hlk7ls"&&(nt.innerHTML=co),en=a(e),u(lt.$$.fragment,e),tn=a(e),R=m(e,"DIV",{class:!0});var Nn=k(R);u(ot.$$.fragment,Nn),ul=a(Nn),os=m(Nn,"P",{"data-svelte-h":!0}),p(os)!=="svelte-1bc1pfc"&&(os.textContent=po),Nn.forEach(s),sn=a(e),u(at.$$.fragment,e),nn=a(e),rt=m(e,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-1946uqd"&&(rt.innerHTML=go),ln=a(e),it=m(e,"P",{"data-svelte-h":!0}),p(it)!=="svelte-1tbo5q5"&&(it.innerHTML=uo),on=a(e),mt=m(e,"P",{"data-svelte-h":!0}),p(mt)!=="svelte-16r94fh"&&(mt.innerHTML=Mo),an=a(e),u(ct.$$.fragment,e),rn=a(e),z=m(e,"DIV",{class:!0});var Ln=k(z);u(dt.$$.fragment,Ln),Ml=a(Ln),as=m(Ln,"P",{"data-svelte-h":!0}),p(as)!=="svelte-1fspdqk"&&(as.textContent=ho),Ln.forEach(s),mn=a(e),u(pt.$$.fragment,e),cn=a(e),gt=m(e,"P",{"data-svelte-h":!0}),p(gt)!=="svelte-72042c"&&(gt.innerHTML=fo),dn=a(e),ut=m(e,"P",{"data-svelte-h":!0}),p(ut)!=="svelte-l4p418"&&(ut.textContent=yo),pn=a(e),u(Mt.$$.fragment,e),gn=a(e),j=m(e,"DIV",{class:!0});var v=k(j);u(ht.$$.fragment,v),hl=a(v),rs=m(v,"P",{"data-svelte-h":!0}),p(rs)!=="svelte-nngfd4"&&(rs.textContent=To),fl=a(v),is=m(v,"P",{"data-svelte-h":!0}),p(is)!=="svelte-1milklp"&&(is.textContent=wo),yl=a(v),ms=m(v,"P",{"data-svelte-h":!0}),p(ms)!=="svelte-xgynbu"&&(ms.textContent=Jo),Tl=a(v),cs=m(v,"P",{"data-svelte-h":!0}),p(cs)!=="svelte-r4fpk6"&&(cs.textContent=bo),wl=a(v),ds=m(v,"UL",{"data-svelte-h":!0}),p(ds)!=="svelte-bxyop7"&&(ds.innerHTML=jo),Jl=a(v),ft=m(v,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(ft)!=="svelte-ens2rm"&&(ft.innerHTML=_o),bl=a(v),ps=m(v,"P",{"data-svelte-h":!0}),p(ps)!=="svelte-kvfsh7"&&(ps.textContent=Io),jl=a(v),u(ae.$$.fragment,v),_l=a(v),u(re.$$.fragment,v),Il=a(v),u(ie.$$.fragment,v),vl=a(v),u(me.$$.fragment,v),v.forEach(s),un=a(e),u(yt.$$.fragment,e),Mn=a(e),u(Tt.$$.fragment,e),hn=a(e),u(wt.$$.fragment,e),fn=a(e),ce=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(ce)!=="svelte-covr82"&&(ce.innerHTML=vo),yn=a(e),Z=m(e,"DIV",{class:!0});var ue=k(Z);u(Jt.$$.fragment,ue),Ul=a(ue),gs=m(ue,"P",{"data-svelte-h":!0}),p(gs)!=="svelte-t9ku5w"&&(gs.textContent=Uo),Cl=a(ue),bt=m(ue,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(bt)!=="svelte-covr82"&&(bt.innerHTML=Co),$l=a(ue),u(de.$$.fragment,ue),ue.forEach(s),Tn=a(e),u(jt.$$.fragment,e),wn=a(e),_t=m(e,"P",{"data-svelte-h":!0}),p(_t)!=="svelte-1vi10v1"&&(_t.innerHTML=$o),Jn=a(e),u(It.$$.fragment,e),bn=a(e),pe=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(pe)!=="svelte-9qh0h6"&&(pe.innerHTML=ko),jn=a(e),X=m(e,"DIV",{class:!0});var Bn=k(X);u(vt.$$.fragment,Bn),kl=a(Bn),us=m(Bn,"P",{"data-svelte-h":!0}),p(us)!=="svelte-1vi10v1"&&(us.innerHTML=xo),Bn.forEach(s),_n=a(e),u(Ut.$$.fragment,e),In=a(e),Ct=m(e,"P",{"data-svelte-h":!0}),p(Ct)!=="svelte-nwgagp"&&(Ct.textContent=Ao),vn=a(e),$t=m(e,"P",{"data-svelte-h":!0}),p($t)!=="svelte-1982g4m"&&($t.innerHTML=qo),Un=a(e),kt=m(e,"OL",{"data-svelte-h":!0}),p(kt)!=="svelte-otqs16"&&(kt.innerHTML=Eo),Cn=a(e),xt=m(e,"P",{"data-svelte-h":!0}),p(xt)!=="svelte-ww7ptk"&&(xt.innerHTML=No),$n=a(e),u(At.$$.fragment,e),kn=a(e),qt=m(e,"P",{"data-svelte-h":!0}),p(qt)!=="svelte-1kcdlrn"&&(qt.innerHTML=Lo),xn=a(e),u(Et.$$.fragment,e),An=a(e),Ms=m(e,"P",{}),k(Ms).forEach(s),this.h()},h(){_(r,"name","hf:doc:metadata"),_(r,"content",sa),_(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ee,"class","tip"),_(Ne,"class","tip"),_(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ft,"class","tip"),_(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ce,"class","tip"),_(bt,"class","tip"),_(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(pe,"class","tip"),_(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){c(document.head,r),l(e,b,t),l(e,T,t),l(e,d,t),M(w,e,t),l(e,n,t),M(J,e,t),l(e,hs,t),M(H,e,t),l(e,fs,t),l(e,Me,t),l(e,ys,t),M(he,e,t),l(e,Ts,t),l(e,fe,t),l(e,ws,t),M(ye,e,t),l(e,Js,t),l(e,Te,t),l(e,bs,t),l(e,C,t),M(we,C,null),c(C,Zn),c(C,Wt),c(C,Qn),c(C,St),c(C,Wn),c(C,Vt),c(C,Sn),M(P,C,null),c(C,Vn),c(C,Y),M(Je,Y,null),c(Y,Rn),c(Y,Rt),c(C,zn),c(C,D),M(be,D,null),c(D,Xn),c(D,zt),c(C,Fn),c(C,O),M(je,O,null),c(O,Gn),c(O,Xt),l(e,js,t),M(_e,e,t),l(e,_s,t),l(e,Ie,t),l(e,Is,t),l(e,L,t),M(ve,L,null),c(L,Hn),c(L,Ft),c(L,Pn),c(L,Gt),c(L,Yn),c(L,K),M(Ue,K,null),c(K,Dn),c(K,Ht),l(e,vs,t),M(Ce,e,t),l(e,Us,t),l(e,$e,t),l(e,Cs,t),M(ke,e,t),l(e,$s,t),M(xe,e,t),l(e,ks,t),l(e,Ae,t),l(e,xs,t),M(qe,e,t),l(e,As,t),l(e,ee,t),l(e,qs,t),l(e,q,t),M(Ee,q,null),c(q,On),c(q,Pt),c(q,Kn),c(q,Yt),c(q,el),c(q,Ne),c(q,tl),M(te,q,null),l(e,Es,t),M(Le,e,t),l(e,Ns,t),l(e,Be,t),l(e,Ls,t),l(e,Ze,t),l(e,Bs,t),M(Qe,e,t),l(e,Zs,t),M(We,e,t),l(e,Qs,t),l(e,Se,t),l(e,Ws,t),M(Ve,e,t),l(e,Ss,t),l(e,x,t),M(Re,x,null),c(x,sl),c(x,Dt),c(x,nl),c(x,Ot),c(x,ll),c(x,Kt),c(x,ol),M(se,x,null),c(x,al),c(x,ne),M(ze,ne,null),c(ne,rl),c(ne,es),l(e,Vs,t),M(Xe,e,t),l(e,Rs,t),l(e,Fe,t),l(e,zs,t),M(Ge,e,t),l(e,Xs,t),l(e,W,t),M(He,W,null),c(W,il),c(W,ts),c(W,ml),c(W,le),M(Pe,le,null),c(le,cl),c(le,ss),l(e,Fs,t),M(Ye,e,t),l(e,Gs,t),l(e,De,t),l(e,Hs,t),M(Oe,e,t),l(e,Ps,t),l(e,B,t),M(Ke,B,null),c(B,dl),c(B,ns),c(B,pl),c(B,ls),c(B,gl),M(oe,B,null),l(e,Ys,t),M(et,e,t),l(e,Ds,t),l(e,tt,t),l(e,Os,t),M(st,e,t),l(e,Ks,t),l(e,nt,t),l(e,en,t),M(lt,e,t),l(e,tn,t),l(e,R,t),M(ot,R,null),c(R,ul),c(R,os),l(e,sn,t),M(at,e,t),l(e,nn,t),l(e,rt,t),l(e,ln,t),l(e,it,t),l(e,on,t),l(e,mt,t),l(e,an,t),M(ct,e,t),l(e,rn,t),l(e,z,t),M(dt,z,null),c(z,Ml),c(z,as),l(e,mn,t),M(pt,e,t),l(e,cn,t),l(e,gt,t),l(e,dn,t),l(e,ut,t),l(e,pn,t),M(Mt,e,t),l(e,gn,t),l(e,j,t),M(ht,j,null),c(j,hl),c(j,rs),c(j,fl),c(j,is),c(j,yl),c(j,ms),c(j,Tl),c(j,cs),c(j,wl),c(j,ds),c(j,Jl),c(j,ft),c(j,bl),c(j,ps),c(j,jl),M(ae,j,null),c(j,_l),M(re,j,null),c(j,Il),M(ie,j,null),c(j,vl),M(me,j,null),l(e,un,t),M(yt,e,t),l(e,Mn,t),M(Tt,e,t),l(e,hn,t),M(wt,e,t),l(e,fn,t),l(e,ce,t),l(e,yn,t),l(e,Z,t),M(Jt,Z,null),c(Z,Ul),c(Z,gs),c(Z,Cl),c(Z,bt),c(Z,$l),M(de,Z,null),l(e,Tn,t),M(jt,e,t),l(e,wn,t),l(e,_t,t),l(e,Jn,t),M(It,e,t),l(e,bn,t),l(e,pe,t),l(e,jn,t),l(e,X,t),M(vt,X,null),c(X,kl),c(X,us),l(e,_n,t),M(Ut,e,t),l(e,In,t),l(e,Ct,t),l(e,vn,t),l(e,$t,t),l(e,Un,t),l(e,kt,t),l(e,Cn,t),l(e,xt,t),l(e,$n,t),M(At,e,t),l(e,kn,t),l(e,qt,t),l(e,xn,t),M(Et,e,t),l(e,An,t),l(e,Ms,t),qn=!0},p(e,[t]){const $={};t&2&&($.$$scope={dirty:t,ctx:e}),H.$set($);const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),P.$set(Nt);const Lt={};t&2&&(Lt.$$scope={dirty:t,ctx:e}),te.$set(Lt);const Bt={};t&2&&(Bt.$$scope={dirty:t,ctx:e}),se.$set(Bt);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),oe.$set(S);const Zt={};t&2&&(Zt.$$scope={dirty:t,ctx:e}),ae.$set(Zt);const Q={};t&2&&(Q.$$scope={dirty:t,ctx:e}),re.$set(Q);const E={};t&2&&(E.$$scope={dirty:t,ctx:e}),ie.$set(E);const Qt={};t&2&&(Qt.$$scope={dirty:t,ctx:e}),me.$set(Qt);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),de.$set(F)},i(e){qn||(h(w.$$.fragment,e),h(J.$$.fragment,e),h(H.$$.fragment,e),h(he.$$.fragment,e),h(ye.$$.fragment,e),h(we.$$.fragment,e),h(P.$$.fragment,e),h(Je.$$.fragment,e),h(be.$$.fragment,e),h(je.$$.fragment,e),h(_e.$$.fragment,e),h(ve.$$.fragment,e),h(Ue.$$.fragment,e),h(Ce.$$.fragment,e),h(ke.$$.fragment,e),h(xe.$$.fragment,e),h(qe.$$.fragment,e),h(Ee.$$.fragment,e),h(te.$$.fragment,e),h(Le.$$.fragment,e),h(Qe.$$.fragment,e),h(We.$$.fragment,e),h(Ve.$$.fragment,e),h(Re.$$.fragment,e),h(se.$$.fragment,e),h(ze.$$.fragment,e),h(Xe.$$.fragment,e),h(Ge.$$.fragment,e),h(He.$$.fragment,e),h(Pe.$$.fragment,e),h(Ye.$$.fragment,e),h(Oe.$$.fragment,e),h(Ke.$$.fragment,e),h(oe.$$.fragment,e),h(et.$$.fragment,e),h(st.$$.fragment,e),h(lt.$$.fragment,e),h(ot.$$.fragment,e),h(at.$$.fragment,e),h(ct.$$.fragment,e),h(dt.$$.fragment,e),h(pt.$$.fragment,e),h(Mt.$$.fragment,e),h(ht.$$.fragment,e),h(ae.$$.fragment,e),h(re.$$.fragment,e),h(ie.$$.fragment,e),h(me.$$.fragment,e),h(yt.$$.fragment,e),h(Tt.$$.fragment,e),h(wt.$$.fragment,e),h(Jt.$$.fragment,e),h(de.$$.fragment,e),h(jt.$$.fragment,e),h(It.$$.fragment,e),h(vt.$$.fragment,e),h(Ut.$$.fragment,e),h(At.$$.fragment,e),h(Et.$$.fragment,e),qn=!0)},o(e){f(w.$$.fragment,e),f(J.$$.fragment,e),f(H.$$.fragment,e),f(he.$$.fragment,e),f(ye.$$.fragment,e),f(we.$$.fragment,e),f(P.$$.fragment,e),f(Je.$$.fragment,e),f(be.$$.fragment,e),f(je.$$.fragment,e),f(_e.$$.fragment,e),f(ve.$$.fragment,e),f(Ue.$$.fragment,e),f(Ce.$$.fragment,e),f(ke.$$.fragment,e),f(xe.$$.fragment,e),f(qe.$$.fragment,e),f(Ee.$$.fragment,e),f(te.$$.fragment,e),f(Le.$$.fragment,e),f(Qe.$$.fragment,e),f(We.$$.fragment,e),f(Ve.$$.fragment,e),f(Re.$$.fragment,e),f(se.$$.fragment,e),f(ze.$$.fragment,e),f(Xe.$$.fragment,e),f(Ge.$$.fragment,e),f(He.$$.fragment,e),f(Pe.$$.fragment,e),f(Ye.$$.fragment,e),f(Oe.$$.fragment,e),f(Ke.$$.fragment,e),f(oe.$$.fragment,e),f(et.$$.fragment,e),f(st.$$.fragment,e),f(lt.$$.fragment,e),f(ot.$$.fragment,e),f(at.$$.fragment,e),f(ct.$$.fragment,e),f(dt.$$.fragment,e),f(pt.$$.fragment,e),f(Mt.$$.fragment,e),f(ht.$$.fragment,e),f(ae.$$.fragment,e),f(re.$$.fragment,e),f(ie.$$.fragment,e),f(me.$$.fragment,e),f(yt.$$.fragment,e),f(Tt.$$.fragment,e),f(wt.$$.fragment,e),f(Jt.$$.fragment,e),f(de.$$.fragment,e),f(jt.$$.fragment,e),f(It.$$.fragment,e),f(vt.$$.fragment,e),f(Ut.$$.fragment,e),f(At.$$.fragment,e),f(Et.$$.fragment,e),qn=!1},d(e){e&&(s(b),s(T),s(d),s(n),s(hs),s(fs),s(Me),s(ys),s(Ts),s(fe),s(ws),s(Js),s(Te),s(bs),s(C),s(js),s(_s),s(Ie),s(Is),s(L),s(vs),s(Us),s($e),s(Cs),s($s),s(ks),s(Ae),s(xs),s(As),s(ee),s(qs),s(q),s(Es),s(Ns),s(Be),s(Ls),s(Ze),s(Bs),s(Zs),s(Qs),s(Se),s(Ws),s(Ss),s(x),s(Vs),s(Rs),s(Fe),s(zs),s(Xs),s(W),s(Fs),s(Gs),s(De),s(Hs),s(Ps),s(B),s(Ys),s(Ds),s(tt),s(Os),s(Ks),s(nt),s(en),s(tn),s(R),s(sn),s(nn),s(rt),s(ln),s(it),s(on),s(mt),s(an),s(rn),s(z),s(mn),s(cn),s(gt),s(dn),s(ut),s(pn),s(gn),s(j),s(un),s(Mn),s(hn),s(fn),s(ce),s(yn),s(Z),s(Tn),s(wn),s(_t),s(Jn),s(bn),s(pe),s(jn),s(X),s(_n),s(In),s(Ct),s(vn),s($t),s(Un),s(kt),s(Cn),s(xt),s($n),s(kn),s(qt),s(xn),s(An),s(Ms)),s(r),y(w,e),y(J,e),y(H,e),y(he,e),y(ye,e),y(we),y(P),y(Je),y(be),y(je),y(_e,e),y(ve),y(Ue),y(Ce,e),y(ke,e),y(xe,e),y(qe,e),y(Ee),y(te),y(Le,e),y(Qe,e),y(We,e),y(Ve,e),y(Re),y(se),y(ze),y(Xe,e),y(Ge,e),y(He),y(Pe),y(Ye,e),y(Oe,e),y(Ke),y(oe),y(et,e),y(st,e),y(lt,e),y(ot),y(at,e),y(ct,e),y(dt),y(pt,e),y(Mt,e),y(ht),y(ae),y(re),y(ie),y(me),y(yt,e),y(Tt,e),y(wt,e),y(Jt),y(de),y(jt,e),y(It,e),y(vt),y(Ut,e),y(At,e),y(Et,e)}}}const sa='{"title":"Models","local":"models","sections":[{"title":"Models","local":"models","sections":[{"title":"Base Model","local":"smolagents.Model","sections":[],"depth":3},{"title":"API Model","local":"smolagents.ApiModel","sections":[],"depth":3},{"title":"TransformersModel","local":"smolagents.TransformersModel","sections":[],"depth":3},{"title":"InferenceClientModel","local":"smolagents.InferenceClientModel","sections":[],"depth":3},{"title":"LiteLLMModel","local":"smolagents.LiteLLMModel","sections":[],"depth":3},{"title":"LiteLLMRouterModel","local":"smolagents.LiteLLMRouterModel","sections":[],"depth":3},{"title":"OpenAIServerModel","local":"smolagents.OpenAIServerModel","sections":[],"depth":3},{"title":"AzureOpenAIServerModel","local":"smolagents.AzureOpenAIServerModel","sections":[],"depth":3},{"title":"AmazonBedrockServerModel","local":"smolagents.AmazonBedrockServerModel","sections":[],"depth":3},{"title":"MLXModel","local":"smolagents.MLXModel","sections":[],"depth":3},{"title":"VLLMModel","local":"smolagents.VLLMModel","sections":[],"depth":3},{"title":"Custom Model","local":"custom-model","sections":[],"depth":3}],"depth":2}],"depth":1}';function na(U){return Zo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ca extends Qo{constructor(r){super(),Wo(this,r,na,ta,Bo,{})}}export{ca as component};
