### CLI Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to list available language models using the CLI. ```bash gdplabs models list ``` -------------------------------- ### REST API Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to list available language models using the REST API. ```bash curl https://api.gdplabs.com/v1/models \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Instantiate a Model Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to instantiate a model with specific parameters. ```python instruction="You are a helpful assistant.", model=Model( id="deepinfra/Qwen/Qwen3-30B-A3B", credentials="your-deepinfra-api-key", # Override default credential lookup hyperparameters={ "temperature": 0.7, "max_tokens": 4096, }, ) ``` -------------------------------- ### Agent Configuration Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to configure an agent with a specific model and name. ```json 124:["$","span","18",{"className":"highlight-line","aria-label":"$undefined","style":{"color":"light-dark(inherit, inherit)","--shiki-light":"inherit","--shiki-dark":"inherit","backgroundColor":"light-dark(inherit, inherit)","--shiki-light-bg":"inherit","--shiki-dark-bg":"inherit"},"children":[false,["$","span",null,{"className":"highlight-line-content","children":[[["$","span","0",{"style":{"color":"light-dark(inherit, inherit)","--shiki-light":"inherit","--shiki-dark":"inherit"},"children":["agent "]},"$","span","1",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-11)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-11))"},"children":["="]},"$","span","2",{"style":{"color":"light-dark(inherit, inherit)","--shiki-light":"inherit","--shiki-dark":"inherit"},"children":[" "]},"$","span","3",{"style":{"color":"light-dark(rgb(var(--primary-10)), rgb(var(--primary-11)))","--shiki-light":"rgb(var(--primary-10))","--shiki-dark":"rgb(var(--primary-11))"},"children":["Agent"]},"$","span","4",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["("]},"\n"]}]}]}]] 125:["$","span","19",{"className":"highlight-line","aria-label":"$undefined","style":{"color":"light-dark(inherit, inherit)","--shiki-light":"inherit","--shiki-dark":"inherit","backgroundColor":"light-dark(inherit, inherit)","--shiki-light-bg":"inherit","--shiki-dark-bg":"inherit"},"children":[false,["$","span",null,{"className":"highlight-line-content","children":[[["$","span","0",{"style":{"color":"light-dark(rgb(var(--primary-10)), rgb(var(--primary-11)))","--shiki-light":"rgb(var(--primary-10))","--shiki-dark":"rgb(var(--primary-11))"},"children":[" "]},"$","span","1",{"style":{"color":"light-dark(rgb(var(--warning-10)), rgb(var(--warning-11)))","--shiki-light":"rgb(var(--warning-10))","--shiki-dark":"rgb(var(--warning-11))"},"children":["name"]},"$","span","2",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-11)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-11))"},"children":["="]},"$","span","3",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["\""]},"$","span","4",{"style":{"color":"light-dark(rgb(var(--success-10)), rgb(var(--success-11)))","--shiki-light":"rgb(var(--success-10))","--shiki-dark":"rgb(var(--success-11))"},"children":["creative"]},"$","span","5",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["\""]},"$","span","6",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":[","]},"\n"]}]}]}]] 126:["$","span","20",{"className":"highlight-line","aria-label":"$undefined","style":{"color":"light-dark(inherit, inherit)","--shiki-light":"inherit","--shiki-dark":"inherit","backgroundColor":"light-dark(inherit, inherit)","--shiki-light-bg":"inherit","--shiki-dark-bg":"inherit"},"children":[false,["$","span",null,{"className":"highlight-line-content","children":[[["$","span","0",{"style":{"color":"light-dark(rgb(var(--primary-10)), rgb(var(--primary-11)))","--shiki-light":"rgb(var(--primary-10))","--shiki-dark":"rgb(var(--primary-11))"},"children":[" "]},"$","span","1",{"style":{"color":"light-dark(rgb(var(--warning-10)), rgb(var(--warning-11)))","--shiki-light":"rgb(var(--warning-10))","--shiki-dark":"rgb(var(--warning-11))"},"children":["name"]},"$","span","2",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["="]},"$","span","3",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["\""]},"$","span","4",{"style":{"color":"light-dark(rgb(var(--success-10)), rgb(var(--success-11)))","--shiki-light":"rgb(var(--success-10))","--shiki-dark":"rgb(var(--success-11))"},"children":["creative"]},"$","span","5",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":["\""]},"$","span","6",{"style":{"color":"light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))","--shiki-light":"rgb(var(--tint-11))","--shiki-dark":"rgb(var(--tint-12))"},"children":[","]},"\n"]}]}]}] ``` -------------------------------- ### Example CLI Command Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide This snippet shows an example of importing a language model using the CLI. ```bash from glaip_sdk import import ``` -------------------------------- ### OpenAI Agent Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to configure an agent for OpenAI models. ```python agent = Agent( name="analysis", instruction="You are a precise analyst.", model="openai/gpt-5" ) ``` -------------------------------- ### Python SDK Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to list available language models using the Python SDK. ```python from gdplabs import Client client = Client(api_key="YOUR_API_KEY") models = client.models.list() for model in models: print(f"- {model.id} ({model.provider})") ``` -------------------------------- ### DeepInfra Agent Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to configure an agent for DeepInfra models. ```python # DeepInfra: deepinfra// agent = Agent( name="research", instruction="You are a research assistant.", model="deepinfra/Qwen/Qwen3-30B-A3B" ) ``` -------------------------------- ### Custom Model Configuration Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example demonstrating how to configure custom endpoints, credentials, and hyperparameters for models. ```javascript self.__next_f.push([ 1, "}" ]) 78:["$","p","VMX7w6rwxxc7",{"className":"has-[.button,input]:flex has-[.button,input]:flex-wrap has-[.button,input]:gap-2 has-[.button,input]:items-center decoration-primary/6 max-w-3xl w-full print:break-inside-avoid text-start self-start justify-start","children":[[ "$","$1","mIXkn6KvRGMv",{"children":[[ "$","$1","0",{"children": "For custom endpoints, credentials, and hyperparameters not covered by the standard format, use the "}],[ "$","$1","1",{"children":[[ "$","code","mark",{"className":"py-px px-1.5 min-w-6.5 justify-center items-center ring-1 ring-inset ring-tint bg-tint rounded-sm text-[.875em] leading-[calc(max(1.20em,1.25rem))] break-words hyphens-none","children": "Model"}]],[ "$","$1","2",{"children": " class:"}]]}]]} 7b:["$","h4","hFSsWjXVQR3T",{"id":"custom-deepinfra-model-with-credentials","className":"text-base @xs:text-lg @lg:text-xl font-semibold heading pdf-heading flex items-baseline scroll-mt-(--content-scroll-margin) text-start self-start justify-start relative group/hash decoration-primary/6 max-w-3xl w-full print:break-inside-avoid column-first-of-type:pt-0 pt-[0.5em]","data-pdf-heading":true,"children":[[ "$","div",null,{"className":"relative hash grid grid-area-1-1 h-[1em] border-0 opacity-0 site-background rounded group-hover/hash:opacity-[0] group-focus/hash:opacity-[0] md:group-hover/hash:opacity-[1] md:group-focus/hash:opacity-[1] -ml-6 pr-2 [.flip-heading-hash_&]:order-last [.flip-heading-hash_&]:ml-1 [.flip-heading-hash_&]:pl-2","children":[[ "$","$L4e",null,{"href":"#custom-deepinfra-model-with-credentials","aria-label":"Direct link to heading","className":"inline-flex h-full items-start leading-snug","children":[[ "$","$L5b",null,{"icon":"hashtag","className":"self-center transition-colors text-transparent group-hover/hash:text-tint-subtle contrast-more:group-hover/hash:text-tint-strong size-4"}]}]],[ "$","div",null,{"className":"flex-1 z-1 justify-self-start max-w-full break-words text-start self-start justify-start leading-snug","children":[[ "$","$1","dN5yVPYnO5Zd",{"children":[[ "$","$1","0",{"children": "Custom DeepInfra Model with Credentials"}]]}]}]],]}]} ``` -------------------------------- ### OpenAI Model Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to specify an OpenAI model. ```python # OpenAI: openai/ agent = Agent( ``` -------------------------------- ### Agent Initialization and Execution Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of initializing an Agent with specific parameters like name, instruction, and model, and then running a task. ```python from glaip_sdk import Agent # This works locally IF the model is available locally # (API key and base_url resolved automatically for known providers) agent = Agent( name="research", instruction="You are a research assistant.", model="deepinfra/Qwen/Qwen3-30B-A3B" ) # Local execution - uses local credentials and base_url result = agent.run("Research quantum computing") ``` -------------------------------- ### Anthropic Agent Example Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of how to configure an agent for Anthropic models. ```python # Anthropic: anthropic/ agent = Agent( name="creative", instruction="You are a creative writer.", model="anthropic/claude-sonnet-4-0" ) ``` -------------------------------- ### Agent Initialization and Local Execution Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Demonstrates how to initialize an Agent with specific parameters (name, instruction, model) and then run it for local execution using the OPENAI_API_KEY environment variable. ```python from glaip_sdk import Agent agent = Agent( name="my-agent", instruction="You are helpful.", model="openai/gpt-5" ) # Local execution - uses local OPENAI_API_KEY result = agent.run("Hello!") ``` -------------------------------- ### Initialize Agent with Custom Model Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of initializing an Agent with a custom model configuration, including name, instruction, and model details. ```python from glaip_sdk import Agent agent = Agent( name="kimi-agent", instruction="You are helpful.", model="custom/kimi-k2.5", # Use provider/name format ) ``` -------------------------------- ### Deploy and run Kimi agent on AIP server Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of initializing an Agent with a custom Kimi model and then deploying and running it on the AIP server. ```python from glaip_sdk import Agent agent = Agent( name="kimi-agent", instruction="You are helpful.", model="custom/kimi-k2.5", # Use provider/name format ) # Deploy and run on AIP server agent.deploy() result = agent.run("Hello!") ``` -------------------------------- ### Agent Deployment and Execution Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example demonstrating how to deploy and run an agent using the GL-AIP SDK. The agent is configured with a specific model and instructions. ```python from glaip_sdk import Agent from glaip_sdk.models import Model agent = Agent( name="kimi-agent", instruction="You are helpful.", model=Model( id="custom/kimi-k2.5", base_url="https://api.moonshot.ai/v1", credentials="sk-xxxx", hyperparameters={ "temperature": 1.0, "max_tokens": 32768, } ) ) result = agent.run("Hello!") # Now runs on AIP server ``` -------------------------------- ### Specifying GPT-4o Model Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of specifying the GPT-4o model. ```python GPT_4O ``` -------------------------------- ### Agent Configuration Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example configuration for an agent, specifying its name and role. ```json { "name": "research", "instruction": "You are a research assistant." } ``` -------------------------------- ### Create Agent CLI Command Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Example of creating an agent using the CLI with specific instructions and model. ```bash aip agents create \ --name analysis \ --instruction "You are a precise analyst." \ --model openai/gpt-5 ``` -------------------------------- ### Example Usage Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide This snippet shows how to use a language model for analysis. ```javascript self.__next_f.push([ 1, "children\": \" \"} ], [ "$", "span", "1", { "style": { "color": "light-dark(rgb(var(--warning-10)), rgb(var(--warning-11)))", "--shiki-light": "rgb(var(--warning-10))", "--shiki-dark": "rgb(var(--warning-11))" }, "children": "name" } ], [ "$", "span", "2", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-11)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-11))" }, "children": "=" } ], [ "$", "span", "3", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "\\\"" } ], [ "$", "span", "4", { "style": { "color": "light-dark(rgb(var(--success-10)), rgb(var(--success-11)))", "--shiki-light": "rgb(var(--success-10))", "--shiki-dark": "rgb(var(--success-11))" }, "children": "analysis" } ], [ "$", "span", "5", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "\\\"" } ], [ "$", "span", "6", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "," } ] ], "\\n" ] } ] ] } ] ] 118:[ "$", "span", "6", { "className": "highlight-line", "aria-label": "$undefined", "style": { "color": "light-dark(inherit, inherit)", "--shiki-light": "inherit", "--shiki-dark": "inherit", "backgroundColor": "light-dark(inherit, inherit)", "--shiki-light-bg": "inherit", "--shiki-dark-bg": "inherit" }, "children": [ false, [ "$", "span", null, { "className": "highlight-line-content", "children": [ [ [ "$", "span", "0", { "style": { "color": "light-dark(rgb(var(--primary-10)), rgb(var(--primary-11)))", "--shiki-light": "rgb(var(--primary-10))", "--shiki-dark": "rgb(var(--primary-11))" }, "children": " " } ], [ "$", "span", "1", { "style": { "color": "light-dark(rgb(var(--warning-10)), rgb(var(--warning-11)))", "--shiki-light": "rgb(var(--warning-10))", "--shiki-dark": "rgb(var(--warning-11))" }, "children": "instruction" } ], [ "$", "span", "2", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-11)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-11))" }, "children": "=" } ], [ "$", "span", "3", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "\\\"" } ], [ "$", "span", "4", { "style": { "color": "light-dark(rgb(var(--success-10)), rgb(var(--success-11)))", "--shiki-light": "rgb(var(--success-10))", "--shiki-dark": "rgb(var(--success-11))" }, "children": "You are a precise analyst." } ], [ "$", "span", "5", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "\\\"" } ], [ "$", "span", "6", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-12)))", "--shiki-light": "rgb(var(--tint-11))", "--shiki-dark": "rgb(var(--tint-12))" }, "children": "," } ] ], "\\n" } ] ] } ] 119:[ "$", "span", "7", { "className": "highlight-line", "aria-label": "$undefined", "style": { "color": "light-dark(inherit, inherit)", "--shiki-light": "inherit", "--shiki-dark": "inherit", "backgroundColor": "light-dark(inherit, inherit)", "--shiki-light-bg": "inherit", "--shiki-dark-bg": "inherit" }, "children": [ false, [ "$", "span", null, { "className": "highlight-line-content", "children": [ [ [ "$", "span", "0", { "style": { "color": "light-dark(rgb(var(--primary-10)), rgb(var(--primary-11)))", "--shiki-light": "rgb(var(--primary-10))", "--shiki-dark": "rgb(var(--primary-11))" }, "children": " " } ], [ "$", "span", "1", { "style": { "color": "light-dark(rgb(var(--warning-10)), rgb(var(--warning-11)))", "--shiki-light": "rgb(var(--warning-10))", "--shiki-dark": "rgb(var(--warning-11))" }, "children": "model" } ], [ "$", "span", "2", { "style": { "color": "light-dark(rgb(var(--tint-11)), rgb(var(--tint-11)))", "--shiki-light": "rgb(va ``` -------------------------------- ### Creating Agents with Different Model Providers Source: https://gdplabs.gitbook.io/gl-aip/how-to-guides/language-models-guide Examples of creating agents using models from OpenAI, DeepInfra, and Anthropic, including the CLI command for agent creation. ```python # OpenAI: openai/ agent = Agent( name="analysis", instruction="You are a precise analyst.", model="openai/gpt-5", ) # DeepInfra: deepinfra// agent = Agent( name="research", instruction="You are a research assistant.", model="deepinfra/Qwen/Qwen3-30B-A3B", ) # Anthropic: anthropic/ agent = Agent( name="creative", instruction="You are a creative writer.", model="anthropic/claude-sonnet-4-0", ) # CLI also uses the string format aip agents create \ --name analysis \ --instruction "You are a precise analyst." \ --model openai/gpt-5 ```