Understand context windows and token limits. Learn how to optimize your prompts for maximum context utilization.
Each model has a maximum context window that includes both input and output tokens.
With 200K tokens, you can process approximately:
from mythicdot import MythicDot
client = MythicDot()
# Get model info including context limits
model = client.models.retrieve("mythic-4")
print(f"Model: {model.id}")
print(f"Context window: {model.context_window:,} tokens")
print(f"Max output: {model.max_output_tokens:,} tokens")
# Count tokens before sending
count = client.messages.count_tokens(
model="mythic-4",
messages=my_messages,
system=my_system_prompt
)
remaining = model.context_window - count.input_tokens - model.max_output_tokens
print(f"Available context: {remaining:,} tokens")
Keep system prompts concise. Every token in your system prompt reduces available context for user input.
For long conversations, periodically summarize older messages to maintain context while reducing token usage.
JSON and structured formats are often more token-efficient than verbose prose descriptions.
Use RAG or semantic search to include only the most relevant context, not everything.
Our Mythic-4 Ultra model offers 1 million tokens of context.