Meta Models: Muse and Llama
AvalAI supports Meta directly through meta.ai for muse-wonder-1.0, muse-spark-1.3, and muse-image-1.0. The open-weight muse-spark-open route is hosted by Fireworks.ai. Meta's Llama models are also accessible through partner integrations such as AWS Bedrock and Google Vertex AI. These are distinct routes: a model's Meta ownership does not imply the same endpoints, pricing, or provider controls.
Direct Meta Models
The direct Muse models below are available from Tier 1. Use your AvalAI API key and the exact unprefixed IDs below; do not substitute a Meta upstream key or URL.
| Model | Exact ID | Role | Supported AvalAI endpoints |
|---|---|---|---|
| Muse Wonder 1.0 (preview) | muse-wonder-1.0 | Text-output reasoning, software engineering, and long-horizon agents | /v1/chat/completions (documented baseline) |
| Muse Spark 1.3 | muse-spark-1.3 | Reasoning, coding, text, and agent workflows | /v1/chat/completions, /v1/messages, /v1/responses (partial) |
| Muse Image 1.0 | muse-image-1.0 | Text-to-image generation | /v1/images/generations only |
Muse Spark 1.3
Muse Spark is Meta's hosted reasoning model for complex problem solving, software engineering, and long-running agents. The AvalAI catalog lists 1,048,576 maximum input tokens and 131,072 maximum output tokens, plus reasoning, vision, PDF input, function calling, parallel function calling, structured output, and prompt caching. The input and output maxima are separate limits, not additive guaranteed request capacity.
Meta describes parallel tool calls, streamed tool-call arguments, and reasoning continuity across turns in its Model API. Verify the exact tool, multimodal, and streaming behavior of your chosen AvalAI endpoint before integrating those upstream features. Responses support is partial: a successful basic text request does not establish support for OpenAI hosted tools, background jobs, stored conversations, previous_response_id, or all provider-specific reasoning controls.
Start without optional effort or thinking overrides. Do not copy reasoning_effort, OpenAI's reasoning object, or Anthropic-specific thinking settings merely because the request uses a compatible SDK. Ask for final answers, concise rationales, or verification checklists rather than hidden chain-of-thought.
Muse Wonder 1.0
Muse Wonder 1.0 joins AvalAI's direct Meta routes on October 25, 2026. Meta describes this preview model as a text-output reasoning model for complex software engineering and long-horizon agents: planning a task, coordinating sub-agents, using tools, and checking changes across a repository. It can help review an API design or propose a multi-file change; your application still runs tools, verifies results, and authorizes consequential actions. Muse Wonder does not generate images; use Muse Image for the generation-only image route described below.
The current AvalAI catalog records Tier 1 access, 1,048,576 maximum input tokens, and 131,072 maximum output tokens. These are ceilings recorded for the route, not a guarantee that both maxima fit in one request. Leave space for output, keep the first integration small, and check your account's rate limits. The catalog also records reasoning, vision, PDF input, function calling, parallel function calling, structured output, and prompt caching; optional payloads need their own AvalAI verification.
This release uses POST https://api.avalai.ir/v1/chat/completions as the documented text baseline. Messages and Responses entries in catalog metadata do not qualify those transports for this new route; this page adds no support claim or example for either. Meta's upstream video/audio input, computer-use workflows, search grounding, reasoning replay, and provider-specific controls are separate upstream capabilities, not new AvalAI promises. Begin with model, messages, and a small max_tokens limit; omit reasoning and sampling overrides until their exact behavior has been checked on AvalAI.
Muse Wonder Full is a different model. Meta offers that higher-capability variant through selected Muse Code subscriptions. The AvalAI ID muse-wonder-1.0 does not select Wonder Full, and raising reasoning effort does not change it into that subscription variant. Meta's model documentation, Wonder page, and model card explain the distinction and evaluation limits. Provider benchmarks do not establish performance for your prompts, serving route, tools, or Persian-language workloads.
Muse Image 1.0
Muse Image generates images from text. Meta describes reasoning-based composition for structured layouts, illustrations, product imagery, and creative assets. Specify the subject, layout, style, and lighting; keep requested text short and review labels and numbers. Repeated requests are nondeterministic.
Generation is the only supported AvalAI operation for this model. /v1/images/edits, /v1/images/variations, Chat Completions, Messages, and Responses are not supported for muse-image-1.0 in this release. Meta's upstream editing, reference-image composition, and multi-turn image workflows do not imply availability through AvalAI.
Meta describes upstream output up to 1600px, but this is not a confirmed AvalAI resolution contract. Start with model, prompt, and n: 1; do not assume OpenAI-specific size, quality, style, streaming, output-format, or Responses image-tool controls apply.
Pricing and the Processing-Fee Exception
AvalAI's general policy remains 0% fee / no markup over official provider pricing. The three direct Meta routes listed above currently have an additional 15% billing-processing fee to cover AvalAI's extra payment and billing overhead for providing meta.ai models. It is added to the applicable AvalAI base rate; it is AvalAI's charge, not a Meta price increase. The fee may change once the overheads are resolved; no change or removal date is promised.
Amounts are USD per 1 million tokens for Wonder/Spark and USD per output image for Image:
| Model / charge | AvalAI base rate before fee | Additional 15% charge | AvalAI billed rate |
|---|---|---|---|
muse-wonder-1.0: input / 1M tokens | $1.25 | $0.1875 | $1.4375 |
muse-wonder-1.0: cached input / 1M tokens | $0.15 | $0.0225 | $0.1725 |
muse-wonder-1.0: output / 1M tokens | $4.25 | $0.6375 | $4.8875 |
muse-spark-1.3: input / 1M tokens | $1.25 | $0.1875 | $1.4375 |
muse-spark-1.3: cached input / 1M tokens | $0.15 | $0.0225 | $0.1725 |
muse-spark-1.3: output / 1M tokens | $4.25 | $0.6375 | $4.8875 |
muse-image-1.0: output / image | $0.01 | $0.0015 | $0.0115 |
Billed rates already include the fee: AvalAI base rate × 1.15. Do not add it twice. Muse Image has a per-image charge even where token-rate fields are zero; use pricing.output_cost_per_image when reading the billed public catalog rate. Spark's cached-input rate applies only to actual cache hits and does not establish cache lifetime or cache-control support.
For Wonder, these are AvalAI's launch base rates, supplied by AvalAI and reflected in the current fee-inclusive catalog. They are not Meta's current public Wonder price: Meta's pricing page currently lists $4.00 input, $0.20 cached input, and $20.00 output per 1 million tokens. Do not relabel AvalAI's base as that official price or replace AvalAI billing with the upstream figures. The existing Spark/Image rows retain their applicable base rates.
For Wonder caching, Meta documents automatic reuse of stable prompt prefixes. Put unchanged instructions and examples first and variable content last. In Chat Completions, usage.prompt_tokens_details.cached_tokens, when returned, counts a subset of prompt_tokens; it is not additional input. With P total input tokens, C cached input tokens, and O output tokens, Wonder's fee-inclusive token estimate is ((P - C) × 1.4375 + C × 0.1725 + O × 4.8875) / 1,000,000 USD. A listed cached-input rate does not guarantee a hit, retention period, cache-control field, or cache writing charge. The bounded example adds no caching controls or paid search/tool features. See prompt caching for application guidance.
This exception applies to these three direct routes, not automatically to all Meta-owned models hosted by partners. See Pricing and the release announcement for cost examples and complete request/response samples.
Muse Wonder: Chat Completions Example
Keep AVALAI_API_KEY on your server. The OpenAI Python and JavaScript SDKs use https://api.avalai.ir/v1. Each program below makes one attempt, disables automatic retries, sets a 60-second request timeout, and caps generation with max_tokens: 256; curl also has a 10-second connection timeout. These are bounded compatibility examples, not settings for a multi-hour agent run. The input is one user message; max_tokens bounds generated tokens and is not the model's input ceiling. Meta accepts this Chat Completions alias upstream, while OpenAI now prefers max_completion_tokens for its own models; use the published AvalAI payload rather than changing fields between API schemas.
curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 60 --retry 0 \
https://api.avalai.ir/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-wonder-1.0",
"messages": [{"role": "user", "content": "Give a concise checklist for reviewing an API change."}],
"max_tokens": 256
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
timeout=60.0,
max_retries=0,
)
response = client.chat.completions.create(
model="muse-wonder-1.0",
messages=[
{"role": "user", "content": "Give a concise checklist for reviewing an API change."}
],
max_tokens=256,
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
timeout: 60000,
maxRetries: 0,
});
const response = await client.chat.completions.create({
model: "muse-wonder-1.0",
messages: [{ role: "user", content: "Give a concise checklist for reviewing an API change." }],
max_tokens: 256,
});
console.log(response.choices[0].message.content);Illustrative response:
{
"id": "chatcmpl-example-wonder",
"object": "chat.completion",
"created": 1792886400,
"model": "muse-wonder-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Check compatibility, authentication, validation, errors, tests, and billing."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 100,
"total_tokens": 120,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": null
},
"estimated_cost": {
"unit": "0.0005175000",
"irt": null,
"exchange_rate": null
}
}The response is illustrative, not captured from a live AvalAI call. Its ID, timestamp, answer, and token counts are synthetic. The cost uses 20 uncached input tokens and 100 output tokens: (20 × $1.4375 + 100 × $4.8875) / 1,000,000 = $0.0005175. It already includes the processing fee. irt and exchange_rate are null because the example supplies no currency-conversion quote.
Read the answer at choices[0].message.content and inspect finish_reason; length can mean the output budget ended before the answer finished. Actual reasoning/output accounting and optional usage or estimated_cost fields can differ or be absent. Preserve the returned values and use the User API for authoritative billing. On HTTP 400, correct the model ID, message shape, unsupported field, or token budget before retrying; on 401/403, check the key and account access. For rate limiting, inspect the response body and retry guidance; terminal quota errors need account intervention. These examples do not retry. A timeout can occur after processing began, so retain the sanitized body and avalai-request-id before deciding to repeat a request.
Muse Spark: Chat Completions Example
Set AVALAI_API_KEY on the server. The OpenAI SDK uses the AvalAI base URL with /v1:
curl https://api.avalai.ir/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-spark-1.3",
"messages": [{"role": "user", "content": "Give a concise checklist for reviewing an API change."}]
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="muse-spark-1.3",
messages=[
{
"role": "user",
"content": "Give a concise checklist for reviewing an API change.",
}
],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.chat.completions.create({
model: "muse-spark-1.3",
messages: [{ role: "user", content: "Give a concise checklist for reviewing an API change." }],
});
console.log(response.choices[0].message.content);For Messages, use the Anthropic SDK with https://api.avalai.ir without /v1, pass max_tokens, and read typed response.content blocks. For partial Responses support, send input through the OpenAI SDK and read response.output_text. See the four-format examples before switching schemas.
Muse Image: Generation Example
This generation-only example saves Base64 image data. Check the actual image format before serving it; the WebP filename follows Meta's reference example and does not select an output format.
curl https://api.avalai.ir/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "muse-image-1.0",
"prompt": "A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
"n": 1
}' --output muse-image-response.jsonimport base64
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.images.generate(
model="muse-image-1.0",
prompt="A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
n=1,
)
image_base64 = response.data[0].b64_json
if not image_base64:
raise ValueError("The response did not include Base64 image data.")
with open("muse-image.webp", "wb") as image_file:
image_file.write(base64.b64decode(image_base64))import OpenAI from "openai";
import { writeFile } from "node:fs/promises";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.images.generate({
model: "muse-image-1.0",
prompt: "A watercolor painting of a red fox in a snowy pine forest, soft golden morning light.",
n: 1,
});
const imageBase64 = response.data?.[0]?.b64_json;
if (!imageBase64) throw new Error("The response did not include Base64 image data.");
await writeFile("muse-image.webp", Buffer.from(imageBase64, "base64"));Use Image Generation for response handling. Check account rate limits, queue image requests, validate generated content, and track final costs through the User API. The examples are documentation samples, not evidence of live API verification.
Partner-Hosted Muse Spark Open
Muse Spark Open is Meta's open-weight Muse release, available through Fireworks.ai in AvalAI from Tier 0 in the October 25 addition. Meta documents a sparse mixture-of-experts architecture with 816B total parameters and 42B active parameters per token, multimodal perception encoders, and text output. Active parameters describe per-token compute; self-hosting still needs the full weights and additional memory. The released weights and license make self-hosting/post-training possible upstream; an AvalAI API request uses hosted inference and does not download weights or establish a private deployment.
Use the exact AvalAI ID muse-spark-open, not Fireworks' upstream accounts/fireworks/models/muse-spark-open string. Meta developed the model; the current catalog's owned_by: nvidia value is routing metadata and does not establish NVIDIA as its developer. AvalAI records a 1,048,576-token input ceiling, while its output ceiling is unrecorded. Do not substitute the input ceiling for an output limit. The documented baseline is Chat Completions; Meta's self-hosted video/audio examples and partner endpoint offerings are not AvalAI transport guarantees.
Spark Open's AvalAI billed rates are $1.25 input, $0.15 cached input, and $4.25 output per 1 million tokens, with no new processing fee. It is a separate partner route from direct Meta Wonder. Choose it when an open-weight model hosted by a partner fits your integration or when Tier 0 access is needed; evaluate quality, latency, tool behavior, and cache hits on your own tasks. See Fireworks.ai for the complete request/response example, caching formula, and integration limits, and Meta's overview and hosting guide for upstream architecture and deployment details.
Partner-Hosted Llama Models
The following existing Llama examples describe partner-hosted integrations, not the new direct meta.ai Muse routes. Identifiers, availability, limits, and historical example prices depend on the hosting provider; check the current model catalog and pricing before use. Their endpoint support must not be inferred from the direct Muse matrix above.
Llama 3.1 Series
The Llama 3.1 series offers significant improvements in reasoning, code generation, and instruction following, with large context windows.
Llama 3.1 405B Instruct
The largest and most capable model in the Llama 3.1 series, designed for complex reasoning and generation tasks.
| Feature | Details |
|---|---|
| Context window | 128,000 input tokens, 4,096 output tokens |
| Training data | Up to March 2024 |
| Input pricing | ~$5.32 / 1M tokens (via Bedrock) |
| Output pricing | ~$16.00 / 1M tokens (via Bedrock) |
| Strengths | State-of-the-art performance for open models, excels at reasoning, code, nuance |
| Best for | Highly complex tasks, research, challenging generation prompts |
response = client.chat.completions.create(
# Model name might vary based on provider, e.g., 'meta.llama3-1-405b-instruct-v1:0' on Bedrock
model="meta.llama3-1-405b-instruct-v1:0",
messages=[
{"role": "system", "content": "You are an expert architect."},
{
"role": "user",
"content": "Design a sustainable and scalable architecture for a global e-commerce platform.",
},
],
)Responses API version This version uses `gpt-5.5` because `meta.llama3-1-405b-instruct-v1:0` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Design a sustainable and scalable architecture for a global e-commerce platform.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Llama 3.1 70B Instruct
A strong balance of performance and efficiency, suitable for a wide range of demanding tasks.
| Feature | Details |
|---|---|
| Context window | 128,000 input tokens, 2,048 output tokens |
| Training data | Up to March 2024 |
| Input pricing | ~$0.99 / 1M tokens (via Bedrock) |
| Output pricing | ~$0.99 / 1M tokens (via Bedrock) |
| Strengths | Excellent performance for its size, strong instruction following |
| Best for | Complex chat applications, content creation, RAG systems |
response = client.chat.completions.create(
# Model name might vary, e.g., 'meta.llama3-1-70b-instruct-v1:0' on Bedrock
model="meta.llama3-1-70b-instruct-v1:0",
messages=[
{"role": "system", "content": "You are a helpful AI assistant."},
{
"role": "user",
"content": "Compare and contrast the Llama 3.1 70B and 8B models.",
},
],
)Responses API version This version uses `gpt-5.5` because `meta.llama3-1-70b-instruct-v1:0` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Compare and contrast the Llama 3.1 70B and 8B models.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Llama 3.1 8B Instruct
The smallest model in the Llama 3.1 series, optimized for speed and efficiency on less complex tasks.
| Feature | Details |
|---|---|
| Context window | 128,000 input tokens, 2,048 output tokens |
| Training data | Up to March 2024 |
| Input pricing | ~$0.22 / 1M tokens (via Bedrock) |
| Output pricing | ~$0.22 / 1M tokens (via Bedrock) |
| Strengths | Very fast and cost-effective, good for simpler tasks |
| Best for | Simple chatbots, summarization, classification, light content generation |
response = client.chat.completions.create(
# Model name might vary, e.g., 'meta.llama3-1-8b-instruct-v1:0' on Bedrock
model="meta.llama3-1-8b-instruct-v1:0",
messages=[
{"role": "user", "content": "What is the capital of France?"},
],
)Responses API version This version uses `gpt-5.5` because `meta.llama3-1-8b-instruct-v1:0` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="What is the capital of France?",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Llama 3.2 Series (Preview)
The Llama 3.2 series introduces new capabilities, including vision, and further performance improvements. Availability might be limited initially.
Llama 3.2 90B Vision Instruct
A large multimodal model combining strong text capabilities with vision understanding.
| Feature | Details |
|---|---|
| Context window | 128,000 input tokens, 2,048 output tokens |
| Training data | Assumed latest available |
| Input pricing | (Check provider pricing, e.g., Vertex AI) |
| Output pricing | (Check provider pricing, e.g., Vertex AI) |
| Strengths | Multimodal input (text and image), strong reasoning |
| Best for | Applications requiring understanding of both text and images |
# Example structure - specific API calls may vary by provider
response = client.chat.completions.create(
model="llama-4-scout-17b-16e-instruct",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image."},
{"type": "image_url", "image_url": {"url": "..."}},
],
}
],
)Responses API version This version uses `gpt-5.5` because `llama-4-scout-17b-16e-instruct` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
input=[
{
"role": "user",
"content": [
{"type": "input_text", "text": "Describe this image."},
{"type": "input_image", "image_url": "https://example.com/image.png"},
],
}
],
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Llama 4 Scout Series (Preview via Together AI)
The Llama 4 Scout series represents experimental models focused on specific capabilities or efficiency improvements.
Llama 4 Scout 17B 128e Instruct FP8
An experimental model potentially using FP8 precision for efficiency.
| Feature | Details |
|---|---|
| Provider | Together AI |
| Owner | Meta |
| Context window | (Check provider details) |
| Input Pricing | (Check provider details via AvalAI) |
| Output Pricing | (Check provider details via AvalAI) |
| Max Req/min | 50.0 |
| Max Tokens/min | 400,000.0 |
| Strengths | Experimental, potentially efficient |
| Best for | Testing new model architectures/formats |
| Model ID (example) | together_ai/meta-llama/llama-4-scout-17b-128e-instruct-fp8 |
# Example using Llama 4 Scout 17B FP8 via Together AI
response = client.chat.completions.create(
model="llama-4-scout-17b-128e-instruct-fp8",
messages=[
{"role": "user", "content": "What are the potential benefits of FP8 inference?"}
],
)Responses API version This version uses `gpt-5.5` because `llama-4-scout-17b-128e-instruct-fp8` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="What are the potential benefits of FP8 inference?",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Llama 4 Scout 17B 16e Instruct
Another experimental model from the Scout series.
| Feature | Details |
|---|---|
| Provider | Together AI |
| Owner | Meta |
| Context window | (Check provider details) |
| Input Pricing | (Check provider details via AvalAI) |
| Output Pricing | (Check provider details via AvalAI) |
| Max Req/min | 50.0 |
| Max Tokens/min | 400,000.0 |
| Strengths | Experimental |
| Best for | Testing new model capabilities |
| Model ID (example) | together_ai/meta-llama/llama-4-scout-17b-16e-instruct |
# Example using Llama 4 Scout 17B 16e via Together AI
response = client.chat.completions.create(
model="llama-4-scout-17b-16e-instruct",
messages=[
{
"role": "user",
"content": "Summarize the key features of the Llama 4 Scout series.",
}
],
)Responses API version This version uses `gpt-5.5` because `llama-4-scout-17b-16e-instruct` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Summarize the key features of the Llama 4 Scout series.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Earlier Llama Models
Older versions like Llama 3 (8B, 70B) and Llama 2 (7B, 13B, 70B) are also available through various providers accessible via AvalAI, often at lower price points but with smaller context windows and potentially lower performance compared to Llama 3.1/3.2. Refer to the specific provider documentation linked through AvalAI for details.
Using Partner-Hosted Llama Models via AvalAI
Access Llama models hosted by partners like Bedrock or Vertex AI using the standard AvalAI API endpoints and OpenAI-compatible libraries. Ensure you use the correct model identifier as provided by the specific AvalAI integration.
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key", # Replace with your actual API key
base_url="https://api.avalai.ir/v1", # AvalAI API endpoint
)
# Example using a Llama 3.1 model (identifier depends on provider)
response = client.chat.completions.create(
model="meta.llama3-1-70b-instruct-v1:0", # Example Bedrock identifier
messages=[{"role": "user", "content": "Tell me about the Llama models."}],
)
print(response.choices[0].message.content)Responses API version This version uses `gpt-5.5` because `meta.llama3-1-70b-instruct-v1:0` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Tell me about the Llama models.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Related Resources
- October 25 model addition and examples
- Official Meta model availability
- Official Meta Chat Completions protocol
- Official Meta Model API documentation
- Official Meta image-generation documentation
- Direct Meta release and examples
- Pricing and the processing fee
- Image Generation API
- Messages API
- Responses API
- Chat Completions API
- Model Index
- Authentication
- Rate Limits