es ▾

Ia sin restricciones: Troubleshooting Common Mistakes

You are getting truncated outputs or silent refusals because you misunderstand how uncensored models handle context and streaming. This guide fixes the most common client-side mistakes that break your integration with any open-weight LLM API.

Last updated

Summary

  • Your system prompt is likely too long for the model to retain in the context window.
  • Streaming errors often occur when the client disconnects before the server finishes sending chunks.
  • JSON mode validation fails when the model outputs markdown code blocks instead of raw JSON.
  • Rate limits are enforced per key, so you must implement exponential backoff for retry logic.

Understanding the Context Window

The context window defines the total amount of text the model can process in a single request, including both your input and its output. Many developers mistake this for a fixed input limit, but the window shrinks as the model generates tokens. If you send a large system prompt and then request a long response, you might hit the limit before the model finishes writing.

For example, a model with a 100,000 token context window means your prompt and completion together cannot exceed that number. If you set max_tokens to 16,000, you must ensure your input stays under 84,000 tokens. Otherwise, the API will return an error or truncate your response mid-stream. Always calculate your available input space by subtracting your desired output length from the total window size.

Why Your System Prompt Gets Ignored

Your system prompt gets ignored if it is pushed out of the context window by subsequent messages or if the model has been trained to prioritize recent instructions. Developers often pack too much detail into the system role, assuming the model will remember every nuance forever. In reality, the model attends to recent tokens more heavily as the conversation grows.

To fix this, keep your system prompt concise and place critical instructions in the first user message. If you are using a long context window, remember that memory is not infinite. You can also reinforce key rules by repeating them in the user role or using a structured format like XML tags. This helps the model maintain focus on your uncensored behavior without getting lost in noise.

Handling Streaming Errors Correctly

Streaming errors occur when the client disconnects or crashes before the server finishes sending all chunks. You might see a partial response or a sudden drop in token usage data. This happens because the server stops sending SSE events when the connection closes, leaving your application with incomplete data.

Always handle the done event or the final chunk carefully. In our API, the final chunk contains the total token usage. If you disconnect early, you lose that data. Implement a retry mechanism that waits for the full stream to complete before processing the final result. This ensures you get accurate usage counts and complete text generation.

Token Limits and Output Truncation

Output truncation happens when the model reaches the max_tokens limit before finishing its thought. You might see a cut-off sentence or an incomplete JSON structure. This is not a bug but a deliberate limit to control costs and latency. If you need longer responses, increase the max_tokens parameter.

Be aware that the model has a hard limit of 16,000 tokens per request unless you specify otherwise. If you set max_tokens to a value higher than 16,000, the API will cap it. Always monitor your token usage to avoid unexpected charges. You can also use the stop parameter to prevent the model from generating too much text.

Function Calling Failures Explained

Function calling fails when the model cannot match the requested tool definition with its internal knowledge. This often happens if the tool schema is too complex or if the model is not instructed to use it. The API will return an error if the function name does not match the definition in your request.

To fix this, keep your tool definitions simple and clear. Use descriptive names and provide detailed descriptions for each parameter. If the model refuses to call a function, try rephrasing the user prompt to encourage tool usage. You can also set tool_choice to auto or required to force the model to select a function.

JSON Mode Validation Issues

JSON mode validation fails when the model outputs markdown code blocks instead of raw JSON. The API expects a valid JSON object, but the model might wrap it in ```json tags. This causes your parser to fail because it receives a string instead of an object.

To fix this, use the response_format parameter set to {"type": "json_object"}. This forces the model to output pure JSON without markdown wrappers. If you still get markdown, preprocess the response to strip the tags. Always validate the JSON before using it in your application to avoid runtime errors.

Rate Limit Management Strategies

Rate limits are enforced to prevent abuse and ensure fair usage for all developers. Our API allows 300 requests per minute per key and 8 concurrent requests. If you exceed these limits, you will receive a 429 Too Many Requests error.

Implement exponential backoff in your client code to handle rate limits gracefully. Start with a short delay and double it after each retry. This prevents your application from overwhelming the API during peak times. You can also monitor your usage via the API response headers to stay within your limits.

Common Client-Side Configuration Errors

Client-side configuration errors often stem from incorrect base URLs or missing headers. Developers might use the wrong endpoint or forget to include the API key in the Authorization header. This results in 401 Unauthorized errors.

Double-check your configuration by comparing it with the official documentation. Ensure you are using the correct base URL and that your API key is valid. If you are using a third-party SDK, make sure it is configured to send requests to the correct endpoint. This small detail can save you hours of debugging.

When to Switch Models or Providers

You should switch models or providers if the current uncensored LLM does not meet your specific needs for latency, cost, or quality. If you need image generation or embeddings, our text-only API might not be the right fit. Similarly, if you require a specific model architecture, you might need to explore other options.

Our API is designed for developers who want a simple, uncensored text generation service. If you need more complex features like fine-tuning or model routing, consider a different provider. Always evaluate your requirements before committing to a single API to ensure it aligns with your project goals.

Support

What is the context window size for this uncensored model?

The context window is 100,000 tokens for both prompt and completion combined. The maximum output per request is 16,000 tokens, unless you specify a different value. This ensures you can process large documents without hitting limits too quickly.

Does this API support streaming responses?

Yes, the API supports streaming via Server-Sent Events (SSE). You can receive tokens as they are generated, which is ideal for real-time applications. The final chunk contains the total token usage for the request.

How do I handle JSON mode validation errors?

Set the <code>response_format</code> parameter to <code>{"type": "json_object"}</code>. This forces the model to output raw JSON without markdown code blocks. If you still receive markdown, preprocess the response to strip the tags before parsing.

What are the rate limits for the API?

You are limited to 300 requests per minute and 8 concurrent requests per API key. If you exceed these limits, you will receive a 429 error. Implement exponential backoff in your client to handle retries gracefully.

Generate your key

Register, retrieve the token, update the base URL. That is the entire configuration.

Start now