Tools
The aiXplain Marketplace offers a variety of assets, including LLMs, models and utilities. This guide covers how to find models using the aiXplain SDK, filter results based on parameters, and retrieve integration code for seamless implementation.
Finding Models in the Marketplace
To search for models, you can list available assets in the aiXplain SDK and apply filters to refine the results.
- Python
- Swift
Let's use query
, function
, source_languages
, target_languages
and suppliers
to search for translation models from English to Canadian French.
from aixplain.factories import ModelFactory
from aixplain.enums import Function, Language, Supplier
model_list = ModelFactory.list(
"Canada",
function=Function.TRANSLATION,
source_languages=Language.English,
target_languages=Language.French,
suppliers=[Supplier.AWS, Supplier.GOOGLE, Supplier.MICROSOFT],
)["results"]
for model in model_list:
print(model.__dict__)
Use the _member_names_
attribute to see the list of available function types, languages and suppliers.
Function._member_names_
Language._member_names_
Supplier._member_names_
Let's use query
and function
to search for translation models from English to Canadian French.
let provider = ModelProvider()
Task {
let query = ModelQuery(query: "English to French Canada", functions: ["translation"])
let result = try? await provider.list(query)
result?.forEach { model in
dump(model)
}
}
Listing Utilities
To retrieve utility tools, such as text processing or data transformation utilities:
from aixplain.factories import ModelFactory
from aixplain.enums import Function
model_list = ModelFactory.list(function=Function.UTILITIES, page_size=50)["results"]
for model in model_list:
print(model.id, model.name, model.supplier)
Filtering Search Results
You can refine search queries based on specific parameters:
- Python
- Swift
Parameter | Description |
---|---|
query | Search by model name. |
version | Retrieve a specific model version. |
function | AI function performed (e.g., text generation, speech synthesis). |
source_languages | Model’s input language. |
target_languages | Model’s output language. |
ownership | Filters by the owner (team/user). |
is_finetunable | Identifies if the model supports fine-tuning. |
vendor | Lists the provider hosting the model. |
Parameter | Description |
---|---|
query | Search by model name. |
function | AI function performed (e.g., text generation, speech synthesis). |
Search on Discover
Alternatively, you can browse models in Discover to find the ones that best fit your needs and seamlessly integrate them into your workflows.
Select a Model
Open the Discover tab and search for a model. Use the Function and Vendor filters to narrow down your search.
Let's select Llama 3 70B
. You can review its specifications to understand the supported input formats and expected outputs.
Deploy the Model
Copy and paste the code snippets from the API integration tab into your projects.
Alternatively, copy the ID of the model and use the code below to get your model.
- Python
- Swift
- Curl
from aixplain.factories import ModelFactory
model = ModelFactory.get("6626a3a8c8f1d089790cf5a2")
result = model.run(<INPUT_DATA>)
let model = try? await ModelProvider().get("6626a3a8c8f1d089790cf5a2")
let response = try await model.run("What is the capital of France?")
curl -X POST 'https://models.aixplain.com/api/v1/execute/6626a3a8c8f1d089790cf5a2' \
-H 'x-api-key: TEAM_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"data": "What is the capital of France?"}'
curl -X GET 'https://models.aixplain.com/api/v1/data/<requestId>' \
-H 'x-api-key: TEAM_API_KEY' \
-H 'Content-Type: application/json'
<requestId>
is available in the POST response.